[SI-1892] - one more bugfix for composition
Signed-off-by: dtheinert <dietmar.theinert@pta.de>
diff --git a/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-list/grid-failure-list.component.ts b/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-list/grid-failure-list.component.ts
index 2dca844..460d31b 100644
--- a/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-list/grid-failure-list.component.ts
+++ b/projects/grid-failure-information-app/src/app/pages/grid-failure/grid-failure-list/grid-failure-list.component.ts
@@ -215,17 +215,19 @@
case this._eventTypeEnum.Readonly:
this._router.navigate(['/grid-failures', event.data.id]);
break;
- case this._eventTypeEnum.Add:
- const newCondensList: boolean = this.sandbox.condensationList.length === 0 && !this.sandbox.condenseId;
- const editEmptyCondensList: boolean = (newCondensList || this.sandbox.condensationList.length === 0) && !!this.sandbox.condenseId;
- const editCondensList: boolean = !newCondensList && !editEmptyCondensList && !!this.sandbox.condenseId;
- const gridFailureAlreadyCondensed = event.data.condensed;
- const canAdd: boolean =
- (newCondensList ||
- (editCondensList && this.sandbox.condensationList[0].branch === event.data.branch) ||
- (editEmptyCondensList && this.sandbox.condenseBranch === event.data.branch)) &&
- !gridFailureAlreadyCondensed;
- if (canAdd) {
+ case this._eventTypeEnum.Add:
+ const newEmptyCondensList: boolean = this.sandbox.condensationList.length === 0 && !this.sandbox.condenseId;
+ const newCondensList: boolean = this.sandbox.condensationList.length > 0 && !this.sandbox.condenseId;
+ const editEmptyCondensList: boolean = (newEmptyCondensList || this.sandbox.condensationList.length === 0) && !!this.sandbox.condenseId;
+ const editCondensList: boolean = !newEmptyCondensList && !editEmptyCondensList && !!this.sandbox.condenseId;
+ const gridFailureAlreadyCondensed = event.data.condensed;
+ const canAdd: boolean =
+ (newEmptyCondensList ||
+ (newCondensList && this.sandbox.condensationList[0].branch === event.data.branch) ||
+ (editCondensList && this.sandbox.condensationList[0].branch === event.data.branch) ||
+ (editEmptyCondensList && this.sandbox.condenseBranch === event.data.branch)) &&
+ !gridFailureAlreadyCondensed;
+ if (canAdd) {
this.sandbox.addItemToCondensationList(event.data);
} else if (gridFailureAlreadyCondensed) {
break;