UNPKG

fabric8-planner

Version:
121 lines 5.26 kB
import { Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core'; import { AuthenticationService } from 'ngx-login-client'; import { AND, EQUAL } from '../../services/query-keys'; import { FilterService } from './../../services/filter.service'; var IterationListEntryComponent = /** @class */ (function () { function IterationListEntryComponent(auth, filterService) { this.auth = auth; this.filterService = filterService; this.selected = false; this.collection = []; this.showTree = ''; this.showCompleted = ''; this.onEditIteration = new EventEmitter(); this.onCloseIteration = new EventEmitter(); this.onCreateIteration = new EventEmitter(); this.loggedIn = false; this.queryParams = {}; this.selectedItemId = 0; } IterationListEntryComponent.prototype.ngOnInit = function () { this.loggedIn = this.auth.isLoggedIn(); }; IterationListEntryComponent.prototype.constructURL = function (iterationId) { //Query for work item type group var type_query = this.filterService.queryBuilder('typegroup.name', EQUAL, this.witGroup.name); //Query for iteration var iteration_query = this.filterService.queryBuilder('iteration', EQUAL, iterationId); //Join type and space query var first_join = this.filterService.queryJoiner({}, AND, type_query); var second_join = this.filterService.queryJoiner(first_join, AND, iteration_query); //this.setGroupType(witGroup); //second_join gives json object return this.filterService.jsonToQuery(second_join); }; IterationListEntryComponent.prototype.constructURLforBoard = function (iterationId) { //Query for work item type group var type_query = this.filterService.queryBuilder('boardContextId', EQUAL, this.witGroup.id); //Query for iteration var iteration_query = this.filterService.queryBuilder('iteration', EQUAL, iterationId); // join type and iteration query var first_join = this.filterService.queryJoiner({}, AND, type_query); var second_join = this.filterService.queryJoiner(first_join, AND, iteration_query); return this.filterService.jsonToQuery(second_join); }; IterationListEntryComponent.prototype.addRemoveQueryParams = function (iterationId) { if (this.context === 'board') { return { q: this.constructURLforBoard(iterationId) }; } if (this.showCompleted && this.showTree) { return { q: this.constructURL(iterationId), showTree: this.showTree, showCompleted: this.showCompleted }; } else if (this.showTree) { return { q: this.constructURL(iterationId), showTree: this.showTree }; } else if (this.showCompleted) { return { q: this.constructURL(iterationId), showCompleted: this.showCompleted }; } else { return { q: this.constructURL(iterationId) }; } }; IterationListEntryComponent.prototype.toggleChildrenDisplay = function (iteration) { // TODO: Dispatch an action to this iteration.showChildren = !iteration.showChildren; }; IterationListEntryComponent.prototype.editIteration = function (iteration) { this.onEditIteration.emit(iteration); }; IterationListEntryComponent.prototype.closeIteration = function (iteration) { this.onCloseIteration.emit(iteration); }; IterationListEntryComponent.prototype.createIteration = function (iteration) { this.onCreateIteration.emit(iteration); }; IterationListEntryComponent.prototype.calcDepth = function (iteration) { var depth = ((iteration.parentPath).split('/')).length - 1; return 'depth-' + depth; }; IterationListEntryComponent.decorators = [ { type: Component, args: [{ encapsulation: ViewEncapsulation.None, selector: 'iteration-list-entry', template: require('./iteration-list-entry.component.html'), styles: [require('./iteration-list-entry.component.css').toString()] },] }, ]; /** @nocollapse */ IterationListEntryComponent.ctorParameters = function () { return [ { type: AuthenticationService, }, { type: FilterService, }, ]; }; IterationListEntryComponent.propDecorators = { 'iteration': [{ type: Input },], 'selected': [{ type: Input },], 'collection': [{ type: Input },], 'witGroup': [{ type: Input },], 'showTree': [{ type: Input },], 'showCompleted': [{ type: Input },], 'context': [{ type: Input },], 'onEditIteration': [{ type: Output },], 'onCloseIteration': [{ type: Output },], 'onCreateIteration': [{ type: Output },], }; return IterationListEntryComponent; }()); export { IterationListEntryComponent }; //# sourceMappingURL=iteration-list-entry.component.js.map