From 95331c22c6c0a7557404dd0185ead17e120759ba Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 11 Dec 2019 17:03:19 -0500 Subject: [PATCH] LP1852782 Progress indicator while saving MARC records Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg --- .../app/staff/share/marc-edit/editor.component.html | 11 ++++++++++- .../src/app/staff/share/marc-edit/editor.component.ts | 7 +++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html index dea85817e1..7daa2c89b2 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html @@ -45,7 +45,16 @@ [disabled]="record && record.deleted" i18n>Save Changes -
+ + +
+
+ +
+
+
+ +
diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts index 1ecfb9e6e6..02c9b459cd 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts @@ -35,6 +35,9 @@ export class MarcEditorComponent implements OnInit { sources: ComboboxEntry[]; context: MarcEditContext; + // True if the save request is in flight + dataSaving: boolean; + @Input() recordType: 'biblio' | 'authority' = 'biblio'; @Input() set recordId(id: number) { @@ -87,6 +90,8 @@ export class MarcEditorComponent implements OnInit { this.sources = []; this.recordSaved = new EventEmitter(); this.context = new MarcEditContext(); + + this.recordSaved.subscribe(_ => this.dataSaving = false); } ngOnInit() { @@ -135,6 +140,7 @@ export class MarcEditorComponent implements OnInit { saveRecord(): Promise { const xml = this.record.toXml(); + this.dataSaving = true; // Save actions clears any pending changes. this.context.changesPending = false; @@ -166,6 +172,7 @@ export class MarcEditorComponent implements OnInit { if (evt) { console.error(evt); this.failMsg.current().then(msg => this.toast.warning(msg)); + this.dataSaving = false; return; } -- 2.43.2