From 667d56bca3c7782ed39dd094f9fe72737e5729d5 Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Wed, 28 May 2025 08:57:09 -0300 Subject: [PATCH 1/2] fix: Disabled sorting for columns without index in Contact Center --- .../directory/chats/ChatsTable/ChatsTable.tsx | 49 +++---------------- 1 file changed, 8 insertions(+), 41 deletions(-) diff --git a/apps/meteor/client/views/omnichannel/directory/chats/ChatsTable/ChatsTable.tsx b/apps/meteor/client/views/omnichannel/directory/chats/ChatsTable/ChatsTable.tsx index d27ca5b0aaf0c..e4b4d10581c7c 100644 --- a/apps/meteor/client/views/omnichannel/directory/chats/ChatsTable/ChatsTable.tsx +++ b/apps/meteor/client/views/omnichannel/directory/chats/ChatsTable/ChatsTable.tsx @@ -31,9 +31,7 @@ const ChatsTable = () => { const chatsQuery = useChatsQuery(); const { current, itemsPerPage, setItemsPerPage: onSetItemsPerPage, setCurrent: onSetCurrent, ...paginationProps } = usePagination(); - const { sortBy, sortDirection, setSort } = useSort< - 'fname' | 'priorityWeight' | 'source.type' | 'verified' | 'department.name' | 'servedBy' | 'ts' | 'lm' | 'status' - >('lm', 'desc'); + const { sortBy, sortDirection, setSort } = useSort<'fname' | 'ts'>('ts', 'desc'); const query = useMemo( () => chatsQuery(filters, [sortBy, sortDirection], current, itemsPerPage), @@ -51,50 +49,19 @@ const ChatsTable = () => { {t('Name')} {isPriorityEnabled && ( - + {t('Priority')} )} - - {t('Channel')} - - - {t('Agent')} - - - {t('Verification')} - - - {t('Department')} - + {t('Channel')} + {t('Agent')} + {t('Verification')} + {t('Department')} {t('Started_At')} - - {t('Last_Message')} - - - {t('Status')} - + {t('Last_Message')} + {t('Status')} {canRemoveClosedChats && } ); From ca4b5f874fa3e828c407edca7aa95de8a5c53125 Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Tue, 3 Jun 2025 10:50:50 -0300 Subject: [PATCH 2/2] chore: changeset --- .changeset/real-fishes-fail.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/real-fishes-fail.md diff --git a/.changeset/real-fishes-fail.md b/.changeset/real-fishes-fail.md new file mode 100644 index 0000000000000..67dcc51d1e4cb --- /dev/null +++ b/.changeset/real-fishes-fail.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Disables sorting on non-indexed columns in the "Chats" tab of Omnichannel Contact Center