Skip to content

Commit

Permalink
UIQM-695: Remove extra $ from error messages when adding/removing $…
Browse files Browse the repository at this point in the history
…t from 1XX of linked MARC authority record. (#731)
  • Loading branch information
Dmytro-Melnyshyn authored Sep 20, 2024
1 parent 09ac535 commit 99e7a28
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* [UIQM-697](https://issues.folio.org/browse/UIQM-697) Field 008: Validate the length of subfields. Add backslashes if the length of a subfield of field 008 is shorter, if longer - cut off the extra characters.
* [UIQM-699](https://issues.folio.org/browse/UIQM-699) ECS - send validation request with central tenant id for shared Bib and Authority records.
* [UIQM-693](https://issues.folio.org/browse/UIQM-693) Hide permission - Edit, View: Enable duplicate LCCN (010 $a) checking of MARC bibliographic and authority records.
* [UIQM-695](https://issues.folio.org/browse/UIQM-695) Remove extra `$` from error messages when adding/removing `$t` from 1XX of linked MARC authority record.

## [8.0.1] (https://github.com/folio-org/ui-quick-marc/tree/v8.0.1) (2024-04-18)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ describe('Given LinkButton', () => {
});

fireEvent.click(getAllByTestId('unlink-authority-button-fakeId')[0]);
fireEvent.click(getByText('ui-quick-marc.record.unlink.confirm.confirm'));
fireEvent.click(getByText('confirm'));

expect(mockHandleUnlinkAuthority).toHaveBeenCalled();
});
Expand Down
1 change: 1 addition & 0 deletions test/jest/__mock__/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './stripesCore.mock';
import './resizeObserver.mock';
import './reactIntl.mock';
import './stripesComponents.mock';
29 changes: 29 additions & 0 deletions test/jest/__mock__/stripesComponents.mock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
jest.mock('@folio/stripes/components', () => ({
...jest.requireActual('@folio/stripes/components'),
ConfirmationModal: jest.fn(({ heading, message, onConfirm, onCancel, onRemove }) => (
<div>
<span>ConfirmationModal</span>
{heading}
<div>{message}</div>
<div>
<button type="button" onClick={onConfirm}>confirm</button>
<button type="button" onClick={onCancel}>cancel</button>
<button type="button" onClick={onRemove}>remove</button>
</div>
</div>
)),
Loading: () => <div>Loading</div>,
LoadingPane: () => <div>LoadingPane</div>,
LoadingView: jest.fn(() => <div>LoadingView</div>),
Modal: jest.fn(({ children, open, label, footer, ...rest }) => {
return open && (
<div
{...rest}
>
<h1>{label}</h1>
{children}
{footer}
</div>
);
}),
}), { virtual: true });
4 changes: 2 additions & 2 deletions translations/ui-quick-marc/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,8 @@
"record.error.location.invalid": "852 $b contains an invalid Location code. Please try again.",
"record.error.$9": "$9 is an invalid subfield for linkable bibliographic fields.",
"record.error.1xx.change": "Cannot change the <b>saved MARC authority field {tag}</b> because it controls a bibliographic field(s). To change this 1XX, you must unlink all controlled bibliographic fields.",
"record.error.1xx.add$t": "Cannot add a <b>$t to the ${tag} field</b> because it controls a bibliographic field(s) that cannot control this subfield. To change this 1XX value, you must unlink all controlled bibliographic fields that cannot control $t.",
"record.error.1xx.remove$t": "Cannot remove <b>$t from the ${tag} field</b> because it controls a bibliographic field(s) that requires this subfield. To change this 1XX value, you must unlink all controlled bibliographic fields that requires $t to be controlled.",
"record.error.1xx.add$t": "Cannot add a <b>$t to the {tag} field</b> because it controls a bibliographic field(s) that cannot control this subfield. To change this 1XX value, you must unlink all controlled bibliographic fields that cannot control $t.",
"record.error.1xx.remove$t": "Cannot remove <b>$t from the {tag} field</b> because it controls a bibliographic field(s) that requires this subfield. To change this 1XX value, you must unlink all controlled bibliographic fields that requires $t to be controlled.",
"record.error.fieldIsControlled": "A subfield(s) cannot be updated because it is controlled by an authority heading.",
"record.error.field.onlyOneSubfield":"<b>{fieldTag}</b> can only have one <b>{subField}</b>.",

Expand Down

0 comments on commit 99e7a28

Please sign in to comment.