From f443560a555785a009eeec5fbb3d6d6b3538efb7 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 31 Aug 2020 21:31:02 -0400 Subject: [PATCH] LH#21: tweak holding tag form Signed-off-by: Galen Charlton --- .../acq/provider/provider-holdings.component.html | 26 ++++++++++++++-------- .../acq/provider/provider-holdings.component.ts | 22 +++++++++++++++--- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-holdings.component.html b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-holdings.component.html index 57cd3f5005..897ddf8c91 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-holdings.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-holdings.component.html @@ -4,6 +4,8 @@ + + @@ -21,14 +23,19 @@ - +
+
+ +
+ +
+
+ +
+
+
- + diff --git a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-holdings.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-holdings.component.ts index 699b2004ca..d79a954d74 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-holdings.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-holdings.component.ts @@ -33,6 +33,8 @@ export class ProviderHoldingsComponent implements OnInit, AfterViewInit { @ViewChild('updateFailedString', { static: false }) updateFailedString: StringComponent; @ViewChild('deleteFailedString', { static: true }) deleteFailedString: StringComponent; @ViewChild('deleteSuccessString', { static: true }) deleteSuccessString: StringComponent; + @ViewChild('successTagString', { static: true }) successTagString: StringComponent; + @ViewChild('updateFailedTagString', { static: false }) updateFailedTagString: StringComponent; cellTextGenerator: GridCellTextGenerator; provider: IdlObject; @@ -101,9 +103,23 @@ export class ProviderHoldingsComponent implements OnInit, AfterViewInit { } updateProvider(providerId: any) { - this.providerRecord.refreshCurrent().then(() => { - this.provider = this.providerRecord.current(); - }); + this.provider.holding_tag(this.provider._holding_tag); + this.provider.ischanged(true); + this.providerRecord.batchUpdate([this.provider]).subscribe( + val => { + this.successTagString.current() + .then(str => this.toast.success(str)); + }, + err => { + this.updateFailedTagString.current() + .then(str => this.toast.danger(str)); + }, + () => { + this.providerRecord.refreshCurrent().then( + () => { this.provider = this.providerRecord.current(); } + ); + } + ); } getDataSource(): GridDataSource { -- 2.11.0