[SI-2948] - hide EditCondensation if condensation grid failure exists AND they are completed; test feedback implemented 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 693e4d2..58aa675 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
@@ -276,10 +276,10 @@ this._router.navigate(['/grid-failures', event.data.id]); break; case this._eventTypeEnum.InitialLoad: + const condensedGridFailure = this.sandbox.overviewGridFailureList.find(gridFailure => gridFailure.id === this.sandbox.condenseId); this.showEditCondensationBtn = !( - this.sandbox.condensationList.length && - this.sandbox.condensationList.length > 0 && - this.sandbox.condensationList[0].statusIntern === StateEnum.COMPLETED + !!condensedGridFailure && + (condensedGridFailure.statusIntern === StateEnum.COMPLETED || condensedGridFailure.statusIntern === StateEnum.CANCELED) ); this._changeMode(); break;