UNPKG

fabric8-planner

Version:
117 lines 4.41 kB
import { Component, Input } from '@angular/core'; var WorkItemEventComponent = /** @class */ (function () { function WorkItemEventComponent() { this.toText = 'to'; } Object.defineProperty(WorkItemEventComponent.prototype, "Event", { set: function (event) { this.event = event; this.getTitle(); switch (event.type) { case null: this.singleValueChange(); break; case 'areas': this.areasAndIteration(); break; case 'users': this.users(); break; case 'iterations': this.areasAndIteration(); break; case 'labels': this.labels(); break; case 'workitemtypes': this.workitemtypes(); break; default: // Do not remove this console. It outputs the unknown events console.log('Unknown event', event); } }, enumerable: true, configurable: true }); WorkItemEventComponent.prototype.ngOnInit = function () { }; WorkItemEventComponent.prototype.getTitle = function () { if (this.event.name.indexOf('system') > -1) { this.title = this.event.name.slice(this.event.name.indexOf('.') + 1); } else { this.title = this.event.name; } }; WorkItemEventComponent.prototype.singleValueChange = function () { if (this.title === 'description') { this.textType = 'description'; } else { this.intermediateText = 'changed the ' + this.title + ' from'; this.textType = 'attribute'; } }; WorkItemEventComponent.prototype.areasAndIteration = function () { this.intermediateText = 'moved this work item to ' + this.title; this.toText = 'from ' + this.title; this.textType = 'relationship'; }; WorkItemEventComponent.prototype.users = function () { if (this.event.oldValueRelationships.length === 0) { if (this.event.newValueRelationships.length === 1 && this.event.newValueRelationships[0].id === this.event.modifierId) { this.intermediateText = 'self assigned this workitem'; this.toText = null; this.event.newValueRelationshipsObs = []; } else { this.intermediateText = 'assigned this work item to'; this.toText = null; } } else if (this.event.newValueRelationships.length === 0) { this.intermediateText = 'unassigned'; this.toText = ' '; } else { this.intermediateText = 'assigned'; this.toText = 'and unassgined'; } this.textType = 'assignee'; }; WorkItemEventComponent.prototype.labels = function () { if (this.event.oldValueRelationships.length === 0) { this.intermediateText = 'added '; this.toText = ' label'; } else if (this.event.newValueRelationships.length === 0) { this.intermediateText = 'removed the label '; this.toText = ' '; } else { this.intermediateText = 'added the label '; this.toText = ' and removed the label '; } this.textType = 'label'; }; WorkItemEventComponent.prototype.workitemtypes = function () { this.intermediateText = 'changed the workitem type from'; this.textType = 'typeChange'; }; WorkItemEventComponent.decorators = [ { type: Component, args: [{ selector: 'work-item-event', template: require('./work-item-event.component.html'), styles: [require('./work-item-event.component.css').toString()] },] }, ]; /** @nocollapse */ WorkItemEventComponent.ctorParameters = function () { return []; }; WorkItemEventComponent.propDecorators = { 'Event': [{ type: Input, args: ['event',] },], }; return WorkItemEventComponent; }()); export { WorkItemEventComponent }; //# sourceMappingURL=work-item-event.component.js.map