Description
Lucas Gass (lukeg)
2024-07-02 22:09:52 UTC
Created attachment 168409 [details] [review] Bug 37238: Add column configuration to item search results table To test: 1. APPLY PATCH 2. Do an item search that will return results. 3. To the right of the table notice thee Columns, Export, Configure buttons 4. Use the Columns button to hide and show various columns, make sure it works right. 5. Use the Export button to try and export the table in various file formats. You should only see visible columns in your export. 6. Go to Admin -> Table settings, make sure you can hide columns properly from there. Created attachment 168411 [details] [review] Bug 37238: Add column configuration to item search results table To test: 1. APPLY PATCH 2. Do an item search that will return results. 3. To the right of the table notice thee Columns, Export, Configure buttons 4. Use the Columns button to hide and show various columns, make sure it works right. 5. Use the Export button to try and export the table in various file formats. You should only see visible columns in your export. 6. Go to Admin -> Table settings, make sure you can hide columns properly from there. Signed-off-by: Sam Lau <samalau@gmail.com> *** Bug 23565 has been marked as a duplicate of this bug. *** I'm getting inconsistent behavior from the column header search fields. Sometimes they work, sometimes they incorrectly filter out all results, and sometimes I get a 500 error: C4::Items::SearchItems(): DBI Exception: DBD::mysql::st execute failed: Column 'itemnumber' in where clause is ambiguous at /kohadevbox/koha/catalogue/itemsearch.pl line 252 at /usr/share/perl5/DBIx/Class/Exception.pm line 77 DBIx::Class::Exception::throw('DBIx::Class::Exception', 'DBI Exception: DBD::mysql::st execute failed: Column \'itemnumber\' in where clause is ambiguous', 0) called at /usr/share/perl5/DBIx/Class/Schema.pm line 1118 (In reply to Owen Leonard from comment #4) > I'm getting inconsistent behavior from the column header search fields. > Sometimes they work, sometimes they incorrectly filter out all results, and > sometimes I get a 500 error: > C4::Items::SearchItems(): DBI Exception: DBD::mysql::st execute failed: > Column 'itemnumber' in where clause is ambiguous at > /kohadevbox/koha/catalogue/itemsearch.pl line 252 > at /usr/share/perl5/DBIx/Class/Exception.pm line 77 > DBIx::Class::Exception::throw('DBIx::Class::Exception', 'DBI Exception: > DBD::mysql::st execute failed: Column \'itemnumber\' in where clause is > ambiguous', 0) called at /usr/share/perl5/DBIx/Class/Schema.pm line 1118 Thanks Owen. For the 500 error, I am reproducing that without my patch applied. It seems specific to the itemnumber column? It also seems like many of the columns, but not all, are incorrectly filtering without this patch applied. Created attachment 168483 [details] [review] Bug 37238: Replace jquery.dataTables.columnFilter.js with native DataTables function I fixed the 500 error when using itemnumber filtering on Bug 37249. The follow-up patch here make filtering work when columns are hidden. I did notice that when filtering things like Item type, Home library, currently library, damaged, lost, ect. it requires the user to know the code. The description doesn't work. This seems to be true with or without my patch. The same seems to true when filtering dates. You must use the ISO date or else filtering doesn't work. This is also true with or without this patchset. Noticed a couple of issues while testing and thus changed status to Failed QA: 1. On the item results page, the filters have been relocated to the bottom of the results list when they should be at the top. 2. After making changes to the table settings, the changes didn't apply until I logged in again to Koha. I think this is different from how the table settings act otherwise? Created attachment 170785 [details] [review] Bug 37238: Move filters from tfoot to thead (In reply to Anni Rajala from comment #8) > Noticed a couple of issues while testing and thus changed status to Failed > QA: > > 1. On the item results page, the filters have been relocated to the bottom > of the results list when they should be at the top. > 2. After making changes to the table settings, the changes didn't apply > until I logged in again to Koha. I think this is different from how the > table settings act otherwise? Anni, thanks for testing. I did move the filters from the footer into the header. However I cannot recreate your 2nd problem. For me the column configuration/Table settings are working. Created attachment 171037 [details] [review] Bug 37238: Move filters from tfoot to thead Signed-off-by: Eric Garcia <cubingguy714@gmail.com> (In reply to Lucas Gass from comment #10) > (In reply to Anni Rajala from comment #8) > > Noticed a couple of issues while testing and thus changed status to Failed > > QA: > > > > 1. On the item results page, the filters have been relocated to the bottom > > of the results list when they should be at the top. > > 2. After making changes to the table settings, the changes didn't apply > > until I logged in again to Koha. I think this is different from how the > > table settings act otherwise? > > Anni, thanks for testing. I did move the filters from the footer into the > header. > > However I cannot recreate your 2nd problem. For me the column > configuration/Table settings are working. I was going to try if I could recreate the 2nd problem, but after applying the batch, I keep getting error ("Unsupported format html at /kohadevbox/koha/catalogue/itemsearch.pl line 100) when trying to search something in item search. This will conflict badly with bug 33484 but I am willing to help to get it pushed ASAP so that I can write on top of it. Please rebase. CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt Should this be "patch doesn't apply"? Created attachment 173414 [details] [review] Bug 37238: Add column configuration to item search results table To test: 1. APPLY PATCH 2. Do an item search that will return results. 3. To the right of the table notice thee Columns, Export, Configure buttons 4. Use the Columns button to hide and show various columns, make sure it works right. 5. Use the Export button to try and export the table in various file formats. You should only see visible columns in your export. 6. Go to Admin -> Table settings, make sure you can hide columns properly from there. Signed-off-by: Sam Lau <samalau@gmail.com> Created attachment 173415 [details] [review] Bug 37238: Replace jquery.dataTables.columnFilter.js with native DataTables function Created attachment 173416 [details] [review] Bug 37238: Move filters from tfoot to thead Signed-off-by: Eric Garcia <cubingguy714@gmail.com> (In reply to Jonathan Druart from comment #13) > This will conflict badly with bug 33484 but I am willing to help to get it > pushed ASAP so that I can write on top of it. > > Please rebase. > > CONFLICT (content): Merge conflict in > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt Rebased. However, there is no reason this need to take precedence over Bug 33484. I can always come back to this later and re-do on top of Bug 33484. Adding a RM_priority keyword here as this blocks other patches and is a much needed usability fix. 1. There is an input in the first and last columns (checkbox and actions) 2. When I click on an input to give it the focus, a request is made to sort the column 3. This table is absolutely not ready for the "save state" feature (from bug 33484). We need to make it an exception: * Remove the 2 'save state' options from the Table settings admin page for this table. * Remove the "Copy shareable link" button * Bypass the save/load state callback functions for this table That will lead to some ugly code I have hardly tried to avoid on bug 33484 :D Or we remove what has been done on bug 14322 and adjust this table to make it work with the "save state" feature. I would move this to in discussion and see what we do next. I can help! (In reply to Jonathan Druart from comment #20) > 1. There is an input in the first and last columns (checkbox and actions) > > 2. When I click on an input to give it the focus, a request is made to sort > the column These problems should now both be fixed by obsoleting my follow-ups. Please have a look now. Created attachment 173740 [details] [review] Bug 37238: (follow-up) Deal with table state, remove sharable link (In reply to Jonathan Druart from comment #20) > 1. There is an input in the first and last columns (checkbox and actions) > > 2. When I click on an input to give it the focus, a request is made to sort > the column > > 3. This table is absolutely not ready for the "save state" feature (from bug > 33484). We need to make it an exception: > * Remove the 2 'save state' options from the Table settings admin page for > this table. > * Remove the "Copy shareable link" button > * Bypass the save/load state callback functions for this table > > That will lead to some ugly code I have hardly tried to avoid on bug 33484 :D > > Or we remove what has been done on bug 14322 and adjust this table to make > it work with the "save state" feature. > > I would move this to in discussion and see what we do next. I can help! I added a follow-up to make an exception for this table. We already have a sharable link from Bug 14322. I am happy to proceed in another direction if you want to try to implement the work from Bug 33484, Jonathan. (In reply to Lucas Gass (lukeg) from comment #21) > (In reply to Jonathan Druart from comment #20) > > 1. There is an input in the first and last columns (checkbox and actions) > > > > 2. When I click on an input to give it the focus, a request is made to sort > > the column > > These problems should now both be fixed by obsoleting my follow-ups. Please > have a look now. Well it's actually for this change that I needed this for bug 36640 :D No worries, I will deal with that later. (In reply to Lucas Gass (lukeg) from comment #23) > (In reply to Jonathan Druart from comment #20) > > 1. There is an input in the first and last columns (checkbox and actions) > > > > 2. When I click on an input to give it the focus, a request is made to sort > > the column > > > > 3. This table is absolutely not ready for the "save state" feature (from bug > > 33484). We need to make it an exception: > > * Remove the 2 'save state' options from the Table settings admin page for > > this table. > > * Remove the "Copy shareable link" button > > * Bypass the save/load state callback functions for this table > > > > That will lead to some ugly code I have hardly tried to avoid on bug 33484 :D > > > > Or we remove what has been done on bug 14322 and adjust this table to make > > it work with the "save state" feature. > > > > I would move this to in discussion and see what we do next. I can help! > > I added a follow-up to make an exception for this table. We already have a > sharable link from Bug 14322. It's not correct. If you don't have save_state in the config you still want to offer the ability to share the state with the link. I will submit a follow-up. > I am happy to proceed in another direction if you want to try to implement > the work from Bug 33484, Jonathan. Yes, we should. But not here, not now :) Created attachment 173765 [details] [review] Bug 37238: Add column configuration to item search results table To test: 1. APPLY PATCH 2. Do an item search that will return results. 3. To the right of the table notice thee Columns, Export, Configure buttons 4. Use the Columns button to hide and show various columns, make sure it works right. 5. Use the Export button to try and export the table in various file formats. You should only see visible columns in your export. 6. Go to Admin -> Table settings, make sure you can hide columns properly from there. Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 173766 [details] [review] Bug 37238: Add exception for itemsearch Item search has its own way to share the link, we should not deal with the state (and the work from bug 33484) on this page. It will certainly need to be adjusted to work like the other tables, but it's something for later. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Lucas, are you happy with the patches? If so please PQA :) Created attachment 173768 [details] [review] Bug 37238: Remove the global search It does not work, we should not display the input. (In reply to Lucas Gass (lukeg) from comment #6) > Created attachment 168483 [details] [review] [review] > Bug 37238: Replace jquery.dataTables.columnFilter.js with native DataTables > function For the record, this is now done on bug 36640, see commit "Bug 36640: Fix itemsearch" on the remote branch there. Created attachment 173785 [details] [review] Bug 37238: Add column configuration to item search results table To test: 1. APPLY PATCH 2. Do an item search that will return results. 3. To the right of the table notice thee Columns, Export, Configure buttons 4. Use the Columns button to hide and show various columns, make sure it works right. 5. Use the Export button to try and export the table in various file formats. You should only see visible columns in your export. 6. Go to Admin -> Table settings, make sure you can hide columns properly from there. Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 173786 [details] [review] Bug 37238: Add exception for itemsearch Item search has its own way to share the link, we should not deal with the state (and the work from bug 33484) on this page. It will certainly need to be adjusted to work like the other tables, but it's something for later. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 173787 [details] [review] Bug 37238: Remove the global search It does not work, we should not display the input. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Looking generally good here.. Passing QA Thanks for the help here, Jonathan. Really happy to see the collaboration and this feature in general. I think it will be one of these seemingly "small" things, that will really help libraries in their day to day. Pushed for 24.11! Well done everyone, thank you! |