From ec6f6a650a552f39dec4af757ebefec3dbe54782 Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Thu, 12 Sep 2024 15:05:00 -0300 Subject: [PATCH] chore: moved UserAutoComplete to ui-client package (#33249) --- apps/meteor/client/omnichannel/monitors/MonitorsTable.tsx | 2 +- .../client/views/omnichannel/agents/AgentsTable/AddAgent.tsx | 2 +- apps/meteor/client/views/omnichannel/managers/AddManager.tsx | 2 +- .../components/UserAutoComplete/UserAutoComplete.stories.tsx | 1 - .../src}/components/UserAutoComplete/UserAutoComplete.tsx | 2 +- .../ui-client/src}/components/UserAutoComplete/index.ts | 0 packages/ui-client/src/components/index.ts | 1 + 7 files changed, 5 insertions(+), 5 deletions(-) rename {apps/meteor/client => packages/ui-client/src}/components/UserAutoComplete/UserAutoComplete.stories.tsx (94%) rename {apps/meteor/client => packages/ui-client/src}/components/UserAutoComplete/UserAutoComplete.tsx (97%) rename {apps/meteor/client => packages/ui-client/src}/components/UserAutoComplete/index.ts (100%) diff --git a/apps/meteor/client/omnichannel/monitors/MonitorsTable.tsx b/apps/meteor/client/omnichannel/monitors/MonitorsTable.tsx index 62adc2a0405f..76a95cf4a0e7 100644 --- a/apps/meteor/client/omnichannel/monitors/MonitorsTable.tsx +++ b/apps/meteor/client/omnichannel/monitors/MonitorsTable.tsx @@ -13,6 +13,7 @@ import { StatesAction, } from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; +import { UserAutoComplete } from '@rocket.chat/ui-client'; import { useTranslation, useToastMessageDispatch, useMethod, useEndpoint, useSetModal } from '@rocket.chat/ui-contexts'; import { useMutation, useQuery, hashQueryKey } from '@tanstack/react-query'; import React, { useMemo, useState } from 'react'; @@ -31,7 +32,6 @@ import { } from '../../components/GenericTable'; import { usePagination } from '../../components/GenericTable/hooks/usePagination'; import { useSort } from '../../components/GenericTable/hooks/useSort'; -import UserAutoComplete from '../../components/UserAutoComplete'; import { queryClient } from '../../lib/queryClient'; const MonitorsTable = () => { diff --git a/apps/meteor/client/views/omnichannel/agents/AgentsTable/AddAgent.tsx b/apps/meteor/client/views/omnichannel/agents/AgentsTable/AddAgent.tsx index 47d60b3d9958..4ad019281bbf 100644 --- a/apps/meteor/client/views/omnichannel/agents/AgentsTable/AddAgent.tsx +++ b/apps/meteor/client/views/omnichannel/agents/AgentsTable/AddAgent.tsx @@ -1,10 +1,10 @@ import { Button, Box, Field, FieldLabel, FieldRow } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import { UserAutoComplete } from '@rocket.chat/ui-client'; import { useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React, { useState } from 'react'; -import UserAutoComplete from '../../../../components/UserAutoComplete'; import { useEndpointAction } from '../../../../hooks/useEndpointAction'; type AddAgentProps = { diff --git a/apps/meteor/client/views/omnichannel/managers/AddManager.tsx b/apps/meteor/client/views/omnichannel/managers/AddManager.tsx index e21896eef9fa..24817a03846e 100644 --- a/apps/meteor/client/views/omnichannel/managers/AddManager.tsx +++ b/apps/meteor/client/views/omnichannel/managers/AddManager.tsx @@ -1,10 +1,10 @@ import { Button, Box, Field, FieldLabel, FieldRow } from '@rocket.chat/fuselage'; import { useMutableCallback, useUniqueId } from '@rocket.chat/fuselage-hooks'; +import { UserAutoComplete } from '@rocket.chat/ui-client'; import { useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React, { useState } from 'react'; -import UserAutoComplete from '../../../components/UserAutoComplete'; import { useEndpointAction } from '../../../hooks/useEndpointAction'; const AddManager = ({ reload }: { reload: () => void }): ReactElement => { diff --git a/apps/meteor/client/components/UserAutoComplete/UserAutoComplete.stories.tsx b/packages/ui-client/src/components/UserAutoComplete/UserAutoComplete.stories.tsx similarity index 94% rename from apps/meteor/client/components/UserAutoComplete/UserAutoComplete.stories.tsx rename to packages/ui-client/src/components/UserAutoComplete/UserAutoComplete.stories.tsx index 757c10b35b86..b9baa3174dda 100644 --- a/apps/meteor/client/components/UserAutoComplete/UserAutoComplete.stories.tsx +++ b/packages/ui-client/src/components/UserAutoComplete/UserAutoComplete.stories.tsx @@ -1,5 +1,4 @@ import type { ComponentMeta, ComponentStory } from '@storybook/react'; -import React from 'react'; import UserAutoComplete from '.'; diff --git a/apps/meteor/client/components/UserAutoComplete/UserAutoComplete.tsx b/packages/ui-client/src/components/UserAutoComplete/UserAutoComplete.tsx similarity index 97% rename from apps/meteor/client/components/UserAutoComplete/UserAutoComplete.tsx rename to packages/ui-client/src/components/UserAutoComplete/UserAutoComplete.tsx index 3f61f421035c..72a8eecec4d0 100644 --- a/apps/meteor/client/components/UserAutoComplete/UserAutoComplete.tsx +++ b/packages/ui-client/src/components/UserAutoComplete/UserAutoComplete.tsx @@ -4,7 +4,7 @@ import { UserAvatar } from '@rocket.chat/ui-avatar'; import { useEndpoint } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; import type { ComponentProps, ReactElement } from 'react'; -import React, { memo, useMemo, useState } from 'react'; +import { memo, useMemo, useState } from 'react'; const query = ( term = '', diff --git a/apps/meteor/client/components/UserAutoComplete/index.ts b/packages/ui-client/src/components/UserAutoComplete/index.ts similarity index 100% rename from apps/meteor/client/components/UserAutoComplete/index.ts rename to packages/ui-client/src/components/UserAutoComplete/index.ts diff --git a/packages/ui-client/src/components/index.ts b/packages/ui-client/src/components/index.ts index 1eccad1fd234..f78c32427cdb 100644 --- a/packages/ui-client/src/components/index.ts +++ b/packages/ui-client/src/components/index.ts @@ -13,3 +13,4 @@ export * from './HeaderV2'; export * from './MultiSelectCustom/MultiSelectCustom'; export * from './FeaturePreview/FeaturePreview'; export * from './RoomBanner'; +export { default as UserAutoComplete } from './UserAutoComplete';