dialogBody="Records with holdings attached cannot be deleted.">
</eg-alert-dialog>
+<eg-string #successMsg i18n-text text="Record successfully updated"></eg-string>
+<eg-string #failMsg i18n-text text="Record failed to update"></eg-string>
+
<div class="row d-flex p-2 m-2">
<div class="flex-1"></div>
<div class="mr-2">
import {AuthService} from '@eg/core/auth.service';
import {OrgService} from '@eg/core/org.service';
import {PcrudService} from '@eg/core/pcrud.service';
+import {ToastService} from '@eg/share/toast/toast.service';
+import {StringComponent} from '@eg/share/string/string.component';
import {MarcRecord} from './marcrecord';
import {ComboboxEntry, ComboboxComponent
} from '@eg/share/combobox/combobox.component';
@ViewChild('confirmDelete') confirmDelete: ConfirmDialogComponent;
@ViewChild('confirmUndelete') confirmUndelete: ConfirmDialogComponent;
@ViewChild('cannotDelete') cannotDelete: ConfirmDialogComponent;
+ @ViewChild('successMsg') successMsg: StringComponent;
+ @ViewChild('failMsg') failMsg: StringComponent;
constructor(
private evt: EventService,
private net: NetService,
private auth: AuthService,
private org: OrgService,
- private pcrud: PcrudService
+ private pcrud: PcrudService,
+ private toast: ToastService
) {
this.sources = [];
this.recordSaved = new EventEmitter<string>();
const evt = this.evt.parse(response);
if (evt) {
console.error(evt);
- // TODO: toast
+ this.failMsg.current().then(msg => this.toast.warning(msg));
+ return;
}
- // TODO: toast
+ this.successMsg.current().then(msg => this.toast.success(msg));
this.recordSaved.emit(xml);
return response;
});