Bug 39410 - Notice display modal should use shadow dom
Summary: Notice display modal should use shadow dom
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Martin Renvoize (ashimema)
QA Contact: Testopia
URL:
Keywords:
Depends on: 30287 38087
Blocks:
  Show dependency treegraph
 
Reported: 2025-03-21 15:15 UTC by Martin Renvoize (ashimema)
Modified: 2025-03-21 15:26 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 39410: Use shadowDOM for notice display modal (3.05 KB, patch)
2025-03-21 15:24 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2025-03-21 15:15:23 UTC
Whilst we improved the notice display modal in bug 30287, it still doesn't fully reflect how a notice appears for the end user.

Because we're not using a shadow dom or embedded iframe, we are including all the styles of the parent page within the notice display. (hence it misleads us to think bootstrap styles are available within notices when in fact we do not include the bootstrap sheets in either HTML email or print notice outputs.

I propose using shadow dom to rectify that and ensure notice displays match as closely as possible to how they will display to the end user.. be that printed or in their email.
Comment 1 Martin Renvoize (ashimema) 2025-03-21 15:24:58 UTC
Created attachment 179626 [details] [review]
Bug 39410: Use shadowDOM for notice display modal

This patch updates the notice display modal found in the members > notices
page to use a shadowDOM to more accurately display notices matching how
they should display for patrons in their email clients or when printed.

Test plan
1) We can use the 'WELCOME' print notice introduced in bug 38087 as it
   includes Bootstrap classes for display.
2) Navigate to the 'Henry' user in KTD and use the 'More > Send welcome
   notice' option to trigger a print notice.
3) Navigate to the 'Notices' tab for the 'Henry' user and click on the
   notice title to trigger the display modal.
4) Note the well formatted notice with an address block on the right and
   some sections in bold.
5) Apply this patchset
6) Display the notice again as in step 3 and note that the foratting is
   now lost. This is showing proper scoping of the CSS in the same way
   that the notice will be displayed to the end user when printed using
   batch printing.

Note: Whilst this degrades the look of the notice in the staff client,
that is actualy highlighting a mistake in the notice template or
possible showing that we should be including bootstrap in the print
notices template... that is for another bug.