From 1915c21f1374cbb145d5bf3190db5f73fdf27bd6 Mon Sep 17 00:00:00 2001 From: Benni Date: Mon, 13 Jan 2020 11:48:52 +0100 Subject: [PATCH] Fix sonarcube errors --- .../distribution-targets.component.ts | 19 ++++++++++--------- web/src/app/shared/tree/tree.component.ts | 1 - 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/web/src/app/administration/workbasket/details/distribution-targets/distribution-targets.component.ts b/web/src/app/administration/workbasket/details/distribution-targets/distribution-targets.component.ts index 23f0ef5b7..c34e5fe87 100644 --- a/web/src/app/administration/workbasket/details/distribution-targets/distribution-targets.component.ts +++ b/web/src/app/administration/workbasket/details/distribution-targets/distribution-targets.component.ts @@ -261,16 +261,17 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy { } private onRequest(finished: boolean = false, side?: Side) { - if (this.loadingItems) { - this.loadingItems = false; + this.loadingItems = false; + const inProgress = !finished; + switch (side) { + case Side.LEFT: this.requestInProgressLeft = inProgress; + break; + case Side.RIGHT: this.requestInProgressRight = inProgress; + break; + default: + this.requestInProgressLeft = inProgress; + this.requestInProgressRight = inProgress; } - if (finished) { - typeof side === 'undefined' ? (this.requestInProgressLeft = false, this.requestInProgressRight = false) - : side === Side.LEFT ? this.requestInProgressLeft = false : this.requestInProgressRight = false; - return; - } - typeof side === 'undefined' ? (this.requestInProgressLeft = true, this.requestInProgressRight = true) - : side === Side.LEFT ? this.requestInProgressLeft = true : this.requestInProgressRight = true; } private getSeletedIds(): Array { diff --git a/web/src/app/shared/tree/tree.component.ts b/web/src/app/shared/tree/tree.component.ts index a77d24b5b..5c0c6b7eb 100644 --- a/web/src/app/shared/tree/tree.component.ts +++ b/web/src/app/shared/tree/tree.component.ts @@ -185,7 +185,6 @@ export class TaskanaTreeComponent implements OnInit, AfterViewChecked, OnDestroy return (this.elementRef.nativeElement.contains(event.target) || this.elementRef.nativeElement === event.target) && (event.target.localName === 'tree-viewport' - || event.target.localName === 'tree-viewport' || event.target.localName === 'taskana-tree'); }