From 22b0b2170b721540c917e12819815f11dc79ccbb Mon Sep 17 00:00:00 2001
From: BVier <26220150+BVier@users.noreply.github.com>
Date: Mon, 9 Dec 2019 10:13:32 +0100
Subject: [PATCH] TSK-975: Remove unnecessary initializers
---
.../access-items-management.component.html | 6 +-
.../classification-details.component.spec.ts | 5 +-
.../classification-details.component.ts | 16 ++---
.../list/classification-list.component.ts | 6 +-
.../import-export/import-export.component.ts | 4 +-
.../type-icon/icon-type.component.ts | 2 +-
.../access-items.component.spec.ts | 7 +-
.../access-items/access-items.component.ts | 10 +--
.../distribution-targets.component.ts | 29 ++++----
.../workbasket-information.component.spec.ts | 8 ++-
.../details/workbasket-details.component.ts | 52 +++++++-------
.../workbasket-list-toolbar.component.spec.ts | 5 +-
.../workbasket-list-toolbar.component.ts | 2 +-
.../master/workbasket-list.component.html | 2 +-
.../master/workbasket-list.component.spec.ts | 4 +-
.../master/workbasket-list.component.ts | 6 +-
.../services/task-query/task-query.service.ts | 2 +-
web/src/app/models/access-id.ts | 4 +-
.../models/access-item-workbasket-resource.ts | 2 +-
web/src/app/models/access-item-workbasket.ts | 8 +--
.../app/models/classification-definition.ts | 48 ++++++-------
web/src/app/models/classification-resource.ts | 2 +-
web/src/app/models/classification.ts | 20 +++---
web/src/app/models/links-classfication.ts | 12 ++--
.../app/models/links-workbasket-summary.ts | 8 +--
web/src/app/models/links.ts | 10 +--
web/src/app/models/message-modal.ts | 4 +-
web/src/app/models/page.ts | 8 +--
web/src/app/models/pair.ts | 4 +-
.../app/models/task-history-event-resource.ts | 2 +-
web/src/app/models/tree-node.ts | 20 +++---
web/src/app/models/user-info.ts | 2 +-
web/src/app/models/version.ts | 2 +-
.../workbasket-access-items-resource.ts | 2 +-
web/src/app/models/workbasket-access-items.ts | 2 +-
web/src/app/models/workbasket-resource.ts | 2 +-
web/src/app/models/workbasket-summary.ts | 26 +++----
web/src/app/models/workbasket.ts | 32 ++++-----
.../custom-fields.service.spec.ts | 2 +-
.../custom-fields/custom-fields.service.ts | 4 +-
web/src/app/services/domain/domain.service.ts | 2 +-
.../orientation/orientation.service.ts | 2 +-
.../services/selected-route/selected-route.ts | 2 +-
web/src/app/services/titles/titles.service.ts | 2 +-
web/src/app/shared/alert/alert.component.ts | 2 +-
...classification-types-selector.component.ts | 5 +-
.../master-and-detail.component.ts | 2 +-
.../services/access-ids/access-ids.service.ts | 12 ++--
.../classifications.service.ts | 6 +-
.../services/workbasket/workbasket.service.ts | 46 ++++++------
.../app/shared/spinner/spinner.component.ts | 6 +-
web/src/app/shared/tree/tree.component.ts | 4 +-
.../shared/type-ahead/type-ahead.component.ts | 2 +-
.../app/shared/util/query-parameters.spec.ts | 4 +-
.../app/workplace/models/object-reference.ts | 12 ++--
web/src/app/workplace/models/task-resource.ts | 2 +-
web/src/app/workplace/models/task.ts | 72 +++++++++----------
.../app/workplace/services/task.service.ts | 8 +--
.../workplace/services/workplace.service.ts | 10 +--
.../general/general-fields.component.ts | 2 +-
.../taskdetails/taskdetails.component.ts | 12 ++--
.../task-list-toolbar.component.ts | 20 +++---
.../task-list/task-list.component.ts | 2 +-
.../taskmaster/task-master.component.ts | 14 ++--
64 files changed, 325 insertions(+), 318 deletions(-)
diff --git a/web/src/app/administration/access-items-management/access-items-management.component.html b/web/src/app/administration/access-items-management/access-items-management.component.html
index eac6455c0..d468c0641 100644
--- a/web/src/app/administration/access-items-management/access-items-management.component.html
+++ b/web/src/app/administration/access-items-management/access-items-management.component.html
@@ -173,10 +173,10 @@
-
0 " class="list-group">
+ 0 " class="list-group">
- {{group.name}}
- The user is not associated to
+
The user is not associated to
any groups
-
\ No newline at end of file
+
diff --git a/web/src/app/administration/classification/details/classification-details.component.spec.ts b/web/src/app/administration/classification/details/classification-details.component.spec.ts
index ce24255b4..f30ca650a 100644
--- a/web/src/app/administration/classification/details/classification-details.component.spec.ts
+++ b/web/src/app/administration/classification/details/classification-details.component.spec.ts
@@ -67,9 +67,8 @@ describe('ClassificationDetailsComponent', () => {
spyOn(classificationCategoriesService, 'getCategories').and.returnValue(of(['firstCategory', 'secondCategory']));
spyOn(classificationsService, 'deleteClassification').and.returnValue(of(true));
spyOn(classificationCategoriesService, 'getCategoryIcon').and.returnValue(new Pair('assets/icons/categories/external.svg'));
- component.classification = new ClassificationDefinition('id1', undefined, undefined, undefined, undefined, undefined, undefined,
- undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined,
- undefined, undefined, undefined, undefined, new LinksClassification({ 'self': '' }));
+ component.classification = new ClassificationDefinition('id1');
+ component.classification._links = new LinksClassification({ 'self': '' });
treeService = TestBed.get(TreeService);
fixture.detectChanges();
done();
diff --git a/web/src/app/administration/classification/details/classification-details.component.ts b/web/src/app/administration/classification/details/classification-details.component.ts
index 8636580d8..8a3f4ea8a 100644
--- a/web/src/app/administration/classification/details/classification-details.component.ts
+++ b/web/src/app/administration/classification/details/classification-details.component.ts
@@ -102,18 +102,18 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
this.routeSubscription = this.route.params.subscribe(params => {
let id = params['id'];
- this.action = undefined;
+ delete this.action;
if (id && id.indexOf('new-classification') !== -1) {
this.action = ACTION.CREATE;
this.badgeMessage = 'Creating new classification';
id = id.replace('new-classification/', '');
if (id === 'undefined') {
- id = undefined;
+ id = '';
}
this.fillClassificationInformation(this.classification ? this.classification : new ClassificationDefinition())
}
- if (!this.classification || this.classification.classificationId !== id && id && id !== '') {
+ if (!this.classification || this.classification.classificationId !== id && id ) {
this.selectClassification(id);
}
});
@@ -140,7 +140,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
}
backClicked(): void {
- this.classificationsService.selectClassification(undefined);
+ this.classificationsService.selectClassification();
this.router.navigate(['./'], { relativeTo: this.route.parent });
}
@@ -167,8 +167,8 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
}
private initProperties() {
- this.classification = undefined;
- this.action = undefined
+ delete this.classification;
+ delete this.action;
}
private async onSave() {
@@ -287,9 +287,9 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
.deleteClassification(this.classification._links.self.href)
.subscribe(() => {
const key = this.classification.key;
- this.classification = undefined;
+ delete this.classification;
this.afterRequest();
- this.classificationsService.selectClassification(undefined);
+ this.classificationsService.selectClassification();
this.router.navigate(['taskana/administration/classifications']);
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Classification ${key} was removed successfully`))
}, error => {
diff --git a/web/src/app/administration/classification/master/list/classification-list.component.ts b/web/src/app/administration/classification/master/list/classification-list.component.ts
index 70bbf4bec..abc3f684d 100644
--- a/web/src/app/administration/classification/master/list/classification-list.component.ts
+++ b/web/src/app/administration/classification/master/list/classification-list.component.ts
@@ -75,10 +75,10 @@ export class ClassificationListComponent implements OnInit, OnDestroy {
this.classifications = [];
this.categoryService.selectClassificationType(classificationTypeSelected);
this.getClassifications();
- this.selectClassification(undefined);
+ this.selectClassification();
}
- selectClassification(id: string) {
+ selectClassification(id?: string) {
this.selectedId = id;
if (!id) {
this.router.navigate(['taskana/administration/classifications']);
@@ -128,7 +128,7 @@ export class ClassificationListComponent implements OnInit, OnDestroy {
}
- private getClassifications(key: string = undefined) {
+ private getClassifications(key?: string) {
this.requestInProgress = true;
this.classificationService.getClassifications()
.subscribe((classifications: Array