[disabled]="record && record.deleted" i18n>Save Changes</button>
</div>
-<div class="row">
+
+<ng-container *ngIf="dataSaving">
+ <div class="row mt-5">
+ <div class="offset-lg-3 col-lg-6">
+ <eg-progress-inline></eg-progress-inline>
+ </div>
+ </div>
+</ng-container>
+
+<div *ngIf="!dataSaving" class="row">
<div class="col-lg-12">
<ngb-tabset [activeId]="editorTab" (tabChange)="tabChange($event)">
<ngb-tab title="Enhanced MARC Editor" i18n-title id="rich">
sources: ComboboxEntry[];
context: MarcEditContext;
+ // True if the save request is in flight
+ dataSaving: boolean;
+
@Input() recordType: 'biblio' | 'authority' = 'biblio';
@Input() set recordId(id: number) {
this.sources = [];
this.recordSaved = new EventEmitter<MarcSavedEvent>();
this.context = new MarcEditContext();
+
+ this.recordSaved.subscribe(_ => this.dataSaving = false);
}
ngOnInit() {
saveRecord(): Promise<any> {
const xml = this.record.toXml();
+ this.dataSaving = true;
// Save actions clears any pending changes.
this.context.changesPending = false;
if (evt) {
console.error(evt);
this.failMsg.current().then(msg => this.toast.warning(msg));
+ this.dataSaving = false;
return;
}