Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro-Melnyshyn committed Sep 18, 2024
2 parents fe7e885 + 6a773ae commit a10513e
Show file tree
Hide file tree
Showing 36 changed files with 64 additions and 66 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* [UIQM-691](https://issues.folio.org/browse/UIQM-691) Show correct field and toast color when validation returns warnings.
* [UIQM-665](https://issues.folio.org/browse/UIQM-665) Fix to generate array content in 008 after changing document type of MARC bib.
* [UIQM-694](https://issues.folio.org/browse/UIQM-694) Separate error messages triggered by controlled subfields of different linked fields.
* [UIQM-592](https://issues.folio.org/browse/UIQM-592) Fix to input polish special chars into fields.
* [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.

## [8.0.1] (https://github.com/folio-org/ui-quick-marc/tree/v8.0.1) (2024-04-18)
Expand Down
3 changes: 3 additions & 0 deletions src/QuickMarcEditor/QuickMarcEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ import {
updateRecordAtIndex,
markLinkedRecords,
getLeaderPositions,
isDiacritic,
} from './utils';

import css from './QuickMarcEditor.css';
Expand Down Expand Up @@ -465,6 +466,8 @@ const QuickMarcEditor = ({
name: 'save',
shortcut: 'mod+s',
handler: async (e) => {
if (isDiacritic(e.key)) return;

if (!saveFormDisabled) {
e.preventDefault();
confirmationChecks.current = { ...REQUIRED_CONFIRMATIONS };
Expand Down
8 changes: 8 additions & 0 deletions src/QuickMarcEditor/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,14 @@ export const joinErrors = (errorsA, errorsB) => {
return assignWith({}, errorsA, errorsB, (objValue = [], srcValue = []) => objValue.concat(srcValue));
};

export const isDiacritic = (char) => {
const specialDiactrics = 'łŁøß';

if (specialDiactrics.includes(char)) return true;

return char.normalize('NFD') !== char;
};

export const getVisibleNonSelectable008Subfields = (fixedFieldType) => {
return fixedFieldType.items
.filter(field => !field.readOnly)
Expand Down
18 changes: 18 additions & 0 deletions src/QuickMarcEditor/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1793,4 +1793,22 @@ describe('QuickMarcEditor utils', () => {
});
});
});

describe('isDiacritic', () => {
it('should all chars to be detected as diacritics', () => {
const diacriticArray = 'ąćęłńóśźżĄĆĘŁŃÓŚŹŻøã鞎šŠşŞß';

[...diacriticArray].forEach(c => {
expect(utils.isDiacritic(c)).toBeTruthy();
});
});

it('should all chars to be detected as not diacritics', () => {
const diacriticArray = 'acelnoszACELNOSZ';

[...diacriticArray].forEach(c => {
expect(utils.isDiacritic(c)).toBeFalsy();
});
});
});
});
3 changes: 1 addition & 2 deletions translations/ui-quick-marc/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@
"sourceFileLookupModal.fieldLabel": "Authority file name",
"sourceFileLookupModal.placeholder": "Select authority file",
"authority-record.create.title": "Create a new {shared, select, true {shared} false {local} other {}} MARC authority record",
"record.error.fieldIsControlled": "<b>{fieldTags}</b> has a subfield(s) that cannot be saved because the field is controlled by an authority record.",
"record.error.fieldsAreControlled": "<b>{fieldTags}{count, plural, one {} =2 { and {lastFieldTag}} other {, and {lastFieldTag}}}</b> has a subfield(s) that cannot be saved because the fields are controlled by authority records.",
"record.error.fieldIsControlled": "A subfield(s) cannot be updated because it is controlled by an authority heading.",
"record.error.controlField.content.empty": "Record cannot be saved. An authority file is required",
"record.error.010.absent": "Record cannot be saved without 010 field.",
"record.error.010.prefix.absent": "Record cannot be saved without a prefix in the 010 field.",
Expand Down
3 changes: 1 addition & 2 deletions translations/ui-quick-marc/ber.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@
"sourceFileLookupModal.fieldLabel": "Authority file name",
"sourceFileLookupModal.placeholder": "Select authority file",
"authority-record.create.title": "Create a new {shared, select, true {shared} false {local} other {}} MARC authority record",
"record.error.fieldIsControlled": "<b>{fieldTags}</b> has a subfield(s) that cannot be saved because the field is controlled by an authority record.",
"record.error.fieldsAreControlled": "<b>{fieldTags}{count, plural, one {} =2 { and {lastFieldTag}} other {, and {lastFieldTag}}}</b> has a subfield(s) that cannot be saved because the fields are controlled by authority records.",
"record.error.fieldIsControlled": "A subfield(s) cannot be updated because it is controlled by an authority heading.",
"record.error.controlField.content.empty": "Record cannot be saved. An authority file is required",
"record.error.010.absent": "Record cannot be saved without 010 field.",
"record.error.010.prefix.absent": "Record cannot be saved without a prefix in the 010 field.",
Expand Down
3 changes: 1 addition & 2 deletions translations/ui-quick-marc/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@
"sourceFileLookupModal.fieldLabel": "Authority file name",
"sourceFileLookupModal.placeholder": "Select authority file",
"authority-record.create.title": "Create a new {shared, select, true {shared} false {local} other {}} MARC authority record",
"record.error.fieldIsControlled": "<b>{fieldTags}</b> has a subfield(s) that cannot be saved because the field is controlled by an authority record.",
"record.error.fieldsAreControlled": "<b>{fieldTags}{count, plural, one {} =2 { and {lastFieldTag}} other {, and {lastFieldTag}}}</b> has a subfield(s) that cannot be saved because the fields are controlled by authority records.",
"record.error.fieldIsControlled": "A subfield(s) cannot be updated because it is controlled by an authority heading.",
"record.error.controlField.content.empty": "Record cannot be saved. An authority file is required",
"record.error.010.absent": "Record cannot be saved without 010 field.",
"record.error.010.prefix.absent": "Record cannot be saved without a prefix in the 010 field.",
Expand Down
3 changes: 1 addition & 2 deletions translations/ui-quick-marc/cs_CZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@
"sourceFileLookupModal.fieldLabel": "Název souboru autority",
"sourceFileLookupModal.placeholder": "Vybrat soubor autority",
"authority-record.create.title": "Vytvořit nový {shared, select, true {sdílený} false {místní} other {}} MARC záznam autority",
"record.error.fieldIsControlled": "<b>{fieldTags}</b> má podpole, které nelze uložit, protože pole je řízeno autoritním záznamem.",
"record.error.fieldsAreControlled": "<b>{fieldTags}{count, plural, one {} =2 { a {lastFieldTag}} other {, a {lastFieldTag}}}</b> má podpole, která nelze uložit, protože pole jsou řízena podle autoritních záznamů.",
"record.error.fieldIsControlled": "Podpole nelze aktualizovat, protože je řízeno záhlavím autority.",
"record.error.controlField.content.empty": "Záznam nelze uložit. Je vyžadován soubor autority",
"record.error.010.absent": "Záznam nelze uložit bez pole 010",
"record.error.010.prefix.absent": "Záznam nelze uložit bez prefixu v poli 010.",
Expand Down
3 changes: 1 addition & 2 deletions translations/ui-quick-marc/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@
"sourceFileLookupModal.fieldLabel": "Authority file name",
"sourceFileLookupModal.placeholder": "Select authority file",
"authority-record.create.title": "Create a new {shared, select, true {shared} false {local} other {}} MARC authority record",
"record.error.fieldIsControlled": "<b>{fieldTags}</b> has a subfield(s) that cannot be saved because the field is controlled by an authority record.",
"record.error.fieldsAreControlled": "<b>{fieldTags}{count, plural, one {} =2 { and {lastFieldTag}} other {, and {lastFieldTag}}}</b> has a subfield(s) that cannot be saved because the fields are controlled by authority records.",
"record.error.fieldIsControlled": "A subfield(s) cannot be updated because it is controlled by an authority heading.",
"record.error.controlField.content.empty": "Record cannot be saved. An authority file is required",
"record.error.010.absent": "Record cannot be saved without 010 field.",
"record.error.010.prefix.absent": "Record cannot be saved without a prefix in the 010 field.",
Expand Down
3 changes: 1 addition & 2 deletions translations/ui-quick-marc/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@
"sourceFileLookupModal.fieldLabel": "Authority file name",
"sourceFileLookupModal.placeholder": "Select authority file",
"authority-record.create.title": "Create a new {shared, select, true {shared} false {local} other {}} MARC authority record",
"record.error.fieldIsControlled": "<b>{fieldTags}</b> has a subfield(s) that cannot be saved because the field is controlled by an authority record.",
"record.error.fieldsAreControlled": "<b>{fieldTags}{count, plural, one {} =2 { and {lastFieldTag}} other {, and {lastFieldTag}}}</b> has a subfield(s) that cannot be saved because the fields are controlled by authority records.",
"record.error.fieldIsControlled": "A subfield(s) cannot be updated because it is controlled by an authority heading.",
"record.error.controlField.content.empty": "Record cannot be saved. An authority file is required",
"record.error.010.absent": "Record cannot be saved without 010 field.",
"record.error.010.prefix.absent": "Record cannot be saved without a prefix in the 010 field.",
Expand Down
3 changes: 1 addition & 2 deletions translations/ui-quick-marc/en_GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@
"sourceFileLookupModal.fieldLabel": "Authority file name",
"sourceFileLookupModal.placeholder": "Select authority file",
"authority-record.create.title": "Create a new {shared, select, true {shared} false {local} other {}} MARC authority record",
"record.error.fieldIsControlled": "<b>{fieldTags}</b> has a subfield(s) that cannot be saved because the field is controlled by an authority record.",
"record.error.fieldsAreControlled": "<b>{fieldTags}{count, plural, one {} =2 { and {lastFieldTag}} other {, and {lastFieldTag}}}</b> has a subfield(s) that cannot be saved because the fields are controlled by authority records.",
"record.error.fieldIsControlled": "A subfield(s) cannot be updated because it is controlled by an authority heading.",
"record.error.controlField.content.empty": "Record cannot be saved. An authority file is required",
"record.error.010.absent": "Record cannot be saved without 010 field.",
"record.error.010.prefix.absent": "Record cannot be saved without a prefix in the 010 field.",
Expand Down
3 changes: 1 addition & 2 deletions translations/ui-quick-marc/en_SE.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@
"sourceFileLookupModal.fieldLabel": "Authority file name",
"sourceFileLookupModal.placeholder": "Select authority file",
"authority-record.create.title": "Create a new {shared, select, true {shared} false {local} other {}} MARC authority record",
"record.error.fieldIsControlled": "<b>{fieldTags}</b> has a subfield(s) that cannot be saved because the field is controlled by an authority record.",
"record.error.fieldsAreControlled": "<b>{fieldTags}{count, plural, one {} =2 { and {lastFieldTag}} other {, and {lastFieldTag}}}</b> has a subfield(s) that cannot be saved because the fields are controlled by authority records.",
"record.error.fieldIsControlled": "A subfield(s) cannot be updated because it is controlled by an authority heading.",
"record.error.controlField.content.empty": "Record cannot be saved. An authority file is required",
"record.error.010.absent": "Record cannot be saved without 010 field.",
"record.error.010.prefix.absent": "Record cannot be saved without a prefix in the 010 field.",
Expand Down
3 changes: 1 addition & 2 deletions translations/ui-quick-marc/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@
"sourceFileLookupModal.fieldLabel": "Authority file name",
"sourceFileLookupModal.placeholder": "Select authority file",
"authority-record.create.title": "Create a new {shared, select, true {shared} false {local} other {}} MARC authority record",
"record.error.fieldIsControlled": "<b>{fieldTags}</b> has a subfield(s) that cannot be saved because the field is controlled by an authority record.",
"record.error.fieldsAreControlled": "<b>{fieldTags}{count, plural, one {} =2 { and {lastFieldTag}} other {, and {lastFieldTag}}}</b> has a subfield(s) that cannot be saved because the fields are controlled by authority records.",
"record.error.fieldIsControlled": "A subfield(s) cannot be updated because it is controlled by an authority heading.",
"record.error.controlField.content.empty": "Record cannot be saved. An authority file is required",
"record.error.010.absent": "Record cannot be saved without 010 field.",
"record.error.010.prefix.absent": "Record cannot be saved without a prefix in the 010 field.",
Expand Down
3 changes: 1 addition & 2 deletions translations/ui-quick-marc/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@
"sourceFileLookupModal.fieldLabel": "Authority file name",
"sourceFileLookupModal.placeholder": "Select authority file",
"authority-record.create.title": "Create a new {shared, select, true {shared} false {local} other {}} MARC authority record",
"record.error.fieldIsControlled": "<b>{fieldTags}</b> has a subfield(s) that cannot be saved because the field is controlled by an authority record.",
"record.error.fieldsAreControlled": "<b>{fieldTags}{count, plural, one {} =2 { and {lastFieldTag}} other {, and {lastFieldTag}}}</b> has a subfield(s) that cannot be saved because the fields are controlled by authority records.",
"record.error.fieldIsControlled": "A subfield(s) cannot be updated because it is controlled by an authority heading.",
"record.error.controlField.content.empty": "Record cannot be saved. An authority file is required",
"record.error.010.absent": "Record cannot be saved without 010 field.",
"record.error.010.prefix.absent": "Record cannot be saved without a prefix in the 010 field.",
Expand Down
3 changes: 1 addition & 2 deletions translations/ui-quick-marc/es_419.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@
"sourceFileLookupModal.fieldLabel": "Authority file name",
"sourceFileLookupModal.placeholder": "Seleccione el archivo de autoridad",
"authority-record.create.title": "Create a new {shared, select, true {shared} false {local} other {}} MARC authority record",
"record.error.fieldIsControlled": "<b>{fieldTags}</b> has a subfield(s) that cannot be saved because the field is controlled by an authority record.",
"record.error.fieldsAreControlled": "<b>{fieldTags}{count, plural, one {} =2 { and {lastFieldTag}} other {, and {lastFieldTag}}}</b> has a subfield(s) that cannot be saved because the fields are controlled by authority records.",
"record.error.fieldIsControlled": "A subfield(s) cannot be updated because it is controlled by an authority heading.",
"record.error.controlField.content.empty": "Record cannot be saved. An authority file is required",
"record.error.010.absent": "Record cannot be saved without 010 field.",
"record.error.010.prefix.absent": "Record cannot be saved without a prefix in the 010 field.",
Expand Down
3 changes: 1 addition & 2 deletions translations/ui-quick-marc/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@
"sourceFileLookupModal.fieldLabel": "Authority file name",
"sourceFileLookupModal.placeholder": "Select authority file",
"authority-record.create.title": "Create a new {shared, select, true {shared} false {local} other {}} MARC authority record",
"record.error.fieldIsControlled": "<b>{fieldTags}</b> has a subfield(s) that cannot be saved because the field is controlled by an authority record.",
"record.error.fieldsAreControlled": "<b>{fieldTags}{count, plural, one {} =2 { and {lastFieldTag}} other {, and {lastFieldTag}}}</b> has a subfield(s) that cannot be saved because the fields are controlled by authority records.",
"record.error.fieldIsControlled": "A subfield(s) cannot be updated because it is controlled by an authority heading.",
"record.error.controlField.content.empty": "Record cannot be saved. An authority file is required",
"record.error.010.absent": "Record cannot be saved without 010 field.",
"record.error.010.prefix.absent": "Record cannot be saved without a prefix in the 010 field.",
Expand Down
3 changes: 1 addition & 2 deletions translations/ui-quick-marc/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@
"sourceFileLookupModal.fieldLabel": "Authority file name",
"sourceFileLookupModal.placeholder": "Select authority file",
"authority-record.create.title": "Create a new {shared, select, true {shared} false {local} other {}} MARC authority record",
"record.error.fieldIsControlled": "<b>{fieldTags}</b> has a subfield(s) that cannot be saved because the field is controlled by an authority record.",
"record.error.fieldsAreControlled": "<b>{fieldTags}{count, plural, one {} =2 { and {lastFieldTag}} other {, and {lastFieldTag}}}</b> has a subfield(s) that cannot be saved because the fields are controlled by authority records.",
"record.error.fieldIsControlled": "A subfield(s) cannot be updated because it is controlled by an authority heading.",
"record.error.controlField.content.empty": "Record cannot be saved. An authority file is required",
"record.error.010.absent": "Record cannot be saved without 010 field.",
"record.error.010.prefix.absent": "Record cannot be saved without a prefix in the 010 field.",
Expand Down
3 changes: 1 addition & 2 deletions translations/ui-quick-marc/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@
"sourceFileLookupModal.fieldLabel": "Authority file name",
"sourceFileLookupModal.placeholder": "Select authority file",
"authority-record.create.title": "Create a new {shared, select, true {shared} false {local} other {}} MARC authority record",
"record.error.fieldIsControlled": "<b>{fieldTags}</b> has a subfield(s) that cannot be saved because the field is controlled by an authority record.",
"record.error.fieldsAreControlled": "<b>{fieldTags}{count, plural, one {} =2 { and {lastFieldTag}} other {, and {lastFieldTag}}}</b> has a subfield(s) that cannot be saved because the fields are controlled by authority records.",
"record.error.fieldIsControlled": "A subfield(s) cannot be updated because it is controlled by an authority heading.",
"record.error.controlField.content.empty": "Record cannot be saved. An authority file is required",
"record.error.010.absent": "Record cannot be saved without 010 field.",
"record.error.010.prefix.absent": "Record cannot be saved without a prefix in the 010 field.",
Expand Down
3 changes: 1 addition & 2 deletions translations/ui-quick-marc/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@
"sourceFileLookupModal.fieldLabel": "Authority file name",
"sourceFileLookupModal.placeholder": "Select authority file",
"authority-record.create.title": "Create a new {shared, select, true {shared} false {local} other {}} MARC authority record",
"record.error.fieldIsControlled": "<b>{fieldTags}</b> has a subfield(s) that cannot be saved because the field is controlled by an authority record.",
"record.error.fieldsAreControlled": "<b>{fieldTags}{count, plural, one {} =2 { and {lastFieldTag}} other {, and {lastFieldTag}}}</b> has a subfield(s) that cannot be saved because the fields are controlled by authority records.",
"record.error.fieldIsControlled": "A subfield(s) cannot be updated because it is controlled by an authority heading.",
"record.error.controlField.content.empty": "Record cannot be saved. An authority file is required",
"record.error.010.absent": "Record cannot be saved without 010 field.",
"record.error.010.prefix.absent": "Record cannot be saved without a prefix in the 010 field.",
Expand Down
3 changes: 1 addition & 2 deletions translations/ui-quick-marc/hi_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@
"sourceFileLookupModal.fieldLabel": "Authority file name",
"sourceFileLookupModal.placeholder": "Select authority file",
"authority-record.create.title": "Create a new {shared, select, true {shared} false {local} other {}} MARC authority record",
"record.error.fieldIsControlled": "<b>{fieldTags}</b> has a subfield(s) that cannot be saved because the field is controlled by an authority record.",
"record.error.fieldsAreControlled": "<b>{fieldTags}{count, plural, one {} =2 { and {lastFieldTag}} other {, and {lastFieldTag}}}</b> has a subfield(s) that cannot be saved because the fields are controlled by authority records.",
"record.error.fieldIsControlled": "A subfield(s) cannot be updated because it is controlled by an authority heading.",
"record.error.controlField.content.empty": "Record cannot be saved. An authority file is required",
"record.error.010.absent": "Record cannot be saved without 010 field.",
"record.error.010.prefix.absent": "Record cannot be saved without a prefix in the 010 field.",
Expand Down
Loading

0 comments on commit a10513e

Please sign in to comment.