UNPKG

fabric8-planner

Version:
54 lines 2.04 kB
var __assign = (this && this.__assign) || Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; import { Injectable } from '@angular/core'; import { select, Store } from '@ngrx/store'; import { filter, map } from 'rxjs/operators'; import { workItemDetailSelector } from './work-item'; var LinkType = /** @class */ (function () { function LinkType() { } return LinkType; }()); export { LinkType }; var WorkItemLinkTypeQuery = /** @class */ (function () { function WorkItemLinkTypeQuery(store) { this.store = store; } Object.defineProperty(WorkItemLinkTypeQuery.prototype, "getLinkTypes", { get: function () { return this.store.pipe(select(workItemDetailSelector), select(function (state) { return state.linkType; }), filter(function (lt) { return !!lt.length; })); }, enumerable: true, configurable: true }); Object.defineProperty(WorkItemLinkTypeQuery.prototype, "getLinkTypesForDropdown", { get: function () { return this.getLinkTypes .pipe(map(function (types) { // The common-dropdown component needs the data in a specific format // Each item should have `key` and `value` property return types .map(function (t) { return __assign({}, t, { value: t.name, key: t.name }); }) .sort(function (t1, t2) { return t1.value.localeCompare(t2.value); }); })); }, enumerable: true, configurable: true }); WorkItemLinkTypeQuery.decorators = [ { type: Injectable }, ]; /** @nocollapse */ WorkItemLinkTypeQuery.ctorParameters = function () { return [ { type: Store, }, ]; }; return WorkItemLinkTypeQuery; }()); export { WorkItemLinkTypeQuery }; //# sourceMappingURL=link-type.js.map