Skip to content

Commit

Permalink
Merge Poppy latest from b9.0 to DCB branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Terala-Priyanka committed Apr 15, 2024
2 parents 921314f + 82fb38f commit 43d2956
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

* Hide fee/fine action menu items when requester is virtual user. Refs UICHKIN-398.
* Hide “Item details” option in Actions menu when item is virtual. Refs UICHKIN-403.
## [9.0.3] (https://github.com/folio-org/ui-checkin/tree/v9.0.3) (2024-03-27)
[Full Changelog](https://github.com/folio-org/ui-checkin/compare/v9.0.2...v9.0.3)
* Add support for Barcode tag with sanitize. Refs UICHKIN-421, UICHKIN-422.

## [9.0.2] (https://github.com/folio-org/ui-checkin/tree/v9.0.2) (2024-03-24)
[Full Changelog](https://github.com/folio-org/ui-checkin/compare/v9.0.1...v9.0.2)
* Only certain HTML tags should be rendered when displaying staff slips. Refs UICHKIN-421, UICHKIN-422.

## [9.0.1] (https://github.com/folio-org/ui-checkin/tree/v9.0.1) (2023-10-23)
[Full Changelog](https://github.com/folio-org/ui-checkin/compare/v9.0.0...v9.0.1)
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@folio/checkin",
"version": "9.0.1",
"version": "9.0.3",
"description": "Item Check-in",
"repository": "folio-org/ui-checkin",
"publishConfig": {
Expand Down Expand Up @@ -94,6 +94,7 @@
},
"dependencies": {
"dateformat": "^2.0.0",
"dompurify": "^3.0.9",
"final-form": "^4.19.1",
"html-to-react": "^1.3.3",
"inactivity-timer": "^1.0.0",
Expand Down
4 changes: 3 additions & 1 deletion src/components/ComponentToPrint/ComponentToPrint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import HtmlToReact, { Parser } from 'html-to-react';
import Barcode from 'react-barcode';
import { sanitize } from 'dompurify';

import { buildTemplate } from '../../util';

export const shouldProcessNode = node => node.name === 'barcode';
Expand Down Expand Up @@ -39,7 +41,7 @@ class ComponentToPrint extends React.Component {
const {
dataSource,
} = this.props;
const componentStr = this.template(dataSource);
const componentStr = sanitize(this.template(dataSource), { ADD_TAGS: ['Barcode'] });
const Component = this.parser.parseWithInstructions(componentStr, () => true, this.rules) || null;

return (
Expand Down
3 changes: 3 additions & 0 deletions src/components/ComponentToPrint/ComponentToPrint.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jest.mock('../../util', () => ({
buildTemplate: jest.fn(Template => (data) => (Template ? <Template {...data} /> : null)),
}));
jest.mock('react-barcode', () => jest.fn(() => null));
jest.mock('dompurify', () => ({
sanitize: jest.fn((data) => (data)),
}));

describe('ComponentToPrint', () => {
const buttonText = 'Test button string';
Expand Down

0 comments on commit 43d2956

Please sign in to comment.