Bugzilla – Attachment 180274 Details for
Bug 39410
Notice display modal should use shadow dom
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39410: Use shadowDOM for notice display modal
Bug-39410-Use-shadowDOM-for-notice-display-modal.patch (text/plain), 3.17 KB, created by
Lucas Gass (lukeg)
on 2025-04-02 09:42:51 UTC
(
hide
)
Description:
Bug 39410: Use shadowDOM for notice display modal
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-04-02 09:42:51 UTC
Size:
3.17 KB
patch
obsolete
>From 9eb95aa053f609c7892d09ba365f9b76ce6341ea Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 21 Mar 2025 15:16:48 +0000 >Subject: [PATCH] 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. > >Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > .../prog/en/modules/members/notices.tt | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >index b72be92c869..bf55ca2233d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >@@ -190,14 +190,24 @@ > $("#noticestable").on("click", ".notice-title", function (e) { > e.preventDefault(); > var title = $(this).text(); >+ $("#noticeModalLabel").text(title); >+ > var noticeid = $(this).data("noticeid"); >- var body = $("#notice" + noticeid).attr("srcdoc"); >+ >+ // Use shadow DOM for notice content preview >+ var srcdoc = $("#notice" + noticeid).attr("srcdoc"); >+ var shadowHost = document.createElement("div"); >+ var shadowRoot = shadowHost.attachShadow({ mode: "open" }); >+ shadowRoot.innerHTML = srcdoc; >+ >+ $("#noticeModal .modal-body").html(""); >+ $("#noticeModal .modal-body")[0].appendChild(shadowHost); >+ > if ($("#resend_notice" + noticeid).length) { >+ $("#resend-notice").data("noticeid", noticeid); > $("#resend-notice").show(); > } >- $("#resend-notice").data("noticeid", noticeid); >- $("#noticeModalLabel").text(title); >- $("#noticeModal .modal-body").html(body); >+ > $("#noticeModal").modal("show"); > }); > >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39410
:
179626
|
180065
| 180274