fabric8-planner
Version:
A planner front-end for Fabric8.
153 lines • 5.53 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import { Injectable } from '@angular/core';
// MemoizedSelector is needed even if it's not being used in this file
// Else you get this error
// Exported variable 'groupTypeSelector' has or is using name 'MemoizedSelector'
// from external module "@ngrx/store/src/selector" but cannot be named.
import { createSelector, select, Store } from '@ngrx/store';
import { filter, map } from 'rxjs/operators';
import { modelService, switchModel } from './common.model';
import { plannerSelector } from './space';
var GroupTypesModel = /** @class */ (function (_super) {
__extends(GroupTypesModel, _super);
function GroupTypesModel() {
return _super !== null && _super.apply(this, arguments) || this;
}
return GroupTypesModel;
}(modelService));
export { GroupTypesModel };
var WITGroupAttributes = /** @class */ (function () {
function WITGroupAttributes() {
}
return WITGroupAttributes;
}());
export { WITGroupAttributes };
var WorkItemRelations = /** @class */ (function () {
function WorkItemRelations() {
}
return WorkItemRelations;
}());
export { WorkItemRelations };
var TypeListData = /** @class */ (function () {
function TypeListData() {
}
return TypeListData;
}());
export { TypeListData };
var GroupTypeMapper = /** @class */ (function () {
function GroupTypeMapper() {
this.serviceToUiMapTree = [{
fromPath: ['id'],
toPath: ['id']
}, {
fromPath: ['attributes', 'name'],
toPath: ['name']
}, {
fromPath: ['attributes', 'bucket'],
toPath: ['bucket']
}, {
fromPath: ['attributes', 'level'],
toPath: ['level']
}, {
fromPath: ['attributes', 'icon'],
toPath: ['icon']
}, {
fromPath: ['attributes', 'sublevel'],
toPath: ['sublevel']
}, {
fromPath: ['attributes', 'group'],
toPath: ['group']
}, {
toPath: ['selected'],
toValue: false
}, {
fromPath: ['attributes', 'show-in-sidebar'],
toPath: ['showInSideBar']
}, {
fromPath: ['relationships', 'typeList', 'data'],
toPath: ['typeList']
}, {
fromPath: ['attributes', 'description'],
toPath: ['description'],
toFunction: function (value) { return value || 'no info-tip'; }
}];
this.uiToServiceMapTree = [{
fromPath: ['id'],
toPath: ['id']
}, {
fromPath: ['name'],
toPath: ['attributes', 'name']
}, {
fromPath: ['bucket'],
toPath: ['attributes', 'bucket']
}, {
fromPath: ['level'],
toPath: ['attributes', 'level']
}, {
fromPath: ['icon'],
toPath: ['attributes', 'icon']
}, {
fromPath: ['sublevel'],
toPath: ['attributes', 'sublevel']
}, {
fromPath: ['group'],
toPath: ['attributes', 'group']
}, {
fromPath: ['showInSideBar'],
toPath: ['attributes', 'show-in-sidebar']
}, {
fromPath: ['typeList'],
toPath: ['relationships', 'typeList', 'data']
}, {
toPath: ['type'],
toValue: 'grouptypes'
}];
}
GroupTypeMapper.prototype.toUIModel = function (arg) {
return switchModel(arg, this.serviceToUiMapTree);
};
GroupTypeMapper.prototype.toServiceModel = function (arg) {
return switchModel(arg, this.uiToServiceMapTree);
};
return GroupTypeMapper;
}());
export { GroupTypeMapper };
export var groupTypeSelector = createSelector(plannerSelector, function (state) { return state.groupTypes; });
var GroupTypeQuery = /** @class */ (function () {
function GroupTypeQuery(store) {
this.store = store;
}
Object.defineProperty(GroupTypeQuery.prototype, "getGroupTypes", {
get: function () {
return this.store.pipe(select(groupTypeSelector), filter(function (g) { return g.length > 0; }));
},
enumerable: true,
configurable: true
});
Object.defineProperty(GroupTypeQuery.prototype, "getFirstGroupType", {
get: function () {
return this.getGroupTypes.pipe(map(function (g) { return g[0]; }));
},
enumerable: true,
configurable: true
});
GroupTypeQuery.decorators = [
{ type: Injectable },
];
/** @nocollapse */
GroupTypeQuery.ctorParameters = function () { return [
{ type: Store, },
]; };
return GroupTypeQuery;
}());
export { GroupTypeQuery };
//# sourceMappingURL=group-types.model.js.map