TSK-975: Remove unnecessary initializers

This commit is contained in:
BVier 2019-12-09 10:13:32 +01:00 committed by Mustapha Zorgati
parent e5102daf16
commit 22b0b2170b
64 changed files with 325 additions and 318 deletions

View File

@ -173,10 +173,10 @@
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<ul *ngIf="belongingGroups !== undefined && belongingGroups.length > 0 " class="list-group"> <ul *ngIf="belongingGroups && belongingGroups.length > 0 " class="list-group">
<li *ngFor="let group of belongingGroups" class="list-group-item">{{group.name}}</li> <li *ngFor="let group of belongingGroups" class="list-group-item">{{group.name}}</li>
</ul> </ul>
<p *ngIf="belongingGroups === undefined || belongingGroups.length === 0">The user is not associated to <p *ngIf="!belongingGroups">The user is not associated to
any groups</p> any groups</p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
@ -194,4 +194,4 @@
</form> </form>
</div> </div>
</div> </div>
</div> </div>

View File

@ -67,9 +67,8 @@ describe('ClassificationDetailsComponent', () => {
spyOn(classificationCategoriesService, 'getCategories').and.returnValue(of(['firstCategory', 'secondCategory'])); spyOn(classificationCategoriesService, 'getCategories').and.returnValue(of(['firstCategory', 'secondCategory']));
spyOn(classificationsService, 'deleteClassification').and.returnValue(of(true)); spyOn(classificationsService, 'deleteClassification').and.returnValue(of(true));
spyOn(classificationCategoriesService, 'getCategoryIcon').and.returnValue(new Pair('assets/icons/categories/external.svg')); spyOn(classificationCategoriesService, 'getCategoryIcon').and.returnValue(new Pair('assets/icons/categories/external.svg'));
component.classification = new ClassificationDefinition('id1', undefined, undefined, undefined, undefined, undefined, undefined, component.classification = new ClassificationDefinition('id1');
undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, component.classification._links = new LinksClassification({ 'self': '' });
undefined, undefined, undefined, undefined, new LinksClassification({ 'self': '' }));
treeService = TestBed.get(TreeService); treeService = TestBed.get(TreeService);
fixture.detectChanges(); fixture.detectChanges();
done(); done();

View File

@ -102,18 +102,18 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
this.routeSubscription = this.route.params.subscribe(params => { this.routeSubscription = this.route.params.subscribe(params => {
let id = params['id']; let id = params['id'];
this.action = undefined; delete this.action;
if (id && id.indexOf('new-classification') !== -1) { if (id && id.indexOf('new-classification') !== -1) {
this.action = ACTION.CREATE; this.action = ACTION.CREATE;
this.badgeMessage = 'Creating new classification'; this.badgeMessage = 'Creating new classification';
id = id.replace('new-classification/', ''); id = id.replace('new-classification/', '');
if (id === 'undefined') { if (id === 'undefined') {
id = undefined; id = '';
} }
this.fillClassificationInformation(this.classification ? this.classification : new ClassificationDefinition()) this.fillClassificationInformation(this.classification ? this.classification : new ClassificationDefinition())
} }
if (!this.classification || this.classification.classificationId !== id && id && id !== '') { if (!this.classification || this.classification.classificationId !== id && id ) {
this.selectClassification(id); this.selectClassification(id);
} }
}); });
@ -140,7 +140,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
} }
backClicked(): void { backClicked(): void {
this.classificationsService.selectClassification(undefined); this.classificationsService.selectClassification();
this.router.navigate(['./'], { relativeTo: this.route.parent }); this.router.navigate(['./'], { relativeTo: this.route.parent });
} }
@ -167,8 +167,8 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
} }
private initProperties() { private initProperties() {
this.classification = undefined; delete this.classification;
this.action = undefined delete this.action;
} }
private async onSave() { private async onSave() {
@ -287,9 +287,9 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
.deleteClassification(this.classification._links.self.href) .deleteClassification(this.classification._links.self.href)
.subscribe(() => { .subscribe(() => {
const key = this.classification.key; const key = this.classification.key;
this.classification = undefined; delete this.classification;
this.afterRequest(); this.afterRequest();
this.classificationsService.selectClassification(undefined); this.classificationsService.selectClassification();
this.router.navigate(['taskana/administration/classifications']); this.router.navigate(['taskana/administration/classifications']);
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Classification ${key} was removed successfully`)) this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Classification ${key} was removed successfully`))
}, error => { }, error => {

View File

@ -75,10 +75,10 @@ export class ClassificationListComponent implements OnInit, OnDestroy {
this.classifications = []; this.classifications = [];
this.categoryService.selectClassificationType(classificationTypeSelected); this.categoryService.selectClassificationType(classificationTypeSelected);
this.getClassifications(); this.getClassifications();
this.selectClassification(undefined); this.selectClassification();
} }
selectClassification(id: string) { selectClassification(id?: string) {
this.selectedId = id; this.selectedId = id;
if (!id) { if (!id) {
this.router.navigate(['taskana/administration/classifications']); this.router.navigate(['taskana/administration/classifications']);
@ -128,7 +128,7 @@ export class ClassificationListComponent implements OnInit, OnDestroy {
} }
private getClassifications(key: string = undefined) { private getClassifications(key?: string) {
this.requestInProgress = true; this.requestInProgress = true;
this.classificationService.getClassifications() this.classificationService.getClassifications()
.subscribe((classifications: Array<TreeNodeModel>) => { .subscribe((classifications: Array<TreeNodeModel>) => {

View File

@ -87,7 +87,7 @@ export class ImportExportComponent implements OnInit {
break; break;
default: default:
file.value = ''; file.value = '';
this.generalModalService.triggerMessage(new MessageModal(undefined, this.generalModalService.triggerMessage(new MessageModal('Wrong format',
`This file format is not allowed! Please use a .json file.`)); `This file format is not allowed! Please use a .json file.`));
} }
return check; return check;
@ -133,7 +133,7 @@ export class ImportExportComponent implements OnInit {
message message
) )
); );
this.selectedFileInput.files = undefined; delete this.selectedFileInput.files;
this.resetProgress(); this.resetProgress();
} }
} }

View File

@ -19,7 +19,7 @@ export class IconTypeComponent implements OnInit {
tooltip = false; tooltip = false;
@Input() @Input()
text: string = undefined; text: string;
public static get allTypes(): Map<string, string> { public static get allTypes(): Map<string, string> {
return new Map([['PERSONAL', 'Personal'], ['GROUP', 'Group'], ['CLEARANCE', 'Clearance'], ['TOPIC', 'Topic']]) return new Map([['PERSONAL', 'Personal'], ['GROUP', 'Group'], ['CLEARANCE', 'Clearance'], ['TOPIC', 'Topic']])

View File

@ -42,8 +42,11 @@ describe('AccessItemsComponent', () => {
configureTests(configure).then(testBed => { configureTests(configure).then(testBed => {
fixture = TestBed.createComponent(AccessItemsComponent); fixture = TestBed.createComponent(AccessItemsComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
component.workbasket = new Workbasket('1', '', '', '', ICONTYPES.TOPIC, '', '', '', '', '', '', '', '', '', '', '', '', component.workbasket = new Workbasket('1');
new Links(undefined, undefined, { 'href': 'someurl' })); component.workbasket.type = ICONTYPES.TOPIC;
component.workbasket._links = new Links()
component.workbasket._links.accessItems = { 'href': 'someurl' };
workbasketService = TestBed.get(WorkbasketService); workbasketService = TestBed.get(WorkbasketService);
alertService = TestBed.get(AlertService); alertService = TestBed.get(AlertService);
spyOn(workbasketService, 'getWorkBasketAccessItems').and.returnValue(of(new WorkbasketAccessItemsResource( spyOn(workbasketService, 'getWorkBasketAccessItems').and.returnValue(of(new WorkbasketAccessItemsResource(

View File

@ -123,11 +123,13 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
} }
addAccessItem() { addAccessItem() {
const newForm = this.formBuilder.group( const workbasketAccessItems = new WorkbasketAccessItems();
new WorkbasketAccessItems(undefined, this.workbasket.workbasketId, '', '', true)); workbasketAccessItems.workbasketId = this.workbasket.workbasketId;
workbasketAccessItems.permRead = true;
const newForm = this.formBuilder.group(workbasketAccessItems);
newForm.controls['accessId'].setValidators(Validators.required); newForm.controls['accessId'].setValidators(Validators.required);
this.accessItemsGroups.push(newForm); this.accessItemsGroups.push(newForm);
this.accessItemsClone.push(new WorkbasketAccessItems(undefined, this.workbasket.workbasketId, '', '', true)); this.accessItemsClone.push(workbasketAccessItems);
} }
clear() { clear() {
@ -200,7 +202,7 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
} }
private setWorkbasketIdForCopy(workbasketId: string) { private setWorkbasketIdForCopy(workbasketId: string) {
this.accessItemsGroups.value.forEach(element => { this.accessItemsGroups.value.forEach(element => {
element.accessItemId = undefined; delete element.accessItemId;
element.workbasketId = workbasketId; element.workbasketId = workbasketId;
}); });
} }

View File

@ -140,16 +140,16 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
} }
performFilter(dualListFilter: any) { performFilter(dualListFilter: any) {
dualListFilter.side === Side.RIGHT ? this.distributionTargetsRight = undefined : this.distributionTargetsLeft = undefined; dualListFilter.side === Side.RIGHT ? delete this.distributionTargetsRight : delete this.distributionTargetsLeft;
this.onRequest(dualListFilter.side, false); this.onRequest(false, dualListFilter.side);
this.workbasketFilterSubscription = this.workbasketService.getWorkBasketsSummary(true, undefined, undefined, undefined, this.workbasketFilterSubscription = this.workbasketService.getWorkBasketsSummary(true, '', '', '',
dualListFilter.filterBy.filterParams.name, dualListFilter.filterBy.filterParams.description, undefined, dualListFilter.filterBy.filterParams.name, dualListFilter.filterBy.filterParams.description, '',
dualListFilter.filterBy.filterParams.owner, dualListFilter.filterBy.filterParams.type, undefined, dualListFilter.filterBy.filterParams.owner, dualListFilter.filterBy.filterParams.type, '',
dualListFilter.filterBy.filterParams.key, undefined, true).subscribe(resultList => { dualListFilter.filterBy.filterParams.key, '', true).subscribe(resultList => {
(dualListFilter.side === Side.RIGHT) ? (dualListFilter.side === Side.RIGHT) ?
this.distributionTargetsRight = (resultList.workbaskets) : this.distributionTargetsRight = (resultList.workbaskets) :
this.distributionTargetsLeft = (resultList.workbaskets); this.distributionTargetsLeft = (resultList.workbaskets);
this.onRequest(dualListFilter.side, true); this.onRequest(true, dualListFilter.side);
}); });
} }
@ -162,7 +162,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
} }
private init() { private init() {
this.onRequest(undefined); this.onRequest();
if (!this.workbasket._links.distributionTargets) { if (!this.workbasket._links.distributionTargets) {
return; return;
} }
@ -215,9 +215,8 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
TaskanaQueryParameters.pageSize = this.cards + this.distributionTargetsSelected.length; TaskanaQueryParameters.pageSize = this.cards + this.distributionTargetsSelected.length;
} }
this.workbasketSubscription = this.workbasketService.getWorkBasketsSummary(true, this.workbasketSubscription = this.workbasketService.getWorkBasketsSummary(true)
undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, .subscribe(
undefined, undefined, undefined, false).subscribe(
(distributionTargetsAvailable: WorkbasketSummaryResource) => { (distributionTargetsAvailable: WorkbasketSummaryResource) => {
if (TaskanaQueryParameters.page === 1) { if (TaskanaQueryParameters.page === 1) {
this.distributionTargetsLeft = []; this.distributionTargetsLeft = [];
@ -232,7 +231,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
this.distributionTargetsRight = Object.assign([], distributionTargetsAvailable.workbaskets); this.distributionTargetsRight = Object.assign([], distributionTargetsAvailable.workbaskets);
this.distributionTargetsClone = Object.assign([], distributionTargetsAvailable.workbaskets); this.distributionTargetsClone = Object.assign([], distributionTargetsAvailable.workbaskets);
} }
this.onRequest(undefined, true); this.onRequest(true);
}); });
} }
@ -255,16 +254,16 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
return originList; return originList;
} }
private onRequest(side: Side = undefined, finished: boolean = false) { private onRequest(finished: boolean = false, side?: Side) {
if (this.loadingItems) { if (this.loadingItems) {
this.loadingItems = false; this.loadingItems = false;
} }
if (finished) { if (finished) {
side === undefined ? (this.requestInProgressLeft = false, this.requestInProgressRight = false) : typeof side === 'undefined' ? (this.requestInProgressLeft = false, this.requestInProgressRight = false) :
side === Side.LEFT ? this.requestInProgressLeft = false : this.requestInProgressRight = false; side === Side.LEFT ? this.requestInProgressLeft = false : this.requestInProgressRight = false;
return; return;
} }
side === undefined ? (this.requestInProgressLeft = true, this.requestInProgressRight = true) : typeof side === 'undefined' ? (this.requestInProgressLeft = true, this.requestInProgressRight = true) :
side === Side.LEFT ? this.requestInProgressLeft = true : this.requestInProgressRight = true; side === Side.LEFT ? this.requestInProgressLeft = true : this.requestInProgressRight = true;
} }

View File

@ -101,7 +101,7 @@ describe('WorkbasketInformationComponent', () => {
it('should create a copy of workbasket when workbasket is selected', () => { it('should create a copy of workbasket when workbasket is selected', () => {
expect(component.workbasketClone).toBeUndefined(); expect(component.workbasketClone).toBeUndefined();
component.workbasket = new Workbasket('id', 'created', 'keyModified', 'domain', ICONTYPES.TOPIC, 'modified', 'name', 'description', component.workbasket = new Workbasket('id', 'created', 'keyModified', 'domain', ICONTYPES.TOPIC, 'modified', 'name', 'description',
'owner', 'custom1', 'custom2', 'custom3', 'custom4', 'orgLevel1', 'orgLevel2', 'orgLevel3', 'orgLevel4', null); 'owner', 'custom1', 'custom2', 'custom3', 'custom4', 'orgLevel1', 'orgLevel2', 'orgLevel3', 'orgLevel4');
component.ngOnChanges( component.ngOnChanges(
undefined undefined
); );
@ -185,12 +185,14 @@ describe('WorkbasketInformationComponent', () => {
})); }));
it('should trigger requestInProgress service true before and requestInProgress false after remove a workbasket', () => { it('should trigger requestInProgress service true before and requestInProgress false after remove a workbasket', () => {
const links = new Links({ 'href': 'someUrl' });
links.removeDistributionTargets = { 'href': 'someUrl' };
const workbasket = new Workbasket(undefined, 'created', 'keyModified', 'domain', ICONTYPES.TOPIC, const workbasket = new Workbasket(undefined, 'created', 'keyModified', 'domain', ICONTYPES.TOPIC,
'modified', 'name', 'description', 'owner', 'custom1', 'custom2', 'modified', 'name', 'description', 'owner', 'custom1', 'custom2',
'custom3', 'custom4', 'orgLevel1', 'orgLevel2', 'custom3', 'custom4', 'orgLevel1', 'orgLevel2',
'orgLevel3', 'orgLevel4', new Links({ 'href': 'someUrl' }, undefined, undefined, undefined, { 'href': 'someUrl' })); 'orgLevel3', 'orgLevel4', links);
component.workbasket = workbasket; component.workbasket = workbasket;
spyOn(workbasketService, 'removeDistributionTarget').and.returnValue(of('')); spyOn(workbasketService, 'removeDistributionTarget').and.returnValue(of(undefined));
const requestInProgressServiceSpy = spyOn(requestInProgressService, 'setRequestInProgress'); const requestInProgressServiceSpy = spyOn(requestInProgressService, 'setRequestInProgress');
component.removeDistributionTargets(); component.removeDistributionTargets();

View File

@ -20,7 +20,7 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
workbasket: Workbasket; workbasket: Workbasket;
workbasketCopy: Workbasket; workbasketCopy: Workbasket;
selectedId: string = undefined; selectedId: string;
showDetail = false; showDetail = false;
requestInProgress = false; requestInProgress = false;
action: string; action: string;
@ -46,32 +46,30 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
ngOnInit() { ngOnInit() {
this.workbasketSelectedSubscription = this.service.getSelectedWorkBasket().subscribe(workbasketIdSelected => { this.workbasketSelectedSubscription = this.service.getSelectedWorkBasket().subscribe(workbasketIdSelected => {
this.workbasket = undefined; delete this.workbasket;
this.getWorkbasketInformation(workbasketIdSelected); this.getWorkbasketInformation(workbasketIdSelected);
}); });
this.routeSubscription = this.route.params.subscribe(params => { this.routeSubscription = this.route.params.subscribe(params => {
let id = params['id']; const id = params['id'];
this.action = undefined; delete this.action;
if (id && id.indexOf('new-workbasket') !== -1) { if (id) {
this.tabSelected = 'information'; if (id.indexOf('new-workbasket') !== -1) {
this.action = ACTION.CREATE; this.tabSelected = 'information';
id = undefined; this.action = ACTION.CREATE;
this.getWorkbasketInformation(id); this.getWorkbasketInformation();
} else if (id && id.indexOf('copy-workbasket') !== -1) { } else if (id.indexOf('copy-workbasket') !== -1) {
if (!this.selectedId) { if (!this.selectedId) {
this.router.navigate(['./'], { relativeTo: this.route.parent }); this.router.navigate(['./'], { relativeTo: this.route.parent });
return; return;
}
this.action = ACTION.COPY;
delete this.workbasket.key;
this.workbasketCopy = this.workbasket;
this.getWorkbasketInformation();
} else {
this.selectWorkbasket(id);
} }
this.action = ACTION.COPY;
this.workbasket.key = undefined;
this.workbasketCopy = this.workbasket;
id = undefined;
this.getWorkbasketInformation(id, this.selectedId);
}
if (id && id !== '') {
this.selectWorkbasket(id);
} }
}); });
@ -79,13 +77,13 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
this.showDetail = showDetail; this.showDetail = showDetail;
}); });
this.importingExportingSubscription = this.importExportService.getImportingFinished().subscribe((value: Boolean) => { this.importingExportingSubscription = this.importExportService.getImportingFinished().subscribe(() => {
if (this.workbasket) { this.getWorkbasketInformation(this.workbasket.workbasketId); } if (this.workbasket) { this.getWorkbasketInformation(this.workbasket.workbasketId); }
}) })
} }
backClicked(): void { backClicked(): void {
this.service.selectWorkBasket(undefined); this.service.selectWorkBasket();
this.router.navigate(['./'], { relativeTo: this.route.parent }); this.router.navigate(['./'], { relativeTo: this.route.parent });
} }
@ -98,18 +96,18 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
this.service.selectWorkBasket(id); this.service.selectWorkBasket(id);
} }
private getWorkbasketInformation(workbasketIdSelected: string, copyId: string = undefined) { private getWorkbasketInformation(workbasketIdSelected?: string) {
this.requestInProgress = true; this.requestInProgress = true;
if (!workbasketIdSelected && this.action === ACTION.CREATE) { // CREATE if (!workbasketIdSelected && this.action === ACTION.CREATE) { // CREATE
this.workbasket = new Workbasket(undefined); this.workbasket = new Workbasket();
this.domainSubscription = this.domainService.getSelectedDomain().subscribe(domain => { this.domainSubscription = this.domainService.getSelectedDomain().subscribe(domain => {
this.workbasket.domain = domain; this.workbasket.domain = domain;
}); });
this.requestInProgress = false; this.requestInProgress = false;
} else if (!workbasketIdSelected && this.action === ACTION.COPY) { // COPY } else if (!workbasketIdSelected && this.action === ACTION.COPY) { // COPY
this.workbasket = { ...this.workbasketCopy }; this.workbasket = { ...this.workbasketCopy };
this.workbasket.workbasketId = undefined; delete this.workbasket.workbasketId;
this.requestInProgress = false; this.requestInProgress = false;
} }
if (workbasketIdSelected) { if (workbasketIdSelected) {

View File

@ -65,8 +65,9 @@ describe('WorkbasketListToolbarComponent', () => {
debugElement = fixture.debugElement.nativeElement; debugElement = fixture.debugElement.nativeElement;
component = fixture.componentInstance; component = fixture.componentInstance;
component.workbaskets = new Array<WorkbasketSummary>( component.workbaskets = new Array<WorkbasketSummary>(
new WorkbasketSummary('1', 'key1', 'NAME1', 'description 1', 'owner 1', new WorkbasketSummary('1', 'key1', 'NAME1', 'description 1', 'owner 1'));
undefined, undefined, undefined, undefined, undefined, undefined, undefined, false, new Links({ 'href': 'selfLink' }))); component.workbaskets[0].markedForDeletion = false;
component.workbaskets[0]._links = new Links({ 'href': 'selfLink' });
fixture.detectChanges(); fixture.detectChanges();
done(); done();

View File

@ -49,7 +49,7 @@ export class WorkbasketListToolbarComponent implements OnInit {
} }
addWorkbasket() { addWorkbasket() {
this.workbasketService.selectWorkBasket(undefined); this.workbasketService.selectWorkBasket();
this.router.navigate([{ outlets: { detail: ['new-workbasket'] } }], { relativeTo: this.route }); this.router.navigate([{ outlets: { detail: ['new-workbasket'] } }], { relativeTo: this.route });
} }

View File

@ -36,5 +36,5 @@
</div> </div>
</ng-template> </ng-template>
</div> </div>
<taskana-pagination [(page)]="workbasketsResource !== undefined ? workbasketsResource.page : workbasketsResource" <taskana-pagination [(page)]="workbasketsResource ? workbasketsResource.page : workbasketsResource"
[type]="type" [numberOfItems]="workbaskets.length" (changePage)="changePage($event)"></taskana-pagination> [type]="type" [numberOfItems]="workbaskets.length" (changePage)="changePage($event)"></taskana-pagination>

View File

@ -53,7 +53,7 @@ const workbasketSummaryResource: WorkbasketSummaryResource = new WorkbasketSumma
describe('WorkbasketListComponent', () => { describe('WorkbasketListComponent', () => {
let component: WorkbasketListComponent; let component: WorkbasketListComponent;
let fixture: ComponentFixture<WorkbasketListComponent>; let fixture: ComponentFixture<WorkbasketListComponent>;
let debugElement: any = undefined; let debugElement: any;
let workbasketService: WorkbasketService; let workbasketService: WorkbasketService;
let workbasketSummarySpy; let workbasketSummarySpy;
@ -167,7 +167,7 @@ describe('WorkbasketListComponent', () => {
component.performFilter(filter); component.performFilter(filter);
expect(workbasketSummarySpy.calls.all()[1].args).toEqual([true, 'key', 'asc', expect(workbasketSummarySpy.calls.all()[1].args).toEqual([true, 'key', 'asc',
undefined, 'someName', 'someDescription', undefined, 'someOwner', 'PERSONAL', undefined, 'someKey', undefined]); '', 'someName', 'someDescription', '', 'someOwner', 'PERSONAL', '', 'someKey', '']);
})); }));

View File

@ -104,9 +104,9 @@ export class WorkbasketListComponent implements OnInit, OnDestroy {
this.requestInProgress = true; this.requestInProgress = true;
this.workbaskets = []; this.workbaskets = [];
this.workbasketServiceSubscription = this.workbasketService.getWorkBasketsSummary( this.workbasketServiceSubscription = this.workbasketService.getWorkBasketsSummary(
true, this.sort.sortBy, this.sort.sortDirection, undefined, true, this.sort.sortBy, this.sort.sortDirection, '',
this.filterBy.filterParams.name, this.filterBy.filterParams.description, undefined, this.filterBy.filterParams.owner, this.filterBy.filterParams.name, this.filterBy.filterParams.description, '', this.filterBy.filterParams.owner,
this.filterBy.filterParams.type, undefined, this.filterBy.filterParams.key, undefined) this.filterBy.filterParams.type, '', this.filterBy.filterParams.key, '')
.subscribe(resultList => { .subscribe(resultList => {
this.workbasketsResource = resultList; this.workbasketsResource = resultList;
this.workbaskets = resultList.workbaskets; this.workbaskets = resultList.workbaskets;

View File

@ -100,7 +100,7 @@ export class TaskQueryService {
parameters.CUSTOM_4_LIKE = custom4; parameters.CUSTOM_4_LIKE = custom4;
parameters.CREATED = created; parameters.CREATED = created;
if (allPages) { TaskanaQueryParameters.page = undefined; TaskanaQueryParameters.pageSize = undefined; } if (allPages) { delete TaskanaQueryParameters.page; delete TaskanaQueryParameters.pageSize; }
return TaskanaQueryParameters.getQueryParameters(parameters); return TaskanaQueryParameters.getQueryParameters(parameters);
} }

View File

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

View File

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

View File

@ -2,9 +2,9 @@ import { Links } from './links';
export class AccessItemWorkbasket { export class AccessItemWorkbasket {
constructor( constructor(
public accessItemId: string = '', public accessItemId: string,
public workbasketKey: string = '', public workbasketKey: string,
public accessId: string = '', public accessId: string,
public permRead: boolean = false, public permRead: boolean = false,
public permOpen: boolean = false, public permOpen: boolean = false,
public permAppend: boolean = false, public permAppend: boolean = false,
@ -22,6 +22,6 @@ export class AccessItemWorkbasket {
public permCustom10: boolean = false, public permCustom10: boolean = false,
public permCustom11: boolean = false, public permCustom11: boolean = false,
public permCustom12: boolean = false, public permCustom12: boolean = false,
public _links: Links = undefined public _links?: Links
) { } ) { }
} }

View File

@ -1,29 +1,29 @@
import { LinksClassification } from 'app/models/links-classfication'; import { LinksClassification } from 'app/models/links-classfication';
export class ClassificationDefinition { export class ClassificationDefinition {
constructor(public classificationId: string = undefined, constructor(public classificationId?: string,
public key: string = undefined, public key?: string,
public parentId: string = undefined, public parentId?: string,
public parentKey: string = undefined, public parentKey?: string,
public category: string = undefined, public category?: string,
public domain: string = undefined, public domain?: string,
public type: string = undefined, public type?: string,
public isValidInDomain: boolean = undefined, public isValidInDomain?: boolean,
public created: string = undefined, public created?: string,
public modified: string = undefined, public modified?: string,
public name: string = undefined, public name?: string,
public description: string = undefined, public description?: string,
public priority: number = undefined, public priority?: number,
public serviceLevel: string = undefined, public serviceLevel?: string,
public applicationEntryPoint: string = undefined, public applicationEntryPoint?: string,
public custom1: string = undefined, public custom1?: string,
public custom2: string = undefined, public custom2?: string,
public custom3: string = undefined, public custom3?: string,
public custom4: string = undefined, public custom4?: string,
public custom5: string = undefined, public custom5?: string,
public custom6: string = undefined, public custom6?: string,
public custom7: string = undefined, public custom7?: string,
public custom8: string = undefined, public custom8?: string,
public _links: LinksClassification = new LinksClassification()) { public _links?: LinksClassification) {
} }
} }

View File

@ -4,7 +4,7 @@ import { Links } from './links';
export class ClassificationResource { export class ClassificationResource {
constructor( constructor(
public classifications: Array<Classification> = [], public classifications: Array<Classification> = [],
public _links: Links = new Links(), public _links?: Links
) { ) {
} }
} }

View File

@ -1,15 +1,15 @@
import {Links} from 'app/models/links'; import {Links} from 'app/models/links';
export class Classification { export class Classification {
constructor(public classificationId: string = undefined, // newly created classifications don't have an id yet. constructor(public classificationId?: string, // newly created classifications don't have an id yet.
public key: string = undefined, public key?: string,
public category: string = undefined, public category?: string,
public type: string = undefined, public type?: string,
public domain: string = undefined, public domain?: string,
public name: string = undefined, public name?: string,
public parentId: string = undefined, public parentId?: string,
public priority: number = undefined, public priority?: number,
public serviceLevel: string = undefined, public serviceLevel?: string,
public _links: Links = new Links()) { public _links?: Links ) {
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,16 +1,16 @@
import { Classification } from 'app/models/classification'; import { Classification } from 'app/models/classification';
export class TreeNodeModel extends Classification { export class TreeNodeModel extends Classification {
constructor(public id: string = '', constructor(public id?: string,
public key: string = '', public key?: string,
public category: string = '', public category?: string,
public type: string = '', public type?: string,
public domain: string = '', public domain?: string,
public name: string = '', public name?: string,
public parentId: string = '', public parentId?: string,
public priority: number = 0, public priority?: number,
public serviceLevel: string = '', public serviceLevel?: string,
public children: Array<TreeNodeModel> = undefined) { public children: Array<TreeNodeModel> = []) {
super(id, key, category, type, domain, name, parentId, priority, serviceLevel); super(id, key, category, type, domain, name, parentId, priority, serviceLevel);
} }
} }

View File

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

View File

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

View File

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

View File

@ -23,6 +23,6 @@ export class WorkbasketAccessItems {
public permCustom10: boolean = false, public permCustom10: boolean = false,
public permCustom11: boolean = false, public permCustom11: boolean = false,
public permCustom12: boolean = false, public permCustom12: boolean = false,
public _links: Links = undefined public _links: Links = new Links()
) { } ) { }
} }

View File

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

View File

@ -4,20 +4,20 @@ import { Links } from './links';
export class WorkbasketSummary { export class WorkbasketSummary {
constructor( constructor(
public workbasketId: string = undefined, public workbasketId?: string,
public key: string = undefined, public key?: string,
public name: string = undefined, public name?: string,
public description: string = undefined, public description?: string,
public owner: string = undefined, public owner?: string,
public modified: string = undefined, public modified?: string,
public domain: string = undefined, public domain?: string,
public type: string = ICONTYPES.PERSONAL, public type: string = ICONTYPES.PERSONAL,
public orgLevel1: string = undefined, public orgLevel1?: string,
public orgLevel2: string = undefined, public orgLevel2?: string,
public orgLevel3: string = undefined, public orgLevel3?: string,
public orgLevel4: string = undefined, public orgLevel4?: string,
public markedForDeletion: boolean = false, public markedForDeletion: boolean = false,
public _links: Links = undefined, public _links?: Links,
public page: Page = undefined) { public page?: Page ) {
} }
} }

View File

@ -25,23 +25,23 @@ export class Workbasket {
} }
constructor( constructor(
public workbasketId: string, public workbasketId?: string,
public created: string = undefined, public created?: string,
public key: string = undefined, public key?: string,
public domain: string = undefined, public domain?: string,
public type: ICONTYPES = ICONTYPES.PERSONAL, public type: ICONTYPES = ICONTYPES.PERSONAL,
public modified: string = undefined, public modified?: string,
public name: string = undefined, public name?: string,
public description: string = undefined, public description?: string,
public owner: string = undefined, public owner?: string,
public custom1: string = undefined, public custom1?: string,
public custom2: string = undefined, public custom2?: string,
public custom3: string = undefined, public custom3?: string,
public custom4: string = undefined, public custom4?: string,
public orgLevel1: string = undefined, public orgLevel1?: string,
public orgLevel2: string = undefined, public orgLevel2?: string,
public orgLevel3: string = undefined, public orgLevel3?: string,
public orgLevel4: string = undefined, public orgLevel4?: string,
public _links: Links = new Links()) { public _links: Links = new Links()) {
} }
} }

View File

@ -15,7 +15,7 @@ describe('CustomFieldsService', () => {
it('should take default icon path', inject([CustomFieldsService], (service: CustomFieldsService) => { it('should take default icon path', inject([CustomFieldsService], (service: CustomFieldsService) => {
const categoriesData = {'DEFAULT': 'assets/icons/categories/default.svg'} const categoriesData = {'DEFAULT': 'assets/icons/categories/default.svg'}
const returnedValue = service.getCustomObject(categoriesData, undefined); const returnedValue = service.getCustomObject(categoriesData);
expect(returnedValue).toBe(categoriesData); expect(returnedValue).toBe(categoriesData);
expect(service).toBeTruthy(); expect(service).toBeTruthy();
})); }));

View File

@ -10,14 +10,14 @@ export class CustomFieldsService {
this.customizedFields = jsonFile[language]; this.customizedFields = jsonFile[language];
} }
getCustomField(fallbacktext: string, customPath: string = undefined): CustomField { getCustomField(fallbacktext: string, customPath?: string): CustomField {
if (!customPath) { if (!customPath) {
return new CustomField(true, fallbacktext) return new CustomField(true, fallbacktext)
} }
return this.jsonPath(customPath, fallbacktext); return this.jsonPath(customPath, fallbacktext);
} }
getCustomObject(fallbackObject: Object, customPath: string = undefined): Object { getCustomObject(fallbackObject: Object, customPath?: string): Object {
if (!customPath) { if (!customPath) {
return fallbackObject; return fallbackObject;
} }

View File

@ -46,7 +46,7 @@ export class DomainService {
this.domainRestValue = domains; this.domainRestValue = domains;
this.domainValue = domains; this.domainValue = domains;
this.dataObs$.next(this.hasMasterDomain ? this.addEmptyDomain(domains) : domains); this.dataObs$.next(this.hasMasterDomain ? this.addEmptyDomain(domains) : domains);
if (this.domainSelectedValue === undefined && this.domainValue.length > 0) { if (!this.domainSelectedValue && this.domainValue.length > 0) {
this.selectDomain(this.domainValue[0]); this.selectDomain(this.domainValue[0]);
} }
}, },

View File

@ -7,7 +7,7 @@ import { TaskanaQueryParameters } from 'app/shared/util/query-parameters';
export class OrientationService { export class OrientationService {
private lock = false; private lock = false;
private currentOrientation = undefined; private currentOrientation;
public orientation = new BehaviorSubject<Orientation>(this.currentOrientation); public orientation = new BehaviorSubject<Orientation>(this.currentOrientation);
constructor() { } constructor() { }

View File

@ -21,7 +21,7 @@ export class SelectedRouteService {
} }
private getRoute(event): string { private getRoute(event): string {
if (event === undefined) { if (!event) {
return this.checkUrl(this.router.url); return this.checkUrl(this.router.url);
} }
return this.checkUrl(event.url) return this.checkUrl(event.url)

View File

@ -11,7 +11,7 @@ export class TitlesService {
this.titles = jsonFile[language]; this.titles = jsonFile[language];
} }
getTitle(id: number, fallBacktext: string, customPath: string = undefined) { getTitle(id: number, fallBacktext: string, customPath?: string) {
return this.titles[id] ? this.titles[id] : fallBacktext return this.titles[id] ? this.titles[id] : fallBacktext
} }

View File

@ -26,7 +26,7 @@ export class AlertComponent implements OnInit {
setTimeOutForClosing(time: number) { setTimeOutForClosing(time: number) {
setTimeout(() => { setTimeout(() => {
this.alert = undefined; delete this.alert;
}, time); }, time);
} }
} }

View File

@ -7,9 +7,10 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
}) })
export class ClassificationTypesSelectorComponent implements OnInit { export class ClassificationTypesSelectorComponent implements OnInit {
@Input() classificationTypes: Array<string> = [];
@Input() @Input()
classificationTypeSelected: string = undefined; classificationTypes: Array<string> = [];
@Input()
classificationTypeSelected: string;
@Output() @Output()
classificationTypeSelectedChange = new EventEmitter<string>(); classificationTypeSelectedChange = new EventEmitter<string>();
@Output() @Output()

View File

@ -35,7 +35,7 @@ export class MasterAndDetailComponent implements OnInit {
} }
private showDetails(event?: RouterEvent): boolean { private showDetails(event?: RouterEvent): boolean {
if (event === undefined) { if (!event) {
return this.checkUrl(this.router.url); return this.checkUrl(this.router.url);
} }
return this.checkUrl(event.url) return this.checkUrl(event.url)

View File

@ -31,8 +31,8 @@ export class AccessIdsService {
getAccessItemsPermissions( getAccessItemsPermissions(
accessIds: Array<AccessIdDefinition>, accessIds: Array<AccessIdDefinition>,
accessIdLike: string = undefined, accessIdLike?: string,
workbasketKeyLike: string = undefined, workbasketKeyLike?: string,
sortModel: SortingModel = new SortingModel('workbasket-key'), sortModel: SortingModel = new SortingModel('workbasket-key'),
forceRequest: boolean = false): Observable<AccessItemsWorkbasketResource> { forceRequest: boolean = false): Observable<AccessItemsWorkbasketResource> {
@ -55,8 +55,8 @@ export class AccessIdsService {
private accessIdsParameters( private accessIdsParameters(
sortModel: SortingModel, sortModel: SortingModel,
accessIds: Array<AccessIdDefinition>, accessIds: Array<AccessIdDefinition>,
accessIdLike: string = undefined, accessIdLike?: string,
workbasketKeyLike: string = undefined): QueryParametersModel { workbasketKeyLike?: string ): QueryParametersModel {
const parameters = new QueryParametersModel(); const parameters = new QueryParametersModel();
parameters.SORTBY = sortModel.sortBy; parameters.SORTBY = sortModel.sortBy;
@ -66,8 +66,8 @@ export class AccessIdsService {
}).join('|'); }).join('|');
parameters.ACCESSIDLIKE = accessIdLike; parameters.ACCESSIDLIKE = accessIdLike;
parameters.WORKBASKETKEYLIKE = workbasketKeyLike; parameters.WORKBASKETKEYLIKE = workbasketKeyLike;
TaskanaQueryParameters.page = undefined; delete TaskanaQueryParameters.page;
TaskanaQueryParameters.pageSize = undefined; delete TaskanaQueryParameters.pageSize;
return parameters; return parameters;
} }
} }

View File

@ -79,7 +79,7 @@ export class ClassificationsService {
} }
// #region "Service extras" // #region "Service extras"
selectClassification(classification: ClassificationDefinition) { selectClassification(classification?: ClassificationDefinition) {
this.classificationSelected.next(classification); this.classificationSelected.next(classification);
} }
@ -103,8 +103,8 @@ export class ClassificationsService {
parameters.SORTBY = TaskanaQueryParameters.parameters.KEY; parameters.SORTBY = TaskanaQueryParameters.parameters.KEY;
parameters.SORTDIRECTION = Direction.ASC; parameters.SORTDIRECTION = Direction.ASC;
parameters.DOMAIN = domain; parameters.DOMAIN = domain;
TaskanaQueryParameters.page = undefined; delete TaskanaQueryParameters.page;
TaskanaQueryParameters.pageSize = undefined; delete TaskanaQueryParameters.pageSize;
return parameters; return parameters;
} }

View File

@ -33,15 +33,15 @@ export class WorkbasketService {
getWorkBasketsSummary(forceRequest: boolean = false, getWorkBasketsSummary(forceRequest: boolean = false,
sortBy: string = TaskanaQueryParameters.parameters.KEY, sortBy: string = TaskanaQueryParameters.parameters.KEY,
order: string = Direction.ASC, order: string = Direction.ASC,
name: string = undefined, name?: string,
nameLike: string = undefined, nameLike?: string,
descLike: string = undefined, descLike?: string,
owner: string = undefined, owner?: string,
ownerLike: string = undefined, ownerLike?: string,
type: string = undefined, type?: string,
key: string = undefined, key?: string,
keyLike: string = undefined, keyLike?: string,
requiredPermission: string = undefined, requiredPermission?: string,
allPages: boolean = false) { allPages: boolean = false) {
if (this.workbasketSummaryRef && !forceRequest) { if (this.workbasketSummaryRef && !forceRequest) {
@ -121,7 +121,7 @@ export class WorkbasketService {
// #endregion // #endregion
// #region "Service extras" // #region "Service extras"
selectWorkBasket(id: string) { selectWorkBasket(id?: string) {
this.workBasketSelected.next(id); this.workBasketSelected.next(id);
} }
@ -158,17 +158,17 @@ export class WorkbasketService {
private workbasketParameters( private workbasketParameters(
sortBy: string = TaskanaQueryParameters.parameters.KEY, sortBy: string = TaskanaQueryParameters.parameters.KEY,
order: string = Direction.ASC, order: string = Direction.ASC,
name: string = undefined, name?: string,
nameLike: string = undefined, nameLike?: string,
descLike: string = undefined, descLike?: string,
owner: string = undefined, owner?: string,
ownerLike: string = undefined, ownerLike?: string,
type: string = undefined, type?: string,
key: string = undefined, key?: string,
keyLike: string = undefined, keyLike?: string,
requiredPermission: string = undefined, requiredPermission?: string,
allPages: boolean = false, allPages?: boolean,
domain: string = ''): QueryParametersModel { domain?: string): QueryParametersModel {
const parameters = new QueryParametersModel(); const parameters = new QueryParametersModel();
parameters.SORTBY = sortBy; parameters.SORTBY = sortBy;
@ -184,8 +184,8 @@ export class WorkbasketService {
parameters.REQUIREDPERMISSION = requiredPermission; parameters.REQUIREDPERMISSION = requiredPermission;
parameters.DOMAIN = domain; parameters.DOMAIN = domain;
if (allPages) { if (allPages) {
TaskanaQueryParameters.page = undefined; delete TaskanaQueryParameters.page;
TaskanaQueryParameters.pageSize = undefined; delete TaskanaQueryParameters.pageSize;
} }
return parameters; return parameters;
} }

View File

@ -45,7 +45,7 @@ export class SpinnerComponent implements OnDestroy {
isModal = false; isModal = false;
@Input() @Input()
positionClass: string = undefined; positionClass: string;
@Output() @Output()
spinnerIsRunning = new EventEmitter<boolean>(); spinnerIsRunning = new EventEmitter<boolean>();
@ -81,8 +81,8 @@ export class SpinnerComponent implements OnDestroy {
private cancelTimeout(): void { private cancelTimeout(): void {
clearTimeout(this.currentTimeout); clearTimeout(this.currentTimeout);
clearTimeout(this.requestTimeout); clearTimeout(this.requestTimeout);
this.currentTimeout = undefined; delete this.currentTimeout; // do we need this?
this.requestTimeout = undefined; delete this.requestTimeout;
} }
ngOnDestroy(): any { ngOnDestroy(): any {

View File

@ -106,7 +106,7 @@ export class TaskanaTreeComponent implements OnInit, AfterViewChecked, OnDestroy
} }
onDeactivate(treeNode: any) { onDeactivate(treeNode: any) {
this.selectNodeIdChanged.emit(undefined); this.selectNodeIdChanged.emit();
} }
async onMoveNode($event) { async onMoveNode($event) {
@ -145,7 +145,7 @@ export class TaskanaTreeComponent implements OnInit, AfterViewChecked, OnDestroy
private unSelectActiveNode() { private unSelectActiveNode() {
const activeNode = this.tree.treeModel.getActiveNode(); const activeNode = this.tree.treeModel.getActiveNode();
this.selectNodeId = undefined; delete this.selectNodeId;
activeNode.setIsActive(false); activeNode.setIsActive(false);
activeNode.blur(); activeNode.blur();
} }

View File

@ -56,7 +56,7 @@ export class TypeAheadComponent implements OnInit, ControlValueAccessor {
typeaheadOptionsInScrollableView = 6; typeaheadOptionsInScrollableView = 6;
// The internal data model // The internal data model
private innerValue: any = undefined; private innerValue: any;
// Placeholders for the callbacks which are later provided // Placeholders for the callbacks which are later provided
// by the Control Value Accessor // by the Control Value Accessor

View File

@ -10,8 +10,8 @@ describe('TaskanaQueryParameters', () => {
}) })
it('should create a empty query', () => { it('should create a empty query', () => {
TaskanaQueryParameters.page = undefined; delete TaskanaQueryParameters.page;
TaskanaQueryParameters.pageSize = undefined; delete TaskanaQueryParameters.pageSize;
expect(TaskanaQueryParameters.getQueryParameters(new QueryParametersModel())).toBe('?'); expect(TaskanaQueryParameters.getQueryParameters(new QueryParametersModel())).toBe('?');
TaskanaQueryParameters.page = 1; TaskanaQueryParameters.page = 1;
TaskanaQueryParameters.pageSize = 9; TaskanaQueryParameters.pageSize = 9;

View File

@ -1,9 +1,9 @@
export class ObjectReference { export class ObjectReference {
constructor(public id: string = undefined, constructor(public id?: string,
public company: string = undefined, public company?: string,
public system: string = undefined, public system?: string,
public systemInstance: string = undefined, public systemInstance?: string,
public type: string = undefined, public type?: string,
public value: string = undefined) { public value?: string) {
} }
} }

View File

@ -4,6 +4,6 @@ import { Page } from 'app/models/page';
export class TaskResource { export class TaskResource {
constructor(public tasks: Array<Task>, constructor(public tasks: Array<Task>,
public _links: Links = undefined, public _links?: Links,
public page: Page = new Page()) {} public page: Page = new Page()) {}
} }

View File

@ -4,44 +4,44 @@ import {ObjectReference} from './object-reference';
export class Task { export class Task {
constructor(public taskId: string, constructor(public taskId: string,
public primaryObjRef: ObjectReference = undefined, public primaryObjRef: ObjectReference = new ObjectReference(),
public workbasketSummaryResource: Workbasket = undefined, public workbasketSummaryResource?: Workbasket,
public classificationSummaryResource: Classification = undefined, public classificationSummaryResource?: Classification,
public businessProcessId: string = undefined, public businessProcessId?: string,
public parentBusinessProcessId: string = undefined, public parentBusinessProcessId?: string,
public owner: string = undefined, public owner?: string,
public created: string = undefined, // ISO-8601 public created?: string, // ISO-8601
public claimed: string = undefined, // ISO-8601 public claimed?: string, // ISO-8601
public completed: string = undefined, // ISO-8601 public completed?: string, // ISO-8601
public modified: string = undefined, // ISO-8601 public modified?: string, // ISO-8601
public planned: string = undefined, // ISO-8601 public planned?: string, // ISO-8601
public due: string = undefined, // ISO-8601 public due?: string, // ISO-8601
public name: string = undefined, public name?: string,
public creator: string = undefined, public creator?: string,
public description: string = undefined, public description?: string,
public note: string = undefined, public note?: string,
public state: any = undefined, public state?: any,
public read: boolean = undefined, public read?: boolean,
public transferred: boolean = undefined, public transferred?: boolean,
public priority: number = undefined, public priority?: number,
public customAttributes: Array<CustomAttribute> = [], public customAttributes: Array<CustomAttribute> = [],
public callbackInfo: Array<CustomAttribute> = [], public callbackInfo: Array<CustomAttribute> = [],
public custom1: string = undefined, public custom1?: string,
public custom2: string = undefined, public custom2?: string,
public custom3: string = undefined, public custom3?: string,
public custom4: string = undefined, public custom4?: string,
public custom5: string = undefined, public custom5?: string,
public custom6: string = undefined, public custom6?: string,
public custom7: string = undefined, public custom7?: string,
public custom8: string = undefined, public custom8?: string,
public custom9: string = undefined, public custom9?: string,
public custom10: string = undefined, public custom10?: string,
public custom11: string = undefined, public custom11?: string,
public custom12: string = undefined, public custom12?: string,
public custom13: string = undefined, public custom13?: string,
public custom14: string = undefined, public custom14?: string,
public custom15: string = undefined, public custom15?: string,
public custom16: string = undefined) { public custom16?: string) {
} }
} }

View File

@ -23,11 +23,11 @@ export class TaskService {
constructor(private httpClient: HttpClient) { constructor(private httpClient: HttpClient) {
} }
publishUpdatedTask(task: Task = undefined) { publishUpdatedTask(task: Task = new Task('empty')) {
this.taskChangedSource.next(task); this.taskChangedSource.next(task);
} }
selectTask(task: Task) { selectTask(task?: Task) {
this.taskSelectedSource.next(task); this.taskSelectedSource.next(task);
} }
@ -121,8 +121,8 @@ export class TaskService {
parameters.TASK_PRIMARY_OBJ_REF_TYPE_LIKE = objRefTypeLike; parameters.TASK_PRIMARY_OBJ_REF_TYPE_LIKE = objRefTypeLike;
parameters.TASK_PRIMARY_OBJ_REF_VALUE_LIKE = objRefValueLike; parameters.TASK_PRIMARY_OBJ_REF_VALUE_LIKE = objRefValueLike;
if (allPages) { if (allPages) {
TaskanaQueryParameters.page = undefined; delete TaskanaQueryParameters.page;
TaskanaQueryParameters.pageSize = undefined; delete TaskanaQueryParameters.pageSize;
} }
return parameters; return parameters;

View File

@ -13,7 +13,7 @@ export class WorkplaceService {
private objectReferenceSource = new Subject<ObjectReference>(); private objectReferenceSource = new Subject<ObjectReference>();
objectReferenceSelectedStream = this.objectReferenceSource.asObservable(); objectReferenceSelectedStream = this.objectReferenceSource.asObservable();
selectWorkbasket(workbasket: Workbasket) { selectWorkbasket(workbasket?: Workbasket) {
this.currentWorkbasket = workbasket; this.currentWorkbasket = workbasket;
this.workbasketSelectedSource.next(workbasket); this.workbasketSelectedSource.next(workbasket);
} }
@ -22,11 +22,11 @@ export class WorkplaceService {
return this.workbasketSelectedStream; return this.workbasketSelectedStream;
} }
selectObjectReference(objectReference: ObjectReference) { selectObjectReference(objectReference?: ObjectReference) {
this.objectReference = new ObjectReference();
if (objectReference) { if (objectReference) {
this.objectReference = new ObjectReference(undefined, undefined, undefined, undefined, objectReference.type, objectReference.value); this.objectReference.type = objectReference.type;
} else { this.objectReference.value = objectReference.value;
this.objectReference = new ObjectReference(undefined);
} }
this.objectReferenceSource.next(objectReference); this.objectReferenceSource.next(objectReference);
} }

View File

@ -27,7 +27,7 @@ export class TaskdetailsGeneralFieldsComponent implements OnInit, OnChanges {
toogleValidationMap = new Map<string, boolean>(); toogleValidationMap = new Map<string, boolean>();
requestInProgress = false; requestInProgress = false;
classifications: Classification[] = undefined; classifications: Classification[];
ownerField = this.customFieldsService.getCustomField( ownerField = this.customFieldsService.getCustomField(
'Owner', 'Owner',

View File

@ -23,12 +23,12 @@ import {MasterAndDetailService} from 'app/services/masterAndDetail/master-and-de
styleUrls: ['./taskdetails.component.scss'] styleUrls: ['./taskdetails.component.scss']
}) })
export class TaskdetailsComponent implements OnInit, OnDestroy { export class TaskdetailsComponent implements OnInit, OnDestroy {
task: Task = undefined; task: Task;
taskClone: Task = undefined; taskClone: Task;
requestInProgress = false; requestInProgress = false;
tabSelected = 'general'; tabSelected = 'general';
currentWorkbasket: Workbasket = undefined; currentWorkbasket: Workbasket;
currentId: string = undefined; currentId: string;
showDetail = false; showDetail = false;
private routeSubscription: Subscription; private routeSubscription: Subscription;
@ -77,7 +77,7 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
this.requestInProgress = true; this.requestInProgress = true;
if (this.currentId === 'new-task') { if (this.currentId === 'new-task') {
this.requestInProgress = false; this.requestInProgress = false;
this.task = new Task(undefined, new ObjectReference(), this.currentWorkbasket); this.task = new Task('', new ObjectReference(), this.currentWorkbasket);
} else { } else {
this.taskService.getTask(this.currentId).subscribe(task => { this.taskService.getTask(this.currentId).subscribe(task => {
this.requestInProgress = false; this.requestInProgress = false;
@ -124,7 +124,7 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
} }
backClicked(): void { backClicked(): void {
this.task = undefined; delete this.task;
this.taskService.selectTask(this.task); this.taskService.selectTask(this.task);
this.router.navigate(['./'], {relativeTo: this.route.parent}); this.router.navigate(['./'], {relativeTo: this.route.parent});
} }

View File

@ -83,11 +83,13 @@ export class TaskListToolbarComponent implements OnInit {
this.toolbarState = false; this.toolbarState = false;
this.workbasketSelected = true; this.workbasketSelected = true;
if (this.searchSelected === this.search.byTypeAndValue) { if (this.searchSelected === this.search.byTypeAndValue) {
this.workplaceService.selectObjectReference( const objectReference = new ObjectReference();
new ObjectReference(undefined, undefined, undefined, undefined, this.resultType, this.resultValue)); objectReference.type = this.resultType;
this.searched = true; objectReference.value = this.resultValue;
this.workplaceService.selectObjectReference(objectReference);
this.searched = true;
} else { } else {
this.workplaceService.selectObjectReference(undefined); this.workplaceService.selectObjectReference();
if (this.workbaskets) { if (this.workbaskets) {
this.workbaskets.forEach(workbasket => { this.workbaskets.forEach(workbasket => {
if (workbasket.name === this.resultName) { if (workbasket.name === this.resultName) {
@ -99,8 +101,8 @@ export class TaskListToolbarComponent implements OnInit {
}); });
if (!this.resultId) { if (!this.resultId) {
this.currentBasket = undefined; delete this.currentBasket;
this.workplaceService.selectWorkbasket(undefined); this.workplaceService.selectWorkbasket();
} }
} }
} }
@ -118,14 +120,14 @@ export class TaskListToolbarComponent implements OnInit {
} }
createTask() { createTask() {
this.taskService.selectTask(undefined); this.taskService.selectTask();
this.router.navigate([{ outlets: { detail: 'taskdetail/new-task' } }], { relativeTo: this.route }); this.router.navigate([{ outlets: { detail: 'taskdetail/new-task' } }], { relativeTo: this.route });
} }
selectSearch(type: Search) { selectSearch(type: Search) {
this.searched = false; this.searched = false;
this.resultId = undefined; delete this.resultId;
this.currentBasket = undefined; delete this.currentBasket;
this.selectSearchType.emit(type); this.selectSearchType.emit(type);
this.searchSelected = type; this.searchSelected = type;

View File

@ -30,7 +30,7 @@ export class TaskListComponent implements OnInit {
} }
selectTask(taskId: string) { selectTask(taskId: string) {
this.workplaceService.selectObjectReference(undefined); this.workplaceService.selectObjectReference();
this.selectedId = taskId; this.selectedId = taskId;
this.selectedIdChange.emit(taskId); this.selectedIdChange.emit(taskId);
this.router.navigate([{outlets: {detail: `taskdetail/${this.selectedId}`}}], {relativeTo: this.route}); this.router.navigate([{outlets: {detail: `taskdetail/${this.selectedId}`}}], {relativeTo: this.route});

View File

@ -56,7 +56,7 @@ export class TaskMasterComponent implements OnInit, OnDestroy {
private orientationService: OrientationService) { private orientationService: OrientationService) {
this.taskChangeSubscription = this.taskService.taskChangedStream.subscribe(task => { this.taskChangeSubscription = this.taskService.taskChangedStream.subscribe(task => {
this.getTasks(); this.getTasks();
this.selectedId = task ? task.taskId : undefined; this.selectedId = task ? task.taskId : '';
}); });
this.workbasketChangeSubscription = this.workplaceService.workbasketSelectedStream.subscribe(workbasket => { this.workbasketChangeSubscription = this.workplaceService.workbasketSelectedStream.subscribe(workbasket => {
@ -68,7 +68,7 @@ export class TaskMasterComponent implements OnInit, OnDestroy {
this.objectReferenceSubscription = this.workplaceService.objectReferenceSelectedStream.subscribe(objectReference => { this.objectReferenceSubscription = this.workplaceService.objectReferenceSelectedStream.subscribe(objectReference => {
this.objectReference = objectReference; this.objectReference = objectReference;
this.currentBasket = undefined; delete this.currentBasket;
if (objectReference) { if (objectReference) {
this.getTasks(); this.getTasks();
} }
@ -83,7 +83,7 @@ export class TaskMasterComponent implements OnInit, OnDestroy {
this.currentBasket = task.workbasketSummaryResource; this.currentBasket = task.workbasketSummaryResource;
} }
if (!task) { if (!task) {
this.selectedId = undefined; this.selectedId = '';
} }
}); });
this.orientationSubscription = this.orientationService.getOrientation().subscribe((orientation: Orientation) => { this.orientationSubscription = this.orientationService.getOrientation().subscribe((orientation: Orientation) => {
@ -131,15 +131,15 @@ export class TaskMasterComponent implements OnInit, OnDestroy {
private getTasks(): void { private getTasks(): void {
this.requestInProgress = true; this.requestInProgress = true;
if (this.currentBasket === undefined && !this.objectReference) { if (!this.currentBasket && !this.objectReference) {
this.requestInProgress = false; this.requestInProgress = false;
this.tasks = []; this.tasks = [];
} else { } else {
this.calculateHeightCard(); this.calculateHeightCard();
this.taskService.findTasksWithWorkbasket(this.currentBasket ? this.currentBasket.workbasketId : undefined, this.taskService.findTasksWithWorkbasket(this.currentBasket ? this.currentBasket.workbasketId : '',
this.sort.sortBy, this.sort.sortDirection, this.filterBy.filterParams.name, this.filterBy.filterParams.owner, this.sort.sortBy, this.sort.sortDirection, this.filterBy.filterParams.name, this.filterBy.filterParams.owner,
this.filterBy.filterParams.priority, this.filterBy.filterParams.state, this.objectReference ? this.objectReference.type : undefined, this.filterBy.filterParams.priority, this.filterBy.filterParams.state, this.objectReference ? this.objectReference.type : '',
this.objectReference ? this.objectReference.value : undefined) this.objectReference ? this.objectReference.value : '')
.subscribe(tasks => { .subscribe(tasks => {
this.requestInProgress = false; this.requestInProgress = false;
if (tasks.tasks) { if (tasks.tasks) {