selectionListName: String;
@ViewChild('fail', { static: true }) private fail: AlertDialogComponent;
+ @ViewChild('dupe', { static: true }) private dupe: AlertDialogComponent;
constructor(
private renderer: Renderer2,
(res) => {
if (this.evt.parse(res)) {
console.error(res);
- this.fail.open();
+ if (res.textcode === 'DATABASE_UPDATE_FAILED') {
+ // a duplicate name is not the only reason it could have failed,
+ // but that's the way to bet
+ this.dupe.open();
+ } else {
+ this.fail.open();
+ }
+ this.close(false);
} else {
console.log(res);
}
(err) => {
console.error(err);
this.fail.open();
+ this.close(false);
},
() => this.close(true)
);
openCreateDialog() {
this.picklistCreateDialog.open().subscribe(
modified => {
+ if (!modified) { return; }
this.createSelectionListString.current().then(msg => this.toast.success(msg));
this.picklistResultsGrid.reload(); // FIXME - spec calls for inserted grid row and not refresh
}
openCloneDialog(rows: IdlObject[]) {
this.picklistCloneDialog.open().subscribe(
modified => {
+ if (!modified) { return; }
this.cloneSelectionListString.current().then(msg => this.toast.success(msg));
this.picklistResultsGrid.reload(); // FIXME - spec calls for inserted grid row and not refresh
}
openDeleteDialog(rows: IdlObject[]) {
this.picklistDeleteDialog.open().subscribe(
modified => {
+ if (!modified) { return; }
this.deleteSelectionListString.current().then(msg => this.toast.success(msg));
this.picklistResultsGrid.reload(); // FIXME - spec calls for removed grid rows and not refresh
}
openMergeDialog(rows: IdlObject[]) {
this.picklistMergeDialog.open().subscribe(
modified => {
+ if (!modified) { return; }
this.mergeSelectionListString.current().then(msg => this.toast.success(msg));
this.picklistResultsGrid.reload(); // FIXME - spec calls for removed grid rows and not refresh
}