Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/metal-jobs-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fixes an issue where the omnichannel default priorities are not being translated in the sidebar room menu
2 changes: 1 addition & 1 deletion .changeset/slow-ants-divide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@rocket.chat/meteor': patch
---

Fixes an issue where the omnichannel default priorities are not being translated
Fixes an issue where the omnichannel default priorities are not being translated in priorities list
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const useOmnichannelPrioritiesMenu = (rid: IRoom['_id']) => {
};

const options = priorities.map(({ _id: priorityId, name, i18n, dirty, sortItem }) => {
const label = dirty && name ? name : i18n;
const label = dirty && name ? name : t(i18n);

return {
id: priorityId,
Expand All @@ -49,5 +49,5 @@ export const useOmnichannelPrioritiesMenu = (rid: IRoom['_id']) => {
});

return priorities.length ? [unprioritizedOption, ...options] : [];
}, [t, priorities, updateRoomPriority, removeRoomPriority, queryClient, rid]);
}, [t, priorities, updateRoomPriority, removeRoomPriority, queryClient, rid, dispatchToastMessage]);
};
10 changes: 5 additions & 5 deletions apps/meteor/client/sidebar/hooks/useRoomMenuActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const useRoomMenuActions = ({
const menuOptions = useMemo(
() =>
!hideDefaultOptions
? [
? ([
!isOmnichannelRoom && {
id: 'hideRoom',
icon: 'eye-off',
Expand All @@ -83,7 +83,7 @@ export const useRoomMenuActions = ({
content: t('Leave_room'),
onClick: handleLeave,
},
]
].filter(Boolean) as GenericMenuItemProps[])
: [],
[
hideDefaultOptions,
Expand All @@ -102,10 +102,10 @@ export const useRoomMenuActions = ({

if (isOmnichannelRoom && prioritiesMenu.length > 0) {
return [
{ title: '', items: menuOptions.filter(Boolean) as GenericMenuItemProps[] },
{ title: t('Priorities'), items: prioritiesMenu },
...(menuOptions.length > 0 ? [{ title: '', items: menuOptions }] : []),
...(prioritiesMenu.length > 0 ? [{ title: t('Priorities'), items: prioritiesMenu }] : []),
];
}

return [{ title: '', items: menuOptions.filter(Boolean) as GenericMenuItemProps[] }];
return menuOptions.length > 0 ? [{ title: '', items: menuOptions }] : [];
};
Loading