From 6bd645045ee3021be3aba448741459bfade283d1 Mon Sep 17 00:00:00 2001 From: Dmitriy-Litvinenko Date: Tue, 12 Nov 2024 19:57:36 +0200 Subject: [PATCH] UICIRC-1122: Fix DOMPurify import --- CHANGELOG.md | 3 +++ package.json | 2 +- .../PatronNoticeEmailSection/PatronNoticeEmailSection.js | 4 ++-- .../StaffSlipTemplateContentSection.js | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12bd4fad..3ed2520b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change history for ui-circulation +## 10.0.0 IN PROGRESS +* Fix DOMPurify import. Refs UICIRC-1122. + ## [9.2.0](https://github.com/folio-org/ui-circulation/tree/v9.2.0) (2024-10-30) [Full Changelog](https://github.com/folio-org/ui-circulation/compare/v9.1.0...v9.2.0) diff --git a/package.json b/package.json index b9df971d..87df807e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@folio/circulation", - "version": "9.2.0", + "version": "10.0.0", "description": "Circulation manager", "repository": "folio-org/ui-circulation", "publishConfig": { diff --git a/src/settings/PatronNotices/components/ViewSections/PatronNoticeEmailSection/PatronNoticeEmailSection.js b/src/settings/PatronNotices/components/ViewSections/PatronNoticeEmailSection/PatronNoticeEmailSection.js index ddd8b68e..c6d3251a 100644 --- a/src/settings/PatronNotices/components/ViewSections/PatronNoticeEmailSection/PatronNoticeEmailSection.js +++ b/src/settings/PatronNotices/components/ViewSections/PatronNoticeEmailSection/PatronNoticeEmailSection.js @@ -2,7 +2,7 @@ import React, { useState } from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import HtmlToReact, { Parser } from 'html-to-react'; -import { sanitize } from 'dompurify'; +import DOMPurify from 'dompurify'; import { Button, @@ -27,7 +27,7 @@ const PatronNoticeEmailSection = ({ notice, locale, emailTemplate }) => { } ]; const tokens = getTokens(locale); - const purifyEmailTemplate = sanitize(emailTemplate); + const purifyEmailTemplate = DOMPurify.sanitize(emailTemplate); const parsedEmailTemplate = parser.parseWithInstructions(purifyEmailTemplate, () => true, rules); const [openPreview, setOpenPreview] = useState(false); diff --git a/src/settings/StaffSlips/components/ViewSections/StaffSlipTemplateContentSection/StaffSlipTemplateContentSection.js b/src/settings/StaffSlips/components/ViewSections/StaffSlipTemplateContentSection/StaffSlipTemplateContentSection.js index b7ec1481..08e7d592 100644 --- a/src/settings/StaffSlips/components/ViewSections/StaffSlipTemplateContentSection/StaffSlipTemplateContentSection.js +++ b/src/settings/StaffSlips/components/ViewSections/StaffSlipTemplateContentSection/StaffSlipTemplateContentSection.js @@ -5,7 +5,7 @@ import { injectIntl, } from 'react-intl'; import HtmlToReact, { Parser } from 'html-to-react'; -import { sanitize } from 'dompurify'; +import DOMPurify from 'dompurify'; import { Button, @@ -36,7 +36,7 @@ const StaffSlipTemplateContentSection = ({ intl, staffSlip }) => { }, ]; const parser = new Parser(); - const purifyTemplate = sanitize(template); + const purifyTemplate = DOMPurify.sanitize(template); const parsedEmailTemplate = parser.parseWithInstructions(purifyTemplate, () => true, rules); const [openPreview, setOpenPreview] = useState(false); const togglePreviewDialog = () => {