Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIBULKED-315 resolve issues missed in initial story #397

Merged
merged 9 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ export const BulkEditInApp = ({
const isHoldingsCapability = capabilities === CAPABILITIES.HOLDING;

const { itemNotes, isItemNotesLoading } = useItemNotes({ enabled: isItemCapability });
const { holdingNotes, isHoldingsNotesLoading } = useHoldingsNotes({ enabled: isHoldingsCapability });
const { holdingsNotes, isHoldingsNotesLoading } = useHoldingsNotes({ enabled: isHoldingsCapability });

const optionsMap = {
[CAPABILITIES.ITEM]: getItemsOptions(intl.formatMessage, itemNotes),
[CAPABILITIES.USER]: getUserOptions(intl.formatMessage),
[CAPABILITIES.HOLDING]: getHoldingsOptions(intl.formatMessage, holdingNotes),
[CAPABILITIES.HOLDING]: getHoldingsOptions(intl.formatMessage, holdingsNotes),
};

const options = optionsMap[capabilities];
Expand Down
4 changes: 2 additions & 2 deletions src/constants/selectOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ export const getHoldingsOptions = (formatMessage, holdingsNotes = []) => [
value: OPTIONS.TEMPORARY_HOLDINGS_LOCATION,
label: formatMessage({ id: 'ui-bulk-edit.layer.options.holdings.temporaryLocation' }),
disabled: false,
categoryName: 'Holdings location'
categoryName: formatMessage({ id: 'ui-bulk-edit.category.holdingsLocation' }),
},
{
value: OPTIONS.PERMANENT_HOLDINGS_LOCATION,
label: formatMessage({ id: 'ui-bulk-edit.layer.options.holdings.permanentLocation' }),
disabled: false,
categoryName: 'Holdings location'
categoryName: formatMessage({ id: 'ui-bulk-edit.category.holdingsLocation' }),
},
...holdingsNotes,
{
Expand Down
8 changes: 4 additions & 4 deletions src/hooks/api/useHoldingsNotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ export const useHoldingsNotes = (options = {}) => {

const { data, isLoading: isHoldingsNotesLoading } = useQuery(
{
queryKey: 'holdingNotes',
queryKey: 'holdingsNotes',
cacheTime: Infinity,
staleTime: Infinity,
queryFn: () => ky.get('holdings-note-types').json(),
...options,
},
);

const holdingNotes = getMappedAndSortedNotes({
const holdingsNotes = getMappedAndSortedNotes({
notes: data?.holdingsNoteTypes,
categoryName: formatMessage({ id: 'ui-bulk-edit.category.holdingNotes' }),
categoryName: formatMessage({ id: 'ui-bulk-edit.category.holdingsNotes' }),
type: OPTIONS.HOLDINGS_NOTE,
key: PARAMETERS_KEYS.HOLDINGS_NOTE_TYPE_ID_KEY,
});

return {
holdingNotes,
holdingsNotes,
isHoldingsNotesLoading,
};
};
3 changes: 2 additions & 1 deletion translations/ui-bulk-edit/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
"category.loanType": "Loan type",
"category.location": "Location",
"category.itemNotes": "Item notes",
"category.holdingNotes": "Holdings notes",
"category.holdingsNotes": "Holdings notes",
"category.holdingsLocation": "Holdings location",

"columns.USER.User name": "Username",
"columns.USER.User id": "User id",
Expand Down
Loading