diff --git a/CHANGELOG.md b/CHANGELOG.md index 9dd040e6..d6afcd83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## In progress +* [UIBULKED-566](https://folio-org.atlassian.net/browse/UIBULKED-566) Bulk edit form - options cleanup. + ## [4.2.2](https://github.com/folio-org/ui-bulk-edit/tree/v4.2.2) (2024-11-15) * [UIPQB-126](https://folio-org.atlassian.net/browse/UIPQB-126) Use tenant timezone for building queries (adds use of permission `configuration.entries.collection.get`). diff --git a/src/components/BulkEditPane/BulkEditListResult/BulkEditInApp/ContentUpdatesForm/ValuesColumn.js b/src/components/BulkEditPane/BulkEditListResult/BulkEditInApp/ContentUpdatesForm/ValuesColumn.js index 8d04ac94..072b5e1d 100644 --- a/src/components/BulkEditPane/BulkEditListResult/BulkEditInApp/ContentUpdatesForm/ValuesColumn.js +++ b/src/components/BulkEditPane/BulkEditListResult/BulkEditInApp/ContentUpdatesForm/ValuesColumn.js @@ -31,7 +31,7 @@ import { getHoldingsNotes, getInstanceNotes, getItemStatusOptions, getItemsWithPlaceholder, - getNotesOptions, + getItemNotes, } from '../../../../../constants'; import { FIELD_VALUE_KEY, @@ -98,7 +98,7 @@ export const ValuesColumn = ({ action, allActions, actionIndex, onChange, option const { holdingsNotes, isHoldingsNotesLoading } = useHoldingsNotes({ enabled: isHoldingsCapability }); const duplicateNoteOptions = getDuplicateNoteOptions(formatMessage).filter(el => el.value !== option); - const filteredAndMappedNotes = getNotesOptions(formatMessage, isCentralTenant ? removeDuplicatesByValue(itemsNotes, tenants) : itemNotes) + const filteredAndMappedNotes = getItemNotes(formatMessage, isCentralTenant ? removeDuplicatesByValue(itemsNotes, tenants) : itemNotes) .filter(obj => obj.value !== option) .map(({ label, value, tenant }) => ({ label, value, tenant })); diff --git a/src/constants/selectOptions.js b/src/constants/selectOptions.js index bd2e5d6d..6eaeaf71 100644 --- a/src/constants/selectOptions.js +++ b/src/constants/selectOptions.js @@ -50,8 +50,6 @@ export const getItemsWithPlaceholder = (items) => [ ...items, ]; -export const getItemsWithoutPlaceholder = (items) => items.filter(item => item.value); - export const identifierOptions = { [CAPABILITIES.USER]: [ { @@ -217,18 +215,13 @@ export const getHoldingsOptions = (formatMessage, holdingsNotes = []) => [ value: OPTIONS.ADMINISTRATIVE_NOTE, label: formatMessage({ id: 'ui-bulk-edit.layer.options.administrativeNote' }), disabled: false, + categoryName: formatMessage({ id: 'ui-bulk-edit.category.administrativeData' }), }, { - value: OPTIONS.ELECTRONIC_ACCESS_URI, - label: formatMessage({ id: 'ui-bulk-edit.layer.options.holdings.uri' }), - disabled: false, - categoryName: formatMessage({ id: 'ui-bulk-edit.category.electronicAccess' }), - }, - { - value: OPTIONS.ELECTRONIC_ACCESS_URL_RELATIONSHIP, - label: formatMessage({ id: 'ui-bulk-edit.layer.options.holdings.urlRelationship' }), + value: OPTIONS.SUPPRESS_FROM_DISCOVERY, + label: formatMessage({ id: 'ui-bulk-edit.layer.options.holdings.suppress' }), disabled: false, - categoryName: formatMessage({ id: 'ui-bulk-edit.category.electronicAccess' }), + categoryName: formatMessage({ id: 'ui-bulk-edit.category.administrativeData' }), }, { value: OPTIONS.ELECTRONIC_ACCESS_LINK_TEXT, @@ -242,30 +235,37 @@ export const getHoldingsOptions = (formatMessage, holdingsNotes = []) => [ disabled: false, categoryName: formatMessage({ id: 'ui-bulk-edit.category.electronicAccess' }), }, + { + value: OPTIONS.ELECTRONIC_ACCESS_URI, + label: formatMessage({ id: 'ui-bulk-edit.layer.options.holdings.uri' }), + 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' }), disabled: false, categoryName: formatMessage({ id: 'ui-bulk-edit.category.electronicAccess' }), }, + { + value: OPTIONS.ELECTRONIC_ACCESS_URL_RELATIONSHIP, + label: formatMessage({ id: 'ui-bulk-edit.layer.options.holdings.urlRelationship' }), + disabled: false, + categoryName: formatMessage({ id: 'ui-bulk-edit.category.electronicAccess' }), + }, { value: OPTIONS.PERMANENT_HOLDINGS_LOCATION, label: formatMessage({ id: 'ui-bulk-edit.layer.options.holdings.permanentLocation' }), disabled: false, - categoryName: formatMessage({ id: 'ui-bulk-edit.category.holdingsLocation' }), + categoryName: formatMessage({ id: 'ui-bulk-edit.category.location' }), }, { value: OPTIONS.TEMPORARY_HOLDINGS_LOCATION, label: formatMessage({ id: 'ui-bulk-edit.layer.options.holdings.temporaryLocation' }), disabled: false, - categoryName: formatMessage({ id: 'ui-bulk-edit.category.holdingsLocation' }), + categoryName: formatMessage({ id: 'ui-bulk-edit.category.location' }), }, ...holdingsNotes, - { - value: OPTIONS.SUPPRESS_FROM_DISCOVERY, - label: formatMessage({ id: 'ui-bulk-edit.layer.options.holdings.suppress' }), - disabled: false, - }, ]; export const getInstanceOptions = (formatMessage, instanceNotes) => [ @@ -273,16 +273,19 @@ export const getInstanceOptions = (formatMessage, instanceNotes) => [ value: OPTIONS.ADMINISTRATIVE_NOTE, label: formatMessage({ id: 'ui-bulk-edit.layer.options.administrativeNote' }), disabled: false, + categoryName: formatMessage({ id: 'ui-bulk-edit.category.administrativeData' }), }, { value: OPTIONS.STAFF_SUPPRESS, label: formatMessage({ id: 'ui-bulk-edit.layer.options.instances.staffSuppress' }), disabled: false, + categoryName: formatMessage({ id: 'ui-bulk-edit.category.administrativeData' }), }, { value: OPTIONS.SUPPRESS_FROM_DISCOVERY, label: formatMessage({ id: 'ui-bulk-edit.layer.options.instances.suppress' }), disabled: false, + categoryName: formatMessage({ id: 'ui-bulk-edit.category.administrativeData' }), }, ...instanceNotes ]; @@ -315,7 +318,7 @@ export const getInstanceNotes = (formatMessage, instanceNotes) => [ ...instanceNotes, ]; -export const getNotesOptions = (formatMessage, itemNotes) => { +export const getItemNotes = (formatMessage, itemNotes) => { return [ { value: '', @@ -355,11 +358,35 @@ export const getDuplicateNoteOptions = (formatMessage) => [ ]; export const getItemsOptions = (formatMessage, itemNotes = []) => [ - ...getItemsWithoutPlaceholder(getNotesOptions(formatMessage, itemNotes)), + { + value: OPTIONS.ADMINISTRATIVE_NOTE, + label: formatMessage({ id: 'ui-bulk-edit.layer.options.administrativeNote' }), + disabled: false, + categoryName: formatMessage({ id: 'ui-bulk-edit.category.administrativeData' }), + }, + { + value: OPTIONS.SUPPRESS_FROM_DISCOVERY, + label: formatMessage({ id: 'ui-bulk-edit.layer.options.suppressFromDiscovery' }), + disabled: false, + categoryName: formatMessage({ id: 'ui-bulk-edit.category.administrativeData' }), + }, + { + value: OPTIONS.CHECK_IN_NOTE, + label: formatMessage({ id: 'ui-bulk-edit.layer.options.checkInNote' }), + disabled: false, + categoryName: formatMessage({ id: 'ui-bulk-edit.category.loanType' }), + }, + { + value: OPTIONS.CHECK_OUT_NOTE, + label: formatMessage({ id: 'ui-bulk-edit.layer.options.checkOutNote' }), + disabled: false, + categoryName: formatMessage({ id: 'ui-bulk-edit.category.loanType' }), + }, { value: OPTIONS.STATUS, label: formatMessage({ id: 'ui-bulk-edit.layer.options.statusLabel' }), disabled: false, + categoryName: formatMessage({ id: 'ui-bulk-edit.category.loanType' }), }, { value: OPTIONS.PERMANENT_LOAN_TYPE, @@ -385,11 +412,7 @@ export const getItemsOptions = (formatMessage, itemNotes = []) => [ disabled: false, categoryName: formatMessage({ id: 'ui-bulk-edit.category.location' }), }, - { - value: OPTIONS.SUPPRESS_FROM_DISCOVERY, - label: formatMessage({ id: 'ui-bulk-edit.layer.options.suppressFromDiscovery' }), - disabled: false, - }, + ...itemNotes, ]; export const getItemStatusOptions = (formatMessage) => [ diff --git a/translations/ui-bulk-edit/en.json b/translations/ui-bulk-edit/en.json index 37f3efb4..39a4ae96 100644 --- a/translations/ui-bulk-edit/en.json +++ b/translations/ui-bulk-edit/en.json @@ -151,12 +151,13 @@ "start.downloadChangedRecords": "Download changed records (CSV)", "start.downloadChangedRecords.marc": "Download changed records (MARC)", - "category.loanType": "Loan type", + "category.loanType": "Loan and availability", "category.location": "Location", "category.itemNotes": "Item notes", "category.holdingsNotes": "Holdings notes", "category.holdingsLocation": "Holdings location", "category.electronicAccess": "Electronic access", + "category.administrativeData": "Administrative data", "category.instanceNotes": "Instance notes", "columns.USER.User name": "Username",