From 61c12e1487d39330dff0cbfd9770ee486a3e3bc3 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Wed, 14 Dec 2022 00:57:25 -0500 Subject: [PATCH] lp1857911 angularized stat cat admin interfaces * for stat cats and stat cat entries in the IDL, make sure we have pcrud controller enabled and pcrud permissions set. Also set config_field for "entries" so that the AdminPage component can link them out to their own admin pages * item and patron stat cat admin pages * lp1857911 release notes Leverages the BasicAdminPage component, with some tweaks. Changes to the BasicAdminPage and AdminPage components all default to off, so should not affect existing interfaces: * add an option to hide the Clear Filters action from subordinate admin pages (when you follow config fields) * add an option to propagate recordLabel to the fmEditor component, and also use said label within the admin page * add an option to propagate orgDefaultAllowed to the fmEditor component For the stat cat and entry admin pages specifically, we leverage these to: * hide Clear Filters so that we don't let the user get into a situation where they try to create a new stat cat entry but have a blank and unsettable stat cat field (because we mark that field as read-only in the fmEditor) * default the Owner field for new stat cats and entries to the workstation library * use Item and Patron instead of Asset and Actor in various labels (at least until we're ready to make that change wholesale in the IDL) Signed-off-by: Jason Etheridge Signed-off-by: Jane Sandberg --- Open-ILS/examples/fm_IDL.xml | 35 ++++++++++++++-- .../admin/basic-admin-page.component.spec.ts | 3 ++ .../staff/admin/basic-admin-page.component.ts | 13 +++++- .../local/admin-local-splash.component.html | 4 ++ .../app/staff/admin/local/routing.module.ts | 42 +++++++++++++++++++ .../admin-page/admin-page.component.html | 18 ++++---- .../share/admin-page/admin-page.component.ts | 9 ++++ docs/RELEASE_NOTES_NEXT/miscellaneous.adoc | 2 + 8 files changed, 112 insertions(+), 14 deletions(-) diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 8bccb8118d..949ed2b1c2 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -7401,7 +7401,7 @@ SELECT usr, - + @@ -7418,8 +7418,12 @@ SELECT usr, + - + + + + @@ -7458,7 +7462,7 @@ SELECT usr, - + @@ -7749,7 +7753,7 @@ SELECT usr, - + @@ -7762,6 +7766,20 @@ SELECT usr, + + + + + + + + + + + + + + @@ -8883,7 +8901,16 @@ SELECT usr, + + + + + + + + + diff --git a/Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.spec.ts b/Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.spec.ts index 764c473b4d..ac5bcd9e79 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.spec.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.spec.ts @@ -30,11 +30,14 @@ class MockAdminPageComponent { @Input() configLinkBasePath: string; @Input() defaultNewRecord: IdlObject; @Input() disableOrgFilter: boolean; + @Input() hideClearFilters: boolean; @Input() fieldOrder: string; @Input() idlClass: string; @Input() persistKeyPfx: string; @Input() readonlyFields: string; @Input() enableUndelete: boolean; + @Input() recordLabel: string; + @Input() orgDefaultAllowed: string; } describe('Component: BasicAdminPage', () => { diff --git a/Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.ts index cd6dbde0d4..7332f6a4c7 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.ts @@ -11,14 +11,17 @@ import {tap, switchMap} from 'rxjs/operators'; @Component({ template: ` - + - + @@ -33,6 +36,9 @@ export class BasicAdminPageComponent implements OnInit { persistKeyPfx: string; fieldOrder = ''; readonlyFields = ''; + recordLabel = ''; + orgDefaultAllowed = ''; + hideClearFilters: boolean; defaultNewRecordIdl: IdlObject; configLinkBasePath = '/staff/admin'; @@ -79,6 +85,9 @@ export class BasicAdminPageComponent implements OnInit { this.enableUndelete = data['enableUndelete']; this.fieldOrder = data['fieldOrder']; this.readonlyFields = data['readonlyFields']; + this.recordLabel = data['recordLabel']; + this.orgDefaultAllowed = data['orgDefaultAllowed']; + this.hideClearFilters = data['hideClearFilters']; this.defaultNewRecord = data['defaultNewRecord']; } diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/admin-local-splash.component.html b/Open-ILS/src/eg2/src/app/staff/admin/local/admin-local-splash.component.html index 92d22f03e4..b5eb8734b6 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/admin-local-splash.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/admin-local-splash.component.html @@ -72,6 +72,10 @@ routerLink="/staff/admin/local/config/standing_penalty"> + + import('./negative-balances/negative-balances.module').then(m => m.NegativeBalancesModule) +}, { + path: 'asset/stat_cat', + component: BasicAdminPageComponent, + data: [{ + schema: 'asset', + table: 'stat_cat', + readonlyFields: 'id', + orgDefaultAllowed: 'owner', + recordLabel: $localize `Item Statistical Category`, + fieldOrder: 'name,owner,required,opac_visible,checkout_archive,sip_field,sip_format'}] +}, { + path: 'asset/stat_cat_entry', + component: BasicAdminPageComponent, + data: [{ + schema: 'asset', + table: 'stat_cat_entry', + readonlyFields: 'id,stat_cat', + orgDefaultAllowed: 'owner', + recordLabel: $localize `Item Statistical Category Entry`, + hideClearFilters: true, + fieldOrder: 'stat_cat,value,owner'}] +}, { + path: 'actor/stat_cat', + component: BasicAdminPageComponent, + data: [{ + schema: 'actor', + table: 'stat_cat', + readonlyFields: 'id', + orgDefaultAllowed: 'owner', + recordLabel: $localize `Patron Statistical Category`, + fieldOrder: 'name,owner,required,opac_visible,usr_summary,allow_freetext,checkout_archive,sip_field,sip_format'}] +}, { + path: 'actor/stat_cat_entry', + component: BasicAdminPageComponent, + data: [{ + schema: 'actor', + table: 'stat_cat_entry', + readonlyFields: 'id,stat_cat', + orgDefaultAllowed: 'owner', + recordLabel: $localize `Patron Statistical Category Entry`, + hideClearFilters: true, + fieldOrder: 'stat_cat,value,owner'}] }, { path: ':schema/:table', component: BasicAdminPageComponent diff --git a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html index 7f672d2348..877dc94952 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html @@ -1,13 +1,13 @@ -{{idlClassDef.label}} Update Succeeded +{{recordLabel || idlClassDef.label}} Update Succeeded -Update of {{idlClassDef.label}} failed +Update of {{recordLabel || idlClassDef.label}} failed -Delete of {{idlClassDef.label}} failed or was not allowed +Delete of {{recordLabel || idlClassDef.label}} failed or was not allowed -{{idlClassDef.label}} Successfully Deleted +{{recordLabel || idlClassDef.label}} Successfully Deleted Undelete of {{idlClassDef.label}} failed or was not allowed @@ -16,10 +16,10 @@ {{idlClassDef.label}} Successfully undeleted -{{idlClassDef.label}} Successfully Created +{{recordLabel || idlClassDef.label}} Successfully Created -Failed to create new {{idlClassDef.label}} +Failed to create new {{recordLabel || idlClassDef.label}} @@ -38,7 +38,7 @@
Filters Applied: {{gridFilters | json}} - Clear Filters @@ -63,7 +63,7 @@ (onRowActivate)="showEditDialog($event)" [filterable]="true" [stickyHeader]="true"> + label="New {{recordLabel || idlClassDef.label}}" i18n-label (onClick)="createNew()"> @@ -87,10 +87,12 @@ diff --git a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts index d9de7bde3d..cf24c436af 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts @@ -82,6 +82,15 @@ export class AdminPageComponent implements OnInit { // Optional comma-separated list of read-only fields @Input() readonlyFields: string; + // Optional record label to use instead of the IDL label + @Input() recordLabel: string; + + // optional flag to hide the Clear Filters action for gridFilters + @Input() hideClearFilters: boolean; + + // optional list of org fields which are allowed a default if unset + @Input() orgDefaultAllowed: string; + // Optional template containing help/about text which will // be added to the page, above the grid. @Input() helpTemplate: TemplateRef; diff --git a/docs/RELEASE_NOTES_NEXT/miscellaneous.adoc b/docs/RELEASE_NOTES_NEXT/miscellaneous.adoc index 70b54406b7..c7a9dcde10 100644 --- a/docs/RELEASE_NOTES_NEXT/miscellaneous.adoc +++ b/docs/RELEASE_NOTES_NEXT/miscellaneous.adoc @@ -29,3 +29,5 @@ UPDATE_COPY permission the new UPDATE_COPY_BARCODE permission at the same depth, though it's technically not needed. * Patron and staff login forms now include a button to reveal the password input. (LP#1977554) +* Adds new Local Administration entries for Item Statistical Categories Editor and Patron Statistical Categories Editor, which are angularized interfaces. +* Tweaks eg-grids to underline hyperlinks within cells. This potentially affects multiple interfaces. -- 2.43.2