Skip to content

Commit

Permalink
Merge pull request #1174 from folio-org/UICIRC-1122
Browse files Browse the repository at this point in the history
UICIRC-1122: Fix DOMPurify import
  • Loading branch information
Dmitriy-Litvinenko authored Nov 12, 2024
2 parents e3fdba8 + 6bd6450 commit ef2e8b4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@folio/circulation",
"version": "9.2.0",
"version": "10.0.0",
"description": "Circulation manager",
"repository": "folio-org/ui-circulation",
"publishConfig": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 = () => {
Expand Down

0 comments on commit ef2e8b4

Please sign in to comment.