TSK-975: Remove unnecessary initializers
This commit is contained in:
parent
e5102daf16
commit
22b0b2170b
|
@ -173,10 +173,10 @@
|
|||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<ul *ngIf="belongingGroups !== undefined && belongingGroups.length > 0 " class="list-group">
|
||||
<ul *ngIf="belongingGroups && belongingGroups.length > 0 " class="list-group">
|
||||
<li *ngFor="let group of belongingGroups" class="list-group-item">{{group.name}}</li>
|
||||
</ul>
|
||||
<p *ngIf="belongingGroups === undefined || belongingGroups.length === 0">The user is not associated to
|
||||
<p *ngIf="!belongingGroups">The user is not associated to
|
||||
any groups</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
@ -194,4 +194,4 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -67,9 +67,8 @@ describe('ClassificationDetailsComponent', () => {
|
|||
spyOn(classificationCategoriesService, 'getCategories').and.returnValue(of(['firstCategory', 'secondCategory']));
|
||||
spyOn(classificationsService, 'deleteClassification').and.returnValue(of(true));
|
||||
spyOn(classificationCategoriesService, 'getCategoryIcon').and.returnValue(new Pair('assets/icons/categories/external.svg'));
|
||||
component.classification = new ClassificationDefinition('id1', undefined, undefined, undefined, undefined, undefined, undefined,
|
||||
undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined,
|
||||
undefined, undefined, undefined, undefined, new LinksClassification({ 'self': '' }));
|
||||
component.classification = new ClassificationDefinition('id1');
|
||||
component.classification._links = new LinksClassification({ 'self': '' });
|
||||
treeService = TestBed.get(TreeService);
|
||||
fixture.detectChanges();
|
||||
done();
|
||||
|
|
|
@ -102,18 +102,18 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
|
|||
|
||||
this.routeSubscription = this.route.params.subscribe(params => {
|
||||
let id = params['id'];
|
||||
this.action = undefined;
|
||||
delete this.action;
|
||||
if (id && id.indexOf('new-classification') !== -1) {
|
||||
this.action = ACTION.CREATE;
|
||||
this.badgeMessage = 'Creating new classification';
|
||||
id = id.replace('new-classification/', '');
|
||||
if (id === 'undefined') {
|
||||
id = undefined;
|
||||
id = '';
|
||||
}
|
||||
this.fillClassificationInformation(this.classification ? this.classification : new ClassificationDefinition())
|
||||
}
|
||||
|
||||
if (!this.classification || this.classification.classificationId !== id && id && id !== '') {
|
||||
if (!this.classification || this.classification.classificationId !== id && id ) {
|
||||
this.selectClassification(id);
|
||||
}
|
||||
});
|
||||
|
@ -140,7 +140,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
backClicked(): void {
|
||||
this.classificationsService.selectClassification(undefined);
|
||||
this.classificationsService.selectClassification();
|
||||
this.router.navigate(['./'], { relativeTo: this.route.parent });
|
||||
}
|
||||
|
||||
|
@ -167,8 +167,8 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
private initProperties() {
|
||||
this.classification = undefined;
|
||||
this.action = undefined
|
||||
delete this.classification;
|
||||
delete this.action;
|
||||
}
|
||||
|
||||
private async onSave() {
|
||||
|
@ -287,9 +287,9 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
|
|||
.deleteClassification(this.classification._links.self.href)
|
||||
.subscribe(() => {
|
||||
const key = this.classification.key;
|
||||
this.classification = undefined;
|
||||
delete this.classification;
|
||||
this.afterRequest();
|
||||
this.classificationsService.selectClassification(undefined);
|
||||
this.classificationsService.selectClassification();
|
||||
this.router.navigate(['taskana/administration/classifications']);
|
||||
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Classification ${key} was removed successfully`))
|
||||
}, error => {
|
||||
|
|
|
@ -75,10 +75,10 @@ export class ClassificationListComponent implements OnInit, OnDestroy {
|
|||
this.classifications = [];
|
||||
this.categoryService.selectClassificationType(classificationTypeSelected);
|
||||
this.getClassifications();
|
||||
this.selectClassification(undefined);
|
||||
this.selectClassification();
|
||||
}
|
||||
|
||||
selectClassification(id: string) {
|
||||
selectClassification(id?: string) {
|
||||
this.selectedId = id;
|
||||
if (!id) {
|
||||
this.router.navigate(['taskana/administration/classifications']);
|
||||
|
@ -128,7 +128,7 @@ export class ClassificationListComponent implements OnInit, OnDestroy {
|
|||
|
||||
}
|
||||
|
||||
private getClassifications(key: string = undefined) {
|
||||
private getClassifications(key?: string) {
|
||||
this.requestInProgress = true;
|
||||
this.classificationService.getClassifications()
|
||||
.subscribe((classifications: Array<TreeNodeModel>) => {
|
||||
|
|
|
@ -87,7 +87,7 @@ export class ImportExportComponent implements OnInit {
|
|||
break;
|
||||
default:
|
||||
file.value = '';
|
||||
this.generalModalService.triggerMessage(new MessageModal(undefined,
|
||||
this.generalModalService.triggerMessage(new MessageModal('Wrong format',
|
||||
`This file format is not allowed! Please use a .json file.`));
|
||||
}
|
||||
return check;
|
||||
|
@ -133,7 +133,7 @@ export class ImportExportComponent implements OnInit {
|
|||
message
|
||||
)
|
||||
);
|
||||
this.selectedFileInput.files = undefined;
|
||||
delete this.selectedFileInput.files;
|
||||
this.resetProgress();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ export class IconTypeComponent implements OnInit {
|
|||
tooltip = false;
|
||||
|
||||
@Input()
|
||||
text: string = undefined;
|
||||
text: string;
|
||||
|
||||
public static get allTypes(): Map<string, string> {
|
||||
return new Map([['PERSONAL', 'Personal'], ['GROUP', 'Group'], ['CLEARANCE', 'Clearance'], ['TOPIC', 'Topic']])
|
||||
|
|
|
@ -42,8 +42,11 @@ describe('AccessItemsComponent', () => {
|
|||
configureTests(configure).then(testBed => {
|
||||
fixture = TestBed.createComponent(AccessItemsComponent);
|
||||
component = fixture.componentInstance;
|
||||
component.workbasket = new Workbasket('1', '', '', '', ICONTYPES.TOPIC, '', '', '', '', '', '', '', '', '', '', '', '',
|
||||
new Links(undefined, undefined, { 'href': 'someurl' }));
|
||||
component.workbasket = new Workbasket('1');
|
||||
component.workbasket.type = ICONTYPES.TOPIC;
|
||||
component.workbasket._links = new Links()
|
||||
component.workbasket._links.accessItems = { 'href': 'someurl' };
|
||||
|
||||
workbasketService = TestBed.get(WorkbasketService);
|
||||
alertService = TestBed.get(AlertService);
|
||||
spyOn(workbasketService, 'getWorkBasketAccessItems').and.returnValue(of(new WorkbasketAccessItemsResource(
|
||||
|
|
|
@ -123,11 +123,13 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
|
|||
}
|
||||
|
||||
addAccessItem() {
|
||||
const newForm = this.formBuilder.group(
|
||||
new WorkbasketAccessItems(undefined, this.workbasket.workbasketId, '', '', true));
|
||||
const workbasketAccessItems = new WorkbasketAccessItems();
|
||||
workbasketAccessItems.workbasketId = this.workbasket.workbasketId;
|
||||
workbasketAccessItems.permRead = true;
|
||||
const newForm = this.formBuilder.group(workbasketAccessItems);
|
||||
newForm.controls['accessId'].setValidators(Validators.required);
|
||||
this.accessItemsGroups.push(newForm);
|
||||
this.accessItemsClone.push(new WorkbasketAccessItems(undefined, this.workbasket.workbasketId, '', '', true));
|
||||
this.accessItemsClone.push(workbasketAccessItems);
|
||||
}
|
||||
|
||||
clear() {
|
||||
|
@ -200,7 +202,7 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
|
|||
}
|
||||
private setWorkbasketIdForCopy(workbasketId: string) {
|
||||
this.accessItemsGroups.value.forEach(element => {
|
||||
element.accessItemId = undefined;
|
||||
delete element.accessItemId;
|
||||
element.workbasketId = workbasketId;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -140,16 +140,16 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
|
|||
}
|
||||
|
||||
performFilter(dualListFilter: any) {
|
||||
dualListFilter.side === Side.RIGHT ? this.distributionTargetsRight = undefined : this.distributionTargetsLeft = undefined;
|
||||
this.onRequest(dualListFilter.side, false);
|
||||
this.workbasketFilterSubscription = this.workbasketService.getWorkBasketsSummary(true, undefined, undefined, undefined,
|
||||
dualListFilter.filterBy.filterParams.name, dualListFilter.filterBy.filterParams.description, undefined,
|
||||
dualListFilter.filterBy.filterParams.owner, dualListFilter.filterBy.filterParams.type, undefined,
|
||||
dualListFilter.filterBy.filterParams.key, undefined, true).subscribe(resultList => {
|
||||
dualListFilter.side === Side.RIGHT ? delete this.distributionTargetsRight : delete this.distributionTargetsLeft;
|
||||
this.onRequest(false, dualListFilter.side);
|
||||
this.workbasketFilterSubscription = this.workbasketService.getWorkBasketsSummary(true, '', '', '',
|
||||
dualListFilter.filterBy.filterParams.name, dualListFilter.filterBy.filterParams.description, '',
|
||||
dualListFilter.filterBy.filterParams.owner, dualListFilter.filterBy.filterParams.type, '',
|
||||
dualListFilter.filterBy.filterParams.key, '', true).subscribe(resultList => {
|
||||
(dualListFilter.side === Side.RIGHT) ?
|
||||
this.distributionTargetsRight = (resultList.workbaskets) :
|
||||
this.distributionTargetsLeft = (resultList.workbaskets);
|
||||
this.onRequest(dualListFilter.side, true);
|
||||
this.onRequest(true, dualListFilter.side);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -162,7 +162,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
|
|||
}
|
||||
|
||||
private init() {
|
||||
this.onRequest(undefined);
|
||||
this.onRequest();
|
||||
if (!this.workbasket._links.distributionTargets) {
|
||||
return;
|
||||
}
|
||||
|
@ -215,9 +215,8 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
|
|||
TaskanaQueryParameters.pageSize = this.cards + this.distributionTargetsSelected.length;
|
||||
}
|
||||
|
||||
this.workbasketSubscription = this.workbasketService.getWorkBasketsSummary(true,
|
||||
undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined,
|
||||
undefined, undefined, undefined, false).subscribe(
|
||||
this.workbasketSubscription = this.workbasketService.getWorkBasketsSummary(true)
|
||||
.subscribe(
|
||||
(distributionTargetsAvailable: WorkbasketSummaryResource) => {
|
||||
if (TaskanaQueryParameters.page === 1) {
|
||||
this.distributionTargetsLeft = [];
|
||||
|
@ -232,7 +231,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
|
|||
this.distributionTargetsRight = Object.assign([], distributionTargetsAvailable.workbaskets);
|
||||
this.distributionTargetsClone = Object.assign([], distributionTargetsAvailable.workbaskets);
|
||||
}
|
||||
this.onRequest(undefined, true);
|
||||
this.onRequest(true);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -255,16 +254,16 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
|
|||
return originList;
|
||||
}
|
||||
|
||||
private onRequest(side: Side = undefined, finished: boolean = false) {
|
||||
private onRequest(finished: boolean = false, side?: Side) {
|
||||
if (this.loadingItems) {
|
||||
this.loadingItems = false;
|
||||
}
|
||||
if (finished) {
|
||||
side === undefined ? (this.requestInProgressLeft = false, this.requestInProgressRight = false) :
|
||||
typeof side === 'undefined' ? (this.requestInProgressLeft = false, this.requestInProgressRight = false) :
|
||||
side === Side.LEFT ? this.requestInProgressLeft = false : this.requestInProgressRight = false;
|
||||
return;
|
||||
}
|
||||
side === undefined ? (this.requestInProgressLeft = true, this.requestInProgressRight = true) :
|
||||
typeof side === 'undefined' ? (this.requestInProgressLeft = true, this.requestInProgressRight = true) :
|
||||
side === Side.LEFT ? this.requestInProgressLeft = true : this.requestInProgressRight = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ describe('WorkbasketInformationComponent', () => {
|
|||
it('should create a copy of workbasket when workbasket is selected', () => {
|
||||
expect(component.workbasketClone).toBeUndefined();
|
||||
component.workbasket = new Workbasket('id', 'created', 'keyModified', 'domain', ICONTYPES.TOPIC, 'modified', 'name', 'description',
|
||||
'owner', 'custom1', 'custom2', 'custom3', 'custom4', 'orgLevel1', 'orgLevel2', 'orgLevel3', 'orgLevel4', null);
|
||||
'owner', 'custom1', 'custom2', 'custom3', 'custom4', 'orgLevel1', 'orgLevel2', 'orgLevel3', 'orgLevel4');
|
||||
component.ngOnChanges(
|
||||
undefined
|
||||
);
|
||||
|
@ -185,12 +185,14 @@ describe('WorkbasketInformationComponent', () => {
|
|||
}));
|
||||
|
||||
it('should trigger requestInProgress service true before and requestInProgress false after remove a workbasket', () => {
|
||||
const links = new Links({ 'href': 'someUrl' });
|
||||
links.removeDistributionTargets = { 'href': 'someUrl' };
|
||||
const workbasket = new Workbasket(undefined, 'created', 'keyModified', 'domain', ICONTYPES.TOPIC,
|
||||
'modified', 'name', 'description', 'owner', 'custom1', 'custom2',
|
||||
'custom3', 'custom4', 'orgLevel1', 'orgLevel2',
|
||||
'orgLevel3', 'orgLevel4', new Links({ 'href': 'someUrl' }, undefined, undefined, undefined, { 'href': 'someUrl' }));
|
||||
'orgLevel3', 'orgLevel4', links);
|
||||
component.workbasket = workbasket;
|
||||
spyOn(workbasketService, 'removeDistributionTarget').and.returnValue(of(''));
|
||||
spyOn(workbasketService, 'removeDistributionTarget').and.returnValue(of(undefined));
|
||||
const requestInProgressServiceSpy = spyOn(requestInProgressService, 'setRequestInProgress');
|
||||
|
||||
component.removeDistributionTargets();
|
||||
|
|
|
@ -20,7 +20,7 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
|
|||
|
||||
workbasket: Workbasket;
|
||||
workbasketCopy: Workbasket;
|
||||
selectedId: string = undefined;
|
||||
selectedId: string;
|
||||
showDetail = false;
|
||||
requestInProgress = false;
|
||||
action: string;
|
||||
|
@ -46,32 +46,30 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
|
|||
|
||||
ngOnInit() {
|
||||
this.workbasketSelectedSubscription = this.service.getSelectedWorkBasket().subscribe(workbasketIdSelected => {
|
||||
this.workbasket = undefined;
|
||||
delete this.workbasket;
|
||||
this.getWorkbasketInformation(workbasketIdSelected);
|
||||
});
|
||||
|
||||
this.routeSubscription = this.route.params.subscribe(params => {
|
||||
let id = params['id'];
|
||||
this.action = undefined;
|
||||
if (id && id.indexOf('new-workbasket') !== -1) {
|
||||
this.tabSelected = 'information';
|
||||
this.action = ACTION.CREATE;
|
||||
id = undefined;
|
||||
this.getWorkbasketInformation(id);
|
||||
} else if (id && id.indexOf('copy-workbasket') !== -1) {
|
||||
if (!this.selectedId) {
|
||||
this.router.navigate(['./'], { relativeTo: this.route.parent });
|
||||
return;
|
||||
const id = params['id'];
|
||||
delete this.action;
|
||||
if (id) {
|
||||
if (id.indexOf('new-workbasket') !== -1) {
|
||||
this.tabSelected = 'information';
|
||||
this.action = ACTION.CREATE;
|
||||
this.getWorkbasketInformation();
|
||||
} else if (id.indexOf('copy-workbasket') !== -1) {
|
||||
if (!this.selectedId) {
|
||||
this.router.navigate(['./'], { relativeTo: this.route.parent });
|
||||
return;
|
||||
}
|
||||
this.action = ACTION.COPY;
|
||||
delete this.workbasket.key;
|
||||
this.workbasketCopy = this.workbasket;
|
||||
this.getWorkbasketInformation();
|
||||
} else {
|
||||
this.selectWorkbasket(id);
|
||||
}
|
||||
this.action = ACTION.COPY;
|
||||
this.workbasket.key = undefined;
|
||||
this.workbasketCopy = this.workbasket;
|
||||
id = undefined;
|
||||
this.getWorkbasketInformation(id, this.selectedId);
|
||||
}
|
||||
|
||||
if (id && id !== '') {
|
||||
this.selectWorkbasket(id);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -79,13 +77,13 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
|
|||
this.showDetail = showDetail;
|
||||
});
|
||||
|
||||
this.importingExportingSubscription = this.importExportService.getImportingFinished().subscribe((value: Boolean) => {
|
||||
this.importingExportingSubscription = this.importExportService.getImportingFinished().subscribe(() => {
|
||||
if (this.workbasket) { this.getWorkbasketInformation(this.workbasket.workbasketId); }
|
||||
})
|
||||
}
|
||||
|
||||
backClicked(): void {
|
||||
this.service.selectWorkBasket(undefined);
|
||||
this.service.selectWorkBasket();
|
||||
this.router.navigate(['./'], { relativeTo: this.route.parent });
|
||||
}
|
||||
|
||||
|
@ -98,18 +96,18 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
|
|||
this.service.selectWorkBasket(id);
|
||||
}
|
||||
|
||||
private getWorkbasketInformation(workbasketIdSelected: string, copyId: string = undefined) {
|
||||
private getWorkbasketInformation(workbasketIdSelected?: string) {
|
||||
this.requestInProgress = true;
|
||||
|
||||
if (!workbasketIdSelected && this.action === ACTION.CREATE) { // CREATE
|
||||
this.workbasket = new Workbasket(undefined);
|
||||
this.workbasket = new Workbasket();
|
||||
this.domainSubscription = this.domainService.getSelectedDomain().subscribe(domain => {
|
||||
this.workbasket.domain = domain;
|
||||
});
|
||||
this.requestInProgress = false;
|
||||
} else if (!workbasketIdSelected && this.action === ACTION.COPY) { // COPY
|
||||
this.workbasket = { ...this.workbasketCopy };
|
||||
this.workbasket.workbasketId = undefined;
|
||||
delete this.workbasket.workbasketId;
|
||||
this.requestInProgress = false;
|
||||
}
|
||||
if (workbasketIdSelected) {
|
||||
|
|
|
@ -65,8 +65,9 @@ describe('WorkbasketListToolbarComponent', () => {
|
|||
debugElement = fixture.debugElement.nativeElement;
|
||||
component = fixture.componentInstance;
|
||||
component.workbaskets = new Array<WorkbasketSummary>(
|
||||
new WorkbasketSummary('1', 'key1', 'NAME1', 'description 1', 'owner 1',
|
||||
undefined, undefined, undefined, undefined, undefined, undefined, undefined, false, new Links({ 'href': 'selfLink' })));
|
||||
new WorkbasketSummary('1', 'key1', 'NAME1', 'description 1', 'owner 1'));
|
||||
component.workbaskets[0].markedForDeletion = false;
|
||||
component.workbaskets[0]._links = new Links({ 'href': 'selfLink' });
|
||||
|
||||
fixture.detectChanges();
|
||||
done();
|
||||
|
|
|
@ -49,7 +49,7 @@ export class WorkbasketListToolbarComponent implements OnInit {
|
|||
}
|
||||
|
||||
addWorkbasket() {
|
||||
this.workbasketService.selectWorkBasket(undefined);
|
||||
this.workbasketService.selectWorkBasket();
|
||||
this.router.navigate([{ outlets: { detail: ['new-workbasket'] } }], { relativeTo: this.route });
|
||||
}
|
||||
|
||||
|
|
|
@ -36,5 +36,5 @@
|
|||
</div>
|
||||
</ng-template>
|
||||
</div>
|
||||
<taskana-pagination [(page)]="workbasketsResource !== undefined ? workbasketsResource.page : workbasketsResource"
|
||||
<taskana-pagination [(page)]="workbasketsResource ? workbasketsResource.page : workbasketsResource"
|
||||
[type]="type" [numberOfItems]="workbaskets.length" (changePage)="changePage($event)"></taskana-pagination>
|
||||
|
|
|
@ -53,7 +53,7 @@ const workbasketSummaryResource: WorkbasketSummaryResource = new WorkbasketSumma
|
|||
describe('WorkbasketListComponent', () => {
|
||||
let component: WorkbasketListComponent;
|
||||
let fixture: ComponentFixture<WorkbasketListComponent>;
|
||||
let debugElement: any = undefined;
|
||||
let debugElement: any;
|
||||
let workbasketService: WorkbasketService;
|
||||
let workbasketSummarySpy;
|
||||
|
||||
|
@ -167,7 +167,7 @@ describe('WorkbasketListComponent', () => {
|
|||
component.performFilter(filter);
|
||||
|
||||
expect(workbasketSummarySpy.calls.all()[1].args).toEqual([true, 'key', 'asc',
|
||||
undefined, 'someName', 'someDescription', undefined, 'someOwner', 'PERSONAL', undefined, 'someKey', undefined]);
|
||||
'', 'someName', 'someDescription', '', 'someOwner', 'PERSONAL', '', 'someKey', '']);
|
||||
|
||||
}));
|
||||
|
||||
|
|
|
@ -104,9 +104,9 @@ export class WorkbasketListComponent implements OnInit, OnDestroy {
|
|||
this.requestInProgress = true;
|
||||
this.workbaskets = [];
|
||||
this.workbasketServiceSubscription = this.workbasketService.getWorkBasketsSummary(
|
||||
true, this.sort.sortBy, this.sort.sortDirection, undefined,
|
||||
this.filterBy.filterParams.name, this.filterBy.filterParams.description, undefined, this.filterBy.filterParams.owner,
|
||||
this.filterBy.filterParams.type, undefined, this.filterBy.filterParams.key, undefined)
|
||||
true, this.sort.sortBy, this.sort.sortDirection, '',
|
||||
this.filterBy.filterParams.name, this.filterBy.filterParams.description, '', this.filterBy.filterParams.owner,
|
||||
this.filterBy.filterParams.type, '', this.filterBy.filterParams.key, '')
|
||||
.subscribe(resultList => {
|
||||
this.workbasketsResource = resultList;
|
||||
this.workbaskets = resultList.workbaskets;
|
||||
|
|
|
@ -100,7 +100,7 @@ export class TaskQueryService {
|
|||
parameters.CUSTOM_4_LIKE = custom4;
|
||||
parameters.CREATED = created;
|
||||
|
||||
if (allPages) { TaskanaQueryParameters.page = undefined; TaskanaQueryParameters.pageSize = undefined; }
|
||||
if (allPages) { delete TaskanaQueryParameters.page; delete TaskanaQueryParameters.pageSize; }
|
||||
|
||||
return TaskanaQueryParameters.getQueryParameters(parameters);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import { LinksClassification } from 'app/models/links-classfication';
|
|||
|
||||
export class AccessIdDefinition {
|
||||
constructor(
|
||||
public accessId: string = undefined,
|
||||
public name: string = undefined) {
|
||||
public accessId?: string,
|
||||
public name?: string) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,6 @@ import { AccessItemWorkbasket } from './access-item-workbasket';
|
|||
export class AccessItemsWorkbasketResource {
|
||||
constructor(
|
||||
public accessItems: Array<AccessItemWorkbasket> = [],
|
||||
public _links: Links = undefined
|
||||
public _links?: Links
|
||||
) { }
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@ import { Links } from './links';
|
|||
|
||||
export class AccessItemWorkbasket {
|
||||
constructor(
|
||||
public accessItemId: string = '',
|
||||
public workbasketKey: string = '',
|
||||
public accessId: string = '',
|
||||
public accessItemId: string,
|
||||
public workbasketKey: string,
|
||||
public accessId: string,
|
||||
public permRead: boolean = false,
|
||||
public permOpen: boolean = false,
|
||||
public permAppend: boolean = false,
|
||||
|
@ -22,6 +22,6 @@ export class AccessItemWorkbasket {
|
|||
public permCustom10: boolean = false,
|
||||
public permCustom11: boolean = false,
|
||||
public permCustom12: boolean = false,
|
||||
public _links: Links = undefined
|
||||
public _links?: Links
|
||||
) { }
|
||||
}
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
import { LinksClassification } from 'app/models/links-classfication';
|
||||
|
||||
export class ClassificationDefinition {
|
||||
constructor(public classificationId: string = undefined,
|
||||
public key: string = undefined,
|
||||
public parentId: string = undefined,
|
||||
public parentKey: string = undefined,
|
||||
public category: string = undefined,
|
||||
public domain: string = undefined,
|
||||
public type: string = undefined,
|
||||
public isValidInDomain: boolean = undefined,
|
||||
public created: string = undefined,
|
||||
public modified: string = undefined,
|
||||
public name: string = undefined,
|
||||
public description: string = undefined,
|
||||
public priority: number = undefined,
|
||||
public serviceLevel: string = undefined,
|
||||
public applicationEntryPoint: string = undefined,
|
||||
public custom1: string = undefined,
|
||||
public custom2: string = undefined,
|
||||
public custom3: string = undefined,
|
||||
public custom4: string = undefined,
|
||||
public custom5: string = undefined,
|
||||
public custom6: string = undefined,
|
||||
public custom7: string = undefined,
|
||||
public custom8: string = undefined,
|
||||
public _links: LinksClassification = new LinksClassification()) {
|
||||
constructor(public classificationId?: string,
|
||||
public key?: string,
|
||||
public parentId?: string,
|
||||
public parentKey?: string,
|
||||
public category?: string,
|
||||
public domain?: string,
|
||||
public type?: string,
|
||||
public isValidInDomain?: boolean,
|
||||
public created?: string,
|
||||
public modified?: string,
|
||||
public name?: string,
|
||||
public description?: string,
|
||||
public priority?: number,
|
||||
public serviceLevel?: string,
|
||||
public applicationEntryPoint?: string,
|
||||
public custom1?: string,
|
||||
public custom2?: string,
|
||||
public custom3?: string,
|
||||
public custom4?: string,
|
||||
public custom5?: string,
|
||||
public custom6?: string,
|
||||
public custom7?: string,
|
||||
public custom8?: string,
|
||||
public _links?: LinksClassification) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Links } from './links';
|
|||
export class ClassificationResource {
|
||||
constructor(
|
||||
public classifications: Array<Classification> = [],
|
||||
public _links: Links = new Links(),
|
||||
public _links?: Links
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import {Links} from 'app/models/links';
|
||||
|
||||
export class Classification {
|
||||
constructor(public classificationId: string = undefined, // newly created classifications don't have an id yet.
|
||||
public key: string = undefined,
|
||||
public category: string = undefined,
|
||||
public type: string = undefined,
|
||||
public domain: string = undefined,
|
||||
public name: string = undefined,
|
||||
public parentId: string = undefined,
|
||||
public priority: number = undefined,
|
||||
public serviceLevel: string = undefined,
|
||||
public _links: Links = new Links()) {
|
||||
constructor(public classificationId?: string, // newly created classifications don't have an id yet.
|
||||
public key?: string,
|
||||
public category?: string,
|
||||
public type?: string,
|
||||
public domain?: string,
|
||||
public name?: string,
|
||||
public parentId?: string,
|
||||
public priority?: number,
|
||||
public serviceLevel?: string,
|
||||
public _links?: Links ) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@ import { Links } from './links';
|
|||
|
||||
export class LinksClassification extends Links {
|
||||
constructor(
|
||||
self = undefined,
|
||||
distributionTargets = undefined,
|
||||
accessItems = undefined,
|
||||
public getAllClassifications: { 'href': string } = undefined,
|
||||
public createClassification: { 'href': string } = undefined,
|
||||
public updateClassification: { 'href': string } = undefined,
|
||||
self?,
|
||||
distributionTargets?,
|
||||
accessItems?,
|
||||
public getAllClassifications?: { 'href': string },
|
||||
public createClassification?: { 'href': string },
|
||||
public updateClassification?: { 'href': string },
|
||||
) { super(self, distributionTargets, accessItems) }
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@ import { Links } from './links';
|
|||
|
||||
export class LinksWorkbasketSummary extends Links {
|
||||
constructor(
|
||||
self = undefined,
|
||||
distributionTargets = undefined,
|
||||
accessItems = undefined,
|
||||
public allWorkbaskets: { 'href': string } = undefined
|
||||
self?,
|
||||
distributionTargets?,
|
||||
accessItems?,
|
||||
public allWorkbaskets?: { 'href': string }
|
||||
) { super(self, distributionTargets, accessItems) }
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
export class Links {
|
||||
constructor(
|
||||
public self: { 'href': string } = undefined,
|
||||
public distributionTargets: { 'href': string } = undefined,
|
||||
public accessItems: { 'href': string } = undefined,
|
||||
public allWorkbasketUrl: { 'href': string } = undefined,
|
||||
public removeDistributionTargets: {'href': string} = undefined
|
||||
public self?: { 'href': string },
|
||||
public distributionTargets?: { 'href': string },
|
||||
public accessItems?: { 'href': string },
|
||||
public allWorkbasketUrl?: { 'href': string },
|
||||
public removeDistributionTargets?: {'href': string}
|
||||
) { }
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
export class MessageModal {
|
||||
constructor(
|
||||
public title: string = undefined,
|
||||
public message: any = undefined,
|
||||
public title?: string,
|
||||
public message?: any,
|
||||
public type = 'error'
|
||||
) { }
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
export class Page {
|
||||
constructor(
|
||||
public size: number = undefined,
|
||||
public totalElements: number = undefined,
|
||||
public totalPages: number = undefined,
|
||||
public number: number = undefined
|
||||
public size?: number,
|
||||
public totalElements?: number,
|
||||
public totalPages?: number,
|
||||
public number?: number
|
||||
) { }
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
export class Pair {
|
||||
constructor(
|
||||
public name: string = undefined,
|
||||
public text: string = undefined,
|
||||
public name?: string,
|
||||
public text?: string,
|
||||
) { }
|
||||
}
|
||||
|
|
|
@ -3,5 +3,5 @@ import { TaskHistoryEventData } from './task-history-event';
|
|||
|
||||
export class TaskHistoryEventResourceData {
|
||||
public taskHistoryEvents: Array<TaskHistoryEventData>
|
||||
public _links: Links = undefined
|
||||
public _links: Links = new Links()
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { Classification } from 'app/models/classification';
|
||||
|
||||
export class TreeNodeModel extends Classification {
|
||||
constructor(public id: string = '',
|
||||
public key: string = '',
|
||||
public category: string = '',
|
||||
public type: string = '',
|
||||
public domain: string = '',
|
||||
public name: string = '',
|
||||
public parentId: string = '',
|
||||
public priority: number = 0,
|
||||
public serviceLevel: string = '',
|
||||
public children: Array<TreeNodeModel> = undefined) {
|
||||
constructor(public id?: string,
|
||||
public key?: string,
|
||||
public category?: string,
|
||||
public type?: string,
|
||||
public domain?: string,
|
||||
public name?: string,
|
||||
public parentId?: string,
|
||||
public priority?: number,
|
||||
public serviceLevel?: string,
|
||||
public children: Array<TreeNodeModel> = []) {
|
||||
super(id, key, category, type, domain, name, parentId, priority, serviceLevel);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
export class UserInfoModel {
|
||||
constructor(
|
||||
public userId: string = undefined,
|
||||
public userId: string = '',
|
||||
public groupIds: Array<string> = [],
|
||||
public roles: Array<string> = []) { };
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
export class VersionModel {
|
||||
constructor(
|
||||
public version: string = undefined
|
||||
public version: string = ''
|
||||
) { };
|
||||
}
|
||||
|
|
|
@ -4,6 +4,6 @@ import { WorkbasketAccessItems } from './workbasket-access-items';
|
|||
export class WorkbasketAccessItemsResource {
|
||||
constructor(
|
||||
public accessItems: Array<WorkbasketAccessItems> = [],
|
||||
public _links: Links = undefined
|
||||
public _links: Links = new Links()
|
||||
) { }
|
||||
}
|
||||
|
|
|
@ -23,6 +23,6 @@ export class WorkbasketAccessItems {
|
|||
public permCustom10: boolean = false,
|
||||
public permCustom11: boolean = false,
|
||||
public permCustom12: boolean = false,
|
||||
public _links: Links = undefined
|
||||
public _links: Links = new Links()
|
||||
) { }
|
||||
}
|
||||
|
|
|
@ -4,5 +4,5 @@ import { Workbasket } from './workbasket';
|
|||
export class WorkbasketResource {
|
||||
constructor(
|
||||
public workbaskets: Array<Workbasket> = [],
|
||||
public _links: Links = undefined) { }
|
||||
public _links: Links = new Links() ) { }
|
||||
}
|
||||
|
|
|
@ -4,20 +4,20 @@ import { Links } from './links';
|
|||
|
||||
export class WorkbasketSummary {
|
||||
constructor(
|
||||
public workbasketId: string = undefined,
|
||||
public key: string = undefined,
|
||||
public name: string = undefined,
|
||||
public description: string = undefined,
|
||||
public owner: string = undefined,
|
||||
public modified: string = undefined,
|
||||
public domain: string = undefined,
|
||||
public workbasketId?: string,
|
||||
public key?: string,
|
||||
public name?: string,
|
||||
public description?: string,
|
||||
public owner?: string,
|
||||
public modified?: string,
|
||||
public domain?: string,
|
||||
public type: string = ICONTYPES.PERSONAL,
|
||||
public orgLevel1: string = undefined,
|
||||
public orgLevel2: string = undefined,
|
||||
public orgLevel3: string = undefined,
|
||||
public orgLevel4: string = undefined,
|
||||
public orgLevel1?: string,
|
||||
public orgLevel2?: string,
|
||||
public orgLevel3?: string,
|
||||
public orgLevel4?: string,
|
||||
public markedForDeletion: boolean = false,
|
||||
public _links: Links = undefined,
|
||||
public page: Page = undefined) {
|
||||
public _links?: Links,
|
||||
public page?: Page ) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,23 +25,23 @@ export class Workbasket {
|
|||
}
|
||||
|
||||
constructor(
|
||||
public workbasketId: string,
|
||||
public created: string = undefined,
|
||||
public key: string = undefined,
|
||||
public domain: string = undefined,
|
||||
public workbasketId?: string,
|
||||
public created?: string,
|
||||
public key?: string,
|
||||
public domain?: string,
|
||||
public type: ICONTYPES = ICONTYPES.PERSONAL,
|
||||
public modified: string = undefined,
|
||||
public name: string = undefined,
|
||||
public description: string = undefined,
|
||||
public owner: string = undefined,
|
||||
public custom1: string = undefined,
|
||||
public custom2: string = undefined,
|
||||
public custom3: string = undefined,
|
||||
public custom4: string = undefined,
|
||||
public orgLevel1: string = undefined,
|
||||
public orgLevel2: string = undefined,
|
||||
public orgLevel3: string = undefined,
|
||||
public orgLevel4: string = undefined,
|
||||
public modified?: string,
|
||||
public name?: string,
|
||||
public description?: string,
|
||||
public owner?: string,
|
||||
public custom1?: string,
|
||||
public custom2?: string,
|
||||
public custom3?: string,
|
||||
public custom4?: string,
|
||||
public orgLevel1?: string,
|
||||
public orgLevel2?: string,
|
||||
public orgLevel3?: string,
|
||||
public orgLevel4?: string,
|
||||
public _links: Links = new Links()) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ describe('CustomFieldsService', () => {
|
|||
|
||||
it('should take default icon path', inject([CustomFieldsService], (service: CustomFieldsService) => {
|
||||
const categoriesData = {'DEFAULT': 'assets/icons/categories/default.svg'}
|
||||
const returnedValue = service.getCustomObject(categoriesData, undefined);
|
||||
const returnedValue = service.getCustomObject(categoriesData);
|
||||
expect(returnedValue).toBe(categoriesData);
|
||||
expect(service).toBeTruthy();
|
||||
}));
|
||||
|
|
|
@ -10,14 +10,14 @@ export class CustomFieldsService {
|
|||
this.customizedFields = jsonFile[language];
|
||||
}
|
||||
|
||||
getCustomField(fallbacktext: string, customPath: string = undefined): CustomField {
|
||||
getCustomField(fallbacktext: string, customPath?: string): CustomField {
|
||||
if (!customPath) {
|
||||
return new CustomField(true, fallbacktext)
|
||||
}
|
||||
return this.jsonPath(customPath, fallbacktext);
|
||||
}
|
||||
|
||||
getCustomObject(fallbackObject: Object, customPath: string = undefined): Object {
|
||||
getCustomObject(fallbackObject: Object, customPath?: string): Object {
|
||||
if (!customPath) {
|
||||
return fallbackObject;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ export class DomainService {
|
|||
this.domainRestValue = domains;
|
||||
this.domainValue = domains;
|
||||
this.dataObs$.next(this.hasMasterDomain ? this.addEmptyDomain(domains) : domains);
|
||||
if (this.domainSelectedValue === undefined && this.domainValue.length > 0) {
|
||||
if (!this.domainSelectedValue && this.domainValue.length > 0) {
|
||||
this.selectDomain(this.domainValue[0]);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -7,7 +7,7 @@ import { TaskanaQueryParameters } from 'app/shared/util/query-parameters';
|
|||
export class OrientationService {
|
||||
|
||||
private lock = false;
|
||||
private currentOrientation = undefined;
|
||||
private currentOrientation;
|
||||
public orientation = new BehaviorSubject<Orientation>(this.currentOrientation);
|
||||
|
||||
constructor() { }
|
||||
|
|
|
@ -21,7 +21,7 @@ export class SelectedRouteService {
|
|||
}
|
||||
|
||||
private getRoute(event): string {
|
||||
if (event === undefined) {
|
||||
if (!event) {
|
||||
return this.checkUrl(this.router.url);
|
||||
}
|
||||
return this.checkUrl(event.url)
|
||||
|
|
|
@ -11,7 +11,7 @@ export class TitlesService {
|
|||
this.titles = jsonFile[language];
|
||||
}
|
||||
|
||||
getTitle(id: number, fallBacktext: string, customPath: string = undefined) {
|
||||
getTitle(id: number, fallBacktext: string, customPath?: string) {
|
||||
|
||||
return this.titles[id] ? this.titles[id] : fallBacktext
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ export class AlertComponent implements OnInit {
|
|||
|
||||
setTimeOutForClosing(time: number) {
|
||||
setTimeout(() => {
|
||||
this.alert = undefined;
|
||||
delete this.alert;
|
||||
}, time);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,9 +7,10 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
|||
})
|
||||
export class ClassificationTypesSelectorComponent implements OnInit {
|
||||
|
||||
@Input() classificationTypes: Array<string> = [];
|
||||
@Input()
|
||||
classificationTypeSelected: string = undefined;
|
||||
classificationTypes: Array<string> = [];
|
||||
@Input()
|
||||
classificationTypeSelected: string;
|
||||
@Output()
|
||||
classificationTypeSelectedChange = new EventEmitter<string>();
|
||||
@Output()
|
||||
|
|
|
@ -35,7 +35,7 @@ export class MasterAndDetailComponent implements OnInit {
|
|||
}
|
||||
|
||||
private showDetails(event?: RouterEvent): boolean {
|
||||
if (event === undefined) {
|
||||
if (!event) {
|
||||
return this.checkUrl(this.router.url);
|
||||
}
|
||||
return this.checkUrl(event.url)
|
||||
|
|
|
@ -31,8 +31,8 @@ export class AccessIdsService {
|
|||
|
||||
getAccessItemsPermissions(
|
||||
accessIds: Array<AccessIdDefinition>,
|
||||
accessIdLike: string = undefined,
|
||||
workbasketKeyLike: string = undefined,
|
||||
accessIdLike?: string,
|
||||
workbasketKeyLike?: string,
|
||||
sortModel: SortingModel = new SortingModel('workbasket-key'),
|
||||
forceRequest: boolean = false): Observable<AccessItemsWorkbasketResource> {
|
||||
|
||||
|
@ -55,8 +55,8 @@ export class AccessIdsService {
|
|||
private accessIdsParameters(
|
||||
sortModel: SortingModel,
|
||||
accessIds: Array<AccessIdDefinition>,
|
||||
accessIdLike: string = undefined,
|
||||
workbasketKeyLike: string = undefined): QueryParametersModel {
|
||||
accessIdLike?: string,
|
||||
workbasketKeyLike?: string ): QueryParametersModel {
|
||||
|
||||
const parameters = new QueryParametersModel();
|
||||
parameters.SORTBY = sortModel.sortBy;
|
||||
|
@ -66,8 +66,8 @@ export class AccessIdsService {
|
|||
}).join('|');
|
||||
parameters.ACCESSIDLIKE = accessIdLike;
|
||||
parameters.WORKBASKETKEYLIKE = workbasketKeyLike;
|
||||
TaskanaQueryParameters.page = undefined;
|
||||
TaskanaQueryParameters.pageSize = undefined;
|
||||
delete TaskanaQueryParameters.page;
|
||||
delete TaskanaQueryParameters.pageSize;
|
||||
return parameters;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ export class ClassificationsService {
|
|||
}
|
||||
|
||||
// #region "Service extras"
|
||||
selectClassification(classification: ClassificationDefinition) {
|
||||
selectClassification(classification?: ClassificationDefinition) {
|
||||
this.classificationSelected.next(classification);
|
||||
}
|
||||
|
||||
|
@ -103,8 +103,8 @@ export class ClassificationsService {
|
|||
parameters.SORTBY = TaskanaQueryParameters.parameters.KEY;
|
||||
parameters.SORTDIRECTION = Direction.ASC;
|
||||
parameters.DOMAIN = domain;
|
||||
TaskanaQueryParameters.page = undefined;
|
||||
TaskanaQueryParameters.pageSize = undefined;
|
||||
delete TaskanaQueryParameters.page;
|
||||
delete TaskanaQueryParameters.pageSize;
|
||||
|
||||
return parameters;
|
||||
}
|
||||
|
|
|
@ -33,15 +33,15 @@ export class WorkbasketService {
|
|||
getWorkBasketsSummary(forceRequest: boolean = false,
|
||||
sortBy: string = TaskanaQueryParameters.parameters.KEY,
|
||||
order: string = Direction.ASC,
|
||||
name: string = undefined,
|
||||
nameLike: string = undefined,
|
||||
descLike: string = undefined,
|
||||
owner: string = undefined,
|
||||
ownerLike: string = undefined,
|
||||
type: string = undefined,
|
||||
key: string = undefined,
|
||||
keyLike: string = undefined,
|
||||
requiredPermission: string = undefined,
|
||||
name?: string,
|
||||
nameLike?: string,
|
||||
descLike?: string,
|
||||
owner?: string,
|
||||
ownerLike?: string,
|
||||
type?: string,
|
||||
key?: string,
|
||||
keyLike?: string,
|
||||
requiredPermission?: string,
|
||||
allPages: boolean = false) {
|
||||
|
||||
if (this.workbasketSummaryRef && !forceRequest) {
|
||||
|
@ -121,7 +121,7 @@ export class WorkbasketService {
|
|||
|
||||
// #endregion
|
||||
// #region "Service extras"
|
||||
selectWorkBasket(id: string) {
|
||||
selectWorkBasket(id?: string) {
|
||||
this.workBasketSelected.next(id);
|
||||
}
|
||||
|
||||
|
@ -158,17 +158,17 @@ export class WorkbasketService {
|
|||
private workbasketParameters(
|
||||
sortBy: string = TaskanaQueryParameters.parameters.KEY,
|
||||
order: string = Direction.ASC,
|
||||
name: string = undefined,
|
||||
nameLike: string = undefined,
|
||||
descLike: string = undefined,
|
||||
owner: string = undefined,
|
||||
ownerLike: string = undefined,
|
||||
type: string = undefined,
|
||||
key: string = undefined,
|
||||
keyLike: string = undefined,
|
||||
requiredPermission: string = undefined,
|
||||
allPages: boolean = false,
|
||||
domain: string = ''): QueryParametersModel {
|
||||
name?: string,
|
||||
nameLike?: string,
|
||||
descLike?: string,
|
||||
owner?: string,
|
||||
ownerLike?: string,
|
||||
type?: string,
|
||||
key?: string,
|
||||
keyLike?: string,
|
||||
requiredPermission?: string,
|
||||
allPages?: boolean,
|
||||
domain?: string): QueryParametersModel {
|
||||
|
||||
const parameters = new QueryParametersModel();
|
||||
parameters.SORTBY = sortBy;
|
||||
|
@ -184,8 +184,8 @@ export class WorkbasketService {
|
|||
parameters.REQUIREDPERMISSION = requiredPermission;
|
||||
parameters.DOMAIN = domain;
|
||||
if (allPages) {
|
||||
TaskanaQueryParameters.page = undefined;
|
||||
TaskanaQueryParameters.pageSize = undefined;
|
||||
delete TaskanaQueryParameters.page;
|
||||
delete TaskanaQueryParameters.pageSize;
|
||||
}
|
||||
return parameters;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ export class SpinnerComponent implements OnDestroy {
|
|||
isModal = false;
|
||||
|
||||
@Input()
|
||||
positionClass: string = undefined;
|
||||
positionClass: string;
|
||||
|
||||
@Output()
|
||||
spinnerIsRunning = new EventEmitter<boolean>();
|
||||
|
@ -81,8 +81,8 @@ export class SpinnerComponent implements OnDestroy {
|
|||
private cancelTimeout(): void {
|
||||
clearTimeout(this.currentTimeout);
|
||||
clearTimeout(this.requestTimeout);
|
||||
this.currentTimeout = undefined;
|
||||
this.requestTimeout = undefined;
|
||||
delete this.currentTimeout; // do we need this?
|
||||
delete this.requestTimeout;
|
||||
}
|
||||
|
||||
ngOnDestroy(): any {
|
||||
|
|
|
@ -106,7 +106,7 @@ export class TaskanaTreeComponent implements OnInit, AfterViewChecked, OnDestroy
|
|||
}
|
||||
|
||||
onDeactivate(treeNode: any) {
|
||||
this.selectNodeIdChanged.emit(undefined);
|
||||
this.selectNodeIdChanged.emit();
|
||||
}
|
||||
|
||||
async onMoveNode($event) {
|
||||
|
@ -145,7 +145,7 @@ export class TaskanaTreeComponent implements OnInit, AfterViewChecked, OnDestroy
|
|||
|
||||
private unSelectActiveNode() {
|
||||
const activeNode = this.tree.treeModel.getActiveNode();
|
||||
this.selectNodeId = undefined;
|
||||
delete this.selectNodeId;
|
||||
activeNode.setIsActive(false);
|
||||
activeNode.blur();
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ export class TypeAheadComponent implements OnInit, ControlValueAccessor {
|
|||
typeaheadOptionsInScrollableView = 6;
|
||||
|
||||
// The internal data model
|
||||
private innerValue: any = undefined;
|
||||
private innerValue: any;
|
||||
|
||||
// Placeholders for the callbacks which are later provided
|
||||
// by the Control Value Accessor
|
||||
|
|
|
@ -10,8 +10,8 @@ describe('TaskanaQueryParameters', () => {
|
|||
})
|
||||
|
||||
it('should create a empty query', () => {
|
||||
TaskanaQueryParameters.page = undefined;
|
||||
TaskanaQueryParameters.pageSize = undefined;
|
||||
delete TaskanaQueryParameters.page;
|
||||
delete TaskanaQueryParameters.pageSize;
|
||||
expect(TaskanaQueryParameters.getQueryParameters(new QueryParametersModel())).toBe('?');
|
||||
TaskanaQueryParameters.page = 1;
|
||||
TaskanaQueryParameters.pageSize = 9;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
export class ObjectReference {
|
||||
constructor(public id: string = undefined,
|
||||
public company: string = undefined,
|
||||
public system: string = undefined,
|
||||
public systemInstance: string = undefined,
|
||||
public type: string = undefined,
|
||||
public value: string = undefined) {
|
||||
constructor(public id?: string,
|
||||
public company?: string,
|
||||
public system?: string,
|
||||
public systemInstance?: string,
|
||||
public type?: string,
|
||||
public value?: string) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,6 @@ import { Page } from 'app/models/page';
|
|||
|
||||
export class TaskResource {
|
||||
constructor(public tasks: Array<Task>,
|
||||
public _links: Links = undefined,
|
||||
public _links?: Links,
|
||||
public page: Page = new Page()) {}
|
||||
}
|
||||
|
|
|
@ -4,44 +4,44 @@ import {ObjectReference} from './object-reference';
|
|||
|
||||
export class Task {
|
||||
constructor(public taskId: string,
|
||||
public primaryObjRef: ObjectReference = undefined,
|
||||
public workbasketSummaryResource: Workbasket = undefined,
|
||||
public classificationSummaryResource: Classification = undefined,
|
||||
public businessProcessId: string = undefined,
|
||||
public parentBusinessProcessId: string = undefined,
|
||||
public owner: string = undefined,
|
||||
public created: string = undefined, // ISO-8601
|
||||
public claimed: string = undefined, // ISO-8601
|
||||
public completed: string = undefined, // ISO-8601
|
||||
public modified: string = undefined, // ISO-8601
|
||||
public planned: string = undefined, // ISO-8601
|
||||
public due: string = undefined, // ISO-8601
|
||||
public name: string = undefined,
|
||||
public creator: string = undefined,
|
||||
public description: string = undefined,
|
||||
public note: string = undefined,
|
||||
public state: any = undefined,
|
||||
public read: boolean = undefined,
|
||||
public transferred: boolean = undefined,
|
||||
public priority: number = undefined,
|
||||
public primaryObjRef: ObjectReference = new ObjectReference(),
|
||||
public workbasketSummaryResource?: Workbasket,
|
||||
public classificationSummaryResource?: Classification,
|
||||
public businessProcessId?: string,
|
||||
public parentBusinessProcessId?: string,
|
||||
public owner?: string,
|
||||
public created?: string, // ISO-8601
|
||||
public claimed?: string, // ISO-8601
|
||||
public completed?: string, // ISO-8601
|
||||
public modified?: string, // ISO-8601
|
||||
public planned?: string, // ISO-8601
|
||||
public due?: string, // ISO-8601
|
||||
public name?: string,
|
||||
public creator?: string,
|
||||
public description?: string,
|
||||
public note?: string,
|
||||
public state?: any,
|
||||
public read?: boolean,
|
||||
public transferred?: boolean,
|
||||
public priority?: number,
|
||||
public customAttributes: Array<CustomAttribute> = [],
|
||||
public callbackInfo: Array<CustomAttribute> = [],
|
||||
public custom1: string = undefined,
|
||||
public custom2: string = undefined,
|
||||
public custom3: string = undefined,
|
||||
public custom4: string = undefined,
|
||||
public custom5: string = undefined,
|
||||
public custom6: string = undefined,
|
||||
public custom7: string = undefined,
|
||||
public custom8: string = undefined,
|
||||
public custom9: string = undefined,
|
||||
public custom10: string = undefined,
|
||||
public custom11: string = undefined,
|
||||
public custom12: string = undefined,
|
||||
public custom13: string = undefined,
|
||||
public custom14: string = undefined,
|
||||
public custom15: string = undefined,
|
||||
public custom16: string = undefined) {
|
||||
public custom1?: string,
|
||||
public custom2?: string,
|
||||
public custom3?: string,
|
||||
public custom4?: string,
|
||||
public custom5?: string,
|
||||
public custom6?: string,
|
||||
public custom7?: string,
|
||||
public custom8?: string,
|
||||
public custom9?: string,
|
||||
public custom10?: string,
|
||||
public custom11?: string,
|
||||
public custom12?: string,
|
||||
public custom13?: string,
|
||||
public custom14?: string,
|
||||
public custom15?: string,
|
||||
public custom16?: string) {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,11 +23,11 @@ export class TaskService {
|
|||
constructor(private httpClient: HttpClient) {
|
||||
}
|
||||
|
||||
publishUpdatedTask(task: Task = undefined) {
|
||||
publishUpdatedTask(task: Task = new Task('empty')) {
|
||||
this.taskChangedSource.next(task);
|
||||
}
|
||||
|
||||
selectTask(task: Task) {
|
||||
selectTask(task?: Task) {
|
||||
this.taskSelectedSource.next(task);
|
||||
}
|
||||
|
||||
|
@ -121,8 +121,8 @@ export class TaskService {
|
|||
parameters.TASK_PRIMARY_OBJ_REF_TYPE_LIKE = objRefTypeLike;
|
||||
parameters.TASK_PRIMARY_OBJ_REF_VALUE_LIKE = objRefValueLike;
|
||||
if (allPages) {
|
||||
TaskanaQueryParameters.page = undefined;
|
||||
TaskanaQueryParameters.pageSize = undefined;
|
||||
delete TaskanaQueryParameters.page;
|
||||
delete TaskanaQueryParameters.pageSize;
|
||||
}
|
||||
|
||||
return parameters;
|
||||
|
|
|
@ -13,7 +13,7 @@ export class WorkplaceService {
|
|||
private objectReferenceSource = new Subject<ObjectReference>();
|
||||
objectReferenceSelectedStream = this.objectReferenceSource.asObservable();
|
||||
|
||||
selectWorkbasket(workbasket: Workbasket) {
|
||||
selectWorkbasket(workbasket?: Workbasket) {
|
||||
this.currentWorkbasket = workbasket;
|
||||
this.workbasketSelectedSource.next(workbasket);
|
||||
}
|
||||
|
@ -22,11 +22,11 @@ export class WorkplaceService {
|
|||
return this.workbasketSelectedStream;
|
||||
}
|
||||
|
||||
selectObjectReference(objectReference: ObjectReference) {
|
||||
selectObjectReference(objectReference?: ObjectReference) {
|
||||
this.objectReference = new ObjectReference();
|
||||
if (objectReference) {
|
||||
this.objectReference = new ObjectReference(undefined, undefined, undefined, undefined, objectReference.type, objectReference.value);
|
||||
} else {
|
||||
this.objectReference = new ObjectReference(undefined);
|
||||
this.objectReference.type = objectReference.type;
|
||||
this.objectReference.value = objectReference.value;
|
||||
}
|
||||
this.objectReferenceSource.next(objectReference);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ export class TaskdetailsGeneralFieldsComponent implements OnInit, OnChanges {
|
|||
|
||||
toogleValidationMap = new Map<string, boolean>();
|
||||
requestInProgress = false;
|
||||
classifications: Classification[] = undefined;
|
||||
classifications: Classification[];
|
||||
|
||||
ownerField = this.customFieldsService.getCustomField(
|
||||
'Owner',
|
||||
|
|
|
@ -23,12 +23,12 @@ import {MasterAndDetailService} from 'app/services/masterAndDetail/master-and-de
|
|||
styleUrls: ['./taskdetails.component.scss']
|
||||
})
|
||||
export class TaskdetailsComponent implements OnInit, OnDestroy {
|
||||
task: Task = undefined;
|
||||
taskClone: Task = undefined;
|
||||
task: Task;
|
||||
taskClone: Task;
|
||||
requestInProgress = false;
|
||||
tabSelected = 'general';
|
||||
currentWorkbasket: Workbasket = undefined;
|
||||
currentId: string = undefined;
|
||||
currentWorkbasket: Workbasket;
|
||||
currentId: string;
|
||||
showDetail = false;
|
||||
|
||||
private routeSubscription: Subscription;
|
||||
|
@ -77,7 +77,7 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
|
|||
this.requestInProgress = true;
|
||||
if (this.currentId === 'new-task') {
|
||||
this.requestInProgress = false;
|
||||
this.task = new Task(undefined, new ObjectReference(), this.currentWorkbasket);
|
||||
this.task = new Task('', new ObjectReference(), this.currentWorkbasket);
|
||||
} else {
|
||||
this.taskService.getTask(this.currentId).subscribe(task => {
|
||||
this.requestInProgress = false;
|
||||
|
@ -124,7 +124,7 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
backClicked(): void {
|
||||
this.task = undefined;
|
||||
delete this.task;
|
||||
this.taskService.selectTask(this.task);
|
||||
this.router.navigate(['./'], {relativeTo: this.route.parent});
|
||||
}
|
||||
|
|
|
@ -83,11 +83,13 @@ export class TaskListToolbarComponent implements OnInit {
|
|||
this.toolbarState = false;
|
||||
this.workbasketSelected = true;
|
||||
if (this.searchSelected === this.search.byTypeAndValue) {
|
||||
this.workplaceService.selectObjectReference(
|
||||
new ObjectReference(undefined, undefined, undefined, undefined, this.resultType, this.resultValue));
|
||||
this.searched = true;
|
||||
const objectReference = new ObjectReference();
|
||||
objectReference.type = this.resultType;
|
||||
objectReference.value = this.resultValue;
|
||||
this.workplaceService.selectObjectReference(objectReference);
|
||||
this.searched = true;
|
||||
} else {
|
||||
this.workplaceService.selectObjectReference(undefined);
|
||||
this.workplaceService.selectObjectReference();
|
||||
if (this.workbaskets) {
|
||||
this.workbaskets.forEach(workbasket => {
|
||||
if (workbasket.name === this.resultName) {
|
||||
|
@ -99,8 +101,8 @@ export class TaskListToolbarComponent implements OnInit {
|
|||
});
|
||||
|
||||
if (!this.resultId) {
|
||||
this.currentBasket = undefined;
|
||||
this.workplaceService.selectWorkbasket(undefined);
|
||||
delete this.currentBasket;
|
||||
this.workplaceService.selectWorkbasket();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -118,14 +120,14 @@ export class TaskListToolbarComponent implements OnInit {
|
|||
}
|
||||
|
||||
createTask() {
|
||||
this.taskService.selectTask(undefined);
|
||||
this.taskService.selectTask();
|
||||
this.router.navigate([{ outlets: { detail: 'taskdetail/new-task' } }], { relativeTo: this.route });
|
||||
}
|
||||
|
||||
selectSearch(type: Search) {
|
||||
this.searched = false;
|
||||
this.resultId = undefined;
|
||||
this.currentBasket = undefined;
|
||||
delete this.resultId;
|
||||
delete this.currentBasket;
|
||||
this.selectSearchType.emit(type);
|
||||
this.searchSelected = type;
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ export class TaskListComponent implements OnInit {
|
|||
}
|
||||
|
||||
selectTask(taskId: string) {
|
||||
this.workplaceService.selectObjectReference(undefined);
|
||||
this.workplaceService.selectObjectReference();
|
||||
this.selectedId = taskId;
|
||||
this.selectedIdChange.emit(taskId);
|
||||
this.router.navigate([{outlets: {detail: `taskdetail/${this.selectedId}`}}], {relativeTo: this.route});
|
||||
|
|
|
@ -56,7 +56,7 @@ export class TaskMasterComponent implements OnInit, OnDestroy {
|
|||
private orientationService: OrientationService) {
|
||||
this.taskChangeSubscription = this.taskService.taskChangedStream.subscribe(task => {
|
||||
this.getTasks();
|
||||
this.selectedId = task ? task.taskId : undefined;
|
||||
this.selectedId = task ? task.taskId : '';
|
||||
});
|
||||
|
||||
this.workbasketChangeSubscription = this.workplaceService.workbasketSelectedStream.subscribe(workbasket => {
|
||||
|
@ -68,7 +68,7 @@ export class TaskMasterComponent implements OnInit, OnDestroy {
|
|||
|
||||
this.objectReferenceSubscription = this.workplaceService.objectReferenceSelectedStream.subscribe(objectReference => {
|
||||
this.objectReference = objectReference;
|
||||
this.currentBasket = undefined;
|
||||
delete this.currentBasket;
|
||||
if (objectReference) {
|
||||
this.getTasks();
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ export class TaskMasterComponent implements OnInit, OnDestroy {
|
|||
this.currentBasket = task.workbasketSummaryResource;
|
||||
}
|
||||
if (!task) {
|
||||
this.selectedId = undefined;
|
||||
this.selectedId = '';
|
||||
}
|
||||
});
|
||||
this.orientationSubscription = this.orientationService.getOrientation().subscribe((orientation: Orientation) => {
|
||||
|
@ -131,15 +131,15 @@ export class TaskMasterComponent implements OnInit, OnDestroy {
|
|||
|
||||
private getTasks(): void {
|
||||
this.requestInProgress = true;
|
||||
if (this.currentBasket === undefined && !this.objectReference) {
|
||||
if (!this.currentBasket && !this.objectReference) {
|
||||
this.requestInProgress = false;
|
||||
this.tasks = [];
|
||||
} else {
|
||||
this.calculateHeightCard();
|
||||
this.taskService.findTasksWithWorkbasket(this.currentBasket ? this.currentBasket.workbasketId : undefined,
|
||||
this.taskService.findTasksWithWorkbasket(this.currentBasket ? this.currentBasket.workbasketId : '',
|
||||
this.sort.sortBy, this.sort.sortDirection, this.filterBy.filterParams.name, this.filterBy.filterParams.owner,
|
||||
this.filterBy.filterParams.priority, this.filterBy.filterParams.state, this.objectReference ? this.objectReference.type : undefined,
|
||||
this.objectReference ? this.objectReference.value : undefined)
|
||||
this.filterBy.filterParams.priority, this.filterBy.filterParams.state, this.objectReference ? this.objectReference.type : '',
|
||||
this.objectReference ? this.objectReference.value : '')
|
||||
.subscribe(tasks => {
|
||||
this.requestInProgress = false;
|
||||
if (tasks.tasks) {
|
||||
|
|
Loading…
Reference in New Issue