[Bug 40383] New: Modernise the EDIFACT Message display modal
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Bug ID: 40383 Summary: Modernise the EDIFACT Message display modal Change sponsored?: --- Product: Koha Version: 24.11 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Depends on: 40334 In bugs 40333 and 40334 we split out the modal display of raw edifact messages and allowed them to be display directly on the related basket and invoice pages. This patch aims to modernise their display to allow for both the 'raw' mode as well as a mode modern and easily navigable 'tree' view mode. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40334 [Bug 40334] When EDIFACT is enabled, one should be able view the corresponding EDIFACT QUOTE and ORDER messages on the Koha Basket page -- 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=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 184185 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184185&action=edit Preview -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |20253 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20253 [Bug 20253] Optionally use buyer's purchase order number from EDIFACT quote in basket name -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |40174 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40174 [Bug 40174] Add a way to cleanly insert data in DB from Cypress tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 184487 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184487&action=edit Bug 40383: Add unit tests for Koha::Edifact to_json method This patch adds unit tests for the new to_json method being introduced in Koha::Edifact module in the next patch. The tests verify: - JSON output generation and validity - Proper structure with header, messages, and trailer fields - Message array structure with correct number of messages - Individual message structure (header, segments, trailer) - Segment data integrity including raw data and elements arrays - Line ID functionality for related segments (LIN, QTY, PRI, PIA) Test plan: 1. Apply this patch and the next one 2. Run: prove t/Edifact.t 3. Verify all 63 tests pass 4. Confirm the new JSON-related tests (22 tests) execute successfully Sponsored-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=40383 --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 184488 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184488&action=edit Bug 40383: Add JSON representation to Koha::Edifact and JSON download to edimsg.pl This patch implements a JSON representation of EDIFACT interchanges for enhanced programmatic access and debugging capabilities. Backend Changes: - Add to_json() method to Koha::Edifact module - Structured JSON output with header, messages array, and trailer - Segment parsing with raw data, elements arrays, and line_id tracking - Line item grouping using LIN segment identifiers Frontend Changes: - Add JSON download button to edimsg.pl page - Support for ?format=json parameter and Accept: application/json header - Proper HTTP content-type handling for JSON responses - Error handling for missing messages in JSON format JSON Structure: { "header": "UNB+UNOC:3+...", "messages": [ { "header": "UNH+1+QUOTES:D:93A:UN:EAN008'", "segments": [ { "tag": "LIN", "raw": "LIN+1+1+9780552150040:EN'", "elements": ["1", "1", "9780552150040:EN"], "line_id": "1" } ], "trailer": "UNT+25+1'" } ], "trailer": "UNZ+1+1'" } Test plan: 1. Apply this patch 2. Ensure you have EDIFACT messages in your system 3. Go to Acquisitions > EDIFACT messages 4. Click "View message" for any message 5. Click the new "JSON" button 6. Verify JSON downloads with proper structure 7. Verify direct URL access with ?format=json parameter works 8. Test with Accept: application/json header -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #4 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 184489 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184489&action=edit Bug 40383: Enhanced EDIFACT message modal with search and focus functionality This patch completely rebuilds the EDIFACT message modal interface, featuring: **Core Features:** - Modern Bootstrap 5 navbar with integrated search functionality - Tree view and raw view display modes for message structure - Real-time search with regex support and result navigation - Smart focus functionality that highlights relevant segments based on context (basket, invoice) **User Interface:** - Bootstrap navbar between modal header and body - Search form with previous/next navigation and live result counts - Clean separation between always-visible controls and view-specific toolbars - Accessibility conscious with proper ARIA labels and semantic markup - Streamlined DOM structure with direct modal-body scrolling **Test Plan:** 1. Apply patch and run: yarn css:build to compile SCSS 2. Navigate to Acquisitions > EDIFACT messages 3. Click "View message" on any EDIFACT message 4. **Modal Display Testing:** - Verify modal opens with Bootstrap navbar between header and body - Confirm tree view is active by default with segment structure visible - Click raw view button to verify plain text display - Test modal responsiveness by resizing window 5. **Search Functionality Testing:** - Enter "UNH" in search field, verify navbar shows result count - Use previous/next buttons to navigate between results - Test search with terms like "ORDER", "NAD", "LIN" - all results should be found - Verify native browser clear button appears and works - Test case-insensitive search behavior 6. **Focus Functionality Testing:** - From basket page, click enhanced view link - should highlight relevant segments - From invoice page, click enhanced view - should focus on invoice-related segments - Verify focus highlighting persists during search operations 7. **Error Handling Testing:** - Test with invalid message ID, verify error display - Test network errors, confirm loading states work properly 8. **Accessibility Testing:** - Verify keyboard navigation works with search controls - Test screen reader compatibility with ARIA labels - Confirm modal can be closed with Escape key -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 184490 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184490&action=edit Bug 40383: Add Cypress test coverage for EDIFACT modal This patch adds end-to-end testing for the EDIFACT modal interface, providing coverage of all user interactions and functionality. **Test Coverage:** - Modal display and initialization with proper Bootstrap navbar structure - View toggle functionality between tree and raw display modes - Search functionality including navigation, result counting, and highlighting - Focus functionality for basket and invoice contexts - Error handling for invalid message IDs and network failures - Accessibility features including keyboard navigation - Responsive behavior and modal interaction patterns **Test Plan:** 1. Apply patch 2. Ensure KTD environment is running with test data 3. Run tests: `npx cypress run --spec "t/cypress/integration/Acquisitions/Edifact*"` 4. **Verify Test Results:** 5. **Manual Verification:** - All test scenarios reflect real user workflows - Test data requirements are clearly documented in spec file - Test data is cleaned up after the tests are run -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> 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=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |32938 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32938 [Bug 32938] Acquisitions EDI - ORDRSP messages are loaded as invoices -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|24.11 |Main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184487|0 |1 is obsolete| | --- Comment #6 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 187558 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187558&action=edit Bug 40383: Add unit tests for Koha::Edifact to_json method This patch adds unit tests for the new to_json method being introduced in Koha::Edifact module in the next patch. The tests verify: - JSON output generation and validity - Proper structure with header, messages, and trailer fields - Message array structure with correct number of messages - Individual message structure (header, segments, trailer) - Segment data integrity including raw data and elements arrays - Line ID functionality for related segments (LIN, QTY, PRI, PIA) Test plan: 1. Apply this patch and the next one 2. Run: prove t/Edifact.t 3. Verify all 63 tests pass 4. Confirm the new JSON-related tests (22 tests) execute successfully Sponsored-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184488|0 |1 is obsolete| | --- Comment #7 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 187559 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187559&action=edit Bug 40383: Add JSON representation to Koha::Edifact and JSON download to edimsg.pl This patch implements a JSON representation of EDIFACT interchanges for enhanced programmatic access and debugging capabilities. Backend Changes: - Add to_json() method to Koha::Edifact module - Structured JSON output with header, messages array, and trailer - Segment parsing with raw data, elements arrays, and line_id tracking - Line item grouping using LIN segment identifiers Frontend Changes: - Add JSON download button to edimsg.pl page - Support for ?format=json parameter and Accept: application/json header - Proper HTTP content-type handling for JSON responses - Error handling for missing messages in JSON format JSON Structure: { "header": "UNB+UNOC:3+...", "messages": [ { "header": "UNH+1+QUOTES:D:93A:UN:EAN008'", "segments": [ { "tag": "LIN", "raw": "LIN+1+1+9780552150040:EN'", "elements": ["1", "1", "9780552150040:EN"], "line_id": "1" } ], "trailer": "UNT+25+1'" } ], "trailer": "UNZ+1+1'" } Test plan: 1. Apply this patch 2. Ensure you have EDIFACT messages in your system 3. Go to Acquisitions > EDIFACT messages 4. Click "View message" for any message 5. Click the new "JSON" button 6. Verify JSON downloads with proper structure 7. Verify direct URL access with ?format=json parameter works 8. Test with Accept: application/json header Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184489|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 187560 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187560&action=edit Bug 40383: Enhanced EDIFACT message modal with search and focus functionality This patch completely rebuilds the EDIFACT message modal interface, featuring: **Core Features:** - Modern Bootstrap 5 navbar with integrated search functionality - Tree view and raw view display modes for message structure - Real-time search with regex support and result navigation - Smart focus functionality that highlights relevant segments based on context (basket, invoice) **User Interface:** - Bootstrap navbar between modal header and body - Search form with previous/next navigation and live result counts - Clean separation between always-visible controls and view-specific toolbars - Accessibility conscious with proper ARIA labels and semantic markup - Streamlined DOM structure with direct modal-body scrolling **Test Plan:** 1. Apply patch and run: yarn css:build to compile SCSS 2. Navigate to Acquisitions > EDIFACT messages 3. Click "View message" on any EDIFACT message 4. **Modal Display Testing:** - Verify modal opens with Bootstrap navbar between header and body - Confirm tree view is active by default with segment structure visible - Click raw view button to verify plain text display - Test modal responsiveness by resizing window 5. **Search Functionality Testing:** - Enter "UNH" in search field, verify navbar shows result count - Use previous/next buttons to navigate between results - Test search with terms like "ORDER", "NAD", "LIN" - all results should be found - Verify native browser clear button appears and works - Test case-insensitive search behavior 6. **Focus Functionality Testing:** - From basket page, click enhanced view link - should highlight relevant segments - From invoice page, click enhanced view - should focus on invoice-related segments - Verify focus highlighting persists during search operations 7. **Error Handling Testing:** - Test with invalid message ID, verify error display - Test network errors, confirm loading states work properly 8. **Accessibility Testing:** - Verify keyboard navigation works with search controls - Test screen reader compatibility with ARIA labels - Confirm modal can be closed with Escape key Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184490|0 |1 is obsolete| | --- Comment #9 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 187561 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187561&action=edit Bug 40383: Add Cypress test coverage for EDIFACT modal This patch adds end-to-end testing for the EDIFACT modal interface, providing coverage of all user interactions and functionality. **Test Coverage:** - Modal display and initialization with proper Bootstrap navbar structure - View toggle functionality between tree and raw display modes - Search functionality including navigation, result counting, and highlighting - Focus functionality for basket and invoice contexts - Error handling for invalid message IDs and network failures - Accessibility features including keyboard navigation - Responsive behavior and modal interaction patterns **Test Plan:** 1. Apply patch 2. Ensure KTD environment is running with test data 3. Run tests: `npx cypress run --spec "t/cypress/integration/Acquisitions/Edifact*"` 4. **Verify Test Results:** 5. **Manual Verification:** - All test scenarios reflect real user workflows - Test data requirements are clearly documented in spec file - Test data is cleaned up after the tests are run Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #10 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Hannah and I have been using this for debugging messages on their live system. It's gone a long way to making EDI message more understandable and accessible -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Bug 40383 depends on bug 40174, which changed state. Bug 40174 Summary: Add a way to cleanly insert data in DB from Cypress tests https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40174 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187558|0 |1 is obsolete| | --- Comment #11 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 188577 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188577&action=edit Bug 40383: Add unit tests for Koha::Edifact to_json method This patch adds unit tests for the new to_json method being introduced in Koha::Edifact module in the next patch. The tests verify: - JSON output generation and validity - Proper structure with header, messages, and trailer fields - Message array structure with correct number of messages - Individual message structure (header, segments, trailer) - Segment data integrity including raw data and elements arrays - Line ID functionality for related segments (LIN, QTY, PRI, PIA) Test plan: 1. Apply this patch and the next one 2. Run: prove t/Edifact.t 3. Verify all 63 tests pass 4. Confirm the new JSON-related tests (22 tests) execute successfully Sponsored-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187559|0 |1 is obsolete| | --- Comment #12 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 188578 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188578&action=edit Bug 40383: Add JSON representation to Koha::Edifact and JSON download to edimsg.pl This patch implements a JSON representation of EDIFACT interchanges for enhanced programmatic access and debugging capabilities. Backend Changes: - Add to_json() method to Koha::Edifact module - Structured JSON output with header, messages array, and trailer - Segment parsing with raw data, elements arrays, and line_id tracking - Line item grouping using LIN segment identifiers Frontend Changes: - Add JSON download button to edimsg.pl page - Support for ?format=json parameter and Accept: application/json header - Proper HTTP content-type handling for JSON responses - Error handling for missing messages in JSON format JSON Structure: { "header": "UNB+UNOC:3+...", "messages": [ { "header": "UNH+1+QUOTES:D:93A:UN:EAN008'", "segments": [ { "tag": "LIN", "raw": "LIN+1+1+9780552150040:EN'", "elements": ["1", "1", "9780552150040:EN"], "line_id": "1" } ], "trailer": "UNT+25+1'" } ], "trailer": "UNZ+1+1'" } Test plan: 1. Apply this patch 2. Ensure you have EDIFACT messages in your system 3. Go to Acquisitions > EDIFACT messages 4. Click "View message" for any message 5. Click the new "JSON" button 6. Verify JSON downloads with proper structure 7. Verify direct URL access with ?format=json parameter works 8. Test with Accept: application/json header Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187560|0 |1 is obsolete| | --- Comment #13 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 188579 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188579&action=edit Bug 40383: Enhanced EDIFACT message modal with search and focus functionality This patch completely rebuilds the EDIFACT message modal interface, featuring: **Core Features:** - Modern Bootstrap 5 navbar with integrated search functionality - Tree view and raw view display modes for message structure - Real-time search with regex support and result navigation - Smart focus functionality that highlights relevant segments based on context (basket, invoice) **User Interface:** - Bootstrap navbar between modal header and body - Search form with previous/next navigation and live result counts - Clean separation between always-visible controls and view-specific toolbars - Accessibility conscious with proper ARIA labels and semantic markup - Streamlined DOM structure with direct modal-body scrolling **Test Plan:** 1. Apply patch and run: yarn css:build to compile SCSS 2. Navigate to Acquisitions > EDIFACT messages 3. Click "View message" on any EDIFACT message 4. **Modal Display Testing:** - Verify modal opens with Bootstrap navbar between header and body - Confirm tree view is active by default with segment structure visible - Click raw view button to verify plain text display - Test modal responsiveness by resizing window 5. **Search Functionality Testing:** - Enter "UNH" in search field, verify navbar shows result count - Use previous/next buttons to navigate between results - Test search with terms like "ORDER", "NAD", "LIN" - all results should be found - Verify native browser clear button appears and works - Test case-insensitive search behavior 6. **Focus Functionality Testing:** - From basket page, click enhanced view link - should highlight relevant segments - From invoice page, click enhanced view - should focus on invoice-related segments - Verify focus highlighting persists during search operations 7. **Error Handling Testing:** - Test with invalid message ID, verify error display - Test network errors, confirm loading states work properly 8. **Accessibility Testing:** - Verify keyboard navigation works with search controls - Test screen reader compatibility with ARIA labels - Confirm modal can be closed with Escape key Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187561|0 |1 is obsolete| | --- Comment #14 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 188580 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188580&action=edit Bug 40383: Add Cypress test coverage for EDIFACT modal This patch adds end-to-end testing for the EDIFACT modal interface, providing coverage of all user interactions and functionality. **Test Coverage:** - Modal display and initialization with proper Bootstrap navbar structure - View toggle functionality between tree and raw display modes - Search functionality including navigation, result counting, and highlighting - Focus functionality for basket and invoice contexts - Error handling for invalid message IDs and network failures - Accessibility features including keyboard navigation - Responsive behavior and modal interaction patterns **Test Plan:** 1. Apply patch 2. Ensure KTD environment is running with test data 3. Run tests: `npx cypress run --spec "t/cypress/integration/Acquisitions/Edifact*"` 4. **Verify Test Results:** 5. **Manual Verification:** - All test scenarios reflect real user workflows - Test data requirements are clearly documented in spec file - Test data is cleaned up after the tests are run Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #15 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Test plan fun.. thanks for looking Kyle. Should all apply again now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188577|0 |1 is obsolete| | --- Comment #16 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 189575 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189575&action=edit Bug 40383: Add unit tests for Koha::Edifact to_json method This patch adds unit tests for the new to_json method being introduced in Koha::Edifact module in the next patch. The tests verify: - JSON output generation and validity - Proper structure with header, messages, and trailer fields - Message array structure with correct number of messages - Individual message structure (header, segments, trailer) - Segment data integrity including raw data and elements arrays - Line ID functionality for related segments (LIN, QTY, PRI, PIA) Test plan: 1. Apply this patch and the next one 2. Run: prove t/Edifact.t 3. Verify all 63 tests pass 4. Confirm the new JSON-related tests (22 tests) execute successfully Sponsored-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188578|0 |1 is obsolete| | --- Comment #17 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 189576 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189576&action=edit Bug 40383: Add JSON representation to Koha::Edifact and JSON download to edimsg.pl This patch implements a JSON representation of EDIFACT interchanges for enhanced programmatic access and debugging capabilities. Backend Changes: - Add to_json() method to Koha::Edifact module - Structured JSON output with header, messages array, and trailer - Segment parsing with raw data, elements arrays, and line_id tracking - Line item grouping using LIN segment identifiers Frontend Changes: - Add JSON download button to edimsg.pl page - Support for ?format=json parameter and Accept: application/json header - Proper HTTP content-type handling for JSON responses - Error handling for missing messages in JSON format JSON Structure: { "header": "UNB+UNOC:3+...", "messages": [ { "header": "UNH+1+QUOTES:D:93A:UN:EAN008'", "segments": [ { "tag": "LIN", "raw": "LIN+1+1+9780552150040:EN'", "elements": ["1", "1", "9780552150040:EN"], "line_id": "1" } ], "trailer": "UNT+25+1'" } ], "trailer": "UNZ+1+1'" } Test plan: 1. Apply this patch 2. Ensure you have EDIFACT messages in your system 3. Go to Acquisitions > EDIFACT messages 4. Click "View message" for any message 5. Click the new "JSON" button 6. Verify JSON downloads with proper structure 7. Verify direct URL access with ?format=json parameter works 8. Test with Accept: application/json header Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188579|0 |1 is obsolete| | --- Comment #18 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 189577 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189577&action=edit Bug 40383: Enhanced EDIFACT message modal with search and focus functionality This patch completely rebuilds the EDIFACT message modal interface, featuring: **Core Features:** - Modern Bootstrap 5 navbar with integrated search functionality - Tree view and raw view display modes for message structure - Real-time search with regex support and result navigation - Smart focus functionality that highlights relevant segments based on context (basket, invoice) **User Interface:** - Bootstrap navbar between modal header and body - Search form with previous/next navigation and live result counts - Clean separation between always-visible controls and view-specific toolbars - Accessibility conscious with proper ARIA labels and semantic markup - Streamlined DOM structure with direct modal-body scrolling **Test Plan:** 1. Apply patch and run: yarn css:build to compile SCSS 2. Navigate to Acquisitions > EDIFACT messages 3. Click "View message" on any EDIFACT message 4. **Modal Display Testing:** - Verify modal opens with Bootstrap navbar between header and body - Confirm tree view is active by default with segment structure visible - Click raw view button to verify plain text display - Test modal responsiveness by resizing window 5. **Search Functionality Testing:** - Enter "UNH" in search field, verify navbar shows result count - Use previous/next buttons to navigate between results - Test search with terms like "ORDER", "NAD", "LIN" - all results should be found - Verify native browser clear button appears and works - Test case-insensitive search behavior 6. **Focus Functionality Testing:** - From basket page, click enhanced view link - should highlight relevant segments - From invoice page, click enhanced view - should focus on invoice-related segments - Verify focus highlighting persists during search operations 7. **Error Handling Testing:** - Test with invalid message ID, verify error display - Test network errors, confirm loading states work properly 8. **Accessibility Testing:** - Verify keyboard navigation works with search controls - Test screen reader compatibility with ARIA labels - Confirm modal can be closed with Escape key Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188580|0 |1 is obsolete| | --- Comment #19 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 189578 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189578&action=edit Bug 40383: Add Cypress test coverage for EDIFACT modal This patch adds end-to-end testing for the EDIFACT modal interface, providing coverage of all user interactions and functionality. **Test Coverage:** - Modal display and initialization with proper Bootstrap navbar structure - View toggle functionality between tree and raw display modes - Search functionality including navigation, result counting, and highlighting - Focus functionality for basket and invoice contexts - Error handling for invalid message IDs and network failures - Accessibility features including keyboard navigation - Responsive behavior and modal interaction patterns **Test Plan:** 1. Apply patch 2. Ensure KTD environment is running with test data 3. Run tests: `npx cypress run --spec "t/cypress/integration/Acquisitions/Edifact*"` 4. **Verify Test Results:** 5. **Manual Verification:** - All test scenarios reflect real user workflows - Test data requirements are clearly documented in spec file - Test data is cleaned up after the tests are run Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41297 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41297 [Bug 41297] Add duplicate invoice number detection on EDI invoice import -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off Comma delimited| |Martin Renvoize list of Sponsors| |<martin.renvoize@openfifth. | |co.uk> Sponsorship status|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189575|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189576|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189577|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189578|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #20 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192527 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192527&action=edit Bug 40383: Add unit tests for Koha::Edifact to_json method This patch adds unit tests for the new to_json method being introduced in Koha::Edifact module in the next patch. The tests verify: - JSON output generation and validity - Proper structure with header, messages, and trailer fields - Message array structure with correct number of messages - Individual message structure (header, segments, trailer) - Segment data integrity including raw data and elements arrays - Line ID functionality for related segments (LIN, QTY, PRI, PIA) Test plan: 1. Apply this patch and the next one 2. Run: prove t/Edifact.t 3. Verify all 63 tests pass 4. Confirm the new JSON-related tests (22 tests) execute successfully Sponsored-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #21 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192528 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192528&action=edit Bug 40383: Add JSON representation to Koha::Edifact and JSON download to edimsg.pl This patch implements a JSON representation of EDIFACT interchanges for enhanced programmatic access and debugging capabilities. Backend Changes: - Add to_json() method to Koha::Edifact module - Structured JSON output with header, messages array, and trailer - Segment parsing with raw data, elements arrays, and line_id tracking - Line item grouping using LIN segment identifiers Frontend Changes: - Add JSON download button to edimsg.pl page - Support for ?format=json parameter and Accept: application/json header - Proper HTTP content-type handling for JSON responses - Error handling for missing messages in JSON format JSON Structure: { "header": "UNB+UNOC:3+...", "messages": [ { "header": "UNH+1+QUOTES:D:93A:UN:EAN008'", "segments": [ { "tag": "LIN", "raw": "LIN+1+1+9780552150040:EN'", "elements": ["1", "1", "9780552150040:EN"], "line_id": "1" } ], "trailer": "UNT+25+1'" } ], "trailer": "UNZ+1+1'" } Test plan: 1. Apply this patch 2. Ensure you have EDIFACT messages in your system 3. Go to Acquisitions > EDIFACT messages 4. Click "View message" for any message 5. Click the new "JSON" button 6. Verify JSON downloads with proper structure 7. Verify direct URL access with ?format=json parameter works 8. Test with Accept: application/json header Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #22 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192529 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192529&action=edit Bug 40383: Enhanced EDIFACT message modal with search and focus functionality This patch completely rebuilds the EDIFACT message modal interface, featuring: **Core Features:** - Modern Bootstrap 5 navbar with integrated search functionality - Tree view and raw view display modes for message structure - Real-time search with regex support and result navigation - Smart focus functionality that highlights relevant segments based on context (basket, invoice) **User Interface:** - Bootstrap navbar between modal header and body - Search form with previous/next navigation and live result counts - Clean separation between always-visible controls and view-specific toolbars - Accessibility conscious with proper ARIA labels and semantic markup - Streamlined DOM structure with direct modal-body scrolling **Test Plan:** 1. Apply patch and run: yarn css:build to compile SCSS 2. Navigate to Acquisitions > EDIFACT messages 3. Click "View message" on any EDIFACT message 4. **Modal Display Testing:** - Verify modal opens with Bootstrap navbar between header and body - Confirm tree view is active by default with segment structure visible - Click raw view button to verify plain text display - Test modal responsiveness by resizing window 5. **Search Functionality Testing:** - Enter "UNH" in search field, verify navbar shows result count - Use previous/next buttons to navigate between results - Test search with terms like "ORDER", "NAD", "LIN" - all results should be found - Verify native browser clear button appears and works - Test case-insensitive search behavior 6. **Focus Functionality Testing:** - From basket page, click enhanced view link - should highlight relevant segments - From invoice page, click enhanced view - should focus on invoice-related segments - Verify focus highlighting persists during search operations 7. **Error Handling Testing:** - Test with invalid message ID, verify error display - Test network errors, confirm loading states work properly 8. **Accessibility Testing:** - Verify keyboard navigation works with search controls - Test screen reader compatibility with ARIA labels - Confirm modal can be closed with Escape key Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #23 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 192530 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192530&action=edit Bug 40383: Add Cypress test coverage for EDIFACT modal This patch adds end-to-end testing for the EDIFACT modal interface, providing coverage of all user interactions and functionality. **Test Coverage:** - Modal display and initialization with proper Bootstrap navbar structure - View toggle functionality between tree and raw display modes - Search functionality including navigation, result counting, and highlighting - Focus functionality for basket and invoice contexts - Error handling for invalid message IDs and network failures - Accessibility features including keyboard navigation - Responsive behavior and modal interaction patterns **Test Plan:** 1. Apply patch 2. Ensure KTD environment is running with test data 3. Run tests: `npx cypress run --spec "t/cypress/integration/Acquisitions/Edifact*"` 4. **Verify Test Results:** 5. **Manual Verification:** - All test scenarios reflect real user workflows - Test data requirements are clearly documented in spec file - Test data is cleaned up after the tests are run Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #24 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Just another rebase -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192527|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192528|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192529|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192530|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #25 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 193057 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193057&action=edit Bug 40383: Add JSON representation to Koha::Edifact and JSON download to edimsg.pl This patch implements a JSON representation of EDIFACT interchanges for enhanced programmatic access and debugging capabilities. Backend Changes: - Add to_json() method to Koha::Edifact module - Structured JSON output with header, messages array, and trailer - Segment parsing with raw data, elements arrays, and line_id tracking - Line item grouping using LIN segment identifiers Frontend Changes: - Add JSON download button to edimsg.pl page - Support for ?format=json parameter and Accept: application/json header - Proper HTTP content-type handling for JSON responses - Error handling for missing messages in JSON format JSON Structure: { "header": "UNB+UNOC:3+...", "messages": [ { "header": "UNH+1+QUOTES:D:93A:UN:EAN008'", "segments": [ { "tag": "LIN", "raw": "LIN+1+1+9780552150040:EN'", "elements": ["1", "1", "9780552150040:EN"], "line_id": "1" } ], "trailer": "UNT+25+1'" } ], "trailer": "UNZ+1+1'" } Test plan: 1. Apply this patch 2. Ensure you have EDIFACT messages in your system 3. Go to Acquisitions > EDIFACT messages 4. Click "View message" for any message 5. Click the new "JSON" button 6. Verify JSON downloads with proper structure 7. Verify direct URL access with ?format=json parameter works 8. Test with Accept: application/json header Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #26 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 193058 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193058&action=edit Bug 40383: Enhanced EDIFACT message modal with search and focus functionality This patch completely rebuilds the EDIFACT message modal interface, featuring: **Core Features:** - Modern Bootstrap 5 navbar with integrated search functionality - Tree view and raw view display modes for message structure - Real-time search with regex support and result navigation - Smart focus functionality that highlights relevant segments based on context (basket, invoice) **User Interface:** - Bootstrap navbar between modal header and body - Search form with previous/next navigation and live result counts - Clean separation between always-visible controls and view-specific toolbars - Accessibility conscious with proper ARIA labels and semantic markup - Streamlined DOM structure with direct modal-body scrolling **Test Plan:** 1. Apply patch and run: yarn css:build to compile SCSS 2. Navigate to Acquisitions > EDIFACT messages 3. Click "View message" on any EDIFACT message 4. **Modal Display Testing:** - Verify modal opens with Bootstrap navbar between header and body - Confirm tree view is active by default with segment structure visible - Click raw view button to verify plain text display - Test modal responsiveness by resizing window 5. **Search Functionality Testing:** - Enter "UNH" in search field, verify navbar shows result count - Use previous/next buttons to navigate between results - Test search with terms like "ORDER", "NAD", "LIN" - all results should be found - Verify native browser clear button appears and works - Test case-insensitive search behavior 6. **Focus Functionality Testing:** - From basket page, click enhanced view link - should highlight relevant segments - From invoice page, click enhanced view - should focus on invoice-related segments - Verify focus highlighting persists during search operations 7. **Error Handling Testing:** - Test with invalid message ID, verify error display - Test network errors, confirm loading states work properly 8. **Accessibility Testing:** - Verify keyboard navigation works with search controls - Test screen reader compatibility with ARIA labels - Confirm modal can be closed with Escape key Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #27 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 193059 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193059&action=edit Bug 40383: Add Cypress test coverage for EDIFACT modal This patch adds end-to-end testing for the EDIFACT modal interface, providing coverage of all user interactions and functionality. **Test Coverage:** - Modal display and initialization with proper Bootstrap navbar structure - View toggle functionality between tree and raw display modes - Search functionality including navigation, result counting, and highlighting - Focus functionality for basket and invoice contexts - Error handling for invalid message IDs and network failures - Accessibility features including keyboard navigation - Responsive behavior and modal interaction patterns **Test Plan:** 1. Apply patch 2. Ensure KTD environment is running with test data 3. Run tests: `npx cypress run --spec "t/cypress/integration/Acquisitions/Edifact*"` 4. **Verify Test Results:** 5. **Manual Verification:** - All test scenarios reflect real user workflows - Test data requirements are clearly documented in spec file - Test data is cleaned up after the tests are run Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #28 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 193060 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193060&action=edit Bug 40383: Tidy t/Edifact.t for QA script Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com, | |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=40383 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #29 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- The cypress tests don't pass for me. Also, I see quite a bit of cy.wait(1000). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #30 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Ah yes.. these were probably some of the first Cypress tests I wrote.. I'll have a little dig -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193057|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193058|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193059|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #31 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 194327 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194327&action=edit Bug 40383: Add unit tests for Koha::Edifact to_json method This patch adds unit tests for the new to_json method being introduced in Koha::Edifact module in the next patch. The tests verify: - JSON output generation and validity - Proper structure with header, messages, and trailer fields - Message array structure with correct number of messages - Individual message structure (header, segments, trailer) - Segment data integrity including raw data and elements arrays - Line ID functionality for related segments (LIN, QTY, PRI, PIA) Test plan: 1. Apply this patch and the next one 2. Run: prove t/Edifact.t 3. Verify all 63 tests pass 4. Confirm the new JSON-related tests (22 tests) execute successfully Sponsored-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #32 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 194328 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194328&action=edit Bug 40383: Add JSON representation to Koha::Edifact and JSON download to edimsg.pl This patch implements a JSON representation of EDIFACT interchanges for enhanced programmatic access and debugging capabilities. Backend Changes: - Add to_json() method to Koha::Edifact module - Structured JSON output with header, messages array, and trailer - Segment parsing with raw data, elements arrays, and line_id tracking - Line item grouping using LIN segment identifiers Frontend Changes: - Add JSON download button to edimsg.pl page - Support for ?format=json parameter and Accept: application/json header - Proper HTTP content-type handling for JSON responses - Error handling for missing messages in JSON format JSON Structure: { "header": "UNB+UNOC:3+...", "messages": [ { "header": "UNH+1+QUOTES:D:93A:UN:EAN008'", "segments": [ { "tag": "LIN", "raw": "LIN+1+1+9780552150040:EN'", "elements": ["1", "1", "9780552150040:EN"], "line_id": "1" } ], "trailer": "UNT+25+1'" } ], "trailer": "UNZ+1+1'" } Test plan: 1. Apply this patch 2. Ensure you have EDIFACT messages in your system 3. Go to Acquisitions > EDIFACT messages 4. Click "View message" for any message 5. Click the new "JSON" button 6. Verify JSON downloads with proper structure 7. Verify direct URL access with ?format=json parameter works 8. Test with Accept: application/json header Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #33 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 194329 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194329&action=edit Bug 40383: Enhanced EDIFACT message modal with search and focus functionality This patch completely rebuilds the EDIFACT message modal interface, featuring: **Core Features:** - Modern Bootstrap 5 navbar with integrated search functionality - Tree view and raw view display modes for message structure - Real-time search with regex support and result navigation - Smart focus functionality that highlights relevant segments based on context (basket, invoice) **User Interface:** - Bootstrap navbar between modal header and body - Search form with previous/next navigation and live result counts - Clean separation between always-visible controls and view-specific toolbars - Accessibility conscious with proper ARIA labels and semantic markup - Streamlined DOM structure with direct modal-body scrolling **Test Plan:** 1. Apply patch and run: yarn css:build to compile SCSS 2. Navigate to Acquisitions > EDIFACT messages 3. Click "View message" on any EDIFACT message 4. **Modal Display Testing:** - Verify modal opens with Bootstrap navbar between header and body - Confirm tree view is active by default with segment structure visible - Click raw view button to verify plain text display - Test modal responsiveness by resizing window 5. **Search Functionality Testing:** - Enter "UNH" in search field, verify navbar shows result count - Use previous/next buttons to navigate between results - Test search with terms like "ORDER", "NAD", "LIN" - all results should be found - Verify native browser clear button appears and works - Test case-insensitive search behavior 6. **Focus Functionality Testing:** - From basket page, click enhanced view link - should highlight relevant segments - From invoice page, click enhanced view - should focus on invoice-related segments - Verify focus highlighting persists during search operations 7. **Error Handling Testing:** - Test with invalid message ID, verify error display - Test network errors, confirm loading states work properly 8. **Accessibility Testing:** - Verify keyboard navigation works with search controls - Test screen reader compatibility with ARIA labels - Confirm modal can be closed with Escape key Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #34 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 194330 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194330&action=edit Bug 40383: Add Cypress test coverage for EDIFACT modal This patch adds end-to-end testing for the EDIFACT modal interface, providing coverage of all user interactions and functionality. **Test Coverage:** - Modal display and initialization with proper Bootstrap navbar structure - View toggle functionality between tree and raw display modes - Search functionality including navigation, result counting, and highlighting - Focus functionality for basket and invoice contexts - Error handling for invalid message IDs and network failures - Accessibility features including keyboard navigation - Responsive behavior and modal interaction patterns **Test Plan:** 1. Apply patch 2. Ensure KTD environment is running with test data 3. Run tests: `npx cypress run --spec "t/cypress/integration/Acquisitions/Edifact*"` 4. **Verify Test Results:** 5. **Manual Verification:** - All test scenarios reflect real user workflows - Test data requirements are clearly documented in spec file - Test data is cleaned up after the tests are run Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #35 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 194331 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194331&action=edit Bug 40383: (QA follow-up) Update Cypress tests to follow current best practices Remove before()/after() DB hooks — all assertions already use cy.intercept mocks so no real database messages are needed. Extract repeated button injection into an openEDIModal() helper. Replace all cy.wait(N) fixed-time waits with assertion-based waits and cy.wait('@alias') for network sync. Fix a Bootstrap 5 race condition in the modal-close cleanup test where hidden.bs.modal fired after the backdrop animation, causing the re-opened modal's focus class to be removed mid-test. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |38689 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38689 [Bug 38689] EDIFACT errors should log to a staff accessible location -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #36 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Martin Renvoize (ashimema) from comment #33)
Created attachment 194329 [details] [review] Bug 40383: Enhanced EDIFACT message modal with search and focus functionality
This patch adds TT tags within script tags. + var interface = "[% interface | html %]"; + var theme = "[% theme | html %]"; It seems that those 2 variables are not used anyway. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #37 from Jonathan Druart <jonathan.druart@gmail.com> --- There are actually used in other .js files. I would suggest to move them into a separate script tag: <script> const interface = "[% interface | html %]"; const theme = "[% theme | html %]"; </script> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #38 from Jonathan Druart <jonathan.druart@gmail.com> --- + const escapeHtml = str => { We already have String.prototype.escapeHtml in staff-global.js -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42001 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42001 [Bug 42001] Add duplicate purchase order number detection on EDI quote import -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|42001 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42001 [Bug 42001] Add duplicate purchase order number detection on EDI quote import -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #39 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 194963 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194963&action=edit Bug 40383: (follow-up) Address code review concerns - Move TT interface/theme variables into a separate <script> tag to avoid mixing template variables with external JavaScript file scope - Replace local escapeHtml() functions in edifact_interchange.js and edifact_errors.js with String.prototype.escapeHtml already defined in staff-global.js -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #40 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Good catches, thanks for the review Jonathan. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |The EDIFACT message viewer release notes| |has been significantly | |improved with a new | |interactive modal interface | |replacing the previous | |basic display. | | | |New features: | | | | - Tree view — | |Collapsible, hierarchical | |display of EDIFACT | |interchange structure with | |segment tagging | | - Raw view — Plain-text | |fallback for direct | |inspection of message | |content | | - Search — Real-time | |search with regex support, | |result count, and | |previous/next navigation | | - Focus mode — Highlights | |segments relevant to the | |current context (basket or | |invoice) when opened from | |those pages | | - JSON download — New | |?format=json endpoint on | |edimsg.pl and download | |button for programmatic | |access and debugging; | |backed by a new to_json() | |method on Koha::Edifact -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193060|0 |1 is obsolete| | Attachment #194327|0 |1 is obsolete| | Attachment #194328|0 |1 is obsolete| | Attachment #194329|0 |1 is obsolete| | Attachment #194330|0 |1 is obsolete| | Attachment #194331|0 |1 is obsolete| | Attachment #194963|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #41 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 196033 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196033&action=edit Bug 40383: Add unit tests for Koha::Edifact to_json method This patch adds unit tests for the new to_json method being introduced in Koha::Edifact module in the next patch. The tests verify: - JSON output generation and validity - Proper structure with header, messages, and trailer fields - Message array structure with correct number of messages - Individual message structure (header, segments, trailer) - Segment data integrity including raw data and elements arrays - Line ID functionality for related segments (LIN, QTY, PRI, PIA) Test plan: 1. Apply this patch and the next one 2. Run: prove t/Edifact.t 3. Verify all 63 tests pass 4. Confirm the new JSON-related tests (22 tests) execute successfully Sponsored-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #42 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 196034 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196034&action=edit Bug 40383: Add JSON representation to Koha::Edifact and JSON download to edimsg.pl This patch implements a JSON representation of EDIFACT interchanges for enhanced programmatic access and debugging capabilities. Backend Changes: - Add to_json() method to Koha::Edifact module - Structured JSON output with header, messages array, and trailer - Segment parsing with raw data, elements arrays, and line_id tracking - Line item grouping using LIN segment identifiers Frontend Changes: - Add JSON download button to edimsg.pl page - Support for ?format=json parameter and Accept: application/json header - Proper HTTP content-type handling for JSON responses - Error handling for missing messages in JSON format JSON Structure: { "header": "UNB+UNOC:3+...", "messages": [ { "header": "UNH+1+QUOTES:D:93A:UN:EAN008'", "segments": [ { "tag": "LIN", "raw": "LIN+1+1+9780552150040:EN'", "elements": ["1", "1", "9780552150040:EN"], "line_id": "1" } ], "trailer": "UNT+25+1'" } ], "trailer": "UNZ+1+1'" } Test plan: 1. Apply this patch 2. Ensure you have EDIFACT messages in your system 3. Go to Acquisitions > EDIFACT messages 4. Click "View message" for any message 5. Click the new "JSON" button 6. Verify JSON downloads with proper structure 7. Verify direct URL access with ?format=json parameter works 8. Test with Accept: application/json header Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #43 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 196035 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196035&action=edit Bug 40383: Enhanced EDIFACT message modal with search and focus functionality This patch completely rebuilds the EDIFACT message modal interface, featuring: **Core Features:** - Modern Bootstrap 5 navbar with integrated search functionality - Tree view and raw view display modes for message structure - Real-time search with regex support and result navigation - Smart focus functionality that highlights relevant segments based on context (basket, invoice) **User Interface:** - Bootstrap navbar between modal header and body - Search form with previous/next navigation and live result counts - Clean separation between always-visible controls and view-specific toolbars - Accessibility conscious with proper ARIA labels and semantic markup - Streamlined DOM structure with direct modal-body scrolling **Test Plan:** 1. Apply patch and run: yarn css:build to compile SCSS 2. Navigate to Acquisitions > EDIFACT messages 3. Click "View message" on any EDIFACT message 4. **Modal Display Testing:** - Verify modal opens with Bootstrap navbar between header and body - Confirm tree view is active by default with segment structure visible - Click raw view button to verify plain text display - Test modal responsiveness by resizing window 5. **Search Functionality Testing:** - Enter "UNH" in search field, verify navbar shows result count - Use previous/next buttons to navigate between results - Test search with terms like "ORDER", "NAD", "LIN" - all results should be found - Verify native browser clear button appears and works - Test case-insensitive search behavior 6. **Focus Functionality Testing:** - From basket page, click enhanced view link - should highlight relevant segments - From invoice page, click enhanced view - should focus on invoice-related segments - Verify focus highlighting persists during search operations 7. **Error Handling Testing:** - Test with invalid message ID, verify error display - Test network errors, confirm loading states work properly 8. **Accessibility Testing:** - Verify keyboard navigation works with search controls - Test screen reader compatibility with ARIA labels - Confirm modal can be closed with Escape key Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #44 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 196036 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196036&action=edit Bug 40383: Add Cypress test coverage for EDIFACT modal This patch adds end-to-end testing for the EDIFACT modal interface, providing coverage of all user interactions and functionality. **Test Coverage:** - Modal display and initialization with proper Bootstrap navbar structure - View toggle functionality between tree and raw display modes - Search functionality including navigation, result counting, and highlighting - Focus functionality for basket and invoice contexts - Error handling for invalid message IDs and network failures - Accessibility features including keyboard navigation - Responsive behavior and modal interaction patterns **Test Plan:** 1. Apply patch 2. Ensure KTD environment is running with test data 3. Run tests: `npx cypress run --spec "t/cypress/integration/Acquisitions/Edifact*"` 4. **Verify Test Results:** 5. **Manual Verification:** - All test scenarios reflect real user workflows - Test data requirements are clearly documented in spec file - Test data is cleaned up after the tests are run Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #45 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 196037 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196037&action=edit Bug 40383: (QA follow-up) Update Cypress tests to follow current best practices Remove before()/after() DB hooks — all assertions already use cy.intercept mocks so no real database messages are needed. Extract repeated button injection into an openEDIModal() helper. Replace all cy.wait(N) fixed-time waits with assertion-based waits and cy.wait('@alias') for network sync. Fix a Bootstrap 5 race condition in the modal-close cleanup test where hidden.bs.modal fired after the backdrop animation, causing the re-opened modal's focus class to be removed mid-test. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #46 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 196038 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196038&action=edit Bug 40383: (follow-up) Address code review concerns - Move TT interface/theme variables into a separate <script> tag to avoid mixing template variables with external JavaScript file scope - Replace local escapeHtml() functions in edifact_interchange.js and edifact_errors.js with String.prototype.escapeHtml already defined in staff-global.js Sponsored-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=40383 --- Comment #47 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 196039 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196039&action=edit Bug 40383: (follow-up) Add nonce attribute to inline script in basket.tt Patch from commit b3b71ba -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196039|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #48 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 196040 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196040&action=edit Bug 40383: (follow-up) Add nonce attribute to inline script in basket.tt Patch from commit e48bfc1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Medium patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.05.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=40383 --- Comment #49 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Thanks for all the hard work! Pushed to main for the next 26.05.00 release as RM Assistant -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed --- Comment #50 from Jonathan Druart <jonathan.druart@gmail.com> --- koha-tmpl/intranet-tmpl/prog/css/edifact_interchange-rtl.css koha-tmpl/intranet-tmpl/prog/css/edifact_interchange.css must be added to .gitignore -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #51 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 197142 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197142&action=edit Bug 40383: (follow-up) Fix flaky Cypress EDIFACT search tests in CI Replace cy.wait(N) + bare assertion with assertion-based waits using { timeout: 10000 }, and replace .type(term, { delay: 50 }) with .invoke('val', term).trigger('input') to avoid keyboard simulation timing races against the 500ms debounce in the search component. 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=40383 --- Comment #52 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 197183 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197183&action=edit Bug 40383: (follow-up) Add css files to gitignore We need to add these generated files to the gitignore. 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=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #53 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- This is causing the following Cypress test to fail: t/cypress/integration/Acquisitions/EdifactModal_spec.ts Please have a look. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #54 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 199391 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199391&action=edit Bug 40383: (follow-up) Fix failing EdifactModal Cypress tests Three issues caused the EdifactModal_spec.ts test suite to fail: 1. insertSampleEdifactMessages inserted a vendor with listprice='USD' and invoiceprice='USD', but those columns have FK constraints against the currency table and USD is not pre-populated in KTD's default install. Drop the currency columns from the INSERT so they default to NULL. 2. Koha::Edifact::File::vendor() and basket() called Koha::Acquisition::Bookseller and Koha::Acquisition::Basket without use-ing them. The edifactmsgs.pl table embeds both on every API call, so a missing module caused a 500 and an empty table. 3. showMessage() already appended &format=json before delegating to showMessageFromUrl(), which then appended it a second time. Remove the redundant copy from showMessage(). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #55 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- (In reply to Martin Renvoize (ashimema) from comment #54)
Created attachment 199391 [details] [review] Bug 40383: (follow-up) Fix failing EdifactModal Cypress tests
Three issues caused the EdifactModal_spec.ts test suite to fail:
1. insertSampleEdifactMessages inserted a vendor with listprice='USD' and invoiceprice='USD', but those columns have FK constraints against the currency table and USD is not pre-populated in KTD's default install. Drop the currency columns from the INSERT so they default to NULL.
2. Koha::Edifact::File::vendor() and basket() called Koha::Acquisition::Bookseller and Koha::Acquisition::Basket without use-ing them. The edifactmsgs.pl table embeds both on every API call, so a missing module caused a 500 and an empty table.
3. showMessage() already appended &format=json before delegating to showMessageFromUrl(), which then appended it a second time. Remove the redundant copy from showMessage().
Makes sense and fixes the test failure, thanks Martin! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #56 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- follow-up 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=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #57 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 199475 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199475&action=edit Bug 40383: (follow-up) Fix CI timing races in EdifactModal search tests Replace cy.type() with invoke+trigger to avoid racing against the 500ms debounce in edifact_interchange.js. Add cy.wait("@ediMsg") in the Search Functionality beforeEach so initializeSearch() is guaranteed to have run before interaction begins. Remove all arbitrary cy.wait(N) calls in favour of condition-based assertions that let Cypress retry until the DOM state is reached: - Modal close/escape tests: drop the force-Bootstrap-close fallback; the timeout:5000 assertions are sufficient and correctly fail if the close action genuinely doesn't work. - Expand-all: classList.add("show") is synchronous so no wait is needed; replace the always-passing conditional block with a real assertion. - Collapse-all / individual toggle: Bootstrap.hide() is async, but Cypress retry handles that without a hardcoded sleep. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199475|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 --- Comment #58 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 199479 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199479&action=edit Bug 40383: (follow-up) Fix EdifactModal Cypress test reliability Three fixes to make all 27 EdifactModal Cypress tests reliably pass: 1. insertData.js: fix currency FK constraint violation (use an existing currency rather than creating an undefined one). 2. Koha/Edifact/File.pm: add missing use statements for File::Basename and File::Temp so the Cypress task can load the module. 3. EdifactModal_spec.ts: - Replace arbitrary cy.wait() calls with condition-based assertions throughout (expand/collapse animations, Bootstrap modal state). - Fix search timing: add cy.intercept + cy.wait("@ediMsg") in the Search Functionality beforeEach so initializeSearch is wired before input events fire; use invoke("val")+trigger("input") instead of type() to bypass the 500ms debounce race. - Fix modal close tests: attach a shown.bs.modal listener before opening the modal so we can wait for Bootstrap's 300ms show animation to complete (_isTransitioning → false) before calling hide(). Without this wait, hide() is silently blocked when the Ajax response is faster than the animation (common in KTD). Use bootstrap.Modal.getInstance().hide() as the programmatic fallback since data-bs-dismiss and keyboard events are unreliable in headless Cypress/Electron. - Fix edifact_interchange.js: remove duplicate &format=json appended to URLs that already contain it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=40383 --- Comment #59 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- follow-up pushed to main, thanks Martin! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40383 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting --- Comment #60 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- This will not be backported to 25.11.x due to it being deemed an enhancement or a dependancy not being met -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org