Bugzilla – Attachment 174154 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: Add authorised values
Bug-38010-Add-authorised-values.patch (text/plain), 8.28 KB, created by
Matt Blenkinsop
on 2024-11-07 11:56:09 UTC
(
hide
)
Description:
Bug 38010: Add authorised values
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-11-07 11:56:09 UTC
Size:
8.28 KB
patch
obsolete
>From ae9a1fbd428d969121f6b95292cec7835dfb3063 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Tue, 17 Sep 2024 12:29:33 +0000 >Subject: [PATCH] Bug 38010: Add authorised values > >--- > .../prog/js/vue/components/Vendors/Main.vue | 59 +------------------ > .../vue/components/Vendors/VendorDetails.vue | 12 +++- > .../components/Vendors/VendorInterfaces.vue | 4 +- > .../js/vue/components/Vendors/VendorShow.vue | 4 -- > .../prog/js/vue/modules/vendors.ts | 2 +- > webpack.config.js | 46 --------------- > 6 files changed, 18 insertions(+), 109 deletions(-) > delete mode 100644 webpack.config.js > >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 ddb24f11414..b26ff4e8b44 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 >@@ -37,19 +37,17 @@ import { APIClient } from "../../fetch/api-client" > export default { > setup() { > const vendorStore = inject("vendorStore") >- >- const AVStore = inject("AVStore") >+ const { config } = storeToRefs(vendorStore) > > const mainStore = inject("mainStore") >- > const { loading, loaded, setError } = mainStore >+ const AVStore = inject("AVStore") > > const permissionsStore = inject("permissionsStore") > const { userPermissions } = storeToRefs(permissionsStore) > > return { > vendorStore, >- AVStore, > setError, > loading, > loaded, >@@ -99,61 +97,10 @@ export default { > this.initialized = true > }) > }, >- beforeCreate() { >- this.loading() >- >- const fetchConfig = () => { >- let promises = [] >- >- const av_client = APIClient.authorised_values >- const authorised_values = { >- vendor_types: "VENDOR_TYPE", >- vendor_interface_types: "VENDOR_INTERFACE_TYPE", >- vendor_payment_methods: "VENDOR_PAYMENT_METHOD", >- lang: "LANG", >- } >- >- 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.vendorStore.currencies = currencies >- this.vendorStore.gstValues = gstValues.map(gv => { >- return { >- label: `${(gv.option * 100).toFixed(2)}%`, >- value: gv.option, >- } >- }) >- this.loaded() >- this.initialized = true >- }) >- }, > data() { > this.userPermissions = userPermissions > return { >- initialized: true, >+ initialized: false, > } > }, > methods: {}, >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 dfafd08075d..1795f5e8d89 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 >@@ -7,7 +7,7 @@ > <li> > <label>{{ $__("Type") }}:</label> > <span> >- {{ vendor.type }} >+ {{ get_lib_from_av("vendor_types", vendor.type) }} > </span> > </li> > <li> >@@ -68,10 +68,20 @@ > </template> > > <script> >+import { inject } from "vue" >+ > export default { > props: { > vendor: Object, > }, >+ setup() { >+ const AVStore = inject("AVStore") >+ const { get_lib_from_av } = AVStore >+ >+ return { >+ get_lib_from_av, >+ } >+ }, > } > </script> > >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 2df655378b5..f405431dee6 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 >@@ -7,7 +7,9 @@ > <legend>{{ vi.name }}</legend> > <li> > <label>{{ $__("Type") }}:</label> >- <span> NEED AUTHORISED VALUES </span> >+ <span> >+ {{ get_lib_from_av("vendor_interface_types", vi.type) }} >+ </span> > </li> > <li v-if="vi.uri"> > <label>{{ $__("URI") }}:</label> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorShow.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorShow.vue >index bb4b06a05b2..2f4f7d8ddcb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorShow.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorShow.vue >@@ -67,13 +67,9 @@ export default { > > const { setConfirmationDialog, setMessage } = inject("mainStore") > >- // const AVStore = inject("AVStore") >- // const { get_lib_from_av } = AVStore >- > return { > format_date, > patron_to_html, >- // get_lib_from_av, > setConfirmationDialog, > setMessage, > } >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/vendors.ts b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/vendors.ts >index 9424ae0b00c..99edd35a198 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/vendors.ts >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/vendors.ts >@@ -21,7 +21,7 @@ import { routes as routesDef } from "../routes/vendors"; > > import { useMainStore } from "../stores/main"; > import { useVendorStore } from "../stores/vendors"; >-import { useAVStore } from "../stores/authorised-values"; >+import { useAVStore } from "../stores/authorisedValues/authorised-values"; > import { useNavigationStore } from "../stores/navigation"; > import { usePermissionsStore } from "../stores/permissions"; > import i18n from "../i18n"; >diff --git a/webpack.config.js b/webpack.config.js >deleted file mode 100644 >index b80cebdb653..00000000000 >--- a/webpack.config.js >+++ /dev/null >@@ -1,46 +0,0 @@ >-const { VueLoaderPlugin } = require("vue-loader"); >-const autoprefixer = require("autoprefixer"); >-const path = require("path"); >-const webpack = require('webpack'); >- >-module.exports = { >- entry: { >- erm: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts", >- preservation: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/preservation.ts", >- "admin/record_sources": "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/admin/record_sources.ts", >- vendors: "./koha-tmpl/intranet-tmpl/prog/js/vue/modules/vendors.ts", >- }, >- output: { >- filename: "[name].js", >- path: path.resolve(__dirname, "koha-tmpl/intranet-tmpl/prog/js/vue/dist/"), >- chunkFilename: "[name].js", >- }, >- module: { >- rules: [ >- { >- test: /\.vue$/, >- loader: "vue-loader", >- exclude: [path.resolve(__dirname, "t/cypress/")], >- }, >- { >- test: /\.ts$/, >- loader: 'ts-loader', >- options: { >- appendTsSuffixTo: [/\.vue$/] >- }, >- exclude: [path.resolve(__dirname, "t/cypress/")], >- }, >- { >- test: /\.css$/, >- use: ['style-loader', 'css-loader'], >- } >- ], >- }, >- plugins: [ >- new VueLoaderPlugin(), >- new webpack.DefinePlugin({ >- __VUE_OPTIONS_API__: true, >- __VUE_PROD_DEVTOOLS__: false, >- }), >- ], >-}; >-- >2.39.3 (Apple Git-146)
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