Skip to content

Commit 350d08f

Browse files
authored
UIQM-781 Allow editing 005 field tags. (#826)
1 parent 5bb65d3 commit 350d08f

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* [UIQM-788](https://issues.folio.org/browse/UIQM-788) Add new props to quickMARC to make it usable without having to define routes.
1313
* [UIQM-789](https://issues.folio.org/browse/UIQM-789) Add new `initialValues` prop to quickMARC to initialize it with some pre-existing values.
1414
* [UIQM-790](https://issues.folio.org/browse/UIQM-790) Allow to initialize quickMARC with pre-edited values.
15+
* [UIQM-781](https://issues.folio.org/browse/UIQM-781) Allow editing 005 field tags.
1516

1617
## [10.0.4](https://github.com/folio-org/ui-quick-marc/tree/v10.0.4) (2025-07-14)
1718

src/QuickMarcEditor/QuickMarcEditorRows/QuickMarcEditorRows.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import {
5656
applyCentralTenantInHeaders,
5757
isControlNumberRow,
5858
isLeaderRow,
59+
isReadOnlyTag,
5960
} from '../utils';
6061
import { useAuthorityLinking } from '../../hooks';
6162
import { QuickMarcContext } from '../../contexts';
@@ -288,6 +289,7 @@ const QuickMarcEditorRows = ({
288289

289290
const isLeader = isLeaderRow(recordRow);
290291
const isDisabled = isReadOnly(recordRow, action, marcType);
292+
const isTagDisabled = isReadOnlyTag(recordRow, marcType);
291293
const fieldValidationIssues = separateValidationErrorsAndWarnings(
292294
validationErrorsRef.current[recordRow.id],
293295
);
@@ -431,7 +433,7 @@ const QuickMarcEditorRows = ({
431433
maxLength={TAG_FIELD_MAX_LENGTH}
432434
marginBottom0
433435
fullWidth
434-
disabled={isDisabled || !idx}
436+
disabled={isTagDisabled || !idx}
435437
hasClearIcon={false}
436438
onChange={onTagChange}
437439
data-testid={`tag-field-${idx}`}

src/QuickMarcEditor/utils.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,16 @@ export const hasDeleteException = (recordRow, marcType = MARC_TYPES.BIB, authori
11251125
return rows.has(recordRow.tag) || isLastRecord(recordRow);
11261126
};
11271127

1128+
const READ_ONLY_TAGS = {
1129+
[MARC_TYPES.BIB]: ['001'],
1130+
[MARC_TYPES.HOLDINGS]: ['001', '004'],
1131+
[MARC_TYPES.AUTHORITY]: ['001'],
1132+
};
1133+
1134+
export const isReadOnlyTag = (recordRow, marcType) => {
1135+
return READ_ONLY_TAGS[marcType].includes(recordRow.tag) || isLastRecord(recordRow);
1136+
};
1137+
11281138
const READ_ONLY_ROWS = new Set(['001', '005']);
11291139

11301140
const READ_ONLY_ROWS_FOR_DERIVE = new Set(['001', '005']);

0 commit comments

Comments
 (0)