From: Bill Erickson Date: Wed, 14 Jul 2021 14:52:44 +0000 (-0400) Subject: LPLP1929741 Optional experimental Acq; seed data X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ad55b9af0fc39c1b4b2ec632eb65104a4d436573;p=working%2FEvergreen.git LPLP1929741 Optional experimental Acq; seed data Adds and org setting and a workstation setting to 1) enable display of experimental Angular ACQ UI's and 2) enable display of links to the experimental UI's from search results. Display a new menu entry "Acquisitions (Experimental)" when the org setting is enabled. This menu contains "Create Purchase Order" only for now. Copy seed data from upgrade file to seed data file. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton Signed-off-by: Jane Sandberg --- 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 81c1d7e354..b78a2bdb6b 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,6 +160,16 @@ [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 1ddc94f9c1..0f0646fc97 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 @@ -4,7 +4,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 {AcqSearchTerm, AcqSearch} from './acq-search.service'; +import {AcqSearchService, AcqSearchTerm, AcqSearch} from './acq-search.service'; import {ServerStoreService} from '@eg/core/server-store.service'; @Component({ @@ -47,6 +47,7 @@ export class AcqSearchFormComponent implements OnInit, OnChanges { private store: ServerStoreService, private idl: IdlService, private toast: ToastService, + private acqSearch: AcqSearchService ) {} ngOnInit() { @@ -239,4 +240,18 @@ export class AcqSearchFormComponent implements OnInit, 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.module.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.module.ts index 4dc22517f1..1fea224ec1 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.module.ts @@ -11,6 +11,7 @@ import {PicklistCreateDialogComponent} from './picklist-create-dialog.component' import {PicklistCloneDialogComponent} from './picklist-clone-dialog.component'; import {PicklistDeleteDialogComponent} from './picklist-delete-dialog.component'; import {PicklistMergeDialogComponent} from './picklist-merge-dialog.component'; +import {AcqSearchService} from './acq-search.service'; @NgModule({ declarations: [ @@ -28,7 +29,8 @@ import {PicklistMergeDialogComponent} from './picklist-merge-dialog.component'; imports: [ StaffCommonModule, AcqSearchRoutingModule - ] + ], + providers: [AcqSearchService] }) export class AcqSearchModule { 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 e25495c4fd..b1367dab73 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,6 +9,7 @@ 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', @@ -108,11 +109,15 @@ 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; @@ -281,4 +286,15 @@ 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/invoice-results.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/invoice-results.component.ts index e187963710..13c22cf350 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/invoice-results.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/invoice-results.component.ts @@ -16,8 +16,7 @@ import {AcqSearchFormComponent} from './acq-search-form.component'; @Component({ selector: 'eg-invoice-results', - templateUrl: 'invoice-results.component.html', - providers: [AcqSearchService] + templateUrl: 'invoice-results.component.html' }) export class InvoiceResultsComponent implements OnInit { 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 bfd16526e2..9b39ef3674 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 @@ -3,32 +3,67 @@ defaultSearchSetting="eg.acq.search.default.lineitems"> - - {{lineitem.id()}} - - - {{lineitem.id()}} - + + + + {{lineitem.id()}} + + + {{lineitem.id()}} + + + + + + {{lineitem.id()}} + + + {{lineitem.id()}} + + - - {{lineitem.purchase_order().name()}} - + + + {{lineitem.purchase_order().name()}} + + + + + {{lineitem.purchase_order().name()}} + + - - {{lineitem.picklist().name()}} - + + + {{lineitem.picklist().name()}} + + + + + + {{lineitem.picklist().name()}} + + @@ -51,11 +86,27 @@
  • Catalog
  • -
  • Worksheet
  • +
  • + + Worksheet + + + Worksheet + +
  • +
  • - Purchase Order
  • + + Purchase Order + + + Purchase Order + +
  • Requests
  • @@ -65,8 +116,15 @@ Queue
  • - Selection List
  • + + 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 044b3e23e2..6c757f8e7d 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 @@ -13,8 +13,7 @@ import {AcqSearchFormComponent} from './acq-search-form.component'; @Component({ selector: 'eg-lineitem-results', - templateUrl: 'lineitem-results.component.html', - providers: [AcqSearchService] + templateUrl: 'lineitem-results.component.html' }) export class LineitemResultsComponent implements OnInit { @@ -71,4 +70,8 @@ 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; + } } 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 612b5a09da..9aaeea048f 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,9 +13,17 @@ - - {{selectionlist.name()}} - + + + {{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 899f0cae80..4fafe8358a 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 @@ -20,8 +20,7 @@ import {AcqSearchFormComponent} from './acq-search-form.component'; @Component({ selector: 'eg-picklist-results', - templateUrl: 'picklist-results.component.html', - providers: [AcqSearchService] + templateUrl: 'picklist-results.component.html' }) export class PicklistResultsComponent implements OnInit { @@ -86,6 +85,14 @@ export class PicklistResultsComponent implements OnInit { }; } + showExpAngOptions(): boolean { + return this.acqSearch.angSelectionEnabled; + } + + showExpAngLinks(): boolean { + return this.acqSearch.angSearchLinksEnabled; + } + openCreateDialog() { this.picklistCreateDialog.open().subscribe( modified => { 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 7f8a81df50..679870803d 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,10 +4,17 @@ defaultSearchSetting="eg.acq.search.default.purchaseorders"> - - {{purchaseorder.name()}} - + + + {{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 81e7db51d5..b4556d8136 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 @@ -14,7 +14,6 @@ import {AcqSearchFormComponent} from './acq-search-form.component'; @Component({ selector: 'eg-purchase-order-results', templateUrl: 'purchase-order-results.component.html', - providers: [AcqSearchService] }) export class PurchaseOrderResultsComponent implements OnInit { @@ -65,4 +64,9 @@ 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 d155e52e18..c3b559d266 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,6 +2,7 @@ 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,15 +12,15 @@ export class AttrDefsResolver implements Resolve> { constructor( private router: Router, private attrDefs: AttrDefsService, + private acqSearch: AcqSearchService ) {} resolve( route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise { - return Promise.all([ - this.attrDefs.fetchAttrDefs() - ]); + return this.attrDefs.fetchAttrDefs() + .then(_ => this.acqSearch.loadUiPrefs()); } } diff --git a/Open-ILS/src/eg2/src/app/staff/nav.component.html b/Open-ILS/src/eg2/src/app/staff/nav.component.html index af3a9fbd5a..95bd530a64 100644 --- a/Open-ILS/src/eg2/src/app/staff/nav.component.html +++ b/Open-ILS/src/eg2/src/app/staff/nav.component.html @@ -316,6 +316,21 @@ + +