Skip to content

Commit

Permalink
Merge branch 'master' into UIBULKED-360
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/components/BulkEditList/BulkEditListResult/BulkEditInApp/ContentUpdatesForm/helpers.test.js
#	src/constants/selectOptions.js
#	translations/ui-bulk-edit/en.json
  • Loading branch information
vashjs committed Nov 26, 2023
2 parents bd1141e + 205ae6b commit 9546487
Show file tree
Hide file tree
Showing 37 changed files with 198 additions and 71 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
* [UIBULKED-356](https://issues.folio.org/browse/UIBULKED-356) Separate holdings notes by note type
* [UIBULKED-349](https://issues.folio.org/browse/UIBULKED-349) Update Electronic access - URL relationship
* [UIBULKED-347](https://issues.folio.org/browse/UIBULKED-347) Group holdings record properties using optgroup component.
* [UIBULKED-359](https://issues.folio.org/browse/UIBULKED-359) Update Electronic access - Materials specified.
* [UIBULKED-378](https://issues.folio.org/browse/UIBULKED-378) "Select location" can be selected for item's location, and the "Confirm changes" button will remain active.
* [UIBULKED-358](https://issues.folio.org/browse/UIBULKED-358) Update Electronic access - Link text.

## [4.0.0](https://github.com/folio-org/ui-bulk-edit/tree/v4.0.0) (2023-10-12)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const ValuesColumn = ({ action, allActions, actionIndex, onChange, option
<>
<LocationSelection
value={actionValue}
onSelect={loc => onChange({ actionIndex, value: loc.id, fieldName: FIELD_VALUE_KEY })}
onSelect={loc => onChange({ actionIndex, value: loc?.id, fieldName: FIELD_VALUE_KEY })}
placeholder={formatMessage({ id: 'ui-bulk-edit.layer.selectLocation' })}
data-test-id={`textField-${actionIndex}`}
aria-label={formatMessage({ id: 'ui-bulk-edit.ariaLabel.location' })}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export const getDefaultActions = (option, options, formatMessage) => {
},
],
};

/* ELECTRONIC ACCESS OPTIONS */
case OPTIONS.ELECTRONIC_ACCESS_URL_RELATIONSHIP:
return {
type: '',
Expand All @@ -306,7 +306,8 @@ export const getDefaultActions = (option, options, formatMessage) => {
},
],
};

case OPTIONS.ELECTRONIC_ACCESS_LINK_TEXT:
case OPTIONS.ELECTRONIC_ACCESS_MATERIALS_SPECIFIED:
case OPTIONS.ELECTRONIC_ACCESS_URI:
case OPTIONS.ELECTRONIC_ACCESS_URL_PUBLIC_NOTE:
return {
Expand Down Expand Up @@ -390,6 +391,8 @@ export const getExtraActions = (option, action, formattedMessage) => {
case `${OPTIONS.ITEM_NOTE}-${ACTIONS.FIND}`:
case `${OPTIONS.ADMINISTRATIVE_NOTE}-${ACTIONS.FIND}`:
case `${OPTIONS.ELECTRONIC_ACCESS_URI}-${ACTIONS.FIND}`:
case `${OPTIONS.ELECTRONIC_ACCESS_LINK_TEXT}-${ACTIONS.FIND}`:
case `${OPTIONS.ELECTRONIC_ACCESS_MATERIALS_SPECIFIED}-${ACTIONS.FIND}`:
case `${OPTIONS.CHECK_IN_NOTE}-${ACTIONS.FIND}`:
case `${OPTIONS.CHECK_OUT_NOTE}-${ACTIONS.FIND}`:
case `${OPTIONS.HOLDINGS_NOTE}-${ACTIONS.FIND}`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -654,44 +654,87 @@ describe('ContentUpdatesForm helpers', () => {
);
});

it('returns the correct object for the ELECTRONIC_ACCESS_URI and ELECTRONIC_ACCESS_URL_PUBLIC_NOTE options', () => {
[OPTIONS.ELECTRONIC_ACCESS_URI, OPTIONS.ELECTRONIC_ACCESS_URL_PUBLIC_NOTE].forEach(option => {
expect(JSON.stringify(getDefaultActions(option, [], formatMessage)))
.toEqual(
JSON.stringify({
type: '',
actions: [
null,
const electronicAccessOptions = [
OPTIONS.ELECTRONIC_ACCESS_URI,
OPTIONS.ELECTRONIC_ACCESS_MATERIALS_SPECIFIED,
OPTIONS.ELECTRONIC_ACCESS_LINK_TEXT,
OPTIONS.ELECTRONIC_ACCESS_URL_PUBLIC_NOTE
];

it('returns the correct object for the ELECTRONIC_ACCESS_URI option', () => {
electronicAccessOptions.forEach(options => expect(JSON.stringify(getDefaultActions(options, [], formatMessage)))
.toEqual(
JSON.stringify({
type: '',
actions: [
null,
{
actionsList: [{
value: '',
disabled: true,
label: undefined,
},
{
actionsList: [{
value: '',
disabled: true,
label: undefined,
},
{
value: ACTIONS.CLEAR_FIELD,
disabled: false,
label: undefined
},
{
value: ACTIONS.FIND,
disabled: false,
label: undefined
},
{
value: ACTIONS.REPLACE_WITH,
disabled: false,
label: undefined
},
],
controlType: () => CONTROL_TYPES.TEXTAREA,
[ACTION_VALUE_KEY]: '',
[FIELD_VALUE_KEY]: '',
value: ACTIONS.CLEAR_FIELD,
disabled: false,
label: undefined
},
],
}),
);
});
{
value: ACTIONS.FIND,
disabled: false,
label: undefined
},
{
value: ACTIONS.REPLACE_WITH,
disabled: false,
label: undefined
},
],
controlType: () => CONTROL_TYPES.TEXTAREA,
[ACTION_VALUE_KEY]: '',
[FIELD_VALUE_KEY]: '',
},
],
}),
));
});

it('returns the correct object for the ELECTRONIC_ACCESS_MATERIALS_SPECIFIED option', () => {
expect(JSON.stringify(getDefaultActions(OPTIONS.ELECTRONIC_ACCESS_MATERIALS_SPECIFIED, [], formatMessage)))
.toEqual(
JSON.stringify({
type: '',
actions: [
null,
{
actionsList: [{
value: '',
disabled: true,
label: undefined,
},
{
value: ACTIONS.CLEAR_FIELD,
disabled: false,
label: undefined
},
{
value: ACTIONS.FIND,
disabled: false,
label: undefined
},
{
value: ACTIONS.REPLACE_WITH,
disabled: false,
label: undefined
},
],
controlType: () => CONTROL_TYPES.TEXTAREA,
[ACTION_VALUE_KEY]: '',
[FIELD_VALUE_KEY]: '',
},
],
}),
);
});

it('returns the correct object for the default case', () => {
Expand Down
14 changes: 14 additions & 0 deletions src/constants/selectOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export const OPTIONS = {
CHECK_OUT_NOTE: 'CHECK_OUT_NOTE',
ELECTRONIC_ACCESS_URI: 'ELECTRONIC_ACCESS_URI',
ELECTRONIC_ACCESS_URL_RELATIONSHIP: 'ELECTRONIC_ACCESS_URL_RELATIONSHIP',
ELECTRONIC_ACCESS_LINK_TEXT: 'ELECTRONIC_ACCESS_LINK_TEXT',
ELECTRONIC_ACCESS_MATERIALS_SPECIFIED: 'ELECTRONIC_ACCESS_MATERIALS_SPECIFIED'
ELECTRONIC_ACCESS_URL_PUBLIC_NOTE: 'ELECTRONIC_ACCESS_URL_PUBLIC_NOTE',
};

Expand Down Expand Up @@ -205,6 +207,18 @@ export const getHoldingsOptions = (formatMessage, holdingsNotes = []) => [
disabled: false,
categoryName: formatMessage({ id: 'ui-bulk-edit.category.electronicAccess' }),
},
{
value: OPTIONS.ELECTRONIC_ACCESS_LINK_TEXT,
label: formatMessage({ id: 'ui-bulk-edit.layer.options.holdings.linkText' }),
disabled: false,
categoryName: formatMessage({ id: 'ui-bulk-edit.category.electronicAccess' }),
},
{
value: OPTIONS.ELECTRONIC_ACCESS_MATERIALS_SPECIFIED,
label: formatMessage({ id: 'ui-bulk-edit.layer.options.holdings.materialsSpecified' }),
disabled: false,
categoryName: formatMessage({ id: 'ui-bulk-edit.category.electronicAccess' }),
},
{
value: OPTIONS.ELECTRONIC_ACCESS_URL_PUBLIC_NOTE,
label: formatMessage({ id: 'ui-bulk-edit.layer.options.holdings.urlPublic' }),
Expand Down
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/ber.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
6 changes: 4 additions & 2 deletions translations/ui-bulk-edit/cs_CZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,15 @@
"category.electronicAccess": "Elektronický přístup",
"layer.options.holdings.uri": "URI",
"columns.HOLDINGS_RECORD.Action note": "Poznámka k akci",
"columns.HOLDINGS_RECORD.Binding": "Svázat",
"columns.HOLDINGS_RECORD.Binding": "Vazba",
"columns.HOLDINGS_RECORD.Copy note": "Kopírovat poznámku",
"columns.HOLDINGS_RECORD.Electronic bookplate": "Elektronická knižní deska",
"columns.HOLDINGS_RECORD.Provenance": "Původ",
"columns.HOLDINGS_RECORD.Reproduction": "Reprodukce",
"layer.options.holdings.urlRelationship": "Vztah URL",
"layer.selectType": "Vybrat typ poznámky",
"ariaLabel.urlRelationshipSelect": "Vybrat vztah URL",
"type.placeholder": "Vybrat typ"
"type.placeholder": "Vybrat typ",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
2 changes: 2 additions & 0 deletions translations/ui-bulk-edit/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@
"layer.options.holdings.permanentLocation": "Permanent holdings location",
"layer.options.holdings.suppress": "Suppress from discovery",
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.options.holdings.linkText": "Link text",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.urlPublic": "URL public note",
"layer.options.expirationDate": "Expiration date",
"layer.options.email": "Email",
Expand Down
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/en_GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/en_SE.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/es_419.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/hi_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
4 changes: 3 additions & 1 deletion translations/ui-bulk-edit/it_IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@
"layer.options.holdings.urlRelationship": "URL Relationship",
"layer.selectType": "Select note type",
"ariaLabel.urlRelationshipSelect": "Url relationship select",
"type.placeholder": "Select type"
"type.placeholder": "Select type",
"layer.options.holdings.materialsSpecified": "Materials specified",
"layer.options.holdings.linkText": "Link text"
}
Loading

0 comments on commit 9546487

Please sign in to comment.