[Bug 40656] New: bookings/list.tt needs to be refactored
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Bug ID: 40656 Summary: bookings/list.tt needs to be refactored Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: paul.derscheid@lmscloud.de QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com When QAing Bug 40296 and looking at Bug 36789, I felt like it was time to clean some of the more wip bits up. This includes: - Inlined CSS - Incomprehensible logic for the table filters (sorry, that was on me) - QA complaints from Bug 36789 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de Depends on| |40296 Assignee|koha-bugs@lists.koha-commun |paul.derscheid@lmscloud.de |ity.org | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40296 [Bug 40296] Bookings that are checked out do not have status updated to completed -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 --- Comment #1 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 185468 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185468&action=edit Bug 40656: Refactor bookings/list.tt to use better patterns and improve code organization This patch aims to improve bookings/list.tt: - Converting filter attributes to boolean data attributes (presence-based) - Creating a reusable table-filters.inc for filter controls - Moving inline styles to proper SCSS files for better caching and separation of concerns - Fixing a runtime error when cancelling bookings from the timeline - Improving JavaScript readability with helper functions - Addressing the QA complaints from Bug 36789: - Cleaning up the long lines for the button elements by moving them into template literals - Using the format method instead of direct interpolation - Using escape_str for all values received from the API. Test plan: 1. Apply the patch and compile css 2. Navigate to a biblio record with bookings (Catalog > Search > View record > Bookings) 3. Verify the filter buttons (Exclude expired/cancelled) appear correctly 4. Click each filter button and verify: - The button text toggles between "Include" and "Exclude" - The table updates to show/hide the appropriate bookings - The status column appears when any items are filtered 5. In the timeline view: - Verify cancelled bookings show with a strikethrough pattern - Try to cancel a booking by clicking the X on a timeline item - Confirm the cancel modal opens without JavaScript errors 6. Check that the table actions (Edit, Cancel) work correctly 7. Verify no inline styles remain in the page source 8. Confirm the filter styles are properly loaded from compiled CSS -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 --- Comment #2 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 185469 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185469&action=edit Bug 40656: (follow-up) Create reusable additional filters library for DataTables This follow-up patch extracts the filter functionality into a reusable library: - Create AdditionalFilters.js library with chainable API for filter functionality - Rename table-filters.inc to additional-filters.inc for clarity - Refactor to use explicit element IDs instead of interpolation for better greppability (filter-expired vs filter-${id}) - Include proper cleanup methods (destroy) for memory management The library provides a fluent API: AdditionalFilters.init(['filter-expired', 'filter-cancelled']) .onChange((filters, { anyFiltersApplied }) => { ... }) .build({ status: ({ filters, isNotApplied }) => ... }); Test plan remains identical except for applying both patches on step 1. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 --- Comment #3 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 185470 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185470&action=edit Bug 40656: (follow-up) Correct inverted logic for column visibility -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Circulation| |Bookings function| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk, | |thibaud.guillot@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |36789 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36789 [Bug 36789] Transform a booking into checkout -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185468|0 |1 is obsolete| | --- Comment #4 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 185860 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185860&action=edit Bug 40656: Refactor bookings/list.tt to use better patterns and improve code organization This patch aims to improve bookings/list.tt: - Converting filter attributes to boolean data attributes (presence-based) - Creating a reusable table-filters.inc for filter controls - Moving inline styles to proper SCSS files for better caching and separation of concerns - Fixing a runtime error when cancelling bookings from the timeline - Improving JavaScript readability with helper functions - Addressing the QA complaints from Bug 36789: - Cleaning up the long lines for the button elements by moving them into template literals - Using the format method instead of direct interpolation - Using escape_str for all values received from the API. Test plan: 1. Apply the patch and compile css 2. Navigate to a biblio record with bookings (Catalog > Search > View record > Bookings) 3. Verify the filter buttons (Exclude expired/cancelled) appear correctly 4. Click each filter button and verify: - The button text toggles between "Include" and "Exclude" - The table updates to show/hide the appropriate bookings - The status column appears when any items are filtered 5. In the timeline view: - Verify cancelled bookings show with a strikethrough pattern - Try to cancel a booking by clicking the X on a timeline item - Confirm the cancel modal opens without JavaScript errors 6. Check that the table actions (Edit, Cancel) work correctly 7. Verify no inline styles remain in the page source 8. Confirm the filter styles are properly loaded from compiled CSS Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185469|0 |1 is obsolete| | --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 185861 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185861&action=edit Bug 40656: (follow-up) Create reusable additional filters library for DataTables This follow-up patch extracts the filter functionality into a reusable library: - Create AdditionalFilters.js library with chainable API for filter functionality - Rename table-filters.inc to additional-filters.inc for clarity - Refactor to use explicit element IDs instead of interpolation for better greppability (filter-expired vs filter-${id}) - Include proper cleanup methods (destroy) for memory management The library provides a fluent API: AdditionalFilters.init(['filter-expired', 'filter-cancelled']) .onChange((filters, { anyFiltersApplied }) => { ... }) .build({ status: ({ filters, isNotApplied }) => ... }); Test plan remains identical except for applying both patches on step 1. Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185470|0 |1 is obsolete| | --- Comment #6 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 185862 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185862&action=edit Bug 40656: (follow-up) Correct inverted logic for column visibility Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 --- Comment #7 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 185863 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185863&action=edit Bug 40656: (follow-up) Always display Status column in bookings table The Status column was previously only visible when filters were applied, making the interface inconsistent and potentially confusing. This change ensures the Status column is always displayed regardless of filter state. Test plan: 1. Navigate to a biblio record with bookings 2. Go to the Bookings tab 3. Verify the Status column is visible in the bookings table 4. Apply filters (Include expired/Include cancelled) 5. Verify the Status column remains visible 6. Remove all filters 7. Confirm the Status column is still visible and shows appropriate status badges (New, Pending, Active, etc.) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 --- Comment #8 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 185864 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185864&action=edit Bug 40656: (QA follow-up) Destroy formatting for QA script We really need a better fix at the translation script level for bug 18675. This change makes the template so much less readable! Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@openfifth.c |y.org |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #9 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- This is some great cleanup work.. going straight for a QA run as one of the key bookings code players I feel I can. Passing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |25.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 --- Comment #10 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 25.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |40838 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40838 [Bug 40838] Bookings related built CSS not ignored by Git -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|25.11.00 |25.11.00,25.05.04 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 --- Comment #11 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Nice work everyone! Pushed to 25.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Needs documenting CC| |fridolin.somers@biblibre.co | |m --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Enhancement not pushed to 24.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Aude Charillon <aude.charillon@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aude.charillon@openfifth.co | |.uk Status|Needs documenting |RESOLVED Resolution|--- |FIXED --- Comment #13 from Aude Charillon <aude.charillon@openfifth.co.uk> --- No update to the Koha Manual needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40656 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org