diff --git a/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx b/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx index 6587563caa5f9..3659f77b394f9 100644 --- a/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx +++ b/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx @@ -150,7 +150,7 @@ const FilterByText: FilterByTextType = ({ setFilter, reload, customFields, setCu - + )} diff --git a/apps/meteor/client/views/omnichannel/directory/chats/contextualBar/RoomEdit/RoomEdit.tsx b/apps/meteor/client/views/omnichannel/directory/chats/contextualBar/RoomEdit/RoomEdit.tsx index 435e29743469f..433af2135068f 100644 --- a/apps/meteor/client/views/omnichannel/directory/chats/contextualBar/RoomEdit/RoomEdit.tsx +++ b/apps/meteor/client/views/omnichannel/directory/chats/contextualBar/RoomEdit/RoomEdit.tsx @@ -134,7 +134,7 @@ function RoomEdit({ room, visitor, reload, reloadInfo, onClose }: RoomEditProps) - + {SlaPoliciesSelect && !!slaPolicies?.length && ( diff --git a/apps/meteor/ee/client/hooks/useTagsList.ts b/apps/meteor/ee/client/hooks/useTagsList.ts index 013a320fbadec..cf087ac437b87 100644 --- a/apps/meteor/ee/client/hooks/useTagsList.ts +++ b/apps/meteor/ee/client/hooks/useTagsList.ts @@ -9,16 +9,18 @@ import { RecordList } from '../../../client/lib/lists/RecordList'; type TagsListOptions = { filter: string; department?: string; + viewAll?: boolean; }; -export const useTagsList = ( - options: TagsListOptions, -): { +type UseTagsListResult = { itemsList: RecordList; initialItemCount: number; reload: () => void; loadMoreItems: (start: number, end: number) => void; -} => { +}; + +export const useTagsList = (options: TagsListOptions): UseTagsListResult => { + const { viewAll, department, filter } = options; const [itemsList, setItemsList] = useState(() => new RecordList()); const reload = useCallback(() => setItemsList(new RecordList()), []); @@ -31,10 +33,11 @@ export const useTagsList = ( const fetchData = useCallback( async (start, end) => { const { tags, total } = await getTags({ - text: options.filter, + text: filter, offset: start, count: end + start, - ...(options.department && { department: options.department }), + ...(viewAll && { viewAll: 'true' }), + ...(department && { department }), }); return { items: tags.map((tag: any) => { @@ -46,7 +49,7 @@ export const useTagsList = ( itemCount: total, }; }, - [getTags, options.filter, options.department], + [getTags, filter, viewAll, department], ); const { loadMoreItems, initialItemCount } = useScrollableRecordList(itemsList, fetchData, 25); diff --git a/apps/meteor/ee/client/omnichannel/tags/AutoCompleteTagsMultiple.js b/apps/meteor/ee/client/omnichannel/tags/AutoCompleteTagsMultiple.js index 5f7fe4a4ffe67..086d796152fc4 100644 --- a/apps/meteor/ee/client/omnichannel/tags/AutoCompleteTagsMultiple.js +++ b/apps/meteor/ee/client/omnichannel/tags/AutoCompleteTagsMultiple.js @@ -8,7 +8,7 @@ import { AsyncStatePhase } from '../../../../client/hooks/useAsyncState'; import { useTagsList } from '../../hooks/useTagsList'; const AutoCompleteTagMultiple = (props) => { - const { value, onlyMyTags = false, onChange = () => {}, department } = props; + const { value, onlyMyTags = false, onChange = () => {}, department, viewAll = false } = props; const t = useTranslation(); const [tagsFilter, setTagsFilter] = useState(''); @@ -16,7 +16,10 @@ const AutoCompleteTagMultiple = (props) => { const debouncedTagsFilter = useDebouncedValue(tagsFilter, 500); const { itemsList: tagsList, loadMoreItems: loadMoreTags } = useTagsList( - useMemo(() => ({ filter: debouncedTagsFilter, onlyMyTags, department }), [debouncedTagsFilter, onlyMyTags, department]), + useMemo( + () => ({ filter: debouncedTagsFilter, onlyMyTags, department, viewAll }), + [debouncedTagsFilter, onlyMyTags, department, viewAll], + ), ); const { phase: tagsPhase, items: tagsItems, itemCount: tagsTotal } = useRecordList(tagsList); diff --git a/apps/meteor/ee/client/omnichannel/tags/CurrentChatTags.tsx b/apps/meteor/ee/client/omnichannel/tags/CurrentChatTags.tsx index 7253764c52b64..61c1d11af9479 100644 --- a/apps/meteor/ee/client/omnichannel/tags/CurrentChatTags.tsx +++ b/apps/meteor/ee/client/omnichannel/tags/CurrentChatTags.tsx @@ -3,8 +3,10 @@ import React from 'react'; import AutoCompleteTagsMultiple from './AutoCompleteTagsMultiple'; -const CurrentChatTags: FC<{ value: Array; handler: () => void; department?: string }> = ({ value, handler, department }) => ( - +type CurrentChatTagsProps = { value: Array; handler: () => void; department?: string; viewAll?: boolean }; + +const CurrentChatTags: FC = ({ value, handler, department, viewAll }) => ( + ); export default CurrentChatTags;