From: Bill Erickson Date: Thu, 3 Jan 2019 15:36:07 +0000 (-0500) Subject: LP1809288 Avoid booking grid prefix doubling X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5be172fdae30e68e8036a7b066e8b29cbdfbc67b;p=evergreen%2Fpines.git LP1809288 Avoid booking grid prefix doubling Teach the booking admin to avoid doubling up the grid prefix, which would lead to grid settings with names like eg.grid.booking.booking.* Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg --- 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 908dadf1da..84219f1338 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 @@ -41,12 +41,15 @@ export class BasicAdminPageComponent implements OnInit { } const fullTable = schema + '.' + table; - // Set the prefix to "server", "local", "workstation", // extracted from the URL path. + // For admin pages that use none of these, avoid setting + // the prefix because that will cause it to double-up. + // e.g. eg.grid.acq.acq.cancel_reason this.persistKeyPfx = this.route.snapshot.parent.url[0].path; - if (this.persistKeyPfx === 'acq') { - // ACQ is a special case, becaus unlike 'server', 'local', + const selfPrefixers = ['acq', 'booking']; + if (selfPrefixers.indexOf(this.persistKeyPfx) > -1) { + // ACQ is a special case, because unlike 'server', 'local', // 'workstation', the schema ('acq') is the root of the path. this.persistKeyPfx = ''; } 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 f0d4a6a431..649ced5d83 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -19457,38 +19457,38 @@ VALUES ( INSERT into config.workstation_setting_type (name, grp, datatype, label) VALUES ( - 'eg.grid.admin.booking.booking.resource', 'gui', 'object', + 'eg.grid.admin.booking.resource', 'gui', 'object', oils_i18n_gettext ( - 'eg.grid.admin.booking.booking.resource', - 'Grid Config: admin.booking.booking.resource', + 'eg.grid.admin.booking.resource', + 'Grid Config: admin.booking.resource', 'cwst', 'label' ) ), ( - 'eg.grid.admin.booking.booking.resource_attr', 'gui', 'object', + 'eg.grid.admin.booking.resource_attr', 'gui', 'object', oils_i18n_gettext ( - 'eg.grid.admin.booking.booking.resource_attr', - 'Grid Config: admin.booking.booking.resource_attr', + 'eg.grid.admin.booking.resource_attr', + 'Grid Config: admin.booking.resource_attr', 'cwst', 'label' ) ), ( - 'eg.grid.admin.booking.booking.resource_attr_map', 'gui', 'object', + 'eg.grid.admin.booking.resource_attr_map', 'gui', 'object', oils_i18n_gettext ( - 'eg.grid.admin.booking.booking.resource_attr_map', - 'Grid Config: admin.booking.booking.resource_attr_map', + 'eg.grid.admin.booking.resource_attr_map', + 'Grid Config: admin.booking.resource_attr_map', 'cwst', 'label' ) ), ( - 'eg.grid.admin.booking.booking.resource_attr_value', 'gui', 'object', + 'eg.grid.admin.booking.resource_attr_value', 'gui', 'object', oils_i18n_gettext ( - 'eg.grid.admin.booking.booking.resource_attr_value', - 'Grid Config: admin.booking.booking.resource_attr_value', + 'eg.grid.admin.booking.resource_attr_value', + 'Grid Config: admin.booking.resource_attr_value', 'cwst', 'label' ) ), ( - 'eg.grid.admin.booking.booking.resource_type', 'gui', 'object', + 'eg.grid.admin.booking.resource_type', 'gui', 'object', oils_i18n_gettext ( - 'eg.grid.admin.booking.booking.resource_type', - 'Grid Config: admin.booking.booking.resource_type', + 'eg.grid.admin.booking.resource_type', + 'Grid Config: admin.booking.resource_type', 'cwst', 'label' ) ); diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.booking-admin-grid-settings.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.booking-admin-grid-settings.sql index 5f2d5d17b3..aad27076dc 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.booking-admin-grid-settings.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.booking-admin-grid-settings.sql @@ -4,38 +4,38 @@ BEGIN; INSERT into config.workstation_setting_type (name, grp, datatype, label) VALUES ( - 'eg.grid.admin.booking.booking.resource', 'gui', 'object', + 'eg.grid.admin.booking.resource', 'gui', 'object', oils_i18n_gettext ( - 'eg.grid.admin.booking.booking.resource', - 'Grid Config: admin.booking.booking.resource', + 'eg.grid.admin.booking.resource', + 'Grid Config: admin.booking.resource', 'cwst', 'label' ) ), ( - 'eg.grid.admin.booking.booking.resource_attr', 'gui', 'object', + 'eg.grid.admin.booking.resource_attr', 'gui', 'object', oils_i18n_gettext ( - 'eg.grid.admin.booking.booking.resource_attr', - 'Grid Config: admin.booking.booking.resource_attr', + 'eg.grid.admin.booking.resource_attr', + 'Grid Config: admin.booking.resource_attr', 'cwst', 'label' ) ), ( - 'eg.grid.admin.booking.booking.resource_attr_map', 'gui', 'object', + 'eg.grid.admin.booking.resource_attr_map', 'gui', 'object', oils_i18n_gettext ( - 'eg.grid.admin.booking.booking.resource_attr_map', - 'Grid Config: admin.booking.booking.resource_attr_map', + 'eg.grid.admin.booking.resource_attr_map', + 'Grid Config: admin.booking.resource_attr_map', 'cwst', 'label' ) ), ( - 'eg.grid.admin.booking.booking.resource_attr_value', 'gui', 'object', + 'eg.grid.admin.booking.resource_attr_value', 'gui', 'object', oils_i18n_gettext ( - 'eg.grid.admin.booking.booking.resource_attr_value', - 'Grid Config: admin.booking.booking.resource_attr_value', + 'eg.grid.admin.booking.resource_attr_value', + 'Grid Config: admin.booking.resource_attr_value', 'cwst', 'label' ) ), ( - 'eg.grid.admin.booking.booking.resource_type', 'gui', 'object', + 'eg.grid.admin.booking.resource_type', 'gui', 'object', oils_i18n_gettext ( - 'eg.grid.admin.booking.booking.resource_type', - 'Grid Config: admin.booking.booking.resource_type', + 'eg.grid.admin.booking.resource_type', + 'Grid Config: admin.booking.resource_type', 'cwst', 'label' ) );