Skip to content

Commit

Permalink
Revert "UIQM-530 Create/Edit/Derive MARC bib/holdings/authority - All…
Browse files Browse the repository at this point in the history
…ow a user to move 00X fields (#594)" (#597)

This reverts commit 1bbae0a.
  • Loading branch information
BogdanDenis authored Sep 19, 2023
1 parent 039e0b8 commit 4b28c4f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
* [UIQM-554](https://issues.folio.org/browse/UIQM-554) Don't pass any arguments to the onClose callback when clicking the Cancel panel button.
* [UIQM-556](https://issues.folio.org/browse/UIQM-556) Edit Shared MARC authority record, update Shared & Local Instances.
* [UIQM-558](https://issues.folio.org/browse/UIQM-558) *BREAKING* bump `react-intl` to `v6.4.4`.
* [UIQM-530](https://issues.folio.org/browse/UIQM-530) Create/Edit/Derive MARC bib/holdings/authority - Allow a user to move 00X fields.
* [UIQM-559](https://issues.folio.org/browse/UIQM-559) Make auto-linking for the consortium.
* [UIQM-558](https://issues.folio.org/browse/UIQM-558) Allow a user to select a location code from the plugin.

Expand Down
12 changes: 6 additions & 6 deletions src/QuickMarcEditor/QuickMarcEditorRows/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ export const hasAddException = (recordRow, marcType = MARC_TYPES.BIB) => {
return ADD_EXCEPTION_ROWS[marcType].has(recordRow.tag);
};

const MOVE_EXCEPTION_ROWS = {
[QUICK_MARC_ACTIONS.CREATE]: new Set([LEADER_TAG]),
[QUICK_MARC_ACTIONS.EDIT]: new Set([LEADER_TAG]),
[QUICK_MARC_ACTIONS.DERIVE]: new Set([LEADER_TAG]),
};
const MOVE_EXCEPTION_ROWS = new Set([LEADER_TAG, '001', '005', '008']);

const MOVE_EXCEPTION_ROWS_FOR_DERIVE = new Set([LEADER_TAG, '001', '003', '005', '008']);

export const hasMoveException = (recordRow, sibling, action = QUICK_MARC_ACTIONS.EDIT) => {
const rows = MOVE_EXCEPTION_ROWS[action];
const rows = action === QUICK_MARC_ACTIONS.DERIVE
? MOVE_EXCEPTION_ROWS_FOR_DERIVE
: MOVE_EXCEPTION_ROWS;

return (
!sibling
Expand Down
6 changes: 4 additions & 2 deletions src/QuickMarcEditor/QuickMarcEditorRows/utils.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
LEADER_TAG,
QUICK_MARC_ACTIONS,
} from '../constants';
import { MARC_TYPES } from '../../common/constants';

Expand Down Expand Up @@ -36,10 +37,11 @@ describe('QuickMarcEditorRows utils', () => {
describe('hasMoveException', () => {
it('should be true for exeptional row', () => {
expect(utils.hasMoveException({ tag: LEADER_TAG })).toBeTruthy();
expect(utils.hasMoveException({ tag: '001' })).toBeTruthy();
});

it('should be false for 0XX fields', () => {
expect(utils.hasMoveException({ tag: '001' }, { tag: '005' })).toBeFalsy();
it('should be true for 003 tag for derive action', () => {
expect(utils.hasMoveException({ tag: '003' }, { tag: '014' }, QUICK_MARC_ACTIONS.DERIVE)).toBeTruthy();
});

it('should be false for common rows', () => {
Expand Down

0 comments on commit 4b28c4f

Please sign in to comment.