Gives a popup message if libraries are still being referenced on delete
This commit is contained in:
parent
760864131b
commit
7380032dcf
|
@ -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
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue