Created attachment 183161 [details] [review] Bug 40118: Trim again after splitting
Created attachment 183162 [details] [review] Bug 40118: Only concat ^ and $ if table is ajax Test plan, k-t-d, before applying patches: 1) Place a hold (next available) to biblio 76 and 437: http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=76 http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=437 2) Visit the 'holds to pull' page: http://localhost:8081/cgi-bin/koha/circ/pendingreserves.pl 3) Notice the 'Libraries' filter contains 'Centervile' twice. Notice the filtering never works regardless of option picked. 4) Apply patches. Repeat test plan. Notice 'Centerville' only shows once. Notice filtering works.
- let value = this.value.length ? "^" + this.value + "$" : ""; Can you explain this? Now we should have tests for changes to this file (See bug 40002 that introduced this change).
(In reply to Jonathan Druart from comment #3) > - let value = this.value.length ? "^" + this.value + "$" > : ""; > > Can you explain this? > > Now we should have tests for changes to this file (See bug 40002 that > introduced this change). It's unused code. The 'value' variable is never used.
Created attachment 183164 [details] [review] Bug 40118: Prevent adding another empty value option This is already done for all select dropdowns by default. If a particular table provides an empty value it should be skipped or 2 empty options may show
(In reply to Pedro Amorim from comment #4) > (In reply to Jonathan Druart from comment #3) > > - let value = this.value.length ? "^" + this.value + "$" > > : ""; > > > > Can you explain this? > > > > Now we should have tests for changes to this file (See bug 40002 that > > introduced this change). > > It's unused code. The 'value' variable is never used. It's caused by 3fce8f83dc9696936342c6c3289389cc0eb38c2b - table_dt - .column(i) - .search( this.value.length ? '^'+this.value+'$' : '', true, false ) - .draw(); + $(this).find("select") + .unbind() + .bind("keyup change", function(){ + let value = this.value.length ? '^'+this.value+'$' : ''; + col_select_search(i, this.value) + }); Should be `col_select_search(i, value)` then I assume. But now the values have the ^$ in them. I am then wondering what's better... Maybe we need to deal with that on a separate bug.
Created attachment 183169 [details] [review] Bug 40118: Add cypress cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts
Created attachment 183170 [details] [review] Bug 40118: [24.11] Squashed patch for 24.11
The cypress tests are wrong: 1. Holdings_spec.ts if for the holdings table on catalogue/detail.pl) 2. NEVER delete everything from a table, you have to create the data you need for the tests 3. The test will fail on Jenkins (it does not have the misc4dev sample data) 4. You should have a look at the mockData (buildSampleObject)
I am working on the Cypress tests, it's for a separate bug report (not trivial). The other patches are correct.
We have a library named 'Wells (Albany)' and filtering doesn't work for that value. A problem with the parentheses?
(In reply to Owen Leonard from comment #11) > We have a library named 'Wells (Albany)' and filtering doesn't work for that > value. A problem with the parentheses? Yes, different bug. Please bug 40122.
Created attachment 183280 [details] [review] Bug 40118: Trim again after splitting Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 183281 [details] [review] Bug 40118: Only concat ^ and $ if table is ajax Test plan, k-t-d, before applying patches: 1) Place a hold (next available) to biblio 76 and 437: http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=76 http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=437 2) Visit the 'holds to pull' page: http://localhost:8081/cgi-bin/koha/circ/pendingreserves.pl 3) Notice the 'Libraries' filter contains 'Centervile' twice. Notice the filtering never works regardless of option picked. 4) Apply patches. Repeat test plan. Notice 'Centerville' only shows once. Notice filtering works. Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 183282 [details] [review] Bug 40118: Prevent adding another empty value option This is already done for all select dropdowns by default. If a particular table provides an empty value it should be skipped or 2 empty options may show Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 183316 [details] [review] Bug 40118: Trim again after splitting Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Created attachment 183317 [details] [review] Bug 40118: Only concat ^ and $ if table is ajax Test plan, k-t-d, before applying patches: 1) Place a hold (next available) to biblio 76 and 437: http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=76 http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=437 2) Visit the 'holds to pull' page: http://localhost:8081/cgi-bin/koha/circ/pendingreserves.pl 3) Notice the 'Libraries' filter contains 'Centervile' twice. Notice the filtering never works regardless of option picked. 4) Apply patches. Repeat test plan. Notice 'Centerville' only shows once. Notice filtering works. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Created attachment 183318 [details] [review] Bug 40118: Prevent adding another empty value option This is already done for all select dropdowns by default. If a particular table provides an empty value it should be skipped or 2 empty options may show Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>