Forgot indent

This commit is contained in:
BVier 2020-01-13 11:28:30 +01:00
parent 0fa4b1d5df
commit a304d2d729
131 changed files with 1712 additions and 1700 deletions

View File

@ -16,7 +16,7 @@ module.exports = {
],
"rules": {
"arrow-parens": ["error", "as-needed"],
"@typescript-eslint/indent": ['off', 2],
"@typescript-eslint/indent": ['error', 2],
"max-len": ["off", { "code": 140, "ignorePattern": "import *" }], // smaller than 140?
"object-curly-newline": ["error", { "ImportDeclaration": "never" }],
"quote-props": ["error", "as-needed"],

View File

@ -98,15 +98,15 @@ export class AccessItemsManagementComponent implements OnInit, OnDestroy {
this.belongingGroups = accessIdsWithGroups.filter(item => item.accessId.includes(this.groupsKey));
this.searchForAccessItemsWorkbaskets();
},
error => {
this.requestInProgressService.setRequestInProgress(false);
this.generalModalService.triggerMessage(
new MessageModal(
'There was error while retrieving your access ids with groups',
error
)
);
});
error => {
this.requestInProgressService.setRequestInProgress(false);
this.generalModalService.triggerMessage(
new MessageModal(
'There was error while retrieving your access ids with groups',
error
)
);
});
}
}
@ -128,20 +128,20 @@ export class AccessItemsManagementComponent implements OnInit, OnDestroy {
this.AccessItemsForm ? this.AccessItemsForm.value.workbasketKeyFilter : undefined,
this.sortModel,
true
)
)
.subscribe((accessItemsResource: AccessItemsWorkbasketResource) => {
this.setAccessItemsGroups(accessItemsResource ? accessItemsResource.accessItems : []);
this.requestInProgressService.setRequestInProgress(false);
},
error => {
this.requestInProgressService.setRequestInProgress(false);
this.generalModalService.triggerMessage(
new MessageModal(
'There was error while retrieving your access items',
error
)
);
});
error => {
this.requestInProgressService.setRequestInProgress(false);
this.generalModalService.triggerMessage(
new MessageModal(
'There was error while retrieving your access items',
error
)
);
});
}
revokeAccess() {
@ -156,28 +156,28 @@ export class AccessItemsManagementComponent implements OnInit, OnDestroy {
private onRemoveConfirmed() {
this.requestInProgressService.setRequestInProgress(true);
this.accessIdsService.removeAccessItemsPermissions(this.accessIdSelected)
.subscribe(
response => {
this.requestInProgressService.setRequestInProgress(false);
this.alertService.triggerAlert(
new AlertModel(
AlertType.SUCCESS,
`${this.accessIdSelected
} was removed successfully`
)
);
this.searchForAccessItemsWorkbaskets();
},
error => {
this.requestInProgressService.setRequestInProgress(false);
this.generalModalService.triggerMessage(
new MessageModal(
'You can\'t delete a group',
error
)
.subscribe(
response => {
this.requestInProgressService.setRequestInProgress(false);
this.alertService.triggerAlert(
new AlertModel(
AlertType.SUCCESS,
`${this.accessIdSelected
} was removed successfully`
)
);
this.searchForAccessItemsWorkbaskets();
},
error => {
this.requestInProgressService.setRequestInProgress(false);
this.generalModalService.triggerMessage(
new MessageModal(
'You can\'t delete a group',
error
)
);
}
);
}
);
}
private unSubscribe(subscription: Subscription): void {

View File

@ -44,9 +44,10 @@ describe('ClassificationDetailsComponent', () => {
let fixture: ComponentFixture<ClassificationDetailsComponent>;
const treeNodes: Array<TreeNodeModel> = new Array(new TreeNodeModel());
let classificationsService; let classificationCategoriesService;
let treeService; let
removeConfirmationService;
let classificationsService;
let classificationCategoriesService;
let treeService;
let removeConfirmationService;
beforeEach(done => {
const configure = (testBed: TestBed) => {

View File

@ -180,19 +180,19 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Classification ${classification.key} was saved successfully`));
this.afterRequest();
},
error => {
this.generalModalService.triggerMessage(new MessageModal('There was an error creating a classification', error));
this.afterRequest();
});
error => {
this.generalModalService.triggerMessage(new MessageModal('There was an error creating a classification', error));
this.afterRequest();
});
} else {
try {
this.classification = (<ClassificationDefinition> await this.classificationsService.putClassification(
this.classification._links.self.href, this.classification
));
));
this.afterRequest();
this.alertService.triggerAlert(
new AlertModel(AlertType.SUCCESS, `Classification ${this.classification.key} was saved successfully`)
);
);
this.cloneClassification(this.classification);
} catch (error) {
this.generalModalService.triggerMessage(new MessageModal('There was error while saving your classification', error));
@ -279,7 +279,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
if (!this.classification || !this.classification.classificationId) {
this.generalModalService.triggerMessage(
new MessageModal('There is no classification selected', 'Please check if you are creating a classification')
);
);
return false;
}
this.requestInProgressService.setRequestInProgress(true);

View File

@ -43,8 +43,8 @@ describe('ClassificationListComponent', () => {
let fixture: ComponentFixture<ClassificationListComponent>;
const treeNodes: Array<TreeNodeModel> = new Array(new TreeNodeModel());
const classificationTypes: Array<string> = new Array<string>('type1', 'type2');
let classificationsService; let
classificationCategoriesService;
let classificationsService;
let classificationCategoriesService;
beforeEach(done => {
const configure = (testBed: TestBed) => {

View File

@ -45,7 +45,7 @@ export class ClassificationListComponent implements OnInit, OnDestroy {
private categoryService: ClassificationCategoriesService,
private importExportService: ImportExportService,
private alertService: AlertService
) {
) {
}
ngOnInit() {
@ -60,8 +60,8 @@ export class ClassificationListComponent implements OnInit, OnDestroy {
});
this.categoriesSubscription = this.categoryService.getCategories(this.classificationTypeSelected).subscribe((categories: Array<string>) => {
this.categories = categories;
});
this.categories = categories;
});
this.importingExportingSubscription = this.importExportService.getImportingFinished().subscribe((value: Boolean) => {
this.performRequest(true);
});

View File

@ -33,7 +33,7 @@ export class ImportExportComponent implements OnInit {
private alertService: AlertService,
public uploadservice: UploadService,
private importExportService: ImportExportService
) {
) {
}
ngOnInit() {
@ -52,8 +52,8 @@ export class ImportExportComponent implements OnInit {
uploadFile() {
const file = this.selectedFileInput.nativeElement.files[0];
const formdata = new FormData();
const ajax = new XMLHttpRequest();
const formdata = new FormData();
const ajax = new XMLHttpRequest();
if (!this.checkFormatFile(file)) { return false; }
formdata.append('file', file);
ajax.upload.addEventListener('progress', this.progressHandler.bind(this), false);
@ -66,7 +66,7 @@ export class ImportExportComponent implements OnInit {
ajax.open('POST', `${environment.taskanaRestUrl}/v1/classification-definitions`);
}
if (!environment.production) {
ajax.setRequestHeader('Authorization', 'Basic YWRtaW46YWRtaW4=');
ajax.setRequestHeader('Authorization', 'Basic YWRtaW46YWRtaW4=');
}
ajax.send(formdata);
this.uploadservice.isInUse = true;

View File

@ -3,7 +3,7 @@ import { Subject, Observable } from 'rxjs';
@Injectable()
export class ImportExportService {
public importingFinished = new Subject<boolean>();
public importingFinished = new Subject<boolean>();
constructor() { }

View File

@ -3,13 +3,13 @@ import { TestBed, inject } from '@angular/core/testing';
import { SavingWorkbasketService } from './saving-workbaskets.service';
describe('SavingWorkbasketsService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [SavingWorkbasketService]
});
beforeEach(() => {
TestBed.configureTestingModule({
providers: [SavingWorkbasketService]
});
});
it('should be created', inject([SavingWorkbasketService], (service: SavingWorkbasketService) => {
expect(service).toBeTruthy();
}));
it('should be created', inject([SavingWorkbasketService], (service: SavingWorkbasketService) => {
expect(service).toBeTruthy();
}));
});

View File

@ -2,32 +2,32 @@ import { Injectable } from '@angular/core';
import { Subject, Observable } from 'rxjs';
export class SavingInformation {
constructor(public url: string,
public workbasketId: string) {
}
constructor(public url: string,
public workbasketId: string) {
}
}
@Injectable()
export class SavingWorkbasketService {
public distributionTargetsSavingInformation = new Subject<SavingInformation>();
public accessItemsSavingInformation = new Subject<SavingInformation>();
public distributionTargetsSavingInformation = new Subject<SavingInformation>();
public accessItemsSavingInformation = new Subject<SavingInformation>();
constructor() { }
constructor() { }
triggerDistributionTargetSaving(distributionTargetInformation: SavingInformation) {
this.distributionTargetsSavingInformation.next(distributionTargetInformation);
}
triggerDistributionTargetSaving(distributionTargetInformation: SavingInformation) {
this.distributionTargetsSavingInformation.next(distributionTargetInformation);
}
triggerAccessItemsSaving(accessItemsInformation: SavingInformation) {
this.accessItemsSavingInformation.next(accessItemsInformation);
}
triggerAccessItemsSaving(accessItemsInformation: SavingInformation) {
this.accessItemsSavingInformation.next(accessItemsInformation);
}
triggeredDistributionTargetsSaving(): Observable<SavingInformation> {
return this.distributionTargetsSavingInformation.asObservable();
}
triggeredDistributionTargetsSaving(): Observable<SavingInformation> {
return this.distributionTargetsSavingInformation.asObservable();
}
triggeredAccessItemsSaving(): Observable<SavingInformation> {
return this.accessItemsSavingInformation.asObservable();
}
triggeredAccessItemsSaving(): Observable<SavingInformation> {
return this.accessItemsSavingInformation.asObservable();
}
}

View File

@ -27,8 +27,11 @@ import { AccessItemsComponent } from './access-items.component';
describe('AccessItemsComponent', () => {
let component: AccessItemsComponent;
let fixture: ComponentFixture<AccessItemsComponent>;
let workbasketService; let debugElement; let alertService; let accessIdsService; let
formsValidatorService;
let workbasketService;
let debugElement;
let alertService;
let accessIdsService;
let formsValidatorService;
beforeEach(done => {
@ -51,16 +54,16 @@ formsValidatorService;
workbasketService = TestBed.get(WorkbasketService);
alertService = TestBed.get(AlertService);
spyOn(workbasketService, 'getWorkBasketAccessItems').and.returnValue(of(new WorkbasketAccessItemsResource(
new Array<WorkbasketAccessItems>(
new WorkbasketAccessItems('id1', '1', 'accessID1', '', false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false),
new WorkbasketAccessItems('id2', '1', 'accessID2')
),
new Links({ href: 'someurl' })
new Array<WorkbasketAccessItems>(
new WorkbasketAccessItems('id1', '1', 'accessID1', '', false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false),
new WorkbasketAccessItems('id2', '1', 'accessID2')
),
new Links({ href: 'someurl' })
)));
spyOn(workbasketService, 'updateWorkBasketAccessItem').and.returnValue(of(true)),
spyOn(alertService, 'triggerAlert').and.returnValue(of(true)),
debugElement = fixture.debugElement.nativeElement;
spyOn(alertService, 'triggerAlert').and.returnValue(of(true)),
debugElement = fixture.debugElement.nativeElement;
accessIdsService = TestBed.get(AccessIdsService);
spyOn(accessIdsService, 'getAccessItemsInformation').and.returnValue(of(new Array<string>(
'accessID1', 'accessID2'
@ -103,7 +106,7 @@ formsValidatorService;
fixture.detectChanges();
expect(alertService.triggerAlert).toHaveBeenCalledWith(
new AlertModel(AlertType.SUCCESS, `Workbasket ${component.workbasket.key} Access items were saved successfully`)
);
);
});
fixture.detectChanges();
}));

View File

@ -89,7 +89,7 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
private customFieldsService: CustomFieldsService,
private formBuilder: FormBuilder,
private formsValidatorService: FormsValidatorService
) {
) {
}
ngOnChanges(changes: SimpleChanges): void {
@ -180,13 +180,13 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
this.requestInProgressService.setRequestInProgress(true);
this.workbasketService.updateWorkBasketAccessItem(
this.accessItemsResource._links.self.href, this.AccessItemsForm.value.accessItemsGroups
)
)
.subscribe(response => {
this.accessItemsClone = this.cloneAccessItems(this.AccessItemsForm.value.accessItemsGroups);
this.accessItemsResetClone = this.cloneAccessItems(this.AccessItemsForm.value.accessItemsGroups);
this.alertService.triggerAlert(new AlertModel(
AlertType.SUCCESS, `Workbasket ${this.workbasket.name} Access items were saved successfully`
));
));
this.requestInProgressService.setRequestInProgress(false);
}, error => {
this.generalModalService.triggerMessage(new MessageModal('There was error while saving your workbasket\'s access items', error));

View File

@ -25,120 +25,120 @@ import { DistributionTargetsComponent, Side } from './distribution-targets.compo
import { DualListComponent } from './dual-list/dual-list.component';
describe('DistributionTargetsComponent', () => {
let component: DistributionTargetsComponent;
let fixture: ComponentFixture<DistributionTargetsComponent>;
let workbasketService;
const workbasket = new Workbasket('1', '', '', '', ICONTYPES.TOPIC, '', '', '', '', '', '', '', '', '', '', '', '',
new Links({ href: 'someurl' }, { href: 'someurl' }, { href: 'someurl' }));
let component: DistributionTargetsComponent;
let fixture: ComponentFixture<DistributionTargetsComponent>;
let workbasketService;
const workbasket = new Workbasket('1', '', '', '', ICONTYPES.TOPIC, '', '', '', '', '', '', '', '', '', '', '', '',
new Links({ href: 'someurl' }, { href: 'someurl' }, { href: 'someurl' }));
beforeEach(done => {
const configure = (testBed: TestBed) => {
testBed.configureTestingModule({
imports: [AngularSvgIconModule, HttpClientModule, InfiniteScrollModule],
declarations: [DistributionTargetsComponent, DualListComponent],
providers: [WorkbasketService, AlertService, SavingWorkbasketService, GeneralModalService, RequestInProgressService,
]
});
};
configureTests(configure).then(testBed => {
fixture = TestBed.createComponent(DistributionTargetsComponent);
component = fixture.componentInstance;
component.workbasket = workbasket;
workbasketService = TestBed.get(WorkbasketService);
spyOn(workbasketService, 'getWorkBasketsSummary').and.callFake(() => of(new WorkbasketSummaryResource(
new Array<WorkbasketSummary>(
new WorkbasketSummary('id1', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' })),
new WorkbasketSummary('id2', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' })),
new WorkbasketSummary('id3', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
),
new LinksWorkbasketSummary({ href: 'someurl' })
)));
spyOn(workbasketService, 'getWorkBasketsDistributionTargets').and.callFake(() => of(new WorkbasketDistributionTargetsResource(
new Array<WorkbasketSummary>(
new WorkbasketSummary('id2', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
),
new LinksWorkbasketSummary({ href: 'someurl' })
)));
component.ngOnChanges({
active: new SimpleChange(undefined, 'distributionTargets', true)
});
fixture.detectChanges();
done();
});
beforeEach(done => {
const configure = (testBed: TestBed) => {
testBed.configureTestingModule({
imports: [AngularSvgIconModule, HttpClientModule, InfiniteScrollModule],
declarations: [DistributionTargetsComponent, DualListComponent],
providers: [WorkbasketService, AlertService, SavingWorkbasketService, GeneralModalService, RequestInProgressService,
]
});
};
configureTests(configure).then(testBed => {
fixture = TestBed.createComponent(DistributionTargetsComponent);
component = fixture.componentInstance;
component.workbasket = workbasket;
workbasketService = TestBed.get(WorkbasketService);
spyOn(workbasketService, 'getWorkBasketsSummary').and.callFake(() => of(new WorkbasketSummaryResource(
new Array<WorkbasketSummary>(
new WorkbasketSummary('id1', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' })),
new WorkbasketSummary('id2', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' })),
new WorkbasketSummary('id3', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
),
new LinksWorkbasketSummary({ href: 'someurl' })
)));
spyOn(workbasketService, 'getWorkBasketsDistributionTargets').and.callFake(() => of(new WorkbasketDistributionTargetsResource(
new Array<WorkbasketSummary>(
new WorkbasketSummary('id2', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
),
new LinksWorkbasketSummary({ href: 'someurl' })
)));
component.ngOnChanges({
active: new SimpleChange(undefined, 'distributionTargets', true)
});
fixture.detectChanges();
done();
});
});
it('should create', () => {
expect(component).toBeTruthy();
it('should create', () => {
expect(component).toBeTruthy();
});
it('should clone distribution target selected on init', () => {
expect(component.distributionTargetsClone).toBeDefined();
});
it('should clone distribution target left and distribution target right lists on init', () => {
expect(component.distributionTargetsLeft).toBeDefined();
expect(component.distributionTargetsRight).toBeDefined();
});
it('should have two list with differents elements onInit', () => {
let repeteadElemens = false;
expect(component.distributionTargetsLeft.length).toBe(2);
expect(component.distributionTargetsRight.length).toBe(1);
component.distributionTargetsLeft.forEach(leftElement => {
component.distributionTargetsRight.forEach(rightElement => {
if (leftElement.workbasketId === rightElement.workbasketId) { repeteadElemens = true; }
});
});
expect(repeteadElemens).toBeFalsy();
});
it('should clone distribution target selected on init', () => {
expect(component.distributionTargetsClone).toBeDefined();
it('should filter left list and keep selected elements as selected', () => {
component.performFilter({
filterBy: new FilterModel({
name: 'someName', owner: 'someOwner', description: 'someDescription', key: 'someKey'
}),
side: Side.LEFT
});
component.distributionTargetsLeft = new Array<WorkbasketSummary>(
new WorkbasketSummary('id1', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
);
expect(component.distributionTargetsLeft.length).toBe(1);
expect(component.distributionTargetsLeft[0].workbasketId).toBe('id1');
expect(component.distributionTargetsRight.length).toBe(1);
expect(component.distributionTargetsRight[0].workbasketId).toBe('id2');
});
it('should clone distribution target left and distribution target right lists on init', () => {
expect(component.distributionTargetsLeft).toBeDefined();
expect(component.distributionTargetsRight).toBeDefined();
});
it('should reset distribution target and distribution target selected on reset', () => {
component.distributionTargetsLeft.push(
new WorkbasketSummary('id4', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
);
component.distributionTargetsRight.push(
new WorkbasketSummary('id5', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
);
it('should have two list with differents elements onInit', () => {
let repeteadElemens = false;
expect(component.distributionTargetsLeft.length).toBe(2);
expect(component.distributionTargetsRight.length).toBe(1);
component.distributionTargetsLeft.forEach(leftElement => {
component.distributionTargetsRight.forEach(rightElement => {
if (leftElement.workbasketId === rightElement.workbasketId) { repeteadElemens = true; }
});
});
expect(repeteadElemens).toBeFalsy();
});
expect(component.distributionTargetsLeft.length).toBe(3);
expect(component.distributionTargetsRight.length).toBe(2);
it('should filter left list and keep selected elements as selected', () => {
component.performFilter({
filterBy: new FilterModel({
name: 'someName', owner: 'someOwner', description: 'someDescription', key: 'someKey'
}),
side: Side.LEFT
});
component.distributionTargetsLeft = new Array<WorkbasketSummary>(
new WorkbasketSummary('id1', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
);
expect(component.distributionTargetsLeft.length).toBe(1);
expect(component.distributionTargetsLeft[0].workbasketId).toBe('id1');
expect(component.distributionTargetsRight.length).toBe(1);
expect(component.distributionTargetsRight[0].workbasketId).toBe('id2');
});
component.onClear();
fixture.detectChanges();
expect(component.distributionTargetsLeft.length).toBe(2);
expect(component.distributionTargetsRight.length).toBe(1);
});
it('should reset distribution target and distribution target selected on reset', () => {
component.distributionTargetsLeft.push(
new WorkbasketSummary('id4', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
);
component.distributionTargetsRight.push(
new WorkbasketSummary('id5', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
);
expect(component.distributionTargetsLeft.length).toBe(3);
expect(component.distributionTargetsRight.length).toBe(2);
component.onClear();
fixture.detectChanges();
expect(component.distributionTargetsLeft.length).toBe(2);
expect(component.distributionTargetsRight.length).toBe(1);
});
it('should save distribution targets selected and update Clone objects.', () => {
expect(component.distributionTargetsSelected.length).toBe(1);
expect(component.distributionTargetsSelectedClone.length).toBe(1);
spyOn(workbasketService, 'updateWorkBasketsDistributionTargets').and.callFake(() => of(new WorkbasketDistributionTargetsResource(
new Array<WorkbasketSummary>(
new WorkbasketSummary('id2', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' })),
new WorkbasketSummary('id1', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
),
new LinksWorkbasketSummary({ href: 'someurl' })
)));
component.onSave();
fixture.detectChanges();
expect(component.distributionTargetsSelected.length).toBe(2);
expect(component.distributionTargetsSelectedClone.length).toBe(2);
expect(component.distributionTargetsLeft.length).toBe(1);
});
it('should save distribution targets selected and update Clone objects.', () => {
expect(component.distributionTargetsSelected.length).toBe(1);
expect(component.distributionTargetsSelectedClone.length).toBe(1);
spyOn(workbasketService, 'updateWorkBasketsDistributionTargets').and.callFake(() => of(new WorkbasketDistributionTargetsResource(
new Array<WorkbasketSummary>(
new WorkbasketSummary('id2', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' })),
new WorkbasketSummary('id1', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
),
new LinksWorkbasketSummary({ href: 'someurl' })
)));
component.onSave();
fixture.detectChanges();
expect(component.distributionTargetsSelected.length).toBe(2);
expect(component.distributionTargetsSelectedClone.length).toBe(2);
expect(component.distributionTargetsLeft.length).toBe(1);
});
});

View File

@ -74,7 +74,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
private generalModalService: GeneralModalService,
private requestInProgressService: RequestInProgressService,
private orientationService: OrientationService
) { }
) { }
ngOnChanges(changes: SimpleChanges): void {
if (!this.initialized && changes.active && changes.active.currentValue === 'distributionTargets') {
@ -116,22 +116,22 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
this.requestInProgressService.setRequestInProgress(true);
this.workbasketService.updateWorkBasketsDistributionTargets(
this.distributionTargetsSelectedResource._links.self.href, this.getSeletedIds()
).subscribe(response => {
this.requestInProgressService.setRequestInProgress(false);
this.distributionTargetsSelected = response.distributionTargets;
this.distributionTargetsSelectedClone = Object.assign([], this.distributionTargetsSelected);
this.distributionTargetsClone = Object.assign([], this.distributionTargetsLeft);
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS,
`Workbasket ${this.workbasket.name} : Distribution targets were saved successfully`));
return true;
},
error => {
this.generalModalService.triggerMessage(
new MessageModal('There was error while saving your workbasket\'s distribution targets', error)
);
this.requestInProgressService.setRequestInProgress(false);
return false;
});
).subscribe(response => {
this.requestInProgressService.setRequestInProgress(false);
this.distributionTargetsSelected = response.distributionTargets;
this.distributionTargetsSelectedClone = Object.assign([], this.distributionTargetsSelected);
this.distributionTargetsClone = Object.assign([], this.distributionTargetsLeft);
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS,
`Workbasket ${this.workbasket.name} : Distribution targets were saved successfully`));
return true;
},
error => {
this.generalModalService.triggerMessage(
new MessageModal('There was error while saving your workbasket\'s distribution targets', error)
);
this.requestInProgressService.setRequestInProgress(false);
return false;
});
return false;
}
@ -149,11 +149,11 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
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(true, dualListFilter.side);
});
(dualListFilter.side === Side.RIGHT)
? this.distributionTargetsRight = (resultList.workbaskets)
: this.distributionTargetsLeft = (resultList.workbaskets);
this.onRequest(true, dualListFilter.side);
});
}
ngOnDestroy(): void {
@ -171,16 +171,16 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
}
this.distributionTargetsSubscription = this.workbasketService.getWorkBasketsDistributionTargets(
this.workbasket._links.distributionTargets.href
).subscribe(
(distributionTargetsSelectedResource: WorkbasketDistributionTargetsResource) => {
this.distributionTargetsSelectedResource = distributionTargetsSelectedResource;
this.distributionTargetsSelected = distributionTargetsSelectedResource.distributionTargets;
this.distributionTargetsSelectedClone = Object.assign([], this.distributionTargetsSelected);
TaskanaQueryParameters.page = 1;
this.calculateNumberItemsList();
this.getWorkbaskets();
}
);
).subscribe(
(distributionTargetsSelectedResource: WorkbasketDistributionTargetsResource) => {
this.distributionTargetsSelectedResource = distributionTargetsSelectedResource;
this.distributionTargetsSelected = distributionTargetsSelectedResource.distributionTargets;
this.distributionTargetsSelectedClone = Object.assign([], this.distributionTargetsSelected);
TaskanaQueryParameters.page = 1;
this.calculateNumberItemsList();
this.getWorkbaskets();
}
);
this.savingDistributionTargetsSubscription = this.savingWorkbaskets.triggeredDistributionTargetsSaving()
.subscribe((savingInformation: SavingInformation) => {
@ -238,7 +238,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
}
this.onRequest(true);
}
);
);
}
private setBadge() {

View File

@ -37,8 +37,12 @@ const routes: Routes = [
describe('WorkbasketInformationComponent', () => {
let component: WorkbasketInformationComponent;
let fixture: ComponentFixture<WorkbasketInformationComponent>;
let debugElement; let workbasketService; let alertService; let savingWorkbasketService; let requestInProgressService; let
formsValidatorService;
let debugElement;
let workbasketService;
let alertService;
let savingWorkbasketService;
let requestInProgressService;
let formsValidatorService;
beforeEach(done => {
const configure = (testBed: TestBed) => {
@ -145,7 +149,7 @@ formsValidatorService;
new Workbasket('someNewId', 'created', 'keyModified', 'domain', ICONTYPES.TOPIC, 'modified', 'name', 'description',
'owner', 'custom1', 'custom2', 'custom3', 'custom4', 'orgLevel1', 'orgLevel2',
'orgLevel3', 'orgLevel4', new Links({ href: 'someUrl' }))
));
));
fixture.detectChanges();
spyOn(formsValidatorService, 'validateFormAccess').and.returnValue(Promise.resolve(true));
component.onSubmit();
@ -158,32 +162,32 @@ formsValidatorService;
it('should post a new workbasket, new distribution targets and new access '
+ 'items when no workbasketId is defined and action is copy', async(() => {
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' }));
component.workbasket = workbasket;
component.action = ACTION.COPY;
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' }));
component.workbasket = workbasket;
component.action = ACTION.COPY;
spyOn(workbasketService, 'createWorkbasket').and.returnValue(of(
new Workbasket('someNewId', 'created', 'keyModified', 'domain', ICONTYPES.TOPIC, 'modified', 'name', 'description',
'owner', 'custom1', 'custom2', 'custom3', 'custom4', 'orgLevel1', 'orgLevel2',
'orgLevel3', 'orgLevel4', new Links({ href: 'someUrl' }, { href: 'someUrl' }, { href: 'someUrl' }))
));
spyOn(workbasketService, 'createWorkbasket').and.returnValue(of(
new Workbasket('someNewId', 'created', 'keyModified', 'domain', ICONTYPES.TOPIC, 'modified', 'name', 'description',
'owner', 'custom1', 'custom2', 'custom3', 'custom4', 'orgLevel1', 'orgLevel2',
'orgLevel3', 'orgLevel4', new Links({ href: 'someUrl' }, { href: 'someUrl' }, { href: 'someUrl' }))
));
spyOn(savingWorkbasketService, 'triggerDistributionTargetSaving');
spyOn(savingWorkbasketService, 'triggerAccessItemsSaving');
spyOn(savingWorkbasketService, 'triggerDistributionTargetSaving');
spyOn(savingWorkbasketService, 'triggerAccessItemsSaving');
fixture.detectChanges();
spyOn(formsValidatorService, 'validateFormAccess').and.returnValue(Promise.resolve(true));
component.onSubmit();
fixture.whenStable().then(() => {
fixture.detectChanges();
spyOn(formsValidatorService, 'validateFormAccess').and.returnValue(Promise.resolve(true));
component.onSubmit();
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(alertService.triggerAlert).toHaveBeenCalled();
expect(component.workbasket.workbasketId).toBe('someNewId');
expect(savingWorkbasketService.triggerDistributionTargetSaving).toHaveBeenCalled();
expect(savingWorkbasketService.triggerAccessItemsSaving).toHaveBeenCalled();
});
}));
expect(alertService.triggerAlert).toHaveBeenCalled();
expect(component.workbasket.workbasketId).toBe('someNewId');
expect(savingWorkbasketService.triggerDistributionTargetSaving).toHaveBeenCalled();
expect(savingWorkbasketService.triggerAccessItemsSaving).toHaveBeenCalled();
});
}));
it('should trigger requestInProgress service true before and requestInProgress false after remove a workbasket', () => {
const links = new Links({ href: 'someUrl' });

View File

@ -32,7 +32,7 @@ import { FormsValidatorService } from 'app/shared/services/forms/forms-validator
styleUrls: ['./workbasket-information.component.scss']
})
export class WorkbasketInformationComponent
implements OnInit, OnChanges, OnDestroy {
implements OnInit, OnChanges, OnDestroy {
@Input()
workbasket: Workbasket;
@ -139,7 +139,7 @@ export class WorkbasketInformationComponent
this.removeConfirmationService.setRemoveConfirmation(
this.onRemoveConfirmed.bind(this),
`You are going to delete workbasket: ${
this.workbasket.key
this.workbasket.key
}. Can you confirm this action?`
);
}
@ -163,7 +163,7 @@ export class WorkbasketInformationComponent
new AlertModel(
AlertType.SUCCESS,
`DistributionTarget for workbasketID: ${
this.workbasket.workbasketId
this.workbasket.workbasketId
} was removed successfully`
)
);
@ -172,7 +172,7 @@ export class WorkbasketInformationComponent
this.generalModalService.triggerMessage(
new MessageModal(
`There was an error removing distribution target for ${
this.workbasket.workbasketId
this.workbasket.workbasketId
}.`,
error
)

View File

@ -34,72 +34,72 @@ import { DistributionTargetsComponent } from './distribution-targets/distributio
import { DualListComponent } from './distribution-targets/dual-list/dual-list.component';
@Component({
selector: 'taskana-dummy-detail',
template: 'dummydetail'
selector: 'taskana-dummy-detail',
template: 'dummydetail'
})
export class DummyDetailComponent {
}
describe('WorkbasketDetailsComponent', () => {
let component: WorkbasketDetailsComponent;
let fixture: ComponentFixture<WorkbasketDetailsComponent>;
let debugElement;
let masterAndDetailService;
let workbasketService;
let router;
const workbasket = new Workbasket('1', '', '', '', ICONTYPES.TOPIC, '', '', '', '', '', '', '', '', '', '', '', '',
new Links({ href: 'someurl' }, { href: 'someurl' }, { href: 'someurl' }));
let component: WorkbasketDetailsComponent;
let fixture: ComponentFixture<WorkbasketDetailsComponent>;
let debugElement;
let masterAndDetailService;
let workbasketService;
let router;
const workbasket = new Workbasket('1', '', '', '', ICONTYPES.TOPIC, '', '', '', '', '', '', '', '', '', '', '', '',
new Links({ href: 'someurl' }, { href: 'someurl' }, { href: 'someurl' }));
const routes: Routes = [
{ path: '*', component: DummyDetailComponent }
];
const routes: Routes = [
{ path: '*', component: DummyDetailComponent }
];
beforeEach(done => {
const configure = (testBed: TestBed) => {
testBed.configureTestingModule({
imports: [RouterTestingModule.withRoutes(routes), FormsModule, AngularSvgIconModule, HttpClientModule, ReactiveFormsModule,
InfiniteScrollModule],
declarations: [WorkbasketDetailsComponent, WorkbasketInformationComponent,
AccessItemsComponent,
DistributionTargetsComponent, DualListComponent, DummyDetailComponent],
providers: [WorkbasketService, MasterAndDetailService, GeneralModalService, RequestInProgressService,
AlertService, SavingWorkbasketService, CustomFieldsService, ImportExportService]
});
};
configureTests(configure).then(testBed => {
fixture = TestBed.createComponent(WorkbasketDetailsComponent);
component = fixture.componentInstance;
debugElement = fixture.debugElement.nativeElement;
router = TestBed.get(Router);
fixture.detectChanges();
masterAndDetailService = TestBed.get(MasterAndDetailService);
workbasketService = TestBed.get(WorkbasketService);
spyOn(masterAndDetailService, 'getShowDetail').and.callFake(() => of(true));
spyOn(workbasketService, 'getSelectedWorkBasket').and.callFake(() => of('id1'));
spyOn(workbasketService, 'getWorkBasketsSummary').and.callFake(() => of(new WorkbasketSummaryResource(
new Array<WorkbasketSummary>(
new WorkbasketSummary('id1', '', '', '', '', '', '', '', '', '', '', '',
false, new Links({ href: 'someurl' }))
),
new LinksWorkbasketSummary({ href: 'someurl' })
)));
beforeEach(done => {
const configure = (testBed: TestBed) => {
testBed.configureTestingModule({
imports: [RouterTestingModule.withRoutes(routes), FormsModule, AngularSvgIconModule, HttpClientModule, ReactiveFormsModule,
InfiniteScrollModule],
declarations: [WorkbasketDetailsComponent, WorkbasketInformationComponent,
AccessItemsComponent,
DistributionTargetsComponent, DualListComponent, DummyDetailComponent],
providers: [WorkbasketService, MasterAndDetailService, GeneralModalService, RequestInProgressService,
AlertService, SavingWorkbasketService, CustomFieldsService, ImportExportService]
});
};
configureTests(configure).then(testBed => {
fixture = TestBed.createComponent(WorkbasketDetailsComponent);
component = fixture.componentInstance;
debugElement = fixture.debugElement.nativeElement;
router = TestBed.get(Router);
fixture.detectChanges();
masterAndDetailService = TestBed.get(MasterAndDetailService);
workbasketService = TestBed.get(WorkbasketService);
spyOn(masterAndDetailService, 'getShowDetail').and.callFake(() => of(true));
spyOn(workbasketService, 'getSelectedWorkBasket').and.callFake(() => of('id1'));
spyOn(workbasketService, 'getWorkBasketsSummary').and.callFake(() => of(new WorkbasketSummaryResource(
new Array<WorkbasketSummary>(
new WorkbasketSummary('id1', '', '', '', '', '', '', '', '', '', '', '',
false, new Links({ href: 'someurl' }))
),
new LinksWorkbasketSummary({ href: 'someurl' })
)));
spyOn(workbasketService, 'getWorkBasket').and.callFake(() => of(workbasket));
spyOn(workbasketService, 'getWorkBasketAccessItems').and.callFake(() => of(new WorkbasketAccessItemsResource(
new Array<WorkbasketAccessItems>(), new Links({ href: 'url' })
)));
spyOn(workbasketService, 'getWorkBasketsDistributionTargets').and.callFake(() => of(new WorkbasketSummaryResource(
new Array<WorkbasketSummary>(), new LinksWorkbasketSummary({ href: 'url' })
)));
done();
});
spyOn(workbasketService, 'getWorkBasket').and.callFake(() => of(workbasket));
spyOn(workbasketService, 'getWorkBasketAccessItems').and.callFake(() => of(new WorkbasketAccessItemsResource(
new Array<WorkbasketAccessItems>(), new Links({ href: 'url' })
)));
spyOn(workbasketService, 'getWorkBasketsDistributionTargets').and.callFake(() => of(new WorkbasketSummaryResource(
new Array<WorkbasketSummary>(), new LinksWorkbasketSummary({ href: 'url' })
)));
done();
});
});
afterEach(() => {
document.body.removeChild(debugElement);
});
afterEach(() => {
document.body.removeChild(debugElement);
});
it('should be created', () => {
expect(component).toBeTruthy();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View File

@ -116,7 +116,7 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
}, err => {
this.generalModalService.triggerMessage(
new MessageModal('An error occurred while fetching the workbasket', err)
);
);
});
}
}

View File

@ -35,8 +35,9 @@ export class DummyDetailComponent {
describe('WorkbasketListToolbarComponent', () => {
let component: WorkbasketListToolbarComponent;
let fixture: ComponentFixture<WorkbasketListToolbarComponent>;
let debugElement; let workbasketService; let
router;
let debugElement;
let workbasketService;
let router;
const routes: Routes = [
{ path: ':id', component: DummyDetailComponent, outlet: 'detail' }
@ -67,7 +68,7 @@ router;
component = fixture.componentInstance;
component.workbaskets = new Array<WorkbasketSummary>(
new WorkbasketSummary('1', 'key1', 'NAME1', 'description 1', 'owner 1')
);
);
component.workbaskets[0].markedForDeletion = false;
component.workbaskets[0]._links = new Links({ href: 'selfLink' });

View File

@ -34,7 +34,7 @@ export class WorkbasketListToolbarComponent implements OnInit {
private workbasketService: WorkbasketService,
private route: ActivatedRoute,
private router: Router
) {
) {
}
ngOnInit() {

View File

@ -25,19 +25,19 @@ import { WorkbasketListToolbarComponent } from './workbasket-list-toolbar/workba
import { WorkbasketListComponent } from './workbasket-list.component';
@Component({
selector: 'taskana-dummy-detail',
template: 'dummydetail'
selector: 'taskana-dummy-detail',
template: 'dummydetail'
})
class DummyDetailComponent {
}
@Component({
selector: 'taskana-pagination',
template: 'dummydetail'
selector: 'taskana-pagination',
template: 'dummydetail'
})
class PaginationComponent {
@Input()
page: Page;
page: Page;
@Output()
workbasketsResourceChange = new EventEmitter<any>();
@ -46,132 +46,132 @@ class PaginationComponent {
}
const workbasketSummaryResource: WorkbasketSummaryResource = new WorkbasketSummaryResource(
new Array<WorkbasketSummary>(
new WorkbasketSummary('1', 'key1', 'NAME1', 'description 1', 'owner 1', '', '', 'PERSONAL', '', '', '', ''),
new WorkbasketSummary('2', 'key2', 'NAME2', 'description 2', 'owner 2', '', '', 'GROUP', '', '', '', '')
),
new LinksWorkbasketSummary({ href: 'url' })
new Array<WorkbasketSummary>(
new WorkbasketSummary('1', 'key1', 'NAME1', 'description 1', 'owner 1', '', '', 'PERSONAL', '', '', '', ''),
new WorkbasketSummary('2', 'key2', 'NAME2', 'description 2', 'owner 2', '', '', 'GROUP', '', '', '', '')
),
new LinksWorkbasketSummary({ href: 'url' })
);
describe('WorkbasketListComponent', () => {
let component: WorkbasketListComponent;
let fixture: ComponentFixture<WorkbasketListComponent>;
let debugElement: any;
let workbasketService: WorkbasketService;
let workbasketSummarySpy;
let component: WorkbasketListComponent;
let fixture: ComponentFixture<WorkbasketListComponent>;
let debugElement: any;
let workbasketService: WorkbasketService;
let workbasketSummarySpy;
const routes: Routes = [
{ path: ':id', component: DummyDetailComponent, outlet: 'detail' },
{ path: 'workbaskets', component: DummyDetailComponent }
];
const routes: Routes = [
{ path: ':id', component: DummyDetailComponent, outlet: 'detail' },
{ path: 'workbaskets', component: DummyDetailComponent }
];
beforeEach(done => {
const configure = (testBed: TestBed) => {
testBed.configureTestingModule({
declarations: [
WorkbasketListComponent,
DummyDetailComponent,
WorkbasketListToolbarComponent,
ImportExportComponent
],
imports: [
AngularSvgIconModule,
HttpClientModule,
RouterTestingModule.withRoutes(routes)
],
providers: [
WorkbasketService,
WorkbasketDefinitionService,
ClassificationDefinitionService,
OrientationService,
ImportExportService
]
});
};
configureTests(configure).then(testBed => {
fixture = TestBed.createComponent(WorkbasketListComponent);
component = fixture.componentInstance;
debugElement = fixture.debugElement.nativeElement;
workbasketService = TestBed.get(WorkbasketService);
const orientationService = TestBed.get(OrientationService);
workbasketSummarySpy = spyOn(workbasketService, 'getWorkBasketsSummary').and.returnValue(of(workbasketSummaryResource));
spyOn(workbasketService, 'getSelectedWorkBasket').and.returnValue(of('2'));
spyOn(orientationService, 'getOrientation').and.returnValue(of(undefined));
beforeEach(done => {
const configure = (testBed: TestBed) => {
testBed.configureTestingModule({
declarations: [
WorkbasketListComponent,
DummyDetailComponent,
WorkbasketListToolbarComponent,
ImportExportComponent
],
imports: [
AngularSvgIconModule,
HttpClientModule,
RouterTestingModule.withRoutes(routes)
],
providers: [
WorkbasketService,
WorkbasketDefinitionService,
ClassificationDefinitionService,
OrientationService,
ImportExportService
]
});
};
configureTests(configure).then(testBed => {
fixture = TestBed.createComponent(WorkbasketListComponent);
component = fixture.componentInstance;
debugElement = fixture.debugElement.nativeElement;
workbasketService = TestBed.get(WorkbasketService);
const orientationService = TestBed.get(OrientationService);
workbasketSummarySpy = spyOn(workbasketService, 'getWorkBasketsSummary').and.returnValue(of(workbasketSummaryResource));
spyOn(workbasketService, 'getSelectedWorkBasket').and.returnValue(of('2'));
spyOn(orientationService, 'getOrientation').and.returnValue(of(undefined));
fixture.detectChanges();
done();
});
fixture.detectChanges();
done();
});
});
afterEach(() => {
fixture.detectChanges();
document.body.removeChild(debugElement);
afterEach(() => {
fixture.detectChanges();
document.body.removeChild(debugElement);
});
it('should be created', () => {
expect(component).toBeTruthy();
});
it('should call workbasketService.getWorkbasketsSummary method on init', () => {
component.ngOnInit();
expect(workbasketService.getWorkBasketsSummary).toHaveBeenCalled();
workbasketService.getWorkBasketsSummary().subscribe(value => {
expect(value).toBe(workbasketSummaryResource);
});
});
it('should be created', () => {
expect(component).toBeTruthy();
});
it('should call workbasketService.getWorkbasketsSummary method on init', () => {
component.ngOnInit();
expect(workbasketService.getWorkBasketsSummary).toHaveBeenCalled();
workbasketService.getWorkBasketsSummary().subscribe(value => {
expect(value).toBe(workbasketSummaryResource);
});
});
it('should have wb-action-toolbar, wb-search-bar, wb-list-container, wb-pagination,'
it('should have wb-action-toolbar, wb-search-bar, wb-list-container, wb-pagination,'
+ ' collapsedMenufilterWb and taskana-filter created in the html', () => {
expect(debugElement.querySelector('#wb-action-toolbar')).toBeDefined();
expect(debugElement.querySelector('#wb-search-bar')).toBeDefined();
expect(debugElement.querySelector('#wb-pagination')).toBeDefined();
expect(debugElement.querySelector('#wb-list-container')).toBeDefined();
expect(debugElement.querySelector('#collapsedMenufilterWb')).toBeDefined();
expect(debugElement.querySelector('taskana-filter')).toBeDefined();
expect(debugElement.querySelectorAll('#wb-list-container > li').length).toBe(3);
});
expect(debugElement.querySelector('#wb-action-toolbar')).toBeDefined();
expect(debugElement.querySelector('#wb-search-bar')).toBeDefined();
expect(debugElement.querySelector('#wb-pagination')).toBeDefined();
expect(debugElement.querySelector('#wb-list-container')).toBeDefined();
expect(debugElement.querySelector('#collapsedMenufilterWb')).toBeDefined();
expect(debugElement.querySelector('taskana-filter')).toBeDefined();
expect(debugElement.querySelectorAll('#wb-list-container > li').length).toBe(3);
});
// it('should have two workbasketsummary rows created with the second one selected.', fakeAsync(() => {
// tick(0);
// fixture.detectChanges();
// fixture.whenStable().then(() => {
// expect(debugElement.querySelectorAll('#wb-list-container > li').length).toBe(3);
// expect(debugElement.querySelectorAll('#wb-list-container > li')[1].getAttribute('class'))
// .toBe('list-group-item ng-star-inserted');
// expect(debugElement.querySelectorAll('#wb-list-container > li')[2].getAttribute('class'))
// .toBe('list-group-item ng-star-inserted active');
// })
//
// }));
// it('should have two workbasketsummary rows created with the second one selected.', fakeAsync(() => {
// tick(0);
// fixture.detectChanges();
// fixture.whenStable().then(() => {
// expect(debugElement.querySelectorAll('#wb-list-container > li').length).toBe(3);
// expect(debugElement.querySelectorAll('#wb-list-container > li')[1].getAttribute('class'))
// .toBe('list-group-item ng-star-inserted');
// expect(debugElement.querySelectorAll('#wb-list-container > li')[2].getAttribute('class'))
// .toBe('list-group-item ng-star-inserted active');
// })
//
// }));
it('should have two workbasketsummary rows created with two different icons: user and users', () => {
expect(debugElement.querySelectorAll('#wb-list-container > li')[1]
.querySelector('svg-icon').getAttribute('ng-reflect-src')).toBe('./assets/icons/user.svg');
expect(debugElement.querySelectorAll('#wb-list-container > li')[2]
.querySelector('svg-icon').getAttribute('ng-reflect-src')).toBe('./assets/icons/users.svg');
it('should have two workbasketsummary rows created with two different icons: user and users', () => {
expect(debugElement.querySelectorAll('#wb-list-container > li')[1]
.querySelector('svg-icon').getAttribute('ng-reflect-src')).toBe('./assets/icons/user.svg');
expect(debugElement.querySelectorAll('#wb-list-container > li')[2]
.querySelector('svg-icon').getAttribute('ng-reflect-src')).toBe('./assets/icons/users.svg');
});
it('should have rendered sort by: name, id, description, owner and type', () => {
expect(debugElement.querySelector('#sort-by-name')).toBeDefined();
expect(debugElement.querySelector('#sort-by-key')).toBeDefined();
expect(debugElement.querySelector('#sort-by-description')).toBeDefined();
expect(debugElement.querySelector('#sort-by-owner')).toBeDefined();
expect(debugElement.querySelector('#sort-by-type')).toBeDefined();
});
it('should have performRequest with forced = true after performFilter is triggered', (() => {
const filter = new FilterModel({
name: 'someName',
owner: 'someOwner',
description: 'someDescription',
key: 'someKey',
type: 'PERSONAL'
});
component.performFilter(filter);
it('should have rendered sort by: name, id, description, owner and type', () => {
expect(debugElement.querySelector('#sort-by-name')).toBeDefined();
expect(debugElement.querySelector('#sort-by-key')).toBeDefined();
expect(debugElement.querySelector('#sort-by-description')).toBeDefined();
expect(debugElement.querySelector('#sort-by-owner')).toBeDefined();
expect(debugElement.querySelector('#sort-by-type')).toBeDefined();
});
it('should have performRequest with forced = true after performFilter is triggered', (() => {
const filter = new FilterModel({
name: 'someName',
owner: 'someOwner',
description: 'someDescription',
key: 'someKey',
type: 'PERSONAL'
});
component.performFilter(filter);
expect(workbasketSummarySpy.calls.all()[1].args).toEqual([true, 'key', 'asc',
'', 'someName', 'someDescription', '', 'someOwner', 'PERSONAL', '', 'someKey', '']);
}));
expect(workbasketSummarySpy.calls.all()[1].args).toEqual([true, 'key', 'asc',
'', 'someName', 'someDescription', '', 'someOwner', 'PERSONAL', '', 'someKey', '']);
}));
});

View File

@ -47,7 +47,7 @@ export class WorkbasketListComponent implements OnInit, OnDestroy {
private route: ActivatedRoute,
private orientationService: OrientationService,
private importExportService: ImportExportService
) {
) {
}
ngOnInit() {
@ -96,7 +96,7 @@ export class WorkbasketListComponent implements OnInit, OnDestroy {
refreshWorkbasketList() {
this.cards = this.orientationService.calculateNumberItemsList(
window.innerHeight, 72, 170 + this.toolbarElement.nativeElement.offsetHeight, false
);
);
this.performRequest();
}
@ -108,7 +108,7 @@ export class WorkbasketListComponent implements OnInit, OnDestroy {
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;

View File

@ -55,13 +55,13 @@ const appRoutes: Routes = [
},
];
@NgModule({
imports: [
RouterModule.forRoot(
appRoutes, { useHash: true }
)
],
exports: [
RouterModule
]
imports: [
RouterModule.forRoot(
appRoutes, { useHash: true }
)
],
exports: [
RouterModule
]
})
export class AppRoutingModule { }

View File

@ -9,8 +9,9 @@ import { AppComponent } from './app.component';
import { NavBarComponent } from './components/nav-bar/nav-bar.component';
describe('AppComponent', () => {
let app; let fixture; let
debugElement;
let app;
let fixture;
let debugElement;
const routes: Routes = [
{ path: 'classifications', component: AppComponent }

View File

@ -46,7 +46,7 @@ export class AppComponent implements OnInit, OnDestroy {
private selectedRouteService: SelectedRouteService,
private formsValidatorService: FormsValidatorService,
public uploadService: UploadService
) {
) {
}
ngOnInit() {

View File

@ -1,9 +1,9 @@
import { getTestBed,
TestBed } from '@angular/core/testing';
TestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule,
platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
import { CustomFieldsService } from 'app/services/custom-fields/custom-fields.service';
import { RemoveConfirmationService } from 'app/services/remove-confirmation/remove-confirmation.service';
@ -24,22 +24,22 @@ import { FormsValidatorService } from './shared/services/forms/forms-validator.s
import { SharedModule } from './shared/shared.module';
export const configureTests = (configure: (testBed: TestBed) => void) => {
const testBed = getTestBed();
const testBed = getTestBed();
if (testBed.platform == null) {
testBed.initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
}
if (testBed.platform == null) {
testBed.initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
}
configure(testBed);
testBed.configureTestingModule({
imports: [BrowserAnimationsModule, SharedModule, FormsModule, ReactiveFormsModule, HttpClientModule, AngularSvgIconModule],
providers: [{ provide: TaskanaEngineService, useClass: TaskanaEngineServiceMock },
{ provide: DomainService, useClass: DomainServiceMock }, CustomFieldsService, RemoveConfirmationService,
AlertService, GeneralModalService, RequestInProgressService, OrientationService, SelectedRouteService, FormsValidatorService]
});
configure(testBed);
testBed.configureTestingModule({
imports: [BrowserAnimationsModule, SharedModule, FormsModule, ReactiveFormsModule, HttpClientModule, AngularSvgIconModule],
providers: [{ provide: TaskanaEngineService, useClass: TaskanaEngineServiceMock },
{ provide: DomainService, useClass: DomainServiceMock }, CustomFieldsService, RemoveConfirmationService,
AlertService, GeneralModalService, RequestInProgressService, OrientationService, SelectedRouteService, FormsValidatorService]
});
return testBed.compileComponents().then(() => testBed);
return testBed.compileComponents().then(() => testBed);
};

View File

@ -5,13 +5,13 @@ const MODULES = [
];
const DECLARATIONS = [
TaskanaTypeAheadMockComponent
TaskanaTypeAheadMockComponent
];
@NgModule({
declarations: DECLARATIONS,
imports: MODULES,
providers: []
declarations: DECLARATIONS,
imports: MODULES,
providers: []
})
export class AppTestModule {
}

View File

@ -20,8 +20,8 @@ import { NavBarComponent } from './nav-bar.component';
describe('NavBarComponent', () => {
let component: NavBarComponent;
let fixture: ComponentFixture<NavBarComponent>;
let debugElement; let
navBar;
let debugElement;
let navBar;
const routes: Routes = [
{ path: 'classifications', component: NavBarComponent }

View File

@ -50,7 +50,7 @@ export class NavBarComponent implements OnInit, OnDestroy {
private domainService: DomainService,
private taskanaEngineService: TaskanaEngineService,
private window: WindowRefService
) { }
) { }
ngOnInit() {
this.selectedRouteSubscription = this.selectedRouteService.getSelectedRoute().subscribe((value: string) => {

View File

@ -4,20 +4,20 @@ import { TaskanaEngineService } from 'app/services/taskana-engine/taskana-engine
@Injectable()
export class BusinessAdminGuard implements CanActivate {
static roles = ['ADMIN', 'BUSINESS_ADMIN'];
static roles = ['ADMIN', 'BUSINESS_ADMIN'];
constructor(private taskanaEngineService: TaskanaEngineService, public router: Router) { }
constructor(private taskanaEngineService: TaskanaEngineService, public router: Router) { }
canActivate() {
if (this.taskanaEngineService.hasRole(BusinessAdminGuard.roles)) {
return true;
}
return this.navigateToWorkplace();
canActivate() {
if (this.taskanaEngineService.hasRole(BusinessAdminGuard.roles)) {
return true;
}
return this.navigateToWorkplace();
}
navigateToWorkplace(): boolean {
this.router.navigate(['workplace']);
return false;
}
navigateToWorkplace(): boolean {
this.router.navigate(['workplace']);
return false;
}
}

View File

@ -8,17 +8,17 @@ import { map, catchError } from 'rxjs/operators';
@Injectable()
export class DomainGuard implements CanActivate {
constructor(private domainService: DomainService, private generalModalService: GeneralModalService) { }
constructor(private domainService: DomainService, private generalModalService: GeneralModalService) { }
canActivate() {
return this.domainService.getDomains().pipe(
map(domain => true),
catchError(() => {
this.generalModalService.triggerMessage(new MessageModal(
'There was an error, please contact with your administrator', 'There was an error getting Domains'
));
return of(false);
})
);
}
canActivate() {
return this.domainService.getDomains().pipe(
map(domain => true),
catchError(() => {
this.generalModalService.triggerMessage(new MessageModal(
'There was an error, please contact with your administrator', 'There was an error getting Domains'
));
return of(false);
})
);
}
}

View File

@ -14,12 +14,12 @@ export class HistoryGuard implements CanActivate {
private taskanaEngineService: TaskanaEngineService,
public router: Router,
public generalModalService: GeneralModalService
) { }
) { }
canActivate(
next: ActivatedRouteSnapshot,
state: RouterStateSnapshot
): Observable<boolean> | Promise<boolean> | boolean {
): Observable<boolean> | Promise<boolean> | boolean {
return this.taskanaEngineService.isHistoryProviderEnabled().pipe(
map(value => {
if (value) {
@ -30,7 +30,7 @@ export class HistoryGuard implements CanActivate {
catchError(() => {
this.generalModalService.triggerMessage(new MessageModal(
'There was an error, please contact with your administrator', 'There was an error getting history provider'
));
));
return of(this.navigateToWorkplace());
})
);

View File

@ -4,18 +4,18 @@ import { TaskanaEngineService } from 'app/services/taskana-engine/taskana-engine
@Injectable()
export class MonitorGuard implements CanActivate {
static roles = ['ADMIN', 'MONITOR'];
constructor(private taskanaEngineService: TaskanaEngineService, public router: Router) { }
static roles = ['ADMIN', 'MONITOR'];
constructor(private taskanaEngineService: TaskanaEngineService, public router: Router) { }
canActivate() {
if (this.taskanaEngineService.hasRole(MonitorGuard.roles)) {
return true;
}
return this.navigateToWorkplace();
canActivate() {
if (this.taskanaEngineService.hasRole(MonitorGuard.roles)) {
return true;
}
return this.navigateToWorkplace();
}
navigateToWorkplace(): boolean {
this.router.navigate(['workplace']);
return false;
}
navigateToWorkplace(): boolean {
this.router.navigate(['workplace']);
return false;
}
}

View File

@ -4,17 +4,17 @@ import { TaskanaEngineService } from 'app/services/taskana-engine/taskana-engine
@Injectable()
export class UserGuard implements CanActivate {
static roles = ['ADMIN', 'USER'];
constructor(private taskanaEngineService: TaskanaEngineService, private router: Router) { }
canActivate() {
if (this.taskanaEngineService.hasRole(UserGuard.roles)) {
return true;
}
return this.navigateToNoRole();
static roles = ['ADMIN', 'USER'];
constructor(private taskanaEngineService: TaskanaEngineService, private router: Router) { }
canActivate() {
if (this.taskanaEngineService.hasRole(UserGuard.roles)) {
return true;
}
return this.navigateToNoRole();
}
navigateToNoRole(): boolean {
this.router.navigate(['no-role']);
return false;
}
navigateToNoRole(): boolean {
this.router.navigate(['no-role']);
return false;
}
}

View File

@ -9,97 +9,97 @@ import { HttpClient } from '@angular/common/http';
import { environment } from 'environments/environment';
@Injectable({
providedIn: 'root'
providedIn: 'root'
})
export class TaskQueryService {
private url = environment.taskanaRestUrl;
private url = environment.taskanaRestUrl;
constructor(private httpClient: HttpClient) { }
constructor(private httpClient: HttpClient) { }
queryTask(
orderBy: string = 'created',
sortDirection: string = Direction.ASC,
searchForValues: TaskHistoryEventData,
allPages: boolean = false
): Observable<TaskHistoryEventResourceData> {
return this.httpClient.get<TaskHistoryEventResourceData>(`${this.url}/v1/task-history-event${this.getQueryParameters(
orderBy,
sortDirection,
searchForValues.taskId,
searchForValues.parentBusinessProcessId,
searchForValues.businessProcessId,
searchForValues.eventType,
searchForValues.userId,
searchForValues.domain,
searchForValues.workbasketKey,
searchForValues.porCompany,
searchForValues.porSystem,
searchForValues.porInstance,
searchForValues.porType,
searchForValues.porValue,
searchForValues.taskClassificationKey,
searchForValues.taskClassificationCategory,
searchForValues.attachmentClassificationKey,
searchForValues.custom1,
searchForValues.custom2,
searchForValues.custom3,
searchForValues.custom4,
searchForValues.created,
allPages
)}`);
}
queryTask(
orderBy: string = 'created',
sortDirection: string = Direction.ASC,
searchForValues: TaskHistoryEventData,
allPages: boolean = false
): Observable<TaskHistoryEventResourceData> {
return this.httpClient.get<TaskHistoryEventResourceData>(`${this.url}/v1/task-history-event${this.getQueryParameters(
orderBy,
sortDirection,
searchForValues.taskId,
searchForValues.parentBusinessProcessId,
searchForValues.businessProcessId,
searchForValues.eventType,
searchForValues.userId,
searchForValues.domain,
searchForValues.workbasketKey,
searchForValues.porCompany,
searchForValues.porSystem,
searchForValues.porInstance,
searchForValues.porType,
searchForValues.porValue,
searchForValues.taskClassificationKey,
searchForValues.taskClassificationCategory,
searchForValues.attachmentClassificationKey,
searchForValues.custom1,
searchForValues.custom2,
searchForValues.custom3,
searchForValues.custom4,
searchForValues.created,
allPages
)}`);
}
private getQueryParameters(
orderBy: string,
sortDirection: string,
taskId: string,
parentBPI: string,
BPI: string,
eventType: string,
userId: string,
domain: string,
workbasketKey: string,
porCompany: string,
porSystem: string,
porInstance: string,
porType: string,
porValue: string,
taskClassificationKey: string,
taskClassificationCategory: string,
attachmentClassificationKey: string,
custom1: string,
custom2: string,
custom3: string,
custom4: string,
created: string,
allPages: boolean = false
): string {
const parameters = new QueryParametersModel();
parameters.SORTBY = orderBy;
parameters.SORTDIRECTION = sortDirection;
parameters.TASK_ID_LIKE = taskId;
parameters.PARENT_BUSINESS_PROCESS_ID_LIKE = parentBPI;
parameters.BUSINESS_PROCESS_ID_LIKE = BPI;
parameters.EVENT_TYPE_LIKE = eventType;
parameters.USER_ID_LIKE = userId;
parameters.DOMAIN = domain;
parameters.WORKBASKETKEYLIKE = workbasketKey;
parameters.POR_COMPANY_LIKE = porCompany;
parameters.POR_SYSTEM_LIKE = porSystem;
parameters.POR_INSTANCE_LIKE = porInstance;
parameters.POR_TYPE_LIKE = porType;
parameters.POR_VALUE_LIKE = porValue;
parameters.TASK_CLASSIFICATION_KEY_LIKE = taskClassificationKey;
parameters.TASK_CLASSIFICATION_CATEGORY_LIKE = taskClassificationCategory;
parameters.ATTACHMENT_CLASSIFICATION_KEY_LIKE = attachmentClassificationKey;
parameters.CUSTOM_1_LIKE = custom1;
parameters.CUSTOM_2_LIKE = custom2;
parameters.CUSTOM_3_LIKE = custom3;
parameters.CUSTOM_4_LIKE = custom4;
parameters.CREATED = created;
private getQueryParameters(
orderBy: string,
sortDirection: string,
taskId: string,
parentBPI: string,
BPI: string,
eventType: string,
userId: string,
domain: string,
workbasketKey: string,
porCompany: string,
porSystem: string,
porInstance: string,
porType: string,
porValue: string,
taskClassificationKey: string,
taskClassificationCategory: string,
attachmentClassificationKey: string,
custom1: string,
custom2: string,
custom3: string,
custom4: string,
created: string,
allPages: boolean = false
): string {
const parameters = new QueryParametersModel();
parameters.SORTBY = orderBy;
parameters.SORTDIRECTION = sortDirection;
parameters.TASK_ID_LIKE = taskId;
parameters.PARENT_BUSINESS_PROCESS_ID_LIKE = parentBPI;
parameters.BUSINESS_PROCESS_ID_LIKE = BPI;
parameters.EVENT_TYPE_LIKE = eventType;
parameters.USER_ID_LIKE = userId;
parameters.DOMAIN = domain;
parameters.WORKBASKETKEYLIKE = workbasketKey;
parameters.POR_COMPANY_LIKE = porCompany;
parameters.POR_SYSTEM_LIKE = porSystem;
parameters.POR_INSTANCE_LIKE = porInstance;
parameters.POR_TYPE_LIKE = porType;
parameters.POR_VALUE_LIKE = porValue;
parameters.TASK_CLASSIFICATION_KEY_LIKE = taskClassificationKey;
parameters.TASK_CLASSIFICATION_CATEGORY_LIKE = taskClassificationCategory;
parameters.ATTACHMENT_CLASSIFICATION_KEY_LIKE = attachmentClassificationKey;
parameters.CUSTOM_1_LIKE = custom1;
parameters.CUSTOM_2_LIKE = custom2;
parameters.CUSTOM_3_LIKE = custom3;
parameters.CUSTOM_4_LIKE = custom4;
parameters.CREATED = created;
if (allPages) { delete TaskanaQueryParameters.page; delete TaskanaQueryParameters.pageSize; }
if (allPages) { delete TaskanaQueryParameters.page; delete TaskanaQueryParameters.pageSize; }
return TaskanaQueryParameters.getQueryParameters(parameters);
}
return TaskanaQueryParameters.getQueryParameters(parameters);
}
}

View File

@ -10,7 +10,7 @@ describe('TaskQueryComponent', () => {
TestBed.configureTestingModule({
declarations: [TaskQueryComponent]
})
.compileComponents();
.compileComponents();
}));
beforeEach(() => {

View File

@ -33,7 +33,7 @@ export class TaskQueryComponent implements OnInit {
private orientationService: OrientationService,
private generalModalService: GeneralModalService,
private requestInProgressService: RequestInProgressService
) { }
) { }
ngOnInit() {
this.orientationSubscription = this.orientationService.getOrientation().subscribe((orientation: Orientation) => {
@ -101,7 +101,7 @@ export class TaskQueryComponent implements OnInit {
}
isDate(fieldName: string): boolean {
return (fieldName === 'created');
return (fieldName === 'created');
}
filterFieldsToAllowQuerying(fieldName: string): boolean {
@ -182,16 +182,16 @@ export class TaskQueryComponent implements OnInit {
this.orderBy.sortDirection,
new TaskHistoryEventData(this.taskQueryForm.value),
false
).subscribe(taskQueryResource => {
this.requestInProgressService.setRequestInProgress(false);
if (!taskQueryResource.taskHistoryEvents) {
this.taskQuery = null;
this.taskQueryResource = null;
return null;
}
this.taskQueryResource = taskQueryResource;
this.taskQuery = taskQueryResource.taskHistoryEvents;
});
).subscribe(taskQueryResource => {
this.requestInProgressService.setRequestInProgress(false);
if (!taskQueryResource.taskHistoryEvents) {
this.taskQuery = null;
this.taskQueryResource = null;
return null;
}
this.taskQueryResource = taskQueryResource;
this.taskQuery = taskQueryResource.taskHistoryEvents;
});
}
private initTaskQueryForm() {
@ -211,8 +211,8 @@ export class TaskQueryComponent implements OnInit {
}
updateDate($event: string) {
this.taskQueryForm.get('created').setValue($event.substring(0, 10));
this.performRequest();
this.taskQueryForm.get('created').setValue($event.substring(0, 10));
this.performRequest();
}
onDestroy() {

View File

@ -1,9 +1,9 @@
import { LinksClassification } from 'app/models/links-classfication';
export class AccessIdDefinition {
constructor(
public accessId?: string,
public name?: string
) {
}
constructor(
public accessId?: string,
public name?: string
) {
}
}

View File

@ -2,8 +2,8 @@ import { Links } from './links';
import { AccessItemWorkbasket } from './access-item-workbasket';
export class AccessItemsWorkbasketResource {
constructor(
public accessItems: Array<AccessItemWorkbasket> = [],
public _links?: Links
) { }
constructor(
public accessItems: Array<AccessItemWorkbasket> = [],
public _links?: Links
) { }
}

View File

@ -1,27 +1,27 @@
import { Links } from './links';
export class AccessItemWorkbasket {
constructor(
public accessItemId: string,
public workbasketKey: string,
public accessId: string,
public permRead: boolean = false,
public permOpen: boolean = false,
public permAppend: boolean = false,
public permTransfer: boolean = false,
public permDistribute: boolean = false,
public permCustom1: boolean = false,
public permCustom2: boolean = false,
public permCustom3: boolean = false,
public permCustom4: boolean = false,
public permCustom5: boolean = false,
public permCustom6: boolean = false,
public permCustom7: boolean = false,
public permCustom8: boolean = false,
public permCustom9: boolean = false,
public permCustom10: boolean = false,
public permCustom11: boolean = false,
public permCustom12: boolean = false,
public _links?: Links
) { }
constructor(
public accessItemId: string,
public workbasketKey: string,
public accessId: string,
public permRead: boolean = false,
public permOpen: boolean = false,
public permAppend: boolean = false,
public permTransfer: boolean = false,
public permDistribute: boolean = false,
public permCustom1: boolean = false,
public permCustom2: boolean = false,
public permCustom3: boolean = false,
public permCustom4: boolean = false,
public permCustom5: boolean = false,
public permCustom6: boolean = false,
public permCustom7: boolean = false,
public permCustom8: boolean = false,
public permCustom9: boolean = false,
public permCustom10: boolean = false,
public permCustom11: boolean = false,
public permCustom12: boolean = false,
public _links?: Links
) { }
}

View File

@ -1,5 +1,5 @@
export enum ACTION {
CREATE = 'CREATE',
COPY = 'COPY'
CREATE = 'CREATE',
COPY = 'COPY'
}

View File

@ -2,14 +2,14 @@ import { Links } from 'app/models/links';
export class Classification {
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) {
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) {
}
}

View File

@ -1,8 +1,8 @@
export class CustomField {
constructor(
public visible: boolean,
public field: string
) {
}
constructor(
public visible: boolean,
public field: string
) {
}
}

View File

@ -1,12 +1,12 @@
import { Links } from './links';
export class LinksClassification extends Links {
constructor(
self?,
distributionTargets?,
accessItems?,
public getAllClassifications?: { 'href': string },
public createClassification?: { 'href': string },
public updateClassification?: { 'href': string },
) { super(self, distributionTargets, accessItems); }
constructor(
self?,
distributionTargets?,
accessItems?,
public getAllClassifications?: { 'href': string },
public createClassification?: { 'href': string },
public updateClassification?: { 'href': string },
) { super(self, distributionTargets, accessItems); }
}

View File

@ -1,10 +1,10 @@
import { Links } from './links';
export class LinksWorkbasketSummary extends Links {
constructor(
self?,
distributionTargets?,
accessItems?,
public allWorkbaskets?: { 'href': string }
) { super(self, distributionTargets, accessItems); }
constructor(
self?,
distributionTargets?,
accessItems?,
public allWorkbaskets?: { 'href': string }
) { super(self, distributionTargets, accessItems); }
}

View File

@ -1,9 +1,9 @@
export class Links {
constructor(
public self?: { 'href': string },
public distributionTargets?: { 'href': string },
public accessItems?: { 'href': string },
public allWorkbasketUrl?: { 'href': string },
public removeDistributionTargets?: {'href': string}
) { }
constructor(
public self?: { 'href': string },
public distributionTargets?: { 'href': string },
public accessItems?: { 'href': string },
public allWorkbasketUrl?: { 'href': string },
public removeDistributionTargets?: {'href': string}
) { }
}

View File

@ -1,7 +1,7 @@
export class MessageModal {
constructor(
public title?: string,
public message?: any,
public type = 'error'
) { }
constructor(
public title?: string,
public message?: any,
public type = 'error'
) { }
}

View File

@ -1,8 +1,8 @@
export class Page {
constructor(
public size?: number,
public totalElements?: number,
public totalPages?: number,
public number?: number
) { }
constructor(
public size?: number,
public totalElements?: number,
public totalPages?: number,
public number?: number
) { }
}

View File

@ -1,6 +1,6 @@
export class Pair {
constructor(
public name?: string,
public text?: string,
) { }
constructor(
public name?: string,
public text?: string,
) { }
}

View File

@ -1,50 +1,50 @@
export class QueryParametersModel {
SORTBY: string;
SORTDIRECTION: string;
// Filtering
NAME: string;
NAMELIKE: string;
DESCLIKE: string;
OWNER: string;
OWNERLIKE: string;
TYPE: string;
KEY: string;
WORKBASKET_KEY: string;
KEYLIKE: string;
PRIORITY: string;
STATE: string;
WORKBASKET_ID: string;
TASK_PRIMARY_OBJ_REF_TYPE_LIKE: string;
TASK_PRIMARY_OBJ_REF_VALUE_LIKE: string;
// Access
REQUIREDPERMISSION: string;
ACCESSIDS: string;
ACCESSIDLIKE: string;
WORKBASKETKEYLIKE: string;
// Pagination
PAGE: string;
PAGESIZE: string;
// Domain
DOMAIN: string;
// Task history events
TASK_ID_LIKE: string;
PARENT_BUSINESS_PROCESS_ID_LIKE: string;
BUSINESS_PROCESS_ID_LIKE: string;
EVENT_TYPE_LIKE: string;
CREATED: string;
USER_ID_LIKE: string;
POR_COMPANY_LIKE: string;
POR_SYSTEM_LIKE: string;
POR_INSTANCE_LIKE: string;
POR_TYPE_LIKE: string;
POR_VALUE_LIKE: string;
TASK_CLASSIFICATION_KEY_LIKE: string;
TASK_CLASSIFICATION_CATEGORY_LIKE: string;
ATTACHMENT_CLASSIFICATION_KEY_LIKE: string;
CUSTOM_1_LIKE: string;
CUSTOM_2_LIKE: string;
CUSTOM_3_LIKE: string;
CUSTOM_4_LIKE: string;
COMMENT_LIKE: string;
SORTBY: string;
SORTDIRECTION: string;
// Filtering
NAME: string;
NAMELIKE: string;
DESCLIKE: string;
OWNER: string;
OWNERLIKE: string;
TYPE: string;
KEY: string;
WORKBASKET_KEY: string;
KEYLIKE: string;
PRIORITY: string;
STATE: string;
WORKBASKET_ID: string;
TASK_PRIMARY_OBJ_REF_TYPE_LIKE: string;
TASK_PRIMARY_OBJ_REF_VALUE_LIKE: string;
// Access
REQUIREDPERMISSION: string;
ACCESSIDS: string;
ACCESSIDLIKE: string;
WORKBASKETKEYLIKE: string;
// Pagination
PAGE: string;
PAGESIZE: string;
// Domain
DOMAIN: string;
// Task history events
TASK_ID_LIKE: string;
PARENT_BUSINESS_PROCESS_ID_LIKE: string;
BUSINESS_PROCESS_ID_LIKE: string;
EVENT_TYPE_LIKE: string;
CREATED: string;
USER_ID_LIKE: string;
POR_COMPANY_LIKE: string;
POR_SYSTEM_LIKE: string;
POR_INSTANCE_LIKE: string;
POR_TYPE_LIKE: string;
POR_VALUE_LIKE: string;
TASK_CLASSIFICATION_KEY_LIKE: string;
TASK_CLASSIFICATION_CATEGORY_LIKE: string;
ATTACHMENT_CLASSIFICATION_KEY_LIKE: string;
CUSTOM_1_LIKE: string;
CUSTOM_2_LIKE: string;
CUSTOM_3_LIKE: string;
CUSTOM_4_LIKE: string;
COMMENT_LIKE: string;
}

View File

@ -1,14 +1,14 @@
export enum Direction {
ASC = 'asc',
DESC = 'desc'
ASC = 'asc',
DESC = 'desc'
}
export class SortingModel {
sortBy: string;
sortDirection: string;
constructor(sortBy: string = 'key', sortDirection: Direction = Direction.ASC) {
this.sortBy = sortBy;
this.sortDirection = sortDirection;
}
sortBy: string;
sortDirection: string;
constructor(sortBy: string = 'key', sortDirection: Direction = Direction.ASC) {
this.sortBy = sortBy;
this.sortDirection = sortDirection;
}
}

View File

@ -1,4 +1,4 @@
export class State {
state: string;
counter: number;
state: string;
counter: number;
}

View File

@ -2,6 +2,6 @@ import { Links } from './links';
import { TaskHistoryEventData } from './task-history-event';
export class TaskHistoryEventResourceData {
public taskHistoryEvents: Array<TaskHistoryEventData>;
public _links: Links = new Links();
public taskHistoryEvents: Array<TaskHistoryEventData>;
public _links: Links = new Links();
}

View File

@ -1,35 +1,35 @@
import { Page } from './page';
export class TaskHistoryEventData {
taskHistoryId = 0;
parentBusinessProcessId = '';
businessProcessId = '';
created = '';
userId = '';
eventType = '';
workbasketKey = '';
porType = '';
porValue = '';
domain = '';
taskId = '';
porCompany = '';
porSystem = '';
porInstance = '';
taskClassificationKey = '';
taskClassificationCategory = '';
attachmentClassificationKey = '';
custom1 = '';
custom2 = '';
custom3 = '';
custom4 = '';
comment = '';
oldValue = '';
newValue = '';
oldData = '';
newData = '';
page = new Page();
taskHistoryId = 0;
parentBusinessProcessId = '';
businessProcessId = '';
created = '';
userId = '';
eventType = '';
workbasketKey = '';
porType = '';
porValue = '';
domain = '';
taskId = '';
porCompany = '';
porSystem = '';
porInstance = '';
taskClassificationKey = '';
taskClassificationCategory = '';
attachmentClassificationKey = '';
custom1 = '';
custom2 = '';
custom3 = '';
custom4 = '';
comment = '';
oldValue = '';
newValue = '';
oldData = '';
newData = '';
page = new Page();
public constructor(init?: Partial<TaskHistoryEventData>) {
Object.assign(this, init);
}
public constructor(init?: Partial<TaskHistoryEventData>) {
Object.assign(this, init);
}
}

View File

@ -1,8 +1,8 @@
export class UserInfoModel {
constructor(
public userId: string = '',
public groupIds: Array<string> = [],
public roles: Array<string> = []
) { }
constructor(
public userId: string = '',
public groupIds: Array<string> = [],
public roles: Array<string> = []
) { }
}

View File

@ -1,6 +1,6 @@
export class VersionModel {
constructor(
public version: string = ''
) { }
constructor(
public version: string = ''
) { }
}

View File

@ -2,8 +2,8 @@ import { Links } from './links';
import { WorkbasketAccessItems } from './workbasket-access-items';
export class WorkbasketAccessItemsResource {
constructor(
public accessItems: Array<WorkbasketAccessItems> = [],
public _links: Links = new Links()
) { }
constructor(
public accessItems: Array<WorkbasketAccessItems> = [],
public _links: Links = new Links()
) { }
}

View File

@ -1,28 +1,28 @@
import { Links } from './links';
export class WorkbasketAccessItems {
constructor(
public accessItemId: string = '',
public workbasketId: string = '',
public accessId: string = '',
public accessName: string = '',
public permRead: boolean = false,
public permOpen: boolean = false,
public permAppend: boolean = false,
public permTransfer: boolean = false,
public permDistribute: boolean = false,
public permCustom1: boolean = false,
public permCustom2: boolean = false,
public permCustom3: boolean = false,
public permCustom4: boolean = false,
public permCustom5: boolean = false,
public permCustom6: boolean = false,
public permCustom7: boolean = false,
public permCustom8: boolean = false,
public permCustom9: boolean = false,
public permCustom10: boolean = false,
public permCustom11: boolean = false,
public permCustom12: boolean = false,
public _links: Links = new Links()
) { }
constructor(
public accessItemId: string = '',
public workbasketId: string = '',
public accessId: string = '',
public accessName: string = '',
public permRead: boolean = false,
public permOpen: boolean = false,
public permAppend: boolean = false,
public permTransfer: boolean = false,
public permDistribute: boolean = false,
public permCustom1: boolean = false,
public permCustom2: boolean = false,
public permCustom3: boolean = false,
public permCustom4: boolean = false,
public permCustom5: boolean = false,
public permCustom6: boolean = false,
public permCustom7: boolean = false,
public permCustom8: boolean = false,
public permCustom9: boolean = false,
public permCustom10: boolean = false,
public permCustom11: boolean = false,
public permCustom12: boolean = false,
public _links: Links = new Links()
) { }
}

View File

@ -3,7 +3,7 @@ import { Workbasket } from './workbasket';
export class WorkbasketDefinition {
constructor(distributionTargets: string[],
workbasketAccessItems: WorkbasketAccessItems[],
workbasket: Workbasket) {
workbasketAccessItems: WorkbasketAccessItems[],
workbasket: Workbasket) {
}
}

View File

@ -2,9 +2,9 @@ import { WorkbasketSummary } from './workbasket-summary';
import { Links } from './links';
export class WorkbasketDistributionTargetsResource {
constructor(
public distributionTargets: Array<WorkbasketSummary> = [],
public _links: Links = null
) {
}
constructor(
public distributionTargets: Array<WorkbasketSummary> = [],
public _links: Links = null
) {
}
}

View File

@ -2,8 +2,8 @@ import { Links } from './links';
import { Workbasket } from './workbasket';
export class WorkbasketResource {
constructor(
public workbaskets: Array<Workbasket> = [],
public _links: Links = new Links()
) { }
constructor(
public workbaskets: Array<Workbasket> = [],
public _links: Links = new Links()
) { }
}

View File

@ -3,10 +3,10 @@ import { WorkbasketSummary } from './workbasket-summary';
import { LinksWorkbasketSummary } from './links-workbasket-summary';
export class WorkbasketSummaryResource {
constructor(
public workbaskets: Array<WorkbasketSummary> = [],
public _links: LinksWorkbasketSummary = new LinksWorkbasketSummary(),
public page: Page = new Page()
) {
}
constructor(
public workbaskets: Array<WorkbasketSummary> = [],
public _links: LinksWorkbasketSummary = new LinksWorkbasketSummary(),
public page: Page = new Page()
) {
}
}

View File

@ -3,22 +3,22 @@ import { Page } from './page';
import { Links } from './links';
export class WorkbasketSummary {
constructor(
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,
public orgLevel2?: string,
public orgLevel3?: string,
public orgLevel4?: string,
public markedForDeletion: boolean = false,
public _links?: Links,
public page?: Page
) {
}
constructor(
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,
public orgLevel2?: string,
public orgLevel3?: string,
public orgLevel4?: string,
public markedForDeletion: boolean = false,
public _links?: Links,
public page?: Page
) {
}
}

View File

@ -2,47 +2,47 @@ import { Links } from './links';
import { ICONTYPES } from './type';
export class Workbasket {
public static equals(org: Workbasket, comp: Workbasket): boolean {
if (org.workbasketId !== comp.workbasketId) { return false; }
if (org.created !== comp.created) { return false; }
if (org.key !== comp.key) { return false; }
if (org.domain !== comp.domain) { return false; }
if (org.type !== comp.type) { return false; }
if (org.modified !== comp.modified) { return false; }
if (org.name !== comp.name) { return false; }
if (org.description !== comp.description) { return false; }
if (org.owner !== comp.owner) { return false; }
if (org.custom1 !== comp.custom1) { return false; }
if (org.custom2 !== comp.custom2) { return false; }
if (org.custom3 !== comp.custom3) { return false; }
if (org.custom4 !== comp.custom4) { return false; }
if (org.orgLevel1 !== comp.orgLevel1) { return false; }
if (org.orgLevel2 !== comp.orgLevel2) { return false; }
if (org.orgLevel3 !== comp.orgLevel3) { return false; }
if (org.orgLevel4 !== comp.orgLevel4) { return false; }
public static equals(org: Workbasket, comp: Workbasket): boolean {
if (org.workbasketId !== comp.workbasketId) { return false; }
if (org.created !== comp.created) { return false; }
if (org.key !== comp.key) { return false; }
if (org.domain !== comp.domain) { return false; }
if (org.type !== comp.type) { return false; }
if (org.modified !== comp.modified) { return false; }
if (org.name !== comp.name) { return false; }
if (org.description !== comp.description) { return false; }
if (org.owner !== comp.owner) { return false; }
if (org.custom1 !== comp.custom1) { return false; }
if (org.custom2 !== comp.custom2) { return false; }
if (org.custom3 !== comp.custom3) { return false; }
if (org.custom4 !== comp.custom4) { return false; }
if (org.orgLevel1 !== comp.orgLevel1) { return false; }
if (org.orgLevel2 !== comp.orgLevel2) { return false; }
if (org.orgLevel3 !== comp.orgLevel3) { return false; }
if (org.orgLevel4 !== comp.orgLevel4) { return false; }
return true;
}
return true;
}
constructor(
public workbasketId?: string,
public created?: string,
public key?: string,
public domain?: string,
public type: ICONTYPES = ICONTYPES.PERSONAL,
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()
) {
}
constructor(
public workbasketId?: string,
public created?: string,
public key?: string,
public domain?: string,
public type: ICONTYPES = ICONTYPES.PERSONAL,
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()
) {
}
}

View File

@ -10,7 +10,7 @@ describe('ClassificationTasksComponent', () => {
TestBed.configureTestingModule({
declarations: [ClassificationTasksComponent]
})
.compileComponents();
.compileComponents();
}));
beforeEach(() => {

View File

@ -27,7 +27,7 @@ export class ClassificationTasksComponent implements OnInit {
constructor(
private restConnectorService: RestConnectorService,
private requestInProgressService: RequestInProgressService
) {
) {
}
async ngOnInit() {

View File

@ -1,70 +1,70 @@
export class ChartColorsDefinition {
public static getColors(): Array<any> {
return [
{ // red
backgroundColor: 'rgba(215, 40, 40, 0.2)',
borderColor: 'rgba(215, 40, 40, 1)',
pointBackgroundColor: 'rgba(215, 40, 40, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(215, 40, 40, 0.8)'
},
{ // yellow
backgroundColor: 'rgba(208, 205, 44, 0.2)',
borderColor: 'rgba(208, 205, 44, 1)',
pointBackgroundColor: 'rgba(208, 205, 44, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(208, 205, 44, 0.8)'
},
{ // green
backgroundColor: 'rgba(45, 205, 44, 0.2)',
borderColor: 'rgba(45, 205, 44, 1)',
pointBackgroundColor: 'rgba(45, 205, 44, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(45, 205, 44, 0.8)'
},
{ // blue
backgroundColor: 'rgba(45, 45, 201, 0.2)',
borderColor: 'rgba(45, 45, 201, 1)',
pointBackgroundColor: 'rgba(45, 45, 201, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(45, 45, 201, 0.8)'
},
{ // cyan
backgroundColor: 'rgba(45, 190, 201, 0.2)',
borderColor: 'rgba(45, 190, 201, 1)',
pointBackgroundColor: 'rgba(45, 190, 201, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(45, 190, 201, 0.8)'
},
{ // black-grey
backgroundColor: 'rgba(37, 35, 38, 0.2)',
borderColor: 'rgba(37, 35, 38, 1)',
pointBackgroundColor: 'rgba(37, 35, 38, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(37, 35, 38, 0.8)'
},
{ // orange
backgroundColor: 'rgba(221, 125, 0, 0.2)',
borderColor: 'rgba(221, 125, 0, 1)',
pointBackgroundColor: 'rgba(221, 125, 0, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(221, 125, 0, 0.8)'
},
{ // lile
backgroundColor: 'rgba(180, 137, 255, 0.2)',
borderColor: 'rgba(180, 137, 255, 1)',
pointBackgroundColor: 'rgba(180, 137, 255, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(180, 137, 255, 0.8)'
}
];
}
public static getColors(): Array<any> {
return [
{ // red
backgroundColor: 'rgba(215, 40, 40, 0.2)',
borderColor: 'rgba(215, 40, 40, 1)',
pointBackgroundColor: 'rgba(215, 40, 40, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(215, 40, 40, 0.8)'
},
{ // yellow
backgroundColor: 'rgba(208, 205, 44, 0.2)',
borderColor: 'rgba(208, 205, 44, 1)',
pointBackgroundColor: 'rgba(208, 205, 44, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(208, 205, 44, 0.8)'
},
{ // green
backgroundColor: 'rgba(45, 205, 44, 0.2)',
borderColor: 'rgba(45, 205, 44, 1)',
pointBackgroundColor: 'rgba(45, 205, 44, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(45, 205, 44, 0.8)'
},
{ // blue
backgroundColor: 'rgba(45, 45, 201, 0.2)',
borderColor: 'rgba(45, 45, 201, 1)',
pointBackgroundColor: 'rgba(45, 45, 201, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(45, 45, 201, 0.8)'
},
{ // cyan
backgroundColor: 'rgba(45, 190, 201, 0.2)',
borderColor: 'rgba(45, 190, 201, 1)',
pointBackgroundColor: 'rgba(45, 190, 201, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(45, 190, 201, 0.8)'
},
{ // black-grey
backgroundColor: 'rgba(37, 35, 38, 0.2)',
borderColor: 'rgba(37, 35, 38, 1)',
pointBackgroundColor: 'rgba(37, 35, 38, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(37, 35, 38, 0.8)'
},
{ // orange
backgroundColor: 'rgba(221, 125, 0, 0.2)',
borderColor: 'rgba(221, 125, 0, 1)',
pointBackgroundColor: 'rgba(221, 125, 0, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(221, 125, 0, 0.8)'
},
{ // lile
backgroundColor: 'rgba(180, 137, 255, 0.2)',
borderColor: 'rgba(180, 137, 255, 1)',
pointBackgroundColor: 'rgba(180, 137, 255, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(180, 137, 255, 0.8)'
}
];
}
}

View File

@ -1,4 +1,4 @@
export class ChartData {
data: Array<number>;
label: string;
data: Array<number>;
label: string;
}

View File

@ -1,4 +1,4 @@
export class WorkbasketCounterData {
data: Array<number>;
label: string;
data: Array<number>;
label: string;
}

View File

@ -1,6 +1,6 @@
import { WorkbasketCounterData } from './workbasket-counter-data';
export class WorkbasketCounter {
dates: Array<string>[];
data: Array<WorkbasketCounterData>;
dates: Array<string>[];
data: Array<WorkbasketCounterData>;
}

View File

@ -14,7 +14,7 @@ export class RestConnectorService {
getTaskStatusReport(): Observable<ReportData> {
return this.httpClient.get<ReportData>(`${environment.taskanaRestUrl + monitorUrl
}tasks-status-report?states=READY,CLAIMED,COMPLETED`);
}tasks-status-report?states=READY,CLAIMED,COMPLETED`);
}
getWorkbasketStatisticsQueryingByDueDate(): Observable<ReportData> {
@ -24,7 +24,7 @@ export class RestConnectorService {
getWorkbasketStatisticsQueryingByPlannedDate(): Observable<ReportData> {
return this.httpClient.get<ReportData>(`${environment.taskanaRestUrl
}/v1/monitor/tasks-workbasket-planned-date-report?daysInPast=7&states=READY,CLAIMED,COMPLETED`);
}/v1/monitor/tasks-workbasket-planned-date-report?daysInPast=7&states=READY,CLAIMED,COMPLETED`);
}
getClassificationTasksReport(): Observable<ReportData> {

View File

@ -10,7 +10,7 @@ describe('TasksComponent', () => {
TestBed.configureTestingModule({
declarations: [TasksComponent]
})
.compileComponents();
.compileComponents();
}));
beforeEach(() => {

View File

@ -17,7 +17,7 @@ export class TasksComponent implements OnInit {
constructor(
private restConnectorService: RestConnectorService,
private requestInProgressService: RequestInProgressService
) {
) {
}
async ngOnInit() {

View File

@ -31,7 +31,7 @@ export class MonitorWorkbasketDueDateComponent implements OnInit {
constructor(
private restConnectorService: RestConnectorService,
private requestInProgressService: RequestInProgressService
) {
) {
}

View File

@ -10,7 +10,7 @@ describe('MonitorWorkbasketQuerySwitcherComponent', () => {
TestBed.configureTestingModule({
declarations: [MonitorWorkbasketQuerySwitcherComponent]
})
.compileComponents();
.compileComponents();
}));
beforeEach(() => {

View File

@ -10,7 +10,7 @@ describe('MonitorWorkbasketsComponent', () => {
TestBed.configureTestingModule({
declarations: [MonitorWorkbasketsComponent]
})
.compileComponents();
.compileComponents();
}));
beforeEach(() => {

View File

@ -10,7 +10,7 @@ describe('MonitorWorkbasketPlannedDateComponent', () => {
TestBed.configureTestingModule({
declarations: [MonitorWorkbasketPlannedDateComponent]
})
.compileComponents();
.compileComponents();
}));
beforeEach(() => {

View File

@ -32,7 +32,7 @@ export class MonitorWorkbasketPlannedDateComponent implements OnInit {
constructor(
private restConnectorService: RestConnectorService,
private requestInProgressService: RequestInProgressService
) {
) {
}
async ngOnInit() {

View File

@ -18,9 +18,9 @@ describe('CustomFieldsService', () => {
const returnedValue = service.getCustomObject(categoriesData);
expect(returnedValue).toBe(categoriesData);
expect(service).toBeTruthy();
}));
}));
it('should take default icon path in merge', inject([CustomFieldsService], (service: CustomFieldsService) => {
it('should take default icon path in merge', inject([CustomFieldsService], (service: CustomFieldsService) => {
const json = require('./taskana-customization-test.json');
service.initCustomFields('EN', json);
const categoriesDefault = json.EN.classifications.categories;
@ -33,9 +33,9 @@ describe('CustomFieldsService', () => {
const returnedValue = service.getCustomObject(categoriesData, 'classifications.categories');
expect(returnedValue).toEqual(categoriesDefault);
expect(service).toBeTruthy();
}));
}));
it('should take merge icon path', inject([CustomFieldsService], (service: CustomFieldsService) => {
it('should take merge icon path', inject([CustomFieldsService], (service: CustomFieldsService) => {
const json = require('./taskana-customization-test.json');
service.initCustomFields('EN', json);
const categoriesData = { DEFAULT: 'assets/icons/categories/default.svg' };
@ -49,5 +49,5 @@ describe('CustomFieldsService', () => {
const returnedValue = service.getCustomObject(categoriesData, 'classifications.categories');
expect(returnedValue).toEqual(result);
expect(service).toBeTruthy();
}));
}));
});

View File

@ -60,23 +60,23 @@ export class CustomFieldsService {
value = this.mergeKeys(value, fallbackObject);
return value;
}
private mergeKeys(defaultObject: Object, newObject: Object) {
const value = new Object();
for (const item of Object.keys(defaultObject)) {
if (!value[item]) {
value[item] = defaultObject[item];
}
return value;
}
for (const item of Object.keys(newObject)) {
if (!value[item]) {
value[item] = newObject[item];
private mergeKeys(defaultObject: Object, newObject: Object) {
const value = new Object();
for (const item of Object.keys(defaultObject)) {
if (!value[item]) {
value[item] = defaultObject[item];
}
}
for (const item of Object.keys(newObject)) {
if (!value[item]) {
value[item] = newObject[item];
}
}
}
return value;
}

View File

@ -22,7 +22,7 @@ export class DomainService {
private router: Router,
private requestInProgressService: RequestInProgressService,
private selectedRouteService: SelectedRouteService
) {
) {
this.selectedRouteService.getSelectedRoute().subscribe((value: string) => {
if (value.indexOf('workbaskets') === 0) {
this.hasMasterDomain = false;
@ -72,7 +72,7 @@ export class DomainService {
/*
This function should be called after getSelectedDomain inner subscriptions have been finished
*/
domainChangedComplete() {
domainChangedComplete() {
this.requestInProgressService.setRequestInProgress(false);
}

View File

@ -4,34 +4,34 @@ import { Router, ActivatedRoute, NavigationStart } from '@angular/router';
@Injectable()
export class SelectedRouteService {
public selectedRouteTriggered = new Subject<string>();
public selectedRouteTriggered = new Subject<string>();
private detailRoutes: Array<string> = ['workbaskets', 'classifications', 'monitor', 'workplace', 'access-items-management', 'history'];
private detailRoutes: Array<string> = ['workbaskets', 'classifications', 'monitor', 'workplace', 'access-items-management', 'history'];
constructor(private router: Router) { }
constructor(private router: Router) { }
selectRoute(value) {
this.selectedRouteTriggered.next(this.getRoute(value));
selectRoute(value) {
this.selectedRouteTriggered.next(this.getRoute(value));
}
getSelectedRoute(): Observable<string> {
return this.selectedRouteTriggered.asObservable();
}
private getRoute(event): string {
if (!event) {
return this.checkUrl(this.router.url);
}
return this.checkUrl(event.url);
}
getSelectedRoute(): Observable<string> {
return this.selectedRouteTriggered.asObservable();
}
private getRoute(event): string {
if (!event) {
return this.checkUrl(this.router.url);
}
return this.checkUrl(event.url);
}
private checkUrl(url: string): string {
for (const routeDetail of this.detailRoutes) {
if (url.indexOf(routeDetail) !== -1) {
return routeDetail;
}
}
return '';
private checkUrl(url: string): string {
for (const routeDetail of this.detailRoutes) {
if (url.indexOf(routeDetail) !== -1) {
return routeDetail;
}
}
return '';
}
}

View File

@ -17,8 +17,8 @@ describe('StartupService', () => {
taskanaLogoutUrl: someLogoutUrl
};
let httpMock; let
service;
let httpMock;
let service;
beforeEach(() => {
TestBed.configureTestingModule({

View File

@ -16,7 +16,7 @@ export class StartupService {
private taskanaEngineService: TaskanaEngineService,
private injector: Injector,
private window: WindowRefService
) {
) {
}
public get router(): Router {
@ -38,7 +38,7 @@ export class StartupService {
}
this.customFieldsService.initCustomFields('EN', jsonFile);
})).toPromise()
.catch(() => of(true));
.catch(() => of(true));
}
geCustomizedFieldsFilePromise() {
@ -47,7 +47,7 @@ export class StartupService {
this.customFieldsService.initCustomFields('EN', jsonFile);
}
})).toPromise()
.catch(() => of(true));
.catch(() => of(true));
}
private loadEnvironment() {

View File

@ -39,9 +39,9 @@ export class TaskanaEngineServiceMock {
private findRole(roles2Find: Array<string>) {
return this.currentUserInfo.roles.find(role => roles2Find.some(roleLookingFor => {
if (role === roleLookingFor) {
return true;
}
}));
if (role === roleLookingFor) {
return true;
}
}));
}
}

View File

@ -21,7 +21,7 @@ export class TaskanaEngineService {
data => {
this.currentUserInfo = data;
}
)).toPromise();
)).toPromise();
}
hasRole(roles2Find: Array<string>): boolean {
@ -49,9 +49,9 @@ export class TaskanaEngineService {
private findRole(roles2Find: Array<string>) {
return this.currentUserInfo.roles.find(role => roles2Find.some(roleLookingFor => {
if (role === roleLookingFor) {
return true;
}
}));
if (role === roleLookingFor) {
return true;
}
}));
}
}

View File

@ -3,15 +3,15 @@ import { Subject } from 'rxjs';
@Injectable()
export class TreeService {
public removedNodeId = new Subject<string>();
public removedNodeId = new Subject<string>();
constructor() { }
constructor() { }
setRemovedNodeId(value: string) {
this.removedNodeId.next(value);
}
setRemovedNodeId(value: string) {
this.removedNodeId.next(value);
}
getRemovedNodeId() {
return this.removedNodeId.asObservable();
}
getRemovedNodeId() {
return this.removedNodeId.asObservable();
}
}

View File

@ -3,16 +3,16 @@ import { Injectable } from '@angular/core';
// This interface is optional, showing how you can add strong typings for custom globals.
// Just use "Window" as the type if you don't have custom global stuff
export interface IWindowService extends Window {
__custom_global_stuff: string;
__custom_global_stuff: string;
}
function getWindow(): any {
return window;
return window;
}
@Injectable()
export class WindowRefService {
get nativeWindow(): IWindowService {
return getWindow();
}
get nativeWindow(): IWindowService {
return getWindow();
}
}

View File

@ -9,7 +9,7 @@ describe('AlertComponent', () => {
let component: AlertComponent;
let fixture: ComponentFixture<AlertComponent>;
let debugElement;
let alertService;
let alertService;
beforeEach(async(() => {
TestBed.configureTestingModule({

View File

@ -1,49 +1,49 @@
import { trigger, style, transition, animate, keyframes, state } from '@angular/animations';
export const expandDown = trigger('toggleDown', [
state('true', style({ opacity: '1', display: 'initial' })),
state('false', style({ opacity: '0', display: 'none' })),
transition('false => true', animate('300ms ease-in', keyframes([
style({ opacity: 0, height: '0px' }),
style({ opacity: 0.5, height: '50px' }),
style({ opacity: 1, height: '*' })]))),
transition('true => false', animate('300ms ease-out', keyframes([
style({ opacity: 1, height: '*' }),
style({ opacity: 0.5, height: '50px' }),
style({ opacity: 0, height: '0px' })])))
]);
state('true', style({ opacity: '1', display: 'initial' })),
state('false', style({ opacity: '0', display: 'none' })),
transition('false => true', animate('300ms ease-in', keyframes([
style({ opacity: 0, height: '0px' }),
style({ opacity: 0.5, height: '50px' }),
style({ opacity: 1, height: '*' })]))),
transition('true => false', animate('300ms ease-out', keyframes([
style({ opacity: 1, height: '*' }),
style({ opacity: 0.5, height: '50px' }),
style({ opacity: 0, height: '0px' })])))
]);
export const expandRight = trigger('toggleRight', [
transition('void => *', animate('300ms ease-in', keyframes([
style({ opacity: 0, width: '0px' }),
style({ opacity: 1, width: '150px' }),
style({ opacity: 1, width: '*' })]))),
transition('* => void', animate('300ms ease-out', keyframes([
style({ opacity: 1, width: '*' }),
style({ opacity: 0, width: '150px' }),
style({ opacity: 0, width: '0px' })])))
transition('void => *', animate('300ms ease-in', keyframes([
style({ opacity: 0, width: '0px' }),
style({ opacity: 1, width: '150px' }),
style({ opacity: 1, width: '*' })]))),
transition('* => void', animate('300ms ease-out', keyframes([
style({ opacity: 1, width: '*' }),
style({ opacity: 0, width: '150px' }),
style({ opacity: 0, width: '0px' })])))
]);
export const expandTop = trigger('toggleTop', [
state('in', style({ transform: 'translateY(0)', overflow: 'hidden' })),
transition('void => *', [
style({ transform: 'translateY(100%)', overflow: 'hidden' }),
animate(100)
]),
transition('* => void', [
animate(100, style({ transform: 'translateY(100%)', overflow: 'hidden' }))
])
state('in', style({ transform: 'translateY(0)', overflow: 'hidden' })),
transition('void => *', [
style({ transform: 'translateY(100%)', overflow: 'hidden' }),
animate(100)
]),
transition('* => void', [
animate(100, style({ transform: 'translateY(100%)', overflow: 'hidden' }))
])
]);
export const opacity = trigger('toggleOpacity', [
state('*', style({ opacity: '1' })),
state('void', style({ opacity: '0' })),
transition('void => *', animate('300ms ease-in', keyframes([
style({ opacity: 0 }),
style({ opacity: 0.5 }),
style({ opacity: 1 })]))),
transition('* => void', animate('300ms ease-out', keyframes([
style({ opacity: 1 }),
style({ opacity: 0.5 }),
style({ opacity: 0 })])))
state('*', style({ opacity: '1' })),
state('void', style({ opacity: '0' })),
transition('void => *', animate('300ms ease-in', keyframes([
style({ opacity: 0 }),
style({ opacity: 0.5 }),
style({ opacity: 1 })]))),
transition('* => void', animate('300ms ease-out', keyframes([
style({ opacity: 1 }),
style({ opacity: 0.5 }),
style({ opacity: 0 })])))
]);

View File

@ -1,12 +1,12 @@
import { trigger, style, transition, animate, keyframes } from '@angular/animations';
export const highlight = trigger('validation', [
transition('true => false, false => true, * => true', animate('1500ms', keyframes([
style({ opacity: '1' }),
style({ opacity: '0.3' }),
style({ opacity: '1' }),
style({ opacity: '0.3' }),
style({ opacity: '1' }),
style({ opacity: '0.3' }),
style({ opacity: '1' })])))
transition('true => false, false => true, * => true', animate('1500ms', keyframes([
style({ opacity: '1' }),
style({ opacity: '0.3' }),
style({ opacity: '1' }),
style({ opacity: '0.3' }),
style({ opacity: '1' }),
style({ opacity: '0.3' }),
style({ opacity: '1' })])))
]);

View File

@ -10,7 +10,7 @@ describe('FieldErrorDisplayComponent', () => {
TestBed.configureTestingModule({
declarations: [FieldErrorDisplayComponent]
})
.compileComponents();
.compileComponents();
}));
beforeEach(() => {

View File

@ -8,8 +8,8 @@ import { FilterComponent } from './filter.component';
describe('FilterComponent', () => {
let component: FilterComponent;
let fixture: ComponentFixture<FilterComponent>;
let debugElement: any;
let fixture: ComponentFixture<FilterComponent>;
let debugElement: any;
beforeEach(done => {
@ -24,10 +24,10 @@ describe('FilterComponent', () => {
component = fixture.componentInstance;
component.filterParams = {
name: 'someName',
owner: 'someOwner',
description: 'someDescription',
owner: 'someOwner',
description: 'someDescription',
key: 'someKey',
type: 'PERSONAL'
type: 'PERSONAL'
};
debugElement = fixture.debugElement.nativeElement;
fixture.detectChanges();
@ -60,10 +60,10 @@ type: 'PERSONAL'
it('should be able to clear all fields after pressing clear button', () => {
component.filterParams = {
name: 'someName',
owner: 'someOwner',
description: 'someDescription',
owner: 'someOwner',
description: 'someDescription',
key: 'someKey',
type: 'PERSONAL'
type: 'PERSONAL'
};
fixture.detectChanges();
debugElement.querySelector('[title="Clear"]').click();

View File

@ -10,10 +10,10 @@ import { TaskanaType } from 'app/models/taskana-type';
})
export class FilterComponent implements OnInit {
@Input() allTypes: Map<string, string> = new Map([['ALL', 'All'], ['PERSONAL', 'Personal'], ['GROUP', 'Group'],
['CLEARANCE', 'Clearance'], ['TOPIC', 'Topic']]);
['CLEARANCE', 'Clearance'], ['TOPIC', 'Topic']]);
@Input() allStates: Map<string, string> = new Map([['ALL', 'All'], ['READY', 'Ready'], ['CLAIMED', 'Claimed'],
['COMPLETED', 'Completed']]);
['COMPLETED', 'Completed']]);
@Input() filterParams = { name: '', key: '', type: '', description: '', owner: '' };

View File

@ -10,7 +10,7 @@ describe('GeneralMessageModalComponent', () => {
TestBed.configureTestingModule({
declarations: [GeneralMessageModalComponent]
})
.compileComponents();
.compileComponents();
}));
beforeEach(() => {

View File

@ -26,8 +26,10 @@ export class DummyDetailComponent {
}
describe('MasterAndDetailComponent ', () => {
let component; let fixture; let debugElement; let
router;
let component;
let fixture;
let debugElement;
let router;
const routes: Routes = [
{

View File

@ -3,61 +3,61 @@ import { Router, ActivatedRoute, NavigationStart, RouterEvent } from '@angular/r
import { MasterAndDetailService } from 'app/services/masterAndDetail/master-and-detail.service';
@Component({
selector: 'taskana-master-and-detail',
templateUrl: './master-and-detail.component.html',
styleUrls: ['./master-and-detail.component.scss'],
selector: 'taskana-master-and-detail',
templateUrl: './master-and-detail.component.html',
styleUrls: ['./master-and-detail.component.scss'],
})
export class MasterAndDetailComponent implements OnInit {
private classifications = 'classifications';
private workbaskets = 'workbaskets';
private tasks = 'tasks';
private detailRoutes: Array<string> = ['/workbaskets/(detail', 'classifications/(detail', 'tasks/(detail'];
private classifications = 'classifications';
private workbaskets = 'workbaskets';
private tasks = 'tasks';
private detailRoutes: Array<string> = ['/workbaskets/(detail', 'classifications/(detail', 'tasks/(detail'];
showDetail = false;
currentRoute = '';
constructor(private route: ActivatedRoute, private router: Router, private masterAndDetailService: MasterAndDetailService) {
}
showDetail = false;
currentRoute = '';
constructor(private route: ActivatedRoute, private router: Router, private masterAndDetailService: MasterAndDetailService) {
}
ngOnInit(): void {
this.showDetail = this.showDetails();
ngOnInit(): void {
this.showDetail = this.showDetails();
this.masterAndDetailService.setShowDetail(this.showDetail);
this.router.events.subscribe(event => {
if (event instanceof NavigationStart) {
this.showDetail = this.showDetails(event);
this.masterAndDetailService.setShowDetail(this.showDetail);
this.router.events.subscribe(event => {
if (event instanceof NavigationStart) {
this.showDetail = this.showDetails(event);
this.masterAndDetailService.setShowDetail(this.showDetail);
}
});
}
}
});
}
backClicked(): void {
this.router.navigate(['../'], { relativeTo: this.route });
}
backClicked(): void {
this.router.navigate(['../'], { relativeTo: this.route });
}
private showDetails(event?: RouterEvent): boolean {
if (!event) {
return this.checkUrl(this.router.url);
}
return this.checkUrl(event.url);
private showDetails(event?: RouterEvent): boolean {
if (!event) {
return this.checkUrl(this.router.url);
}
return this.checkUrl(event.url);
}
private checkUrl(url: string): boolean {
this.checkRoute(url);
for (const routeDetail of this.detailRoutes) {
if (url.indexOf(routeDetail) !== -1) {
return true;
}
}
return false;
private checkUrl(url: string): boolean {
this.checkRoute(url);
for (const routeDetail of this.detailRoutes) {
if (url.indexOf(routeDetail) !== -1) {
return true;
}
}
return false;
}
private checkRoute(url: string) {
if (url.indexOf(this.workbaskets) !== -1) {
this.currentRoute = this.workbaskets;
} else if (url.indexOf(this.classifications) !== -1) {
this.currentRoute = this.classifications;
} else if (url.indexOf(this.tasks) !== -1) {
this.currentRoute = this.tasks;
}
private checkRoute(url: string) {
if (url.indexOf(this.workbaskets) !== -1) {
this.currentRoute = this.workbaskets;
} else if (url.indexOf(this.classifications) !== -1) {
this.currentRoute = this.classifications;
} else if (url.indexOf(this.tasks) !== -1) {
this.currentRoute = this.tasks;
}
}
}

View File

@ -2,20 +2,20 @@ import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'mapValues' })
export class MapValuesPipe implements PipeTransform {
transform(value: any, args?: any[]): Object[] {
const returnArray = [];
transform(value: any, args?: any[]): Object[] {
const returnArray = [];
if (!value) {
return returnArray;
}
value.forEach((entryVal, entryKey) => {
returnArray.push({
key: entryKey,
value: entryVal
});
});
return returnArray;
if (!value) {
return returnArray;
}
value.forEach((entryVal, entryKey) => {
returnArray.push({
key: entryKey,
value: entryVal
});
});
return returnArray;
}
}

View File

@ -2,16 +2,16 @@ import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'removeEmptyType' })
export class RemoveNoneTypePipe implements PipeTransform {
transform(value: any): Object[] {
const returnArray = [];
value.forEach(entry => {
if (entry.key !== '') {
returnArray.push({
key: entry.key,
value: entry.value
});
}
transform(value: any): Object[] {
const returnArray = [];
value.forEach(entry => {
if (entry.key !== '') {
returnArray.push({
key: entry.key,
value: entry.value
});
return returnArray;
}
}
});
return returnArray;
}
}

View File

@ -3,22 +3,22 @@ import { TaskanaQueryParameters } from 'app/shared/util/query-parameters';
@Pipe({ name: 'selectWorkbaskets' })
export class SelectWorkBasketPipe implements PipeTransform {
transform(originArray: any, selectionArray: any, arg1: any): Object[] {
let returnArray = [];
if (!originArray || !selectionArray) {
return returnArray;
}
for (let index = originArray.length - 1; index >= 0; index--) {
if ((arg1 && !selectionArray.some(elementToRemove => originArray[index].workbasketId === elementToRemove.workbasketId))
|| !arg1 && selectionArray.some(elementToRemove => originArray[index].workbasketId === elementToRemove.workbasketId)) {
originArray.splice(index, 1);
}
}
if (originArray.length > TaskanaQueryParameters.pageSize) {
originArray.slice(0, TaskanaQueryParameters.pageSize);
}
returnArray = originArray;
return returnArray;
transform(originArray: any, selectionArray: any, arg1: any): Object[] {
let returnArray = [];
if (!originArray || !selectionArray) {
return returnArray;
}
for (let index = originArray.length - 1; index >= 0; index--) {
if ((arg1 && !selectionArray.some(elementToRemove => originArray[index].workbasketId === elementToRemove.workbasketId))
|| !arg1 && selectionArray.some(elementToRemove => originArray[index].workbasketId === elementToRemove.workbasketId)) {
originArray.splice(index, 1);
}
}
if (originArray.length > TaskanaQueryParameters.pageSize) {
originArray.slice(0, TaskanaQueryParameters.pageSize);
}
returnArray = originArray;
return returnArray;
}
}

Some files were not shown because too many files have changed in this diff Show More