my-test123
Version:
A planner front-end for Fabric8.
113 lines • 5.39 kB
JavaScript
import { Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { Broadcaster, Logger, Notifications } from 'ngx-base';
import { AuthenticationService } from 'ngx-login-client';
import { Spaces } from 'ngx-fabric8-wit';
import { FilterService } from '../../services/filter.service';
import { GroupTypesService } from '../../services/group-types.service';
var IterationListEntryComponent = /** @class */ (function () {
function IterationListEntryComponent(auth, broadcaster, route, filterService, groupTypesService, notifications, router, spaces, logger) {
this.auth = auth;
this.broadcaster = broadcaster;
this.route = route;
this.filterService = filterService;
this.groupTypesService = groupTypesService;
this.notifications = notifications;
this.router = router;
this.spaces = spaces;
this.logger = logger;
this.selected = false;
this.collection = [];
this.witGroup = '';
this.onEditIteration = new EventEmitter();
this.onCloseIteration = new EventEmitter();
this.onCreateIteration = new EventEmitter();
this.onSelectIteration = new EventEmitter();
this.loggedIn = false;
this.queryParams = {};
this.eventListeners = [];
this.selectedItemId = 0;
this.spaceSubscription = null;
this.spaceId = '';
}
IterationListEntryComponent.prototype.ngOnInit = function () {
var _this = this;
this.loggedIn = this.auth.isLoggedIn();
this.spaceSubscription = this.spaces.current.subscribe(function (space) {
if (space) {
_this.spaceId = space.id;
}
});
};
IterationListEntryComponent.prototype.ngOnDestroy = function () {
this.eventListeners.forEach(function (subscriber) { return subscriber.unsubscribe(); });
};
IterationListEntryComponent.prototype.setGuidedTypeWI = function (wiCollection, iteration) {
this.onSelectIteration.emit(iteration);
this.groupTypesService.setCurrentGroupType(wiCollection, 'Execution');
};
IterationListEntryComponent.prototype.constructURL = function (iterationId) {
//Query for work item type group
var type_query = this.filterService.queryBuilder('typegroup.name', this.filterService.equal_notation, this.witGroup);
//Query for space
var space_query = this.filterService.queryBuilder('space', this.filterService.equal_notation, this.spaceId);
//Query for iteration
var iteration_query = this.filterService.queryBuilder('iteration', this.filterService.equal_notation, iterationId);
//Join type and space query
var first_join = this.filterService.queryJoiner({}, this.filterService.and_notation, space_query);
var second_join = this.filterService.queryJoiner(first_join, this.filterService.and_notation, type_query);
var third_join = this.filterService.queryJoiner(second_join, this.filterService.and_notation, iteration_query);
//this.setGroupType(witGroup);
//second_join gives json object
return this.filterService.jsonToQuery(third_join);
};
IterationListEntryComponent.prototype.toggleChildrenDisplay = function (iteration) {
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.attributes.parent_path).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: Broadcaster, },
{ type: ActivatedRoute, },
{ type: FilterService, },
{ type: GroupTypesService, },
{ type: Notifications, },
{ type: Router, },
{ type: Spaces, },
{ type: Logger, },
]; };
IterationListEntryComponent.propDecorators = {
'iteration': [{ type: Input },],
'selected': [{ type: Input },],
'collection': [{ type: Input },],
'witGroup': [{ type: Input },],
'onEditIteration': [{ type: Output },],
'onCloseIteration': [{ type: Output },],
'onCreateIteration': [{ type: Output },],
'onSelectIteration': [{ type: Output },],
};
return IterationListEntryComponent;
}());
export { IterationListEntryComponent };
//# sourceMappingURL=iteration-list-entry.component.js.map