Skip to content

Commit

Permalink
Merge branch 'master' into UXPROD-4559-ECS
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-blazhko committed Nov 13, 2024
2 parents 90bdf08 + e21eab9 commit 4f5e73a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* Add `mod-settings.global.read.circulation` permission. Refs UIREQ-1170.
* Add `mod-settings.entries.collection.get` permission. Refs UIREQ-1177.
* *BREAKING* Migrate to new `mod-circulation-bff` endpoints. Refs UIREQ-1134.
* Fix DOMPurify import. Refs UIREQ-1180.

## [10.0.0] (https://github.com/folio-org/ui-requests/tree/v10.0.0) (2024-10-31)
[Full Changelog](https://github.com/folio-org/ui-requests/compare/v9.1.2...v10.0.0)
Expand Down
4 changes: 2 additions & 2 deletions src/components/ComponentToPrint/ComponentToPrint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import Barcode from 'react-barcode';
import HtmlToReact, { Parser } from 'html-to-react';
import { sanitize } from 'dompurify';
import DOMPurify from 'dompurify';

const processNodeDefinitions = new HtmlToReact.ProcessNodeDefinitions(React);
const rules = [
Expand All @@ -20,7 +20,7 @@ const rules = [
const parser = new Parser();

const ComponentToPrint = ({ dataSource, templateFn }) => {
const componentStr = sanitize(templateFn(dataSource), { ADD_TAGS: ['Barcode'] });
const componentStr = DOMPurify.sanitize(templateFn(dataSource), { ADD_TAGS: ['Barcode'] });
const Component = parser.parseWithInstructions(componentStr, () => true, rules) || null;

return Component;
Expand Down
4 changes: 2 additions & 2 deletions src/routes/RequestsRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
FormattedMessage,
injectIntl,
} from 'react-intl';
import { sanitize } from 'dompurify';
import DOMPurify from 'dompurify';

import {
AppIcon,
Expand Down Expand Up @@ -1288,7 +1288,7 @@ class RequestsRoute extends React.Component {
const slipTypeInLowerCase = slipType.toLowerCase();
const slipTemplate = staffSlips.find(slip => slip.name.toLowerCase() === slipTypeInLowerCase);

return sanitize(get(slipTemplate, 'template', ''), { ADD_TAGS: ['Barcode'] });
return DOMPurify.sanitize(get(slipTemplate, 'template', ''), { ADD_TAGS: ['Barcode'] });
}

handleFilterChange = ({ name, values }) => {
Expand Down

0 comments on commit 4f5e73a

Please sign in to comment.