Skip to content

Commit

Permalink
Release v10.3.3 (#1918)
Browse files Browse the repository at this point in the history
  • Loading branch information
OleksandrHladchenko1 committed Dec 6, 2022
1 parent 176db97 commit ea50095
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,10 @@
# Change history for stripes-components

## [10.3.3](https://github.com/folio-org/stripes-components/tree/v10.3.3) (2022-12-04)
[Full Changelog](https://github.com/folio-org/stripes-components/compare/v10.3.1...v10.3.2)

* After click submit button disable the confirmation button in Confirmation modal component. Refs STCOM-1058.

## [10.3.2](https://github.com/folio-org/stripes-components/tree/v10.3.2) (2022-11-23)
[Full Changelog](https://github.com/folio-org/stripes-components/compare/v10.3.0...v10.3.1)

Expand Down
4 changes: 4 additions & 0 deletions lib/ConfirmationModal/ConfirmationModal.js
Expand Up @@ -21,6 +21,7 @@ const propTypes = {
confirmLabel: PropTypes.node,
heading: PropTypes.node.isRequired,
id: PropTypes.string,
isConfirmButtonDisabled: PropTypes.bool,
message: PropTypes.oneOfType([
PropTypes.node,
PropTypes.arrayOf(PropTypes.node),
Expand All @@ -34,6 +35,7 @@ const defaultProps = {
bodyTag: 'p',
buttonStyle: 'primary',
cancelButtonStyle: 'default',
isConfirmButtonDisabled: false,
};

const ConfirmationModal = (props) => {
Expand All @@ -46,6 +48,7 @@ const ConfirmationModal = (props) => {
bodyTag: Element,
onCancel,
ariaLabel, // deprecated
isConfirmButtonDisabled,
} = props;

const footer = (
Expand All @@ -56,6 +59,7 @@ const ConfirmationModal = (props) => {
id={`clickable-${testId}-confirm`}
onClick={props.onConfirm}
ref={footerPrimary}
disabled={isConfirmButtonDisabled}
>
{confirmLabel}
</Button>
Expand Down
1 change: 1 addition & 0 deletions lib/ConfirmationModal/readme.md
Expand Up @@ -46,3 +46,4 @@ confirmLabel | string | String to render on the Submit action. | "Submit" |
onConfirm | func | Callback fired when the Submit button is clicked | | &#10004;
onCancel | func | Callback fired when the Cancel button is clicked | | &#10004;
bodyTag | string | String to set the HTML tag used to wrap the modal message | "p" |
isConfirmButtonDisabled | bool | Boolean reflecting confirm button's enabled/disabled status | false |
22 changes: 22 additions & 0 deletions lib/ConfirmationModal/tests/ConfirmationModal-test.js
Expand Up @@ -14,6 +14,7 @@ const html = Bigtest.HTML;
const ConfirmButton = Button.extend('confirm button')
.filters({
focused: el => document.activeElement === el,
disabled: el => el.disabled,
});

describe('ConfirmationModal', () => {
Expand Down Expand Up @@ -49,6 +50,27 @@ describe('ConfirmationModal', () => {

it('focus is on the primary button', () => ConfirmButton(confirmLabel).is({ focused: true }));

describe('when confirm button is disabled', () => {
beforeEach(async () => {
await mountWithContext(
<ConfirmationModal
open
id="confirmation-modal-test"
heading={heading}
message={message}
bodyTag="div"
isConfirmButtonDisabled
onConfirm={() => { confirmed = true; }}
onCancel={() => { cancelled = true; }}
cancelLabel={cancelLabel}
confirmLabel={confirmLabel}
/>
);
});

it('The confirm button should have disabled attribute', () => ConfirmButton(confirmLabel).has({ disabled: true }));
});

describe('When clicking the confirm button', () => {
beforeEach(async () => {
await confirmationModal.confirm();
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@folio/stripes-components",
"version": "10.3.2",
"version": "10.3.3",
"description": "Component library for building Stripes applications.",
"license": "Apache-2.0",
"repository": "folio-org/stripes-components",
Expand Down

0 comments on commit ea50095

Please sign in to comment.