Skip to content

Commit

Permalink
Merge branch 'master' into UIBULKED-539
Browse files Browse the repository at this point in the history
  • Loading branch information
UladzislauKutarkin authored Sep 30, 2024
2 parents 016a0c5 + 43b38de commit c2a936f
Show file tree
Hide file tree
Showing 37 changed files with 769 additions and 699 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@
"bulk-operations.used.tenants.get",
"consortia.publications.item.get",
"consortia.publications.item.post",
"consortia.publications-results.item.get"
"consortia.publications-results.item.get",
"consortium-search.institutions.collection.get",
"consortium-search.campuses.collection.get",
"consortium-search.libraries.collection.get"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ export const ValuesColumn = ({ action, allActions, actionIndex, onChange, option

const filteredAndMappedNotes = getNotesOptions(formatMessage, isCentralTenant ? removeDuplicatesByValue(itemsNotes, tenants) : itemNotes)
.filter(obj => obj.value !== option)
.map(({ label, value }) => ({ label, value }));
.map(({ label, value, tenant }) => ({ label, value, tenant }));

const filteredAndMappedHoldingsNotes = getHoldingsNotes(formatMessage, isCentralTenant ? removeDuplicatesByValue(holdingsNotesEsc, tenants) : holdingsNotes)
.filter(obj => obj.value !== option)
.map(({ label, value, disabled }) => ({ label, value, disabled }));
.map(({ label, value, disabled, tenant }) => ({ label, value, disabled, tenant }));

const filteredAndMappedInstanceNotes = getInstanceNotes(formatMessage, instanceNotes)
.filter(obj => obj.value !== option)
Expand Down Expand Up @@ -264,25 +264,28 @@ export const ValuesColumn = ({ action, allActions, actionIndex, onChange, option
);

const renderLoanTypeSelect = () => controlType === CONTROL_TYPES.LOAN_TYPE && (
<Selection
id="loanType"
value={actionValue}
loading={isLoanTypesLoading || isLoanTypesEscLoading}
onChange={value => {
onChange(
{
actionIndex,
value,
fieldName: FIELD_VALUE_KEY,
tenants: getTenantsById(removeDuplicatesByValue(loanTypesEsc, tenants), value)
}
);
}}
placeholder={formatMessage({ id: 'ui-bulk-edit.layer.selectLoanType' })}
dataOptions={isCentralTenant ? removeDuplicatesByValue(loanTypesEsc, tenants) : loanTypes}
aria-label={formatMessage({ id: 'ui-bulk-edit.ariaLabel.loanTypeSelect' })}
dirty={!!actionValue}
/>
isLoanTypesEscLoading ?
<Loading size="large" />
:
<Selection
id="loanType"
value={actionValue}
loading={isLoanTypesLoading}
onChange={value => {
onChange(
{
actionIndex,
value,
fieldName: FIELD_VALUE_KEY,
tenants: getTenantsById(removeDuplicatesByValue(loanTypesEsc, tenants), value)
}
);
}}
placeholder={formatMessage({ id: 'ui-bulk-edit.layer.selectLoanType' })}
dataOptions={isCentralTenant ? removeDuplicatesByValue(loanTypesEsc, tenants) : loanTypes}
aria-label={formatMessage({ id: 'ui-bulk-edit.ariaLabel.loanTypeSelect' })}
dirty={!!actionValue}
/>
);

const renderNoteTypeSelect = () => controlType === CONTROL_TYPES.NOTE_SELECT && (
Expand Down
48 changes: 25 additions & 23 deletions src/constants/selectOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,29 +313,31 @@ export const getInstanceNotes = (formatMessage, instanceNotes) => [
...instanceNotes,
];

export const getNotesOptions = (formatMessage, itemNotes) => [
{
value: '',
label: formatMessage({ id: 'ui-bulk-edit.options.placeholder' }),
disabled: true,
},
{
value: OPTIONS.ADMINISTRATIVE_NOTE,
label: formatMessage({ id: 'ui-bulk-edit.layer.options.administrativeNote' }),
disabled: false,
},
{
value: OPTIONS.CHECK_IN_NOTE,
label: formatMessage({ id: 'ui-bulk-edit.layer.options.checkInNote' }),
disabled: false,
},
{
value: OPTIONS.CHECK_OUT_NOTE,
label: formatMessage({ id: 'ui-bulk-edit.layer.options.checkOutNote' }),
disabled: false,
},
...itemNotes,
];
export const getNotesOptions = (formatMessage, itemNotes) => {
return [
{
value: '',
label: formatMessage({ id: 'ui-bulk-edit.options.placeholder' }),
disabled: true,
},
{
value: OPTIONS.ADMINISTRATIVE_NOTE,
label: formatMessage({ id: 'ui-bulk-edit.layer.options.administrativeNote' }),
disabled: false,
},
{
value: OPTIONS.CHECK_IN_NOTE,
label: formatMessage({ id: 'ui-bulk-edit.layer.options.checkInNote' }),
disabled: false,
},
{
value: OPTIONS.CHECK_OUT_NOTE,
label: formatMessage({ id: 'ui-bulk-edit.layer.options.checkOutNote' }),
disabled: false,
},
...itemNotes,
];
};

export const getDuplicateNoteOptions = (formatMessage) => [
{
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/api/useHoldingsNotesEsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const useHoldingsNotesEsc = (tenants, type, options = {}) => {
options,
url: NOTE_ESC.URL,
noteKey: NOTE_ESC.NOTE_KEY,
optionType: OPTIONS.ITEM_NOTE,
optionType: OPTIONS.HOLDINGS_NOTE,
parameterKey: PARAMETERS_KEYS.ITEM_NOTE_TYPE_ID_KEY
});
};
1 change: 0 additions & 1 deletion src/utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ export const removeDuplicatesByValue = (arr = [], tenants = []) => {
return Array.from(valueMap.values()).sort((a, b) => a.label.localeCompare(b.label));
};


export const getTenantsById = (arr, id) => {
const item = arr.find(obj => obj.value === id);
return item ? item.tenant : null;
Expand Down
6 changes: 4 additions & 2 deletions translations/ui-bulk-edit/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
"start.edit.instance": "Instances and Administrative data",
"list.errors.table.link": "View latest version",
"actions.find": "Find",
"start.edit.mark": "Instances with source MARC(POC)",
"start.edit.mark": "Instances with source MARC (POC)",
"logs.status.RETRIEVING_IDENTIFIERS": "Retrieving identifiers",
"logs.status.SAVED_IDENTIFIERS": "Saving identifiers",
"meta.title.uploadedFile.mark": "Bulk edit MARC fields - <b>{fileName}</b>",
Expand Down Expand Up @@ -505,5 +505,7 @@
"error.mod-bulk-operations.not.download.file.from.s3": "There is a problem to retrieve data from S3. Please contact your hosting provider to check S3 configuration. Further details are available in Bulk edit app logs (mod-bulk-operations and mod-data-export-worker modules).",
"error.mod-bulk-operations.not.confirm.changes.s3.issue": "There is a problem to retrieve data from S3. Please contact your hosting provider to check S3 configuration. Further details are available in Bulk edit app logs (mod-bulk-operations and mod-data-export-worker modules).",
"menuGroup.startEdit": "Start bulk edit",
"File uploading failed, reason: Cannot upload a file. Reason: file is empty.": "The uploaded file is empty."
"File uploading failed, reason: Cannot upload a file. Reason: file is empty.": "The uploaded file is empty.",
"previewModal.message.empty.marc": "All instances have source FOLIO. Use “Instances and Administrative data” option for bulk edit.",
"start.downloadChangedRecords.marc": "Download changed records (MARC)"
}
6 changes: 4 additions & 2 deletions translations/ui-bulk-edit/ber.json
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
"start.edit.instance": "Instances and Administrative data",
"list.errors.table.link": "View latest version",
"actions.find": "Find",
"start.edit.mark": "Instances with source MARC(POC)",
"start.edit.mark": "Instances with source MARC (POC)",
"logs.status.RETRIEVING_IDENTIFIERS": "Retrieving identifiers",
"logs.status.SAVED_IDENTIFIERS": "Saving identifiers",
"meta.title.uploadedFile.mark": "Bulk edit MARC fields - <b>{fileName}</b>",
Expand Down Expand Up @@ -505,5 +505,7 @@
"error.mod-bulk-operations.not.download.file.from.s3": "There is a problem to retrieve data from S3. Please contact your hosting provider to check S3 configuration. Further details are available in Bulk edit app logs (mod-bulk-operations and mod-data-export-worker modules).",
"error.mod-bulk-operations.not.confirm.changes.s3.issue": "There is a problem to retrieve data from S3. Please contact your hosting provider to check S3 configuration. Further details are available in Bulk edit app logs (mod-bulk-operations and mod-data-export-worker modules).",
"menuGroup.startEdit": "Start bulk edit",
"File uploading failed, reason: Cannot upload a file. Reason: file is empty.": "The uploaded file is empty."
"File uploading failed, reason: Cannot upload a file. Reason: file is empty.": "The uploaded file is empty.",
"previewModal.message.empty.marc": "All instances have source FOLIO. Use “Instances and Administrative data” option for bulk edit.",
"start.downloadChangedRecords.marc": "Download changed records (MARC)"
}
6 changes: 4 additions & 2 deletions translations/ui-bulk-edit/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
"start.edit.instance": "Instances and Administrative data",
"list.errors.table.link": "View latest version",
"actions.find": "Find",
"start.edit.mark": "Instances with source MARC(POC)",
"start.edit.mark": "Instances with source MARC (POC)",
"logs.status.RETRIEVING_IDENTIFIERS": "Retrieving identifiers",
"logs.status.SAVED_IDENTIFIERS": "Saving identifiers",
"meta.title.uploadedFile.mark": "Bulk edit MARC fields - <b>{fileName}</b>",
Expand Down Expand Up @@ -505,5 +505,7 @@
"error.mod-bulk-operations.not.download.file.from.s3": "There is a problem to retrieve data from S3. Please contact your hosting provider to check S3 configuration. Further details are available in Bulk edit app logs (mod-bulk-operations and mod-data-export-worker modules).",
"error.mod-bulk-operations.not.confirm.changes.s3.issue": "There is a problem to retrieve data from S3. Please contact your hosting provider to check S3 configuration. Further details are available in Bulk edit app logs (mod-bulk-operations and mod-data-export-worker modules).",
"menuGroup.startEdit": "Start bulk edit",
"File uploading failed, reason: Cannot upload a file. Reason: file is empty.": "The uploaded file is empty."
"File uploading failed, reason: Cannot upload a file. Reason: file is empty.": "The uploaded file is empty.",
"previewModal.message.empty.marc": "All instances have source FOLIO. Use “Instances and Administrative data” option for bulk edit.",
"start.downloadChangedRecords.marc": "Download changed records (MARC)"
}
8 changes: 5 additions & 3 deletions translations/ui-bulk-edit/cs_CZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
"layer.options.items.removeNote": "Odstranit",
"logs.infoPopover": "Soubory nejsou k dispozici ke stažení, protože od data spuštění úlohy uplynulo 30 dní.",
"permissionsModal.title": "Vyberte Oprávnění",
"permissionsModal.filter.title": "Hledat a filtrovat",
"permissionsModal.filter.title": "Vyhledat a filtrovat",
"permissionsModal.filter.search": "Vyhledat",
"permissionsModal.filter.resetAll": "Obnovit vše",
"permissionsModal.filter.permissionTypes": "Typy oprávnění",
Expand Down Expand Up @@ -423,7 +423,7 @@
"start.edit.instance": "Tituly a administrativní údaje",
"list.errors.table.link": "Zobrazit nejnovější verzi",
"actions.find": "Najít",
"start.edit.mark": "Tituly se zdrojem MARC(POC)",
"start.edit.mark": "Tituly se zdrojem MARC (POC)",
"logs.status.RETRIEVING_IDENTIFIERS": "Získávání identifikátorů",
"logs.status.SAVED_IDENTIFIERS": "Ukládání identifikátorů",
"meta.title.uploadedFile.mark": "Hromadná úprava polí MARC - <b>{fileName}</b>",
Expand Down Expand Up @@ -505,5 +505,7 @@
"error.mod-bulk-operations.not.download.file.from.s3": "Při načítání dat z S3 došlo k problému. Chcete-li zkontrolovat konfiguraci S3, kontaktujte svého poskytovatele hostingu. Další detaily jsou k dispozici v logu aplikace pro hromadné úpravy (moduly mod-hromadné-operace a mod-data-export-worker).",
"error.mod-bulk-operations.not.confirm.changes.s3.issue": "Při načítání dat z S3 došlo k problému. Chcete-li zkontrolovat konfiguraci S3, kontaktujte svého poskytovatele hostingu. Další detaily jsou k dispozici v logu aplikace pro hromadné úpravy (moduly mod-hromadné-operace a mod-data-export-worker).",
"menuGroup.startEdit": "Spustit hromadné úpravy",
"File uploading failed, reason: Cannot upload a file. Reason: file is empty.": "Nahraný soubor je prázdný."
"File uploading failed, reason: Cannot upload a file. Reason: file is empty.": "Nahraný soubor je prázdný.",
"previewModal.message.empty.marc": "All instances have source FOLIO. Use “Instances and Administrative data” option for bulk edit.",
"start.downloadChangedRecords.marc": "Stáhnout změněné záznamy (MARC)"
}
6 changes: 4 additions & 2 deletions translations/ui-bulk-edit/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
"start.edit.instance": "Instances and Administrative data",
"list.errors.table.link": "View latest version",
"actions.find": "Find",
"start.edit.mark": "Instances with source MARC(POC)",
"start.edit.mark": "Instances with source MARC (POC)",
"logs.status.RETRIEVING_IDENTIFIERS": "Retrieving identifiers",
"logs.status.SAVED_IDENTIFIERS": "Saving identifiers",
"meta.title.uploadedFile.mark": "Bulk edit MARC fields - <b>{fileName}</b>",
Expand Down Expand Up @@ -505,5 +505,7 @@
"error.mod-bulk-operations.not.download.file.from.s3": "There is a problem to retrieve data from S3. Please contact your hosting provider to check S3 configuration. Further details are available in Bulk edit app logs (mod-bulk-operations and mod-data-export-worker modules).",
"error.mod-bulk-operations.not.confirm.changes.s3.issue": "There is a problem to retrieve data from S3. Please contact your hosting provider to check S3 configuration. Further details are available in Bulk edit app logs (mod-bulk-operations and mod-data-export-worker modules).",
"menuGroup.startEdit": "Start bulk edit",
"File uploading failed, reason: Cannot upload a file. Reason: file is empty.": "The uploaded file is empty."
"File uploading failed, reason: Cannot upload a file. Reason: file is empty.": "The uploaded file is empty.",
"previewModal.message.empty.marc": "All instances have source FOLIO. Use “Instances and Administrative data” option for bulk edit.",
"start.downloadChangedRecords.marc": "Download changed records (MARC)"
}
6 changes: 4 additions & 2 deletions translations/ui-bulk-edit/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
"start.edit.instance": "Instances and Administrative data",
"list.errors.table.link": "View latest version",
"actions.find": "Find",
"start.edit.mark": "Instances with source MARC(POC)",
"start.edit.mark": "Instances with source MARC (POC)",
"logs.status.RETRIEVING_IDENTIFIERS": "Retrieving identifiers",
"logs.status.SAVED_IDENTIFIERS": "Saving identifiers",
"meta.title.uploadedFile.mark": "Bulk edit MARC fields - <b>{fileName}</b>",
Expand Down Expand Up @@ -505,5 +505,7 @@
"error.mod-bulk-operations.not.download.file.from.s3": "There is a problem to retrieve data from S3. Please contact your hosting provider to check S3 configuration. Further details are available in Bulk edit app logs (mod-bulk-operations and mod-data-export-worker modules).",
"error.mod-bulk-operations.not.confirm.changes.s3.issue": "There is a problem to retrieve data from S3. Please contact your hosting provider to check S3 configuration. Further details are available in Bulk edit app logs (mod-bulk-operations and mod-data-export-worker modules).",
"menuGroup.startEdit": "Start bulk edit",
"File uploading failed, reason: Cannot upload a file. Reason: file is empty.": "The uploaded file is empty."
"File uploading failed, reason: Cannot upload a file. Reason: file is empty.": "The uploaded file is empty.",
"previewModal.message.empty.marc": "All instances have source FOLIO. Use “Instances and Administrative data” option for bulk edit.",
"start.downloadChangedRecords.marc": "Download changed records (MARC)"
}
6 changes: 4 additions & 2 deletions translations/ui-bulk-edit/en_GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
"start.edit.instance": "Instances and Administrative data",
"list.errors.table.link": "View latest version",
"actions.find": "Find",
"start.edit.mark": "Instances with source MARC(POC)",
"start.edit.mark": "Instances with source MARC (POC)",
"logs.status.RETRIEVING_IDENTIFIERS": "Retrieving identifiers",
"logs.status.SAVED_IDENTIFIERS": "Saving identifiers",
"meta.title.uploadedFile.mark": "Bulk edit MARC fields - <b>{fileName}</b>",
Expand Down Expand Up @@ -505,5 +505,7 @@
"error.mod-bulk-operations.not.download.file.from.s3": "There is a problem to retrieve data from S3. Please contact your hosting provider to check S3 configuration. Further details are available in Bulk edit app logs (mod-bulk-operations and mod-data-export-worker modules).",
"error.mod-bulk-operations.not.confirm.changes.s3.issue": "There is a problem to retrieve data from S3. Please contact your hosting provider to check S3 configuration. Further details are available in Bulk edit app logs (mod-bulk-operations and mod-data-export-worker modules).",
"menuGroup.startEdit": "Start bulk edit",
"File uploading failed, reason: Cannot upload a file. Reason: file is empty.": "The uploaded file is empty."
"File uploading failed, reason: Cannot upload a file. Reason: file is empty.": "The uploaded file is empty.",
"previewModal.message.empty.marc": "All instances have source FOLIO. Use “Instances and Administrative data” option for bulk edit.",
"start.downloadChangedRecords.marc": "Download changed records (MARC)"
}
6 changes: 4 additions & 2 deletions translations/ui-bulk-edit/en_SE.json
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
"start.edit.instance": "Instances and Administrative data",
"list.errors.table.link": "View latest version",
"actions.find": "Find",
"start.edit.mark": "Instances with source MARC(POC)",
"start.edit.mark": "Instances with source MARC (POC)",
"logs.status.RETRIEVING_IDENTIFIERS": "Retrieving identifiers",
"logs.status.SAVED_IDENTIFIERS": "Saving identifiers",
"meta.title.uploadedFile.mark": "Bulk edit MARC fields - <b>{fileName}</b>",
Expand Down Expand Up @@ -505,5 +505,7 @@
"error.mod-bulk-operations.not.download.file.from.s3": "There is a problem to retrieve data from S3. Please contact your hosting provider to check S3 configuration. Further details are available in Bulk edit app logs (mod-bulk-operations and mod-data-export-worker modules).",
"error.mod-bulk-operations.not.confirm.changes.s3.issue": "There is a problem to retrieve data from S3. Please contact your hosting provider to check S3 configuration. Further details are available in Bulk edit app logs (mod-bulk-operations and mod-data-export-worker modules).",
"menuGroup.startEdit": "Start bulk edit",
"File uploading failed, reason: Cannot upload a file. Reason: file is empty.": "The uploaded file is empty."
"File uploading failed, reason: Cannot upload a file. Reason: file is empty.": "The uploaded file is empty.",
"previewModal.message.empty.marc": "All instances have source FOLIO. Use “Instances and Administrative data” option for bulk edit.",
"start.downloadChangedRecords.marc": "Download changed records (MARC)"
}
Loading

0 comments on commit c2a936f

Please sign in to comment.