Bugzilla – Attachment 174211 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: Fix vendors search bar
Bug-38010-Fix-vendors-search-bar.patch (text/plain), 6.14 KB, created by
Matt Blenkinsop
on 2024-11-07 13:33:19 UTC
(
hide
)
Description:
Bug 38010: Fix vendors search bar
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-11-07 13:33:19 UTC
Size:
6.14 KB
patch
obsolete
>From f4048ece0c7003b6367629781fb0e33c00c1d13a Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Tue, 1 Oct 2024 10:31:02 +0000 >Subject: [PATCH] Bug 38010: Fix vendors search bar > >--- > .../prog/en/includes/acquisitions-search.inc | 2 +- > .../intranet-tmpl/prog/en/modules/acqui/acqui-home.tt | 8 ++++++-- > .../prog/js/vue/components/Vendors/VendorList.vue | 7 +++++++ > koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js | 6 ++++++ > t/cypress/integration/Acquisitions/Vendors_spec.ts | 6 +++--- > 5 files changed, 23 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-search.inc >index 86ca5e0204d..c08ae702059 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-search.inc >@@ -6,7 +6,7 @@ > > [% WRAPPER tab_panels %] > [% WRAPPER tab_panel tabname="supplier_search" bt_active= 1 %] >- <form name="findsupplier" action="/cgi-bin/koha/acqui/booksellers.pl" method="get"> >+ <form name="findsupplier" action="/cgi-bin/koha/vendors" method="get"> > <div class="form-title"> > <label class="control-label" for="supplier"><span class="control-text">Vendor search</span> <i class="fa fa-fw fa-upload" aria-hidden="true"></i></label> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >index c8e18c09156..ff59a2f4cd0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >@@ -49,8 +49,12 @@ > <div class="col"> > <div id="acqui_acqui_home_order"> > <fieldset> >- <legend>View vendors</legend> >- <a href="/cgi-bin/koha/vendors" class="btn btn-default">Vendor list</a> >+ <legend>Search vendors</legend> >+ <form name="findsupplier" action="/cgi-bin/koha/vendors" method="get"> >+ <p><label for="supplierpage">Vendor: </label><input type="text" size="25" name="supplier" id="supplierpage" class="focus" /> >+ <input type="submit" class="btn btn-primary" value="Search" /> >+ </p> >+ </form> > </fieldset> > </div> > </div> >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 25b1a94f0a7..530a99ebb14 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 >@@ -59,6 +59,7 @@ export default { > fp_config: flatpickr_defaults, > vendor_count: 0, > initialized: false, >+ searchTerm: null, > tableOptions: { > columns: this.getTableColumns(), > options: { embed: "aliases,baskets,subscriptions" }, >@@ -97,6 +98,9 @@ export default { > beforeRouteEnter(to, from, next) { > next(vm => { > vm.getVendorCount().then(() => (vm.initialized = true)) >+ if (to.query.supplier) { >+ vm.searchTerm = to.query.supplier >+ } > }) > }, > methods: { >@@ -155,6 +159,9 @@ export default { > }, > tableURL() { > let url = "/api/v1/acquisitions/vendors" >+ if (this.searchTerm) { >+ url += "?name=" + this.searchTerm >+ } > return url > }, > getTableColumns() { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js >index 1e3ecb58b36..d46e97c0bbb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js >@@ -152,6 +152,12 @@ export const useNavigationStore = defineStore("navigation", { > } > }, > leftNavigation() { >+ const currentRoute = this.current[this.current.length - 1]; >+ if (currentRoute) { >+ const alternateMenuRequired = >+ currentRoute.meta.self.alternateLeftMenu; >+ if (alternateMenuRequired) return alternateMenuRequired; >+ } > return _getNavigationElements(this.routeState); > > // Function declarations >diff --git a/t/cypress/integration/Acquisitions/Vendors_spec.ts b/t/cypress/integration/Acquisitions/Vendors_spec.ts >index 23f9ad69bef..482c1633f5f 100644 >--- a/t/cypress/integration/Acquisitions/Vendors_spec.ts >+++ b/t/cypress/integration/Acquisitions/Vendors_spec.ts >@@ -64,7 +64,6 @@ describe("Vendor CRUD operations", () => { > > it("should list vendors", () => { > cy.visit("/cgi-bin/koha/acqui/acqui-home.pl"); >- cy.get("#acqui_acqui_home_order").contains("Vendor list").click(); > > cy.intercept("GET", "/api/v1/acquisitions/vendors*", []); > cy.visit("/cgi-bin/koha/vendors"); >@@ -282,9 +281,9 @@ describe("External URLs", () => { > > it("should navigate to the receive shipments page", () => { > cy.visit("/cgi-bin/koha/acqui/acqui-home.pl"); >- cy.get("#acqui_acqui_home_order").contains("Vendor list").click(); > > const vendor = getVendor(); >+ > cy.intercept("GET", "/api/v1/acquisitions/vendors*", { > statusCode: 200, > body: [vendor], >@@ -293,13 +292,14 @@ describe("External URLs", () => { > "X-Total-Count": "1", > }, > }); >- cy.intercept("GET", "/api/v1/acquisitions/vendors/*", vendor); > cy.visit("/cgi-bin/koha/vendors"); > const name_link = cy.get( > "#vendors_list table tbody tr:first td:first a" > ); > name_link.should("have.text", vendor.name + " (#" + vendor.id + ")"); > name_link.click(); >+ cy.wait(500); >+ cy.get("#vendors_show h1").contains(vendor.name); > > cy.get("#vendors_show").contains("Receive shipments").click(); > cy.get("h1").contains("Receive shipment from vendor " + vendor.name); >-- >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