Bugzilla – Attachment 181790 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) Fix issues in Show component
Bug-38010-QA-follow-up-Fix-issues-in-Show-componen.patch (text/plain), 9.71 KB, created by
Jonathan Druart
on 2025-04-30 21:04:05 UTC
(
hide
)
Description:
Bug 38010: (QA follow-up) Fix issues in Show component
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-04-30 21:04:05 UTC
Size:
9.71 KB
patch
obsolete
>From 3e4a3a60225d942b887e575751281dfe61bcf4f3 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> >Date: Tue, 22 Apr 2025 11:58:08 +0100 >Subject: [PATCH] Bug 38010: (QA follow-up) Fix issues in Show component > >This patch addresses the following: >- website links were buttons so we now can pass a css class to the toolbar buttons again >- contact options have been formatted to have the correct margin >- the dropdown-item class has been added to the dropdown button list >- entries in the dropdown were opening in a new tab, they are now a callback to avoid this > >Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../js/vue/components/DropdownButtons.vue | 1 + > .../prog/js/vue/components/ToolbarButton.vue | 51 +++++++++++-------- > .../vue/components/Vendors/VendorContacts.vue | 16 +++--- > .../vue/components/Vendors/VendorDetails.vue | 2 +- > .../components/Vendors/VendorInterfaces.vue | 2 +- > .../js/vue/components/Vendors/VendorShow.vue | 14 ++++- > 6 files changed, 54 insertions(+), 32 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/DropdownButtons.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/DropdownButtons.vue >index 7f10b634b88..ac04e60984a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/DropdownButtons.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/DropdownButtons.vue >@@ -12,6 +12,7 @@ > :to="item.to" > :title="$__(item.title)" > :callback="item.callback" >+ :cssClass="'dropdown-item'" > /> > </li> > </ul> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ToolbarButton.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ToolbarButton.vue >index b13d3dbcf5f..554b6fa944b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ToolbarButton.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ToolbarButton.vue >@@ -1,16 +1,13 @@ > <template> > <a > v-if="callback" >- @click="typeof callback === 'string' ? redirect() : callback" >- class="btn btn-default" >+ @click="typeof callback === 'string' ? redirect() : callback(this)" >+ :class="cssClass" > style="cursor: pointer" > > > <font-awesome-icon v-if="icon" :icon="icon" /> {{ title }} > </a> >- <router-link >- v-else >- :to="to" >- class="btn btn-default" >+ <router-link v-else :to="to" :class="cssClass" > ><font-awesome-icon v-if="icon" :icon="icon" /> {{ title }}</router-link > > > </template> >@@ -32,24 +29,20 @@ export default { > type: [String, Function], > required: false, > }, >+ cssClass: { >+ type: String, >+ default: "btn btn-default", >+ required: false, >+ }, > }, > methods: { >- redirect() { >- if (typeof this.to === "string") >- window.location.href = this.formatUrl(this.to); >- if (typeof this.to === "object") { >- let url = this.to.path; >- if (this.to.hasOwnProperty("query")) { >- url += >- "?" + >- Object.keys(this.to.query) >- .map( >- queryParam => >- `${queryParam}=${this.to.query[queryParam]}` >- ) >- .join("&"); >- } >- window.open(this.formatUrl(url, this.to.internal), "_blank"); >+ redirect(url) { >+ const redirectParams = url ? url : this.to; >+ if (typeof redirectParams === "string") >+ window.location.href = this.formatUrl(redirectParams); >+ if (typeof redirectParams === "object") { >+ const url = this.handleQuery(redirectParams); >+ window.open(this.formatUrl(url), "_blank"); > } > }, > formatUrl(url) { >@@ -58,6 +51,20 @@ export default { > return `//${window.location.host}/${url}`; > return `//${url}`; > }, >+ handleQuery(query) { >+ let url = this.to.path; >+ if (this.to.hasOwnProperty("query")) { >+ url += >+ "?" + >+ Object.keys(this.to.query) >+ .map( >+ queryParam => >+ `${queryParam}=${this.to.query[queryParam]}` >+ ) >+ .join("&"); >+ } >+ return url; >+ }, > }, > name: "ToolbarButton", > }; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorContacts.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorContacts.vue >index 8ca36a4356c..e1afb903068 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorContacts.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorContacts.vue >@@ -46,19 +46,19 @@ > <span class="label">{{ $__("Acquisitions options") }}:</span> > <ol> > <li v-if="contact.acqprimary"> >- <span >+ <span class="contact_details" > ><i class="fa fa-check"></i> > {{ $__("Primary acquisitions contact") }}</span > > > </li> > <li v-if="contact.orderacquisition"> >- <span >+ <span class="contact_details" > ><i class="fa fa-check"></i> > {{ $__("Receives orders") }}</span > > > </li> > <li v-if="contact.claimacquisition"> >- <span >+ <span class="contact_details" > ><i class="fa fa-check"></i> > {{ $__("Receives claims for late orders") }}</span > > >@@ -69,13 +69,13 @@ > <span class="label">{{ $__("Serials options") }}:</span> > <ol> > <li v-if="contact.serialsprimary"> >- <span >+ <span class="contact_details" > ><i class="fa fa-check"></i> > {{ $__("Primary serials contact") }}</span > > > </li> > <li v-if="contact.claimissues"> >- <span >+ <span class="contact_details" > ><i class="fa fa-check"></i> > {{ $__("Receives claims for late issues") }}</span > > >@@ -281,4 +281,8 @@ export default { > }; > </script> > >-<style></style> >+<style scoped> >+.contact_details { >+ margin-left: 9em; >+} >+</style> >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 cd77214a9e1..c6f8ce0023a 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 >@@ -49,7 +49,7 @@ > :to="{ > path: vendor.url, > }" >- class="" >+ :cssClass="''" > :title="vendor.url" > callback="redirect" > /> >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 92c02d4d840..40f3ff86606 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 >@@ -17,7 +17,7 @@ > :to="{ > path: vi.uri, > }" >- class="" >+ :cssClass="''" > :title="vi.uri" > callback="redirect" > /> >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 e0114e8b137..77fdcbb3853 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 >@@ -10,7 +10,12 @@ > query: { booksellerid: vendor.id, op: 'add_form' }, > }, > title: 'Basket', >- callback: 'redirect', >+ callback: toolbarComponent => { >+ const url = toolbarComponent.handleQuery( >+ toolbarComponent.to >+ ); >+ toolbarComponent.redirect(url); >+ }, > }, > { > to: { >@@ -18,7 +23,12 @@ > query: { booksellerid: vendor.id, op: 'add_form' }, > }, > title: 'Contract', >- callback: 'redirect', >+ callback: toolbarComponent => { >+ const url = toolbarComponent.handleQuery( >+ toolbarComponent.to >+ ); >+ toolbarComponent.redirect(url); >+ }, > }, > { > to: { name: 'VendorFormAdd' }, >-- >2.34.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
|
181579
|
181585
|
181727
|
181728
|
181729
|
181730
|
181731
|
181732
|
181733
|
181734
|
181735
|
181736
|
181737
|
181738
|
181739
|
181740
|
181741
|
181742
|
181743
|
181744
|
181745
|
181746
|
181747
|
181748
|
181749
|
181750
|
181751
|
181752
|
181753
|
181754
|
181755
|
181756
|
181757
|
181758
|
181759
|
181760
|
181761
|
181762
|
181763
|
181764
|
181765
|
181766
|
181767
|
181768
|
181769
|
181770
|
181771
|
181772
|
181773
|
181774
|
181775
|
181776
|
181777
|
181778
|
181779
|
181780
|
181781
|
181782
|
181783
|
181784
|
181785
|
181786
|
181787
|
181788
|
181789
| 181790 |
181791
|
181792
|
181793
|
181794
|
181795
|
181796
|
181797
|
181798
|
181799
|
181800
|
181801
|
181802
|
181803
|
181804
|
181805
|
181806
|
181807
|
181808
|
181809
|
181810
|
181811
|
181812
|
181813
|
181814
|
181815
|
181816
|
181817
|
181818
|
181819
|
181820
|
181821
|
181891
|
181898
|
181901
|
181963
|
181964
|
182053
|
182351
|
182438