Bugzilla – Attachment 176828 Details for
Bug 38930
Add a permissions store for Vue apps
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38930: (DO NOT PUSH) Add an example to ERM
Bug-38930-DO-NOT-PUSH-Add-an-example-to-ERM.patch (text/plain), 4.19 KB, created by
Matt Blenkinsop
on 2025-01-20 15:42:55 UTC
(
hide
)
Description:
Bug 38930: (DO NOT PUSH) Add an example to ERM
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2025-01-20 15:42:55 UTC
Size:
4.19 KB
patch
obsolete
>From 6277bf1ea39f212aea862543757f7a81871dbcae Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Fri, 17 Jan 2025 17:05:46 +0000 >Subject: [PATCH] Bug 38930: (DO NOT PUSH) Add an example to ERM > >--- > .../prog/js/vue/components/ERM/AgreementsList.vue | 6 ++++++ > .../intranet-tmpl/prog/js/vue/components/ERM/Main.vue | 10 ++++++++-- > koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts | 3 +++ > 3 files changed, 17 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >index c1934e6daf9..c0120ac7579 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >@@ -6,6 +6,9 @@ > :to="{ name: 'AgreementsFormAdd' }" > icon="plus" > :title="$__('New agreement')" >+ v-if=" >+ isUserPermitted('CAN_user_suggestions_suggestions_create') >+ " > /> > </Toolbar> > <fieldset v-if="agreement_count > 0" class="filters"> >@@ -72,6 +75,8 @@ export default { > const vendorStore = inject("vendorStore") > const { vendors } = storeToRefs(vendorStore) > >+ const { isUserPermitted } = inject("permissionsStore") >+ > const { setConfirmationDialog, setMessage } = inject("mainStore") > > const { get_lib_from_av, map_av_dt_filter } = inject("ERMStore") >@@ -94,6 +99,7 @@ export default { > escape_str, > agreement_table_settings, > filters, >+ isUserPermitted, > } > }, > data: function () { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue >index 9cbb5482f45..c09c47f991a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue >@@ -50,6 +50,9 @@ export default { > const { config, authorisedValues } = storeToRefs(ERMStore) > const { loadAuthorisedValues } = ERMStore > >+ const permissionsStore = inject("permissionsStore") >+ const { loadUserPermissions } = permissionsStore >+ > return { > vendorStore, > ERMStore, >@@ -59,6 +62,7 @@ export default { > loaded, > loadAuthorisedValues, > authorisedValues, >+ loadUserPermissions, > } > }, > data() { >@@ -82,8 +86,10 @@ export default { > this.authorisedValues, > this.ERMStore > ).then(() => { >- this.loaded() >- this.initialized = true >+ this.loadUserPermissions().then(() => { >+ this.loaded() >+ this.initialized = true >+ }) > }) > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts >index 4dcca91eddc..775f771e621 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts >@@ -24,6 +24,7 @@ import { useVendorStore } from "../stores/vendors"; > import { useERMStore } from "../stores/erm"; > import { useNavigationStore } from "../stores/navigation"; > import { useReportsStore } from "../stores/usage-reports"; >+import { usePermissionsStore } from "../stores/permissions"; > import i18n from "../i18n"; > > const pinia = createPinia(); >@@ -31,6 +32,7 @@ const pinia = createPinia(); > const mainStore = useMainStore(pinia); > const navigationStore = useNavigationStore(pinia); > const routes = navigationStore.setRoutes(routesDef); >+const permissionsStore = usePermissionsStore(pinia); > > const router = createRouter({ > history: createWebHistory(), >@@ -50,6 +52,7 @@ const rootComponent = app > app.config.unwrapInjectedRef = true; > app.provide("vendorStore", useVendorStore(pinia)); > app.provide("mainStore", mainStore); >+app.provide("permissionsStore", permissionsStore); > app.provide("navigationStore", navigationStore); > const ERMStore = useERMStore(pinia); > app.provide("ERMStore", ERMStore); >-- >2.48.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38930
:
176826
|
176827
|
176828
|
178245
|
178246
|
178247