Bugzilla – Attachment 178238 Details for
Bug 38010
Migrate vendors to Vue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38010: (QA follow-up) Rebase for bug 37930
Bug-38010-QA-follow-up-Rebase-for-bug-37930.patch (text/plain), 11.10 KB, created by
Matt Blenkinsop
on 2025-02-18 13:50:05 UTC
(
hide
)
Description:
Bug 38010: (QA follow-up) Rebase for bug 37930
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2025-02-18 13:50:05 UTC
Size:
11.10 KB
patch
obsolete
>From e1fc7ee472f9890bff27aa8be13b225a8b9a4f71 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Thu, 13 Feb 2025 09:41:29 +0000 >Subject: [PATCH] Bug 38010: (QA follow-up) Rebase for bug 37930 > >--- > .../prog/js/vue/components/Vendors/Main.vue | 72 ++++++------------- > .../vue/components/Vendors/VendorDetails.vue | 10 +-- > .../components/Vendors/VendorInterfaces.vue | 8 +-- > .../js/vue/components/Vendors/VendorList.vue | 3 +- > .../Vendors/VendorOrderingInformation.vue | 3 - > .../prog/js/vue/modules/acquisitions.ts | 4 +- > .../prog/js/vue/stores/vendors.js | 18 +++++ > 7 files changed, 49 insertions(+), 69 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/Main.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/Main.vue >index 990fdfd34bd..87d76eec324 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/Main.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/Main.vue >@@ -32,16 +32,15 @@ import LeftMenu from "../LeftMenu.vue"; > import Dialog from "../Dialog.vue"; > import "vue-select/dist/vue-select.css"; > import { storeToRefs } from "pinia"; >-import { APIClient } from "../../fetch/api-client"; > > export default { > setup() { > const vendorStore = inject("vendorStore"); >- const { config } = storeToRefs(vendorStore); >+ const { config, authorisedValues } = storeToRefs(vendorStore); >+ const { loadAuthorisedValues } = vendorStore; > > const mainStore = inject("mainStore"); > const { loading, loaded, setError } = mainStore; >- const AVStore = inject("AVStore"); > > const permissionsStore = inject("permissionsStore"); > const { userPermissions } = storeToRefs(permissionsStore); >@@ -52,61 +51,30 @@ export default { > loading, > loaded, > userPermissions, >- AVStore, > config, >+ loadAuthorisedValues, >+ authorisedValues, > }; > }, > beforeCreate() { > this.loading(); > >- const fetchConfig = () => { >- let promises = []; >- >- const av_client = APIClient.authorised_values; >- const authorised_values = { >- av_vendor_types: "VENDOR_TYPE", >- av_vendor_interface_types: "VENDOR_INTERFACE_TYPE", >- }; >- >- let av_cat_array = Object.keys(authorised_values).map( >- function (av_cat) { >- return '"' + authorised_values[av_cat] + '"'; >- } >- ); >- >- promises.push( >- av_client.values >- .getCategoriesWithValues(av_cat_array) >- .then(av_categories => { >- Object.entries(authorised_values).forEach( >- ([av_var, av_cat]) => { >- const av_match = av_categories.find( >- element => element.category_name == av_cat >- ); >- this.AVStore[av_var] = >- av_match.authorised_values; >- } >- ); >- }) >- ); >- >- return Promise.all(promises); >- }; >- >- fetchConfig().then(() => { >- this.loaded(); >- this.userPermissions = userPermissions; >- this.config.settings.edifact = edifact; >- this.config.settings.marcOrderAutomation = marcOrderAutomation; >- this.vendorStore.currencies = currencies; >- this.vendorStore.gstValues = gstValues.map(gv => { >- return { >- label: `${Number(gv.option * 100).format_price()}%`, >- value: gv.option, >- }; >- }); >- this.initialized = true; >- }); >+ this.loadAuthorisedValues(this.authorisedValues, this.vendorStore).then( >+ () => { >+ this.userPermissions = userPermissions; >+ this.config.settings.edifact = edifact; >+ this.config.settings.marcOrderAutomation = marcOrderAutomation; >+ this.vendorStore.currencies = currencies; >+ this.vendorStore.gstValues = gstValues.map(gv => { >+ return { >+ label: `${Number(gv.option * 100).format_price()}%`, >+ value: gv.option, >+ }; >+ }); >+ this.loaded(); >+ this.initialized = true; >+ } >+ ); > }, > data() { > return { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorDetails.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorDetails.vue >index 70409fb389a..cd77214a9e1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorDetails.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorDetails.vue >@@ -132,12 +132,12 @@ > <li> > <label for="vendor_type">{{ $__("Vendor type") }}:</label> > <v-select >- v-if="av_vendor_types.length" >+ v-if="authorisedValues['av_vendor_types'].length" > id="vendor_type" > v-model="vendor.type" > label="description" > :reduce="av => av.value" >- :options="av_vendor_types" >+ :options="authorisedValues['av_vendor_types']" > /> > <input v-else id="vendor_type" v-model="vendor.type" /> > </li> >@@ -178,11 +178,11 @@ export default { > display: Boolean, > }, > setup() { >- const AVStore = inject("AVStore"); >- const { get_lib_from_av, av_vendor_types } = AVStore; >+ const vendorStore = inject("vendorStore"); >+ const { get_lib_from_av, authorisedValues } = vendorStore; > return { > get_lib_from_av, >- av_vendor_types, >+ authorisedValues, > }; > }, > data() { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorInterfaces.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorInterfaces.vue >index d17c92db251..92c02d4d840 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorInterfaces.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorInterfaces.vue >@@ -76,7 +76,7 @@ > v-model="vendorInterface.type" > label="description" > :reduce="av => av.value" >- :options="av_vendor_interface_types" >+ :options="authorisedValues['av_vendor_interface_types']" > /> > </li> > <li> >@@ -150,11 +150,11 @@ export default { > display: Boolean, > }, > setup() { >- const AVStore = inject("AVStore"); >- const { get_lib_from_av, av_vendor_interface_types } = AVStore; >+ const vendorStore = inject("vendorStore"); >+ const { get_lib_from_av, authorisedValues } = vendorStore; > return { > get_lib_from_av, >- av_vendor_interface_types, >+ authorisedValues, > }; > }, > methods: { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorList.vue >index 79e96d0d1cf..99163403fb8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorList.vue >@@ -38,11 +38,10 @@ export default { > setup() { > const vendorStore = inject("vendorStore"); > const { vendors } = storeToRefs(vendorStore); >+ const { get_lib_from_av, map_av_dt_filter } = vendorStore; > > const { setConfirmationDialog, setMessage } = inject("mainStore"); > >- const { get_lib_from_av, map_av_dt_filter } = inject("AVStore"); >- > const table = ref(); > > const permissionsStore = inject("permissionsStore"); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorOrderingInformation.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorOrderingInformation.vue >index abec175f5e0..7c9a8e8fa4b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorOrderingInformation.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorOrderingInformation.vue >@@ -233,9 +233,6 @@ export default { > const vendorStore = inject("vendorStore"); > const { currencies, gstValues } = storeToRefs(vendorStore); > >- const AVStore = inject("AVStore"); >- const { get_lib_from_av } = AVStore; >- > return { > currencies, > gstValues, >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/acquisitions.ts b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/acquisitions.ts >index 181ac69f785..c2d06f1368b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/acquisitions.ts >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/acquisitions.ts >@@ -24,7 +24,6 @@ import { useMainStore } from "../stores/main"; > import { useVendorStore } from "../stores/vendors"; > import { useNavigationStore } from "../stores/navigation"; > import { usePermissionsStore } from "../stores/permissions"; >-import { useAVStore } from "../stores/authorised-values"; > import i18n from "../i18n"; > > const pinia = createPinia(); >@@ -32,7 +31,7 @@ const pinia = createPinia(); > const mainStore = useMainStore(pinia); > const navigationStore = useNavigationStore(pinia); > const permissionsStore = usePermissionsStore(pinia); >-const AVStore = useAVStore(pinia); >+ > const routes = navigationStore.setRoutes(routesDef); > > const router = createRouter({ >@@ -55,7 +54,6 @@ app.provide("vendorStore", useVendorStore(pinia)); > app.provide("mainStore", mainStore); > app.provide("navigationStore", navigationStore); > app.provide("permissionsStore", permissionsStore); >-app.provide("AVStore", AVStore); > > app.mount("#__vendors"); > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/vendors.js b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/vendors.js >index 34b3351af89..0039befc177 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/vendors.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/vendors.js >@@ -1,4 +1,9 @@ > import { defineStore } from "pinia"; >+import { >+ loadAuthorisedValues, >+ get_lib_from_av_handler, >+ map_av_dt_filter_handler, >+} from "../composables/authorisedValues"; > > export const useVendorStore = defineStore("vendors", { > state: () => ({ >@@ -10,5 +15,18 @@ export const useVendorStore = defineStore("vendors", { > edifact: false, > }, > }, >+ authorisedValues: { >+ av_vendor_types: "VENDOR_TYPE", >+ av_vendor_interface_types: "VENDOR_INTERFACE_TYPE", >+ }, > }), >+ actions: { >+ loadAuthorisedValues, >+ get_lib_from_av(arr_name, av) { >+ return get_lib_from_av_handler(arr_name, av, this); >+ }, >+ map_av_dt_filter(arr_name) { >+ return map_av_dt_filter_handler(arr_name, this); >+ }, >+ }, > }); >-- >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 38010
:
174119
|
174120
|
174121
|
174122
|
174123
|
174124
|
174125
|
174126
|
174128
|
174129
|
174130
|
174131
|
174132
|
174133
|
174134
|
174135
|
174136
|
174137
|
174138
|
174139
|
174140
|
174141
|
174142
|
174143
|
174144
|
174145
|
174146
|
174147
|
174148
|
174151
|
174152
|
174153
|
174154
|
174155
|
174156
|
174157
|
174158
|
174159
|
174160
|
174161
|
174162
|
174163
|
174164
|
174165
|
174166
|
174167
|
174168
|
174169
|
174170
|
174171
|
174172
|
174173
|
174174
|
174175
|
174176
|
174177
|
174178
|
174179
|
174194
|
174196
|
174197
|
174198
|
174199
|
174200
|
174201
|
174202
|
174203
|
174204
|
174205
|
174206
|
174207
|
174208
|
174209
|
174210
|
174211
|
174212
|
174213
|
174214
|
174215
|
174216
|
174217
|
174218
|
174220
|
174221
|
174222
|
174223
|
174224
|
174225
|
174226
|
174248
|
174266
|
174267
|
174269
|
174270
|
174273
|
174327
|
174328
|
174329
|
174330
|
174331
|
174332
|
174333
|
174334
|
174335
|
174336
|
174337
|
174338
|
174339
|
174340
|
174341
|
174342
|
174343
|
174344
|
174345
|
174346
|
174347
|
174348
|
174349
|
174350
|
174351
|
174352
|
174353
|
174354
|
174355
|
174356
|
174357
|
174358
|
174359
|
174360
|
174603
|
175098
|
175099
|
175100
|
175101
|
175102
|
175103
|
175104
|
175105
|
175106
|
175107
|
175108
|
175109
|
175110
|
175111
|
175112
|
175113
|
175114
|
175115
|
175116
|
175117
|
175118
|
175119
|
175120
|
175121
|
175122
|
175123
|
175124
|
175125
|
175126
|
175127
|
175128
|
175129
|
175130
|
175131
|
175133
|
175134
|
175135
|
175136
|
175137
|
175167
|
175168
|
175170
|
175240
|
175241
|
175242
|
175243
|
175248
|
175249
|
175266
|
175791
|
175799
|
176547
|
178182
|
178183
|
178184
|
178185
|
178186
|
178187
|
178188
|
178189
|
178190
|
178191
|
178192
|
178193
|
178194
|
178195
|
178196
|
178197
|
178198
|
178199
|
178200
|
178201
|
178202
|
178203
|
178204
|
178205
|
178206
|
178207
|
178208
|
178209
|
178210
|
178211
|
178212
|
178213
|
178214
|
178215
|
178216
|
178217
|
178218
|
178219
|
178220
|
178221
|
178222
|
178223
|
178224
|
178225
|
178226
|
178227
|
178228
|
178229
|
178230
|
178231
|
178232
|
178233
|
178234
|
178235
|
178236
|
178237
| 178238 |
178239
|
178240
|
178241
|
178242