From 6768e6076c76f51ca2d2fdef732ad17c4354a65c Mon Sep 17 00:00:00 2001 From: Tiago Evangelista Pinto Date: Sat, 5 Nov 2022 03:16:11 -0300 Subject: [PATCH 1/8] ts --- ...partment.js => AutoCompleteDepartment.tsx} | 39 ++++++++++++------- .../views/admin/emailInbox/EmailInboxForm.tsx | 4 +- .../omnichannel/analytics/AnalyticsPage.js | 2 +- .../omnichannel/currentChats/FilterByText.tsx | 4 +- .../omnichannel/queueList/QueueListFilter.tsx | 4 +- .../RealTimeMonitoringPage.js | 2 +- .../omnichannel/additionalForms/register.ts | 2 +- .../components/cannedResponseForm.tsx | 3 +- 8 files changed, 36 insertions(+), 24 deletions(-) rename apps/meteor/client/components/{AutoCompleteDepartment.js => AutoCompleteDepartment.tsx} (59%) diff --git a/apps/meteor/client/components/AutoCompleteDepartment.js b/apps/meteor/client/components/AutoCompleteDepartment.tsx similarity index 59% rename from apps/meteor/client/components/AutoCompleteDepartment.js rename to apps/meteor/client/components/AutoCompleteDepartment.tsx index 29759443c7b8..7ca24885927f 100644 --- a/apps/meteor/client/components/AutoCompleteDepartment.js +++ b/apps/meteor/client/components/AutoCompleteDepartment.tsx @@ -1,18 +1,29 @@ -// Cannot convert this file to ts because PaginatedSelectFiltered is not typed yet -// Next release we'll add required types and convert this file, since a new -// fuselage release is OoS of this regression import { PaginatedSelectFiltered } from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import React, { memo, useMemo, useState } from 'react'; +import React, { memo, ReactElement, useMemo, useState } from 'react'; import { useRecordList } from '../hooks/lists/useRecordList'; import { AsyncStatePhase } from '../hooks/useAsyncState'; import { useDepartmentsList } from './Omnichannel/hooks/useDepartmentsList'; -const AutoCompleteDepartment = (props) => { - const { value, excludeDepartmentId, onlyMyDepartments = false, onChange = () => {}, haveAll = false, haveNone = false } = props; +type AutoCompleteDepartmentProps = { + value: { value: string; label: string } | string; + onChange: (value: string) => void; + excludeDepartmentId?: string; + onlyMyDepartments?: boolean; + haveAll?: boolean; + haveNone?: boolean; +}; +export const AutoCompleteDepartment = ({ + value, + excludeDepartmentId, + onlyMyDepartments, + onChange, + haveAll, + haveNone, +}: AutoCompleteDepartmentProps): ReactElement | null /* null added to satisfy register type condition */ => { const t = useTranslation(); const [departmentsFilter, setDepartmentsFilter] = useState(''); @@ -48,10 +59,9 @@ const AutoCompleteDepartment = (props) => { return 0; }); - const findValue = value !== undefined && value !== null ? value : ''; - const department = sortedByName.find( - (dep) => dep._id === (typeof findValue !== 'object' && findValue ? findValue : findValue.value), - )?.value; + const findValue = value || ''; + + const department = sortedByName.find((dep) => dep._id === (typeof findValue === 'string' ? findValue : findValue.value))?.value; return ( { value={department} onChange={onChange} filter={departmentsFilter} - setFilter={setDepartmentsFilter} - options={sortedByName} + // Workaround for setFilter weird typing + setFilter={setDepartmentsFilter as (value: string | number | undefined) => void} + options={sortedByName.map((dep) => ({ value: dep._id, label: dep.name }))} placeholder={t('Select_an_option')} data-qa='autocomplete-department' endReached={ - departmentsPhase === AsyncStatePhase.LOADING ? () => {} : (start) => loadMoreDepartments(start, Math.min(50, departmentsTotal)) + departmentsPhase === AsyncStatePhase.LOADING + ? (): void => undefined + : (start): void => loadMoreDepartments(start, Math.min(50, departmentsTotal)) } /> ); diff --git a/apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx b/apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx index 074e3031ca88..191472ad836b 100644 --- a/apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx +++ b/apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx @@ -19,7 +19,7 @@ import React, { useCallback, ReactElement } from 'react'; import { useForm, Controller } from 'react-hook-form'; import { validateEmail } from '../../../../lib/emailValidator'; -import AutoCompleteDepartment from '../../../components/AutoCompleteDepartment'; +import { AutoCompleteDepartment } from '../../../components/AutoCompleteDepartment'; import GenericModal from '../../../components/GenericModal'; import Page from '../../../components/Page'; @@ -47,7 +47,7 @@ const EmailInboxForm = ({ inboxData }: { inboxData?: IEmailInboxPayload }): Reac email: inboxData?.email, description: inboxData?.description, senderInfo: inboxData?.senderInfo, - department: inboxData?.department, + department: inboxData?.department || '', // SMTP smtpServer: inboxData?.smtp.server, smtpPort: inboxData?.smtp.port ?? 587, diff --git a/apps/meteor/client/views/omnichannel/analytics/AnalyticsPage.js b/apps/meteor/client/views/omnichannel/analytics/AnalyticsPage.js index f1d227c58935..2ae80e9a5205 100644 --- a/apps/meteor/client/views/omnichannel/analytics/AnalyticsPage.js +++ b/apps/meteor/client/views/omnichannel/analytics/AnalyticsPage.js @@ -2,7 +2,7 @@ import { Box, Select, Margins, Field, Label } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import React, { useMemo, useState, useEffect } from 'react'; -import AutoCompleteDepartment from '../../../components/AutoCompleteDepartment'; +import { AutoCompleteDepartment } from '../../../components/AutoCompleteDepartment'; import Page from '../../../components/Page'; import AgentOverview from './AgentOverview'; import DateRangePicker from './DateRangePicker'; diff --git a/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx b/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx index ba5f94b65603..d93077615c7d 100644 --- a/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx +++ b/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx @@ -5,7 +5,7 @@ import moment from 'moment'; import React, { Dispatch, FC, SetStateAction, useEffect } from 'react'; import AutoCompleteAgent from '../../../components/AutoCompleteAgent'; -import AutoCompleteDepartment from '../../../components/AutoCompleteDepartment'; +import { AutoCompleteDepartment } from '../../../components/AutoCompleteDepartment'; import GenericModal from '../../../components/GenericModal'; import { useFormsSubscription } from '../additionalForms'; import Label from './Label'; @@ -149,7 +149,7 @@ const FilterByText: FilterByTextType = ({ setFilter, reload, customFields, setCu - + {EETagsComponent && ( diff --git a/apps/meteor/client/views/omnichannel/queueList/QueueListFilter.tsx b/apps/meteor/client/views/omnichannel/queueList/QueueListFilter.tsx index 00c49783d23a..21dae7fd38a7 100644 --- a/apps/meteor/client/views/omnichannel/queueList/QueueListFilter.tsx +++ b/apps/meteor/client/views/omnichannel/queueList/QueueListFilter.tsx @@ -4,7 +4,7 @@ import { useTranslation } from '@rocket.chat/ui-contexts'; import React, { Dispatch, FC, SetStateAction, useEffect } from 'react'; import AutoCompleteAgent from '../../../components/AutoCompleteAgent'; -import AutoCompleteDepartment from '../../../components/AutoCompleteDepartment'; +import { AutoCompleteDepartment } from '../../../components/AutoCompleteDepartment'; type QueueListFilterPropsType = FC<{ setFilter: Dispatch>; @@ -58,7 +58,7 @@ export const QueueListFilter: QueueListFilterPropsType = ({ setFilter, ...props - + diff --git a/apps/meteor/client/views/omnichannel/realTimeMonitoring/RealTimeMonitoringPage.js b/apps/meteor/client/views/omnichannel/realTimeMonitoring/RealTimeMonitoringPage.js index b719099221a4..34a8bf4812f8 100644 --- a/apps/meteor/client/views/omnichannel/realTimeMonitoring/RealTimeMonitoringPage.js +++ b/apps/meteor/client/views/omnichannel/realTimeMonitoring/RealTimeMonitoringPage.js @@ -3,7 +3,7 @@ import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; import React, { useRef, useState, useMemo, useEffect } from 'react'; -import AutoCompleteDepartment from '../../../components/AutoCompleteDepartment'; +import { AutoCompleteDepartment } from '../../../components/AutoCompleteDepartment'; import Page from '../../../components/Page'; import { getDateRange } from '../../../lib/utils/getDateRange'; import Label from '../components/Label'; diff --git a/apps/meteor/ee/client/omnichannel/additionalForms/register.ts b/apps/meteor/ee/client/omnichannel/additionalForms/register.ts index a230ca84471a..18c6dac665f8 100644 --- a/apps/meteor/ee/client/omnichannel/additionalForms/register.ts +++ b/apps/meteor/ee/client/omnichannel/additionalForms/register.ts @@ -1,6 +1,6 @@ import { useMemo, lazy, LazyExoticComponent } from 'react'; -import type AutoCompleteDepartment from '../../../../client/components/AutoCompleteDepartment'; +import type { AutoCompleteDepartment } from '../../../../client/components/AutoCompleteDepartment'; import { registerForm } from '../../../../client/views/omnichannel/additionalForms'; import { hasLicense } from '../../../app/license/client'; import type CurrentChatTags from '../tags/CurrentChatTags'; diff --git a/apps/meteor/ee/client/omnichannel/cannedResponses/components/cannedResponseForm.tsx b/apps/meteor/ee/client/omnichannel/cannedResponses/components/cannedResponseForm.tsx index f7d03493b4a8..3ca9f211e8b6 100644 --- a/apps/meteor/ee/client/omnichannel/cannedResponses/components/cannedResponseForm.tsx +++ b/apps/meteor/ee/client/omnichannel/cannedResponses/components/cannedResponseForm.tsx @@ -3,7 +3,7 @@ import { Box, Field, TextInput } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import React, { FC } from 'react'; -import AutoCompleteDepartment from '../../../../../client/components/AutoCompleteDepartment'; +import { AutoCompleteDepartment } from '../../../../../client/components/AutoCompleteDepartment'; import Tags from '../../../../../client/components/Omnichannel/Tags'; import MarkdownTextEditor from '../../components/CannedResponse/MarkdownTextEditor'; import PreviewText from '../../components/CannedResponse/modals/CreateCannedResponse/PreviewText'; @@ -75,7 +75,6 @@ const CannedResponseForm: FC<{ {...(isMonitor && { onlyMyDepartments: isMonitor })} value={departmentId} onChange={handleDepartmentId} - error={errors.departmentId} /> {errors.departmentId} From 5f74d71d2d77afaa89dfb10713ba7e11b687be93 Mon Sep 17 00:00:00 2001 From: Tiago Evangelista Pinto Date: Mon, 7 Nov 2022 11:43:56 -0300 Subject: [PATCH 2/8] alek review --- .../components/AutoCompleteDepartment.tsx | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/apps/meteor/client/components/AutoCompleteDepartment.tsx b/apps/meteor/client/components/AutoCompleteDepartment.tsx index 7ca24885927f..402dd0c915e8 100644 --- a/apps/meteor/client/components/AutoCompleteDepartment.tsx +++ b/apps/meteor/client/components/AutoCompleteDepartment.tsx @@ -44,24 +44,28 @@ export const AutoCompleteDepartment = ({ const { phase: departmentsPhase, items: departmentsItems, itemCount: departmentsTotal } = useRecordList(departmentsList); - const sortedByName = departmentsItems.sort((a, b) => { - if (a.value.value === 'all') { - return -1; - } + const findValue = useMemo(() => (typeof value === 'string' ? value : value.value || ''), [value]); - if (a.name > b.name) { - return 1; - } - if (a.name < b.name) { - return -1; - } + const sortedByName = useMemo( + () => + departmentsItems.sort((a, b) => { + if (a.value.value === 'all') { + return -1; + } - return 0; - }); + if (a.name > b.name) { + return 1; + } + if (a.name < b.name) { + return -1; + } - const findValue = value || ''; + return 0; + }), + [departmentsItems], + ); - const department = sortedByName.find((dep) => dep._id === (typeof findValue === 'string' ? findValue : findValue.value))?.value; + const department = useMemo(() => sortedByName.find((dep) => dep._id === findValue)?.value, [sortedByName, findValue]); return ( Date: Mon, 7 Nov 2022 13:44:23 -0300 Subject: [PATCH 3/8] ops --- apps/meteor/client/components/AutoCompleteDepartment.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/meteor/client/components/AutoCompleteDepartment.tsx b/apps/meteor/client/components/AutoCompleteDepartment.tsx index 402dd0c915e8..7e76d09efc58 100644 --- a/apps/meteor/client/components/AutoCompleteDepartment.tsx +++ b/apps/meteor/client/components/AutoCompleteDepartment.tsx @@ -44,8 +44,6 @@ export const AutoCompleteDepartment = ({ const { phase: departmentsPhase, items: departmentsItems, itemCount: departmentsTotal } = useRecordList(departmentsList); - const findValue = useMemo(() => (typeof value === 'string' ? value : value.value || ''), [value]); - const sortedByName = useMemo( () => departmentsItems.sort((a, b) => { @@ -65,7 +63,10 @@ export const AutoCompleteDepartment = ({ [departmentsItems], ); - const department = useMemo(() => sortedByName.find((dep) => dep._id === findValue)?.value, [sortedByName, findValue]); + const department = useMemo(() => { + const findValue = typeof value === 'string' ? value : value.value || ''; + return sortedByName.find((dep) => dep._id === findValue)?.value; + }, [sortedByName, value]); return ( Date: Mon, 7 Nov 2022 13:54:36 -0300 Subject: [PATCH 4/8] remove comment --- apps/meteor/client/components/AutoCompleteDepartment.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/client/components/AutoCompleteDepartment.tsx b/apps/meteor/client/components/AutoCompleteDepartment.tsx index 7e76d09efc58..1ddfdbc6872e 100644 --- a/apps/meteor/client/components/AutoCompleteDepartment.tsx +++ b/apps/meteor/client/components/AutoCompleteDepartment.tsx @@ -23,7 +23,7 @@ export const AutoCompleteDepartment = ({ onChange, haveAll, haveNone, -}: AutoCompleteDepartmentProps): ReactElement | null /* null added to satisfy register type condition */ => { +}: AutoCompleteDepartmentProps): ReactElement | null => { const t = useTranslation(); const [departmentsFilter, setDepartmentsFilter] = useState(''); From 5386843b13013f01112c6e0d2180fbc52d430755 Mon Sep 17 00:00:00 2001 From: Tiago Evangelista Pinto Date: Wed, 9 Nov 2022 17:07:31 -0300 Subject: [PATCH 5/8] fix QA findings --- apps/meteor/client/components/AutoCompleteDepartment.tsx | 8 +++++--- .../views/omnichannel/currentChats/FilterByText.tsx | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/meteor/client/components/AutoCompleteDepartment.tsx b/apps/meteor/client/components/AutoCompleteDepartment.tsx index 1ddfdbc6872e..0be7ebf9a352 100644 --- a/apps/meteor/client/components/AutoCompleteDepartment.tsx +++ b/apps/meteor/client/components/AutoCompleteDepartment.tsx @@ -64,8 +64,8 @@ export const AutoCompleteDepartment = ({ ); const department = useMemo(() => { - const findValue = typeof value === 'string' ? value : value.value || ''; - return sortedByName.find((dep) => dep._id === findValue)?.value; + const valueFound = typeof value !== 'object' ? value : value.value || ''; + return sortedByName.find((dep) => dep.value.value === valueFound)?.value; }, [sortedByName, value]); return ( @@ -76,7 +76,9 @@ export const AutoCompleteDepartment = ({ filter={departmentsFilter} // Workaround for setFilter weird typing setFilter={setDepartmentsFilter as (value: string | number | undefined) => void} - options={sortedByName.map((dep) => ({ value: dep._id, label: dep.name }))} + // TODO: Fix typing on fuselage + // Workaround for options wrong typing + options={sortedByName as any} placeholder={t('Select_an_option')} data-qa='autocomplete-department' endReached={ diff --git a/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx b/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx index d93077615c7d..03a90e06ade2 100644 --- a/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx +++ b/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx @@ -74,7 +74,7 @@ const FilterByText: FilterByTextType = ({ setFilter, reload, customFields, setCu guest, servedBy, status, - ...(department?.value && department.value !== 'all' && { department: department.value }), + department: department?.value && department.value !== 'all' ? department.value : '', from: from && moment(new Date(from)).utc().format('YYYY-MM-DDTHH:mm:ss'), to: to && moment(new Date(to)).utc().format('YYYY-MM-DDTHH:mm:ss'), tags: tags.map((tag) => tag.label), From ed4065f42f8d6df8558ee891f7d96ddb3b1fa503 Mon Sep 17 00:00:00 2001 From: Tiago Evangelista Pinto Date: Thu, 10 Nov 2022 14:55:00 -0300 Subject: [PATCH 6/8] last fix --- apps/meteor/client/components/AutoCompleteDepartment.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/client/components/AutoCompleteDepartment.tsx b/apps/meteor/client/components/AutoCompleteDepartment.tsx index 0be7ebf9a352..565dcc46b63a 100644 --- a/apps/meteor/client/components/AutoCompleteDepartment.tsx +++ b/apps/meteor/client/components/AutoCompleteDepartment.tsx @@ -64,7 +64,7 @@ export const AutoCompleteDepartment = ({ ); const department = useMemo(() => { - const valueFound = typeof value !== 'object' ? value : value.value || ''; + const valueFound = value && (typeof value !== 'object' ? value : value.value || ''); return sortedByName.find((dep) => dep.value.value === valueFound)?.value; }, [sortedByName, value]); From 351756be509d9df57b385a1da39d4c92fe155abe Mon Sep 17 00:00:00 2001 From: Tiago Evangelista Pinto Date: Thu, 10 Nov 2022 15:14:00 -0300 Subject: [PATCH 7/8] last review --- apps/meteor/client/components/AutoCompleteDepartment.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/meteor/client/components/AutoCompleteDepartment.tsx b/apps/meteor/client/components/AutoCompleteDepartment.tsx index 565dcc46b63a..cf93fb2e9f33 100644 --- a/apps/meteor/client/components/AutoCompleteDepartment.tsx +++ b/apps/meteor/client/components/AutoCompleteDepartment.tsx @@ -8,7 +8,7 @@ import { AsyncStatePhase } from '../hooks/useAsyncState'; import { useDepartmentsList } from './Omnichannel/hooks/useDepartmentsList'; type AutoCompleteDepartmentProps = { - value: { value: string; label: string } | string; + value?: { value: string; label: string } | string; onChange: (value: string) => void; excludeDepartmentId?: string; onlyMyDepartments?: boolean; @@ -64,7 +64,7 @@ export const AutoCompleteDepartment = ({ ); const department = useMemo(() => { - const valueFound = value && (typeof value !== 'object' ? value : value.value || ''); + const valueFound = typeof value === 'string' ? value : value?.value || ''; return sortedByName.find((dep) => dep.value.value === valueFound)?.value; }, [sortedByName, value]); From dac6cf692925fb55943dd5bc13d122fa91d83a5b Mon Sep 17 00:00:00 2001 From: Tiago Evangelista Pinto Date: Fri, 11 Nov 2022 20:24:08 -0300 Subject: [PATCH 8/8] use default import --- apps/meteor/client/components/AutoCompleteDepartment.tsx | 2 +- apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx | 2 +- apps/meteor/client/views/omnichannel/analytics/AnalyticsPage.js | 2 +- .../client/views/omnichannel/currentChats/FilterByText.tsx | 2 +- .../client/views/omnichannel/queueList/QueueListFilter.tsx | 2 +- .../omnichannel/realTimeMonitoring/RealTimeMonitoringPage.js | 2 +- apps/meteor/ee/client/omnichannel/additionalForms/register.ts | 2 +- .../cannedResponses/components/cannedResponseForm.tsx | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/meteor/client/components/AutoCompleteDepartment.tsx b/apps/meteor/client/components/AutoCompleteDepartment.tsx index cf93fb2e9f33..78cf107f13b0 100644 --- a/apps/meteor/client/components/AutoCompleteDepartment.tsx +++ b/apps/meteor/client/components/AutoCompleteDepartment.tsx @@ -16,7 +16,7 @@ type AutoCompleteDepartmentProps = { haveNone?: boolean; }; -export const AutoCompleteDepartment = ({ +const AutoCompleteDepartment = ({ value, excludeDepartmentId, onlyMyDepartments, diff --git a/apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx b/apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx index 191472ad836b..0419bda84731 100644 --- a/apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx +++ b/apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx @@ -19,7 +19,7 @@ import React, { useCallback, ReactElement } from 'react'; import { useForm, Controller } from 'react-hook-form'; import { validateEmail } from '../../../../lib/emailValidator'; -import { AutoCompleteDepartment } from '../../../components/AutoCompleteDepartment'; +import AutoCompleteDepartment from '../../../components/AutoCompleteDepartment'; import GenericModal from '../../../components/GenericModal'; import Page from '../../../components/Page'; diff --git a/apps/meteor/client/views/omnichannel/analytics/AnalyticsPage.js b/apps/meteor/client/views/omnichannel/analytics/AnalyticsPage.js index 2ae80e9a5205..f1d227c58935 100644 --- a/apps/meteor/client/views/omnichannel/analytics/AnalyticsPage.js +++ b/apps/meteor/client/views/omnichannel/analytics/AnalyticsPage.js @@ -2,7 +2,7 @@ import { Box, Select, Margins, Field, Label } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import React, { useMemo, useState, useEffect } from 'react'; -import { AutoCompleteDepartment } from '../../../components/AutoCompleteDepartment'; +import AutoCompleteDepartment from '../../../components/AutoCompleteDepartment'; import Page from '../../../components/Page'; import AgentOverview from './AgentOverview'; import DateRangePicker from './DateRangePicker'; diff --git a/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx b/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx index 03a90e06ade2..11a5df1f42df 100644 --- a/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx +++ b/apps/meteor/client/views/omnichannel/currentChats/FilterByText.tsx @@ -5,7 +5,7 @@ import moment from 'moment'; import React, { Dispatch, FC, SetStateAction, useEffect } from 'react'; import AutoCompleteAgent from '../../../components/AutoCompleteAgent'; -import { AutoCompleteDepartment } from '../../../components/AutoCompleteDepartment'; +import AutoCompleteDepartment from '../../../components/AutoCompleteDepartment'; import GenericModal from '../../../components/GenericModal'; import { useFormsSubscription } from '../additionalForms'; import Label from './Label'; diff --git a/apps/meteor/client/views/omnichannel/queueList/QueueListFilter.tsx b/apps/meteor/client/views/omnichannel/queueList/QueueListFilter.tsx index 21dae7fd38a7..a47663dc1a86 100644 --- a/apps/meteor/client/views/omnichannel/queueList/QueueListFilter.tsx +++ b/apps/meteor/client/views/omnichannel/queueList/QueueListFilter.tsx @@ -4,7 +4,7 @@ import { useTranslation } from '@rocket.chat/ui-contexts'; import React, { Dispatch, FC, SetStateAction, useEffect } from 'react'; import AutoCompleteAgent from '../../../components/AutoCompleteAgent'; -import { AutoCompleteDepartment } from '../../../components/AutoCompleteDepartment'; +import AutoCompleteDepartment from '../../../components/AutoCompleteDepartment'; type QueueListFilterPropsType = FC<{ setFilter: Dispatch>; diff --git a/apps/meteor/client/views/omnichannel/realTimeMonitoring/RealTimeMonitoringPage.js b/apps/meteor/client/views/omnichannel/realTimeMonitoring/RealTimeMonitoringPage.js index 34a8bf4812f8..b719099221a4 100644 --- a/apps/meteor/client/views/omnichannel/realTimeMonitoring/RealTimeMonitoringPage.js +++ b/apps/meteor/client/views/omnichannel/realTimeMonitoring/RealTimeMonitoringPage.js @@ -3,7 +3,7 @@ import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; import React, { useRef, useState, useMemo, useEffect } from 'react'; -import { AutoCompleteDepartment } from '../../../components/AutoCompleteDepartment'; +import AutoCompleteDepartment from '../../../components/AutoCompleteDepartment'; import Page from '../../../components/Page'; import { getDateRange } from '../../../lib/utils/getDateRange'; import Label from '../components/Label'; diff --git a/apps/meteor/ee/client/omnichannel/additionalForms/register.ts b/apps/meteor/ee/client/omnichannel/additionalForms/register.ts index 18c6dac665f8..a230ca84471a 100644 --- a/apps/meteor/ee/client/omnichannel/additionalForms/register.ts +++ b/apps/meteor/ee/client/omnichannel/additionalForms/register.ts @@ -1,6 +1,6 @@ import { useMemo, lazy, LazyExoticComponent } from 'react'; -import type { AutoCompleteDepartment } from '../../../../client/components/AutoCompleteDepartment'; +import type AutoCompleteDepartment from '../../../../client/components/AutoCompleteDepartment'; import { registerForm } from '../../../../client/views/omnichannel/additionalForms'; import { hasLicense } from '../../../app/license/client'; import type CurrentChatTags from '../tags/CurrentChatTags'; diff --git a/apps/meteor/ee/client/omnichannel/cannedResponses/components/cannedResponseForm.tsx b/apps/meteor/ee/client/omnichannel/cannedResponses/components/cannedResponseForm.tsx index 3ca9f211e8b6..10325606008b 100644 --- a/apps/meteor/ee/client/omnichannel/cannedResponses/components/cannedResponseForm.tsx +++ b/apps/meteor/ee/client/omnichannel/cannedResponses/components/cannedResponseForm.tsx @@ -3,7 +3,7 @@ import { Box, Field, TextInput } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import React, { FC } from 'react'; -import { AutoCompleteDepartment } from '../../../../../client/components/AutoCompleteDepartment'; +import AutoCompleteDepartment from '../../../../../client/components/AutoCompleteDepartment'; import Tags from '../../../../../client/components/Omnichannel/Tags'; import MarkdownTextEditor from '../../components/CannedResponse/MarkdownTextEditor'; import PreviewText from '../../components/CannedResponse/modals/CreateCannedResponse/PreviewText';