From 7b6e0b389e3e714e1080774782218d5d050d4de9 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 9 Dec 2021 16:45:24 -0500 Subject: [PATCH] LP#1942220: change how linking to Dojo interfaces is handled This patch takes out the notion that the Angular acquisitions interface is experimental in favor of a different setting that controls whether or not the Angular PO summary links to the legacy PO interface. IOW, this change pushes the user towards using the new interfaces and dipping into the old ones only one necessary. Additional links (e.g., to the legacy LI worksheet page) could be readily added as needed. Signed-off-by: Galen Charlton --- .../src/app/staff/acq/po/summary.component.html | 6 +++ .../eg2/src/app/staff/acq/po/summary.component.ts | 11 ++++- .../acq/search/acq-search-form.component.html | 10 ---- .../staff/acq/search/acq-search-form.component.ts | 19 +------- .../src/app/staff/acq/search/acq-search.service.ts | 15 ------ .../acq/search/lineitem-results.component.html | 54 +++------------------- .../staff/acq/search/lineitem-results.component.ts | 7 +-- .../acq/search/picklist-results.component.html | 8 +--- .../staff/acq/search/picklist-results.component.ts | 10 +--- .../search/purchase-order-results.component.html | 7 +-- .../acq/search/purchase-order-results.component.ts | 5 -- .../src/app/staff/acq/search/resolver.service.ts | 9 ++-- Open-ILS/src/eg2/src/app/staff/resolver.service.ts | 1 - Open-ILS/src/sql/Pg/950.data.seed-values.sql | 6 +-- .../Pg/upgrade/XXXX.data.picklist-po-angular.sql | 11 ----- .../src/sql/Pg/upgrade/YYYY.data.acq-sprint-4.sql | 10 ++++ Open-ILS/src/templates/staff/navbar.tt2 | 16 ------- .../web/js/ui/default/staff/services/navbar.js | 3 -- 18 files changed, 47 insertions(+), 161 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.html b/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.html index 7555120345..f3df273e46 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.html @@ -223,6 +223,12 @@ Finalize Blanket Order + + | + + Show PO in Legacy Interface + + diff --git a/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.ts index 7467bc6a55..66d19d0694 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.ts @@ -40,6 +40,7 @@ export class PoSummaryComponent implements OnInit, OnDestroy { zeroCopyActivate = false; canActivate: boolean = null; canFinalize = false; + showLegacyLinks = false; activationBlocks: EgEvent[] = []; activationEvent: EgEvent; @@ -107,7 +108,8 @@ export class PoSummaryComponent implements OnInit, OnDestroy { }) .then(_ => this.setCanActivate()) - .then(_ => this.setCanFinalize()); + .then(_ => this.setCanFinalize()) + .then(_ => this.loadUiPrefs()); } // Can run via Enter or blur. If it just ran via Enter, avoid @@ -273,6 +275,13 @@ export class PoSummaryComponent implements OnInit, OnDestroy { .subscribe(_ => this.canFinalize = true); } + loadUiPrefs() { + return this.store.getItemBatch(['ui.staff.acq.show_deprecated_links']) + .then(settings => { + this.showLegacyLinks = settings['ui.staff.acq.show_deprecated_links']; + }); + } + finalizePo() { this.confirmFinalize.open().subscribe(confirmed => { diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.html b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.html index 3e68276f28..ba724dce33 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.html @@ -160,16 +160,6 @@ [ngModelOptions]="{standalone: true}" [(ngModel)]="runImmediately"/> -
-
- - -
-
diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts index ef5b9214f1..335153d0b3 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts @@ -6,7 +6,7 @@ import {IdlService, IdlObject} from '@eg/core/idl.service'; import {PcrudService} from '@eg/core/pcrud.service'; import {StringComponent} from '@eg/share/string/string.component'; import {ToastService} from '@eg/share/toast/toast.service'; -import {AcqSearchService, AcqSearchTerm, AcqSearch} from './acq-search.service'; +import {AcqSearchTerm, AcqSearch} from './acq-search.service'; import {ServerStoreService} from '@eg/core/server-store.service'; @Component({ @@ -50,8 +50,7 @@ export class AcqSearchFormComponent implements OnInit, AfterViewInit, OnChanges private pcrud: PcrudService, private store: ServerStoreService, private idl: IdlService, - private toast: ToastService, - private acqSearch: AcqSearchService + private toast: ToastService ) {} ngOnInit() { @@ -246,18 +245,4 @@ export class AcqSearchFormComponent implements OnInit, AfterViewInit, OnChanges saveRunImmediately() { return this.store.setItem(this.runImmediatelySetting, this.runImmediately); } - - showExpAngOptions(): boolean { - return this.acqSearch.angSelectionEnabled; - } - - showExpAngLinks(): boolean { - return this.acqSearch.angSearchLinksEnabled; - } - - toggleExpSearchLinks() { - this.acqSearch.angSearchLinksEnabled = !this.acqSearch.angSearchLinksEnabled; - this.store.setItem('ui.staff.angular_acq_search.enabled', - this.acqSearch.angSearchLinksEnabled); - } } diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts index b1367dab73..577f6ba1dc 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts @@ -9,7 +9,6 @@ import {Pager} from '@eg/share/util/pager'; import {IdlObject} from '@eg/core/idl.service'; import {EventService} from '@eg/core/event.service'; import {AttrDefsService} from './attr-defs.service'; -import {ServerStoreService} from '@eg/core/server-store.service'; const baseIdlClass = { lineitem: 'jub', @@ -109,15 +108,11 @@ export class AcqSearchService { _conjunction = 'all'; firstRun = true; - angSelectionEnabled = false; - angSearchLinksEnabled = false; - constructor( private net: NetService, private evt: EventService, private auth: AuthService, private pcrud: PcrudService, - private serverStore: ServerStoreService, private attrDefs: AttrDefsService ) { this.firstRun = true; @@ -287,14 +282,4 @@ export class AcqSearchService { return gridSource; } - loadUiPrefs(): Promise { - return this.serverStore.getItemBatch([ - 'ui.staff.angular_acq_selection.enabled', - 'ui.staff.angular_acq_search.enabled' - ]).then(sets => { - this.angSelectionEnabled = sets['ui.staff.angular_acq_selection.enabled']; - this.angSearchLinksEnabled = - sets['ui.staff.angular_acq_search.enabled'] && this.angSelectionEnabled; - }); - } } diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.html b/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.html index 741289db04..f52b046162 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.html @@ -4,7 +4,7 @@ - + @@ -17,54 +17,26 @@ - - - - {{lineitem.id()}} - - - {{lineitem.id()}} - - - + {{lineitem.purchase_order().name()}} - - - {{lineitem.purchase_order().name()}} - - - + {{lineitem.picklist().name()}} - - - - {{lineitem.picklist().name()}} - - @@ -88,25 +60,17 @@ Catalog
  • - - + Worksheet - - Worksheet -
  • - + Purchase Order - - Purchase Order -
  • Requests
  • @@ -117,14 +81,10 @@ Queue
  • - + Selection List - - Selection List -
  • diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.ts index 6c757f8e7d..4e91b8eb04 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.ts @@ -68,10 +68,7 @@ export class LineitemResultsComponent implements OnInit { } showRow(row: any) { - window.open('/eg/staff/acq/legacy/lineitem/worksheet/' + row.id(), '_blank'); - } - - showExpAngLinks(): boolean { - return this.acqSearch.angSearchLinksEnabled; + window.open('/eg2/staff/acq/po/' + row.purchase_order().id() + + '/lineitem/' + row.id() + '/worksheet', '_blank'); } } diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-results.component.html b/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-results.component.html index 9aaeea048f..7d03199419 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-results.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-results.component.html @@ -13,17 +13,11 @@ - + {{selectionlist.name()}} - - - {{selectionlist.name()}} - - diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-results.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-results.component.ts index 4fafe8358a..65d27e8b5f 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-results.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-results.component.ts @@ -85,14 +85,6 @@ export class PicklistResultsComponent implements OnInit { }; } - showExpAngOptions(): boolean { - return this.acqSearch.angSelectionEnabled; - } - - showExpAngLinks(): boolean { - return this.acqSearch.angSearchLinksEnabled; - } - openCreateDialog() { this.picklistCreateDialog.open().subscribe( modified => { @@ -138,7 +130,7 @@ export class PicklistResultsComponent implements OnInit { } showRow(row: any) { - window.open('/eg/staff/acq/legacy/picklist/view/' + row.id(), '_blank'); + window.open('/eg2/staff/acq/picklist/' + row.id(), '_blank'); } doSearch(search: AcqSearch) { diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/purchase-order-results.component.html b/Open-ILS/src/eg2/src/app/staff/acq/search/purchase-order-results.component.html index 456027ebf3..14f78de756 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/purchase-order-results.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/purchase-order-results.component.html @@ -4,16 +4,11 @@ defaultSearchSetting="eg.acq.search.default.purchaseorders"> - + {{purchaseorder.name()}} - - - {{purchaseorder.name()}} - - diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/purchase-order-results.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/purchase-order-results.component.ts index 7e583bf080..254e124224 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/purchase-order-results.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/purchase-order-results.component.ts @@ -64,9 +64,4 @@ export class PurchaseOrderResultsComponent implements OnInit { this.purchaseOrderResultsGrid.reload(); }); } - - showExpAngLinks(): boolean { - return this.acqSearch.angSearchLinksEnabled; - } - } diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/resolver.service.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/resolver.service.ts index c3b559d266..bdc46389e3 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/resolver.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/resolver.service.ts @@ -2,7 +2,6 @@ import {Injectable} from '@angular/core'; import {Router, Resolve, RouterStateSnapshot, ActivatedRouteSnapshot} from '@angular/router'; import {AttrDefsService} from './attr-defs.service'; -import {AcqSearchService} from './acq-search.service'; @Injectable() export class AttrDefsResolver implements Resolve> { @@ -11,16 +10,16 @@ export class AttrDefsResolver implements Resolve> { constructor( private router: Router, - private attrDefs: AttrDefsService, - private acqSearch: AcqSearchService + private attrDefs: AttrDefsService ) {} resolve( route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise { - return this.attrDefs.fetchAttrDefs() - .then(_ => this.acqSearch.loadUiPrefs()); + return Promise.all([ + this.attrDefs.fetchAttrDefs() + ]); } } diff --git a/Open-ILS/src/eg2/src/app/staff/resolver.service.ts b/Open-ILS/src/eg2/src/app/staff/resolver.service.ts index 13969a667d..0ce843cfd4 100644 --- a/Open-ILS/src/eg2/src/app/staff/resolver.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/resolver.service.ts @@ -142,7 +142,6 @@ export class StaffResolver implements Resolve> { 'webstaff.format.date_and_time', 'ui.staff.max_recent_patrons', 'circ.curbside', // navbar - 'ui.staff.angular_acq_selection.enabled', // navbar 'ui.staff.angular_catalog.enabled' // navbar ]).then(settings => { // Avoid clobbering defaults diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index b7a549bd1b..c1fdc50eeb 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -21898,10 +21898,10 @@ VALUES ( INSERT INTO config.org_unit_setting_type (name, grp, datatype, label) VALUES ( - 'ui.staff.angular_acq_selection.enabled', 'gui', 'bool', + 'ui.staff.acq.show_deprecated_links', 'gui', 'bool', oils_i18n_gettext( - 'ui.staff.angular_acq_selection.enabled', - 'Enable Experimental ACQ Selection/Purchase Interfaces', + 'ui.staff.acq.show_deprecated_links', + 'Display Links to Deprecated Acquisitions Interfaces', 'cwst', 'label' ) ); diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.picklist-po-angular.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.picklist-po-angular.sql index 242da1065b..ab370fb6d8 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.picklist-po-angular.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.picklist-po-angular.sql @@ -40,17 +40,6 @@ VALUES ( ) ); -INSERT INTO config.org_unit_setting_type (name, grp, datatype, label) -VALUES ( - 'ui.staff.angular_acq_selection.enabled', 'gui', 'bool', - oils_i18n_gettext( - 'ui.staff.angular_acq_selection.enabled', - 'Enable Experimental ACQ Selection/Purchase Interfaces', - 'cwst', 'label' - ) -); - - INSERT INTO config.print_template (id, name, label, owner, active, locale, template) VALUES ( diff --git a/Open-ILS/src/sql/Pg/upgrade/YYYY.data.acq-sprint-4.sql b/Open-ILS/src/sql/Pg/upgrade/YYYY.data.acq-sprint-4.sql index c9f9e4dca5..4f3d5567a2 100644 --- a/Open-ILS/src/sql/Pg/upgrade/YYYY.data.acq-sprint-4.sql +++ b/Open-ILS/src/sql/Pg/upgrade/YYYY.data.acq-sprint-4.sql @@ -12,4 +12,14 @@ VALUES ( ) ); +INSERT INTO config.org_unit_setting_type (name, grp, datatype, label) +VALUES ( + 'ui.staff.acq.show_deprecated_links', 'gui', 'bool', + oils_i18n_gettext( + 'ui.staff.acq.show_deprecated_links', + 'Display Links to Deprecated Acquisitions Interfaces', + 'cwst', 'label' + ) +); + COMMIT; diff --git a/Open-ILS/src/templates/staff/navbar.tt2 b/Open-ILS/src/templates/staff/navbar.tt2 index 0fe2efef1a..3d9b9b9f8c 100644 --- a/Open-ILS/src/templates/staff/navbar.tt2 +++ b/Open-ILS/src/templates/staff/navbar.tt2 @@ -453,22 +453,6 @@ - - - -