From 7380032dcff07cb611633c9823ff5971bf0fb630 Mon Sep 17 00:00:00 2001 From: alicia pritchett Date: Fri, 11 Feb 2022 10:14:44 -0500 Subject: [PATCH] Gives a popup message if libraries are still being referenced on delete --- .../workflow-spec-list.component.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/workflow-spec-list/workflow-spec-list.component.ts b/src/app/workflow-spec-list/workflow-spec-list.component.ts index d105048..c0e3381 100644 --- a/src/app/workflow-spec-list/workflow-spec-list.component.ts +++ b/src/app/workflow-spec-list/workflow-spec-list.component.ts @@ -191,15 +191,21 @@ export class WorkflowSpecListComponent implements OnInit { canDeleteWorkflowSpec(wfs){ - // TODO: put the popup back in for this let references = [] if (wfs.library){ this.workflowSpecs.forEach(spec => { if (spec.libraries.indexOf(wfs.id) >= 0 ) { - references.push(wfs.id); + references.push(spec.id); } }); if (references.length > 0) { + let message = ''; + references.forEach(ref => { + message += ref.toString() + ', '; + }); + message = message.substr(0, message.length-2); + this.snackBar.open('The Library ' + '\'' + wfs.display_name + '\'' + + ' is still being referenced by these workflows: ' + message, 'Ok'); return false; } } @@ -221,8 +227,6 @@ export class WorkflowSpecListComponent implements OnInit { if (typeof this.masterStatusSpec !== 'undefined') { this.selectSpec(this.masterStatusSpec); } - } else { - // TODO: the library is being referenced elsewhere still } }); }