Bug 33426 - Add client storage of user-selected DataTables configuration to suggestion.tt
Summary: Add client storage of user-selected DataTables configuration to suggestion.tt
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Emily Lamancusa (emlam)
QA Contact: Testopia
URL:
Keywords:
Depends on: 22276
Blocks: 33484 38192
  Show dependency treegraph
 
Reported: 2023-04-05 19:50 UTC by Emily Lamancusa (emlam)
Modified: 2024-10-17 09:52 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This allows Koha to remember the changes that a user has made to the columns settings on the Purchase Suggestions Management page, so that the columns settings and sorts are kept when reloading the page.
Version(s) released in:
23.11.00
Circulation function:


Attachments
Bug 33426: Add DataTables saveState to suggestion.tt (2.04 KB, patch)
2023-04-05 20:00 UTC, Emily Lamancusa (emlam)
Details | Diff | Splinter Review
Bug 33426: Add DataTables saveState to suggestion.tt (2.10 KB, patch)
2023-04-11 14:13 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 33426: Add DataTables saveState to suggestion.tt (2.10 KB, patch)
2023-04-20 16:16 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Emily Lamancusa (emlam) 2023-04-05 19:50:02 UTC
Bug 22276 added a method to columns_settings.inc to support the use of the DataTables "saveState" option. Making use of that function in suggestion.tt would enable the suggestion table to remember individual users' local changes to the table configuration.
Comment 1 Katrin Fischer 2023-04-05 19:57:14 UTC
I'd love to see that :)
Comment 2 Emily Lamancusa (emlam) 2023-04-05 20:00:09 UTC
Created attachment 149222 [details] [review]
Bug 33426: Add DataTables saveState to suggestion.tt

To test:
1. In the staff client, go to Purchase Suggestion management page and
   add a suggestion if needed to make the table display.
2. Make some changes to the table settings (hide/show columns, change
   sort column, and/or change number of rows to display)
3. Navigate to a different page.
4. Navigate back to Purchase Suggestions page. Note that the table
   settings have been reset.
5. Apply patch and restart_all
6. Repeat steps 1-4. Note that this time the changes to the table
   settings were preserved.
Comment 3 Emily Lamancusa (emlam) 2023-04-05 20:38:30 UTC
(In reply to Katrin Fischer from comment #1)
> I'd love to see that :)

Granted :)
Comment 4 Martin Renvoize (ashimema) 2023-04-11 10:25:46 UTC
Should we use this bug as is.. or attempt to generalise the pattern..

I feel like we could move the code into our KohaTable wrappers and make it work for all cases
Comment 5 Martin Renvoize (ashimema) 2023-04-11 14:05:50 UTC
Please see bug 33484 for a more global approach to this.
Comment 6 Martin Renvoize (ashimema) 2023-04-11 14:12:11 UTC
Awesome work btw Emily.. I didn't mean to rain on your parade here.. the code works perfectly here and I'll SO on it.. we can perhaps replace with bug 33484 once it's ready and keep your work here credited :)
Comment 7 Martin Renvoize (ashimema) 2023-04-11 14:13:31 UTC
Created attachment 149446 [details] [review]
Bug 33426: Add DataTables saveState to suggestion.tt

To test:
1. In the staff client, go to Purchase Suggestion management page and
   add a suggestion if needed to make the table display.
2. Make some changes to the table settings (hide/show columns, change
   sort column, and/or change number of rows to display)
3. Navigate to a different page.
4. Navigate back to Purchase Suggestions page. Note that the table
   settings have been reset.
5. Apply patch and restart_all
6. Repeat steps 1-4. Note that this time the changes to the table
   settings were preserved.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize (ashimema) 2023-04-11 14:14:32 UTC
Going straight for QA on this one.. it works perfectly as designed.. it's the design of the original bug I dissagree with ;P

Making my bug depend on both so we can keep Emily's contribution recorded :)
Comment 9 Emily Lamancusa (emlam) 2023-04-11 14:21:11 UTC
Thanks Martin! :) I agree that generalizing it is a better approach - working on testing yours now!
Comment 10 Martin Renvoize (ashimema) 2023-04-20 16:16:24 UTC
Created attachment 149973 [details] [review]
Bug 33426: Add DataTables saveState to suggestion.tt

To test:
1. In the staff client, go to Purchase Suggestion management page and
   add a suggestion if needed to make the table display.
2. Make some changes to the table settings (hide/show columns, change
   sort column, and/or change number of rows to display)
3. Navigate to a different page.
4. Navigate back to Purchase Suggestions page. Note that the table
   settings have been reset.
5. Apply patch and restart_all
6. Repeat steps 1-4. Note that this time the changes to the table
   settings were preserved.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Tomás Cohen Arazi (tcohen) 2023-10-10 13:56:13 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 12 Fridolin Somers 2023-10-12 20:53:47 UTC
Enhancement not pushed to 23.05.x
Comment 13 Fridolin Somers 2023-10-12 20:54:19 UTC
Needs nice release notes
Comment 14 Caroline Cyr La Rose 2023-12-12 21:43:52 UTC
I don't think there is anything to document here. Feel free to reopen with more details if needed.