From: Galen Charlton Date: Thu, 9 Jul 2020 16:37:50 +0000 (-0400) Subject: improve display of the EDI Default field (LH#23) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=748ee76278b2379eec4db4b8fd7084147f3a4608;p=working%2FEvergreen.git improve display of the EDI Default field (LH#23) Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-details.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-details.component.ts index e60d12110c..4852fd421a 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-details.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-details.component.ts @@ -42,12 +42,15 @@ export class ProviderDetailsComponent implements OnInit { } _deflesh() { - // unflesh the currency type field so that the record editor - // can display it + // unflesh the currency type and edi_default fields so that the + // record editor can display them // TODO: make fm-editor be able to handle fleshed linked fields if (this.provider.currency_type()) { this.provider.currency_type(this.provider.currency_type().code()); } + if (this.provider.edi_default()) { + this.provider.edi_default(this.provider.edi_default().id()); + } } updateProvider(providerId: any) { diff --git a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-record.service.ts b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-record.service.ts index 792e31f6d9..9547fb91f5 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-record.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-record.service.ts @@ -42,7 +42,7 @@ export class ProviderRecordService { flesh_fields: { acqpro: [ 'attributes', 'holdings_subfields', 'contacts', 'addresses', 'provider_notes', - 'edi_accounts', 'currency_type' + 'edi_accounts', 'currency_type', 'edi_default' ], acqpa: ['provider'], acqpc: ['provider','addresses'], @@ -63,21 +63,6 @@ export class ProviderRecordService { return this.currentProvider ? this.currentProvider.record : null; } - // FIXME: ultimately, this is needed because eg-fm-record-editor currently can't - // handle records that have linked fields fleshed; if/when it could, - // we could just flesh edi_default and be done - currentEdiDefault(): Promise { - if (this.currentProviderId) { - if (this.currentProvider.record.edi_default()) { - return this.pcrud.retrieve('acqedi', this.currentProvider.record.edi_default()).toPromise(); - } else { - return Promise.resolve(null); - } - } else { - return Promise.reject(); - } - } - fetch(id: number): Promise { return new Promise((resolve, reject) => { this.getProviderRecord(id).subscribe( diff --git a/Open-ILS/src/eg2/src/app/staff/acq/provider/summary-pane.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/provider/summary-pane.component.ts index e2d6965de6..28997b9dc0 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/provider/summary-pane.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/provider/summary-pane.component.ts @@ -140,13 +140,7 @@ export class AcqProviderSummaryPaneComponent implements OnInit, AfterViewInit { this.provider_holding_tag = provider.holding_tag(); this.provider_addresses = provider.addresses(); this.provider_san = provider.san(); - if (provider.edi_default()) { - this.prov.currentEdiDefault().then(acqedi => { - this.provider_edi_default = acqedi.label(); - }); - } else { - this.provider_edi_default = ''; - } + this.provider_edi_default = provider.edi_default() ? provider.edi_default().label() : ''; this.provider_active = provider.active(); this.provider_prepayment_required = provider.prepayment_required(); this.provider_url = provider.url();