From 4643466994b9846c6887bcd7cae7438b74d5c139 Mon Sep 17 00:00:00 2001 From: Tasso Evangelista Date: Mon, 17 Jul 2023 18:44:48 -0300 Subject: [PATCH 01/14] regression: Router not capturing search string parameters (#29846) --- .../meteor/client/providers/RouterProvider.tsx | 2 +- .../externals/meteor/kadira-flow-router.d.ts | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/apps/meteor/client/providers/RouterProvider.tsx b/apps/meteor/client/providers/RouterProvider.tsx index af0448ce34e8..0dd7ee31deed 100644 --- a/apps/meteor/client/providers/RouterProvider.tsx +++ b/apps/meteor/client/providers/RouterProvider.tsx @@ -126,7 +126,7 @@ const routesSubscribers = new Set<() => void>(); const updateFlowRouter = () => { if (FlowRouter._initialized) { FlowRouter._updateCallbacks(); - FlowRouter._page.dispatch({ path: FlowRouter._current.path, params: {} }); + FlowRouter._page.dispatch(new FlowRouter._page.Context(FlowRouter._current.path)); return; } diff --git a/apps/meteor/definition/externals/meteor/kadira-flow-router.d.ts b/apps/meteor/definition/externals/meteor/kadira-flow-router.d.ts index 8dfc0de5a01b..946d3d074e26 100644 --- a/apps/meteor/definition/externals/meteor/kadira-flow-router.d.ts +++ b/apps/meteor/definition/externals/meteor/kadira-flow-router.d.ts @@ -164,14 +164,20 @@ declare module 'meteor/kadira:flow-router' { _current: Current; } + namespace page { + function start(): void; + function stop(): void; + function show(path: string): void; + function dispatch(ctx: page.Context): void; + + class Context { + constructor(path: string, state?: object): Context; + } + } + const FlowRouter: Router & { Route: typeof Route; Router: typeof Router; - _page: { - start(): void; - stop(): void; - show(path: string): void; - dispatch(ctx: { path: string; params: any }): void; - }; + _page: typeof page; }; } From 53822be591971229e961db19749b9e1f571e9c02 Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Mon, 17 Jul 2023 23:20:49 -0300 Subject: [PATCH 02/14] test: Cover sidebar audit/administration items hooks (#29821) Co-authored-by: Guilherme Gazzo --- .../client/hooks/useAppActionButtons.ts | 4 +- .../hooks/useAdministrationItems.spec.tsx | 203 ++++++++++++++++++ .../actions/hooks/useAdministrationItems.tsx | 15 +- .../actions/hooks/useAuditItems.spec.tsx | 171 +++++++++++++++ .../client/views/hooks/useUpgradeTabParams.ts | 2 +- .../{jest.client.config.ts => jest.config.ts} | 0 apps/meteor/package.json | 2 +- .../mock-providers/src/MockedModalContext.tsx | 20 ++ .../src/MockedServerContext.tsx | 16 +- packages/mock-providers/src/index.ts | 5 + .../src/hooks/useFeaturePreviewList.spec.tsx | 33 +++ 11 files changed, 456 insertions(+), 15 deletions(-) create mode 100644 apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.spec.tsx create mode 100644 apps/meteor/client/sidebar/header/actions/hooks/useAuditItems.spec.tsx rename apps/meteor/{jest.client.config.ts => jest.config.ts} (100%) create mode 100644 packages/mock-providers/src/MockedModalContext.tsx create mode 100644 packages/mock-providers/src/index.ts diff --git a/apps/meteor/client/hooks/useAppActionButtons.ts b/apps/meteor/client/hooks/useAppActionButtons.ts index 6d5aac3e92a3..4eb28a393d1b 100644 --- a/apps/meteor/client/hooks/useAppActionButtons.ts +++ b/apps/meteor/client/hooks/useAppActionButtons.ts @@ -95,9 +95,9 @@ export const useUserDropdownAppsActionButtons = () => { ?.filter((action) => { return applyButtonFilters(action); }) - .map((action, key) => { + .map((action) => { return { - id: action.actionId + key, + id: `${action.appId}_${action.actionId}`, // icon: action.icon as GenericMenuItemProps['icon'], content: action.labelI18n, onClick: () => { diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.spec.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.spec.tsx new file mode 100644 index 000000000000..a050e0f48060 --- /dev/null +++ b/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.spec.tsx @@ -0,0 +1,203 @@ +import { MockedAuthorizationContext } from '@rocket.chat/mock-providers/src/MockedAuthorizationContext'; +import { MockedModalContext } from '@rocket.chat/mock-providers/src/MockedModalContext'; +import { MockedServerContext } from '@rocket.chat/mock-providers/src/MockedServerContext'; +import { MockedSettingsContext } from '@rocket.chat/mock-providers/src/MockedSettingsContext'; +import { MockedUserContext } from '@rocket.chat/mock-providers/src/MockedUserContext'; +import { QueryClientProvider, QueryClient } from '@tanstack/react-query'; +import { renderHook } from '@testing-library/react-hooks'; +import React from 'react'; + +import { useAdministrationItems } from './useAdministrationItems'; + +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + // ✅ turns retries off + retry: false, + }, + }, +}); + +beforeEach(() => { + queryClient.clear(); +}); + +it('should not show upgrade item if has license and not have trial', async () => { + const { result, waitFor } = renderHook(() => useAdministrationItems(), { + wrapper: ({ children }) => ( + + { + if (args.method === 'GET' && args.pathPattern === '/v1/licenses.get') { + return { + licenses: [ + { + modules: ['testModule'], + meta: { trial: false }, + }, + ], + } as any; + } + + if (args.method === 'GET' && args.pathPattern === '/v1/cloud.registrationStatus') { + return { + registrationStatus: { + workspaceRegistered: false, + }, + }; + } + }} + > + + + + {children} + + + + + + ), + }); + + await waitFor(() => Boolean(result.all.length > 1)); + expect(result.current).toEqual([]); +}); + +it('should return an upgrade item if not have license or if have a trial', async () => { + const { result, waitFor } = renderHook(() => useAdministrationItems(), { + wrapper: ({ children }) => ( + + { + if (args.method === 'GET' && args.pathPattern === '/v1/licenses.get') { + return { + licenses: [ + { + modules: [], + }, + ], + } as any; + } + + if (args.method === 'GET' && args.pathPattern === '/v1/cloud.registrationStatus') { + return { + registrationStatus: { + workspaceRegistered: false, + }, + }; + } + }} + > + + + + {children} + + + + + + ), + }); + + await waitFor(() => { + return !queryClient.isFetching(); + }); + + expect(result.current[0]).toEqual( + expect.objectContaining({ + id: 'showUpgradeItem', + }), + ); +}); + +it('should return omnichannel item if has `view-livechat-manager` permission ', async () => { + const { result, waitFor } = renderHook(() => useAdministrationItems(), { + wrapper: ({ children }) => ( + + { + if (args.method === 'GET' && args.pathPattern === '/v1/licenses.get') { + return { + licenses: [ + { + modules: [], + }, + ], + } as any; + } + + if (args.method === 'GET' && args.pathPattern === '/v1/cloud.registrationStatus') { + return { + registrationStatus: { + workspaceRegistered: false, + }, + }; + } + }} + > + + + + {children} + + + + + + ), + }); + + await waitFor(() => Boolean(result.current.length)); + expect(result.current[0]).toEqual( + expect.objectContaining({ + id: 'omnichannel', + }), + ); +}); + +it('should show administration item if has at least one admin permission', async () => { + const { result, waitFor } = renderHook(() => useAdministrationItems(), { + wrapper: ({ children }) => ( + + { + if (args.method === 'GET' && args.pathPattern === '/v1/licenses.get') { + return { + licenses: [ + { + modules: [], + }, + ], + } as any; + } + + if (args.method === 'GET' && args.pathPattern === '/v1/cloud.registrationStatus') { + return { + registrationStatus: { + workspaceRegistered: false, + }, + }; + } + }} + > + + + + {children} + + + + + + ), + }); + + await waitFor(() => Boolean(result.current.length)); + expect(result.current[0]).toEqual( + expect.objectContaining({ + id: 'workspace', + }), + ); +}); diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.tsx index 3d4d640fecf2..ea678413a16b 100644 --- a/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.tsx +++ b/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.tsx @@ -1,20 +1,19 @@ import { useTranslation, useRoute, - useMethod, useSetModal, useRole, useRouter, useAtLeastOnePermission, usePermission, } from '@rocket.chat/ui-contexts'; -import { useQuery } from '@tanstack/react-query'; import React from 'react'; import type { UpgradeTabVariant } from '../../../../../lib/upgradeTab'; import { getUpgradeTabLabel, isFullyFeature } from '../../../../../lib/upgradeTab'; import Emoji from '../../../../components/Emoji'; import type { GenericMenuItemProps } from '../../../../components/GenericMenu/GenericMenuItem'; +import { useRegistrationStatus } from '../../../../hooks/useRegistrationStatus'; import RegisterWorkspaceModal from '../../../../views/admin/cloud/modals/RegisterWorkspaceModal'; import { useUpgradeTabParams } from '../../../../views/hooks/useUpgradeTabParams'; @@ -53,8 +52,8 @@ const ADMIN_PERMISSIONS = [ */ export const useAdministrationItems = (): GenericMenuItemProps[] => { - const router = useRouter(); const t = useTranslation(); + const router = useRouter(); const shouldShowAdminMenu = useAtLeastOnePermission(ADMIN_PERMISSIONS); @@ -66,9 +65,13 @@ export const useAdministrationItems = (): GenericMenuItemProps[] => { const isAdmin = useRole('admin'); const setModal = useSetModal(); - const checkCloudRegisterStatus = useMethod('cloud:checkRegisterStatus'); - const result = useQuery(['admin/cloud/register-status'], async () => checkCloudRegisterStatus()); - const { workspaceRegistered } = result.data || {}; + // TODO: DEPRECATE IT + // const checkCloudRegisterStatus = useMethod('cloud:checkRegisterStatus'); + // const result = useQuery(['admin/cloud/register-status'], async () => checkCloudRegisterStatus()); + // const { workspaceRegistered } = result.data || {}; + + const { data: registrationStatusData } = useRegistrationStatus(); + const workspaceRegistered = registrationStatusData?.registrationStatus?.workspaceRegistered ?? false; const handleRegisterWorkspaceClick = (): void => { const handleModalClose = (): void => setModal(null); diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useAuditItems.spec.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useAuditItems.spec.tsx new file mode 100644 index 000000000000..1cf43158db7c --- /dev/null +++ b/apps/meteor/client/sidebar/header/actions/hooks/useAuditItems.spec.tsx @@ -0,0 +1,171 @@ +import { MockedAuthorizationContext } from '@rocket.chat/mock-providers/src/MockedAuthorizationContext'; +import { MockedServerContext } from '@rocket.chat/mock-providers/src/MockedServerContext'; +import { MockedSettingsContext } from '@rocket.chat/mock-providers/src/MockedSettingsContext'; +import { MockedUserContext } from '@rocket.chat/mock-providers/src/MockedUserContext'; +import { QueryClientProvider, QueryClient } from '@tanstack/react-query'; +import { renderHook } from '@testing-library/react-hooks'; +import React from 'react'; + +import { useAuditItems } from './useAuditItems'; + +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + // ✅ turns retries off + retry: false, + }, + }, +}); + +it('should return an empty array if doesn`t have license', async () => { + const { result, waitFor } = renderHook(() => useAuditItems(), { + wrapper: ({ children }) => ( + + { + if (methodName === 'license:getModules') { + return [] as any; + } + + throw new Error('Method not mocked'); + }} + > + + + {children} + + + + + ), + }); + + await waitFor(() => Boolean(result.all.length > 1)); + expect(result.current).toEqual([]); +}); + +it('should return an empty array if have license and not have permissions', async () => { + const { result, waitFor } = renderHook(() => useAuditItems(), { + wrapper: ({ children }) => ( + + { + if (methodName === 'license:getModules') { + return ['auditing'] as any; + } + + throw new Error('Method not mocked'); + }} + > + + + {children} + + + + + ), + }); + + await waitFor(() => Boolean(result.all.length > 1)); + expect(result.current).toEqual([]); +}); + +it('should return auditItems if have license and permissions', async () => { + const { result, waitFor } = renderHook(() => useAuditItems(), { + wrapper: ({ children }) => ( + + { + if (methodName === 'license:getModules') { + return ['auditing'] as any; + } + + throw new Error('Method not mocked'); + }} + > + + + {children} + + + + + ), + }); + + await waitFor(() => Boolean(result.current.length)); + expect(result.current[0]).toEqual( + expect.objectContaining({ + id: 'messages', + }), + ); + + expect(result.current[1]).toEqual( + expect.objectContaining({ + id: 'auditLog', + }), + ); +}); + +it('should return auditMessages item if have license and can-audit permission', async () => { + const { result, waitFor } = renderHook(() => useAuditItems(), { + wrapper: ({ children }) => ( + + { + if (methodName === 'license:getModules') { + return ['auditing'] as any; + } + + throw new Error('Method not mocked'); + }} + > + + + {children} + + + + + ), + }); + + await waitFor(() => Boolean(result.current.length)); + expect(result.current[0]).toEqual( + expect.objectContaining({ + id: 'messages', + }), + ); +}); + +it('should return audiLogs item if have license and can-audit-log permission', async () => { + const { result, waitFor } = renderHook(() => useAuditItems(), { + wrapper: ({ children }) => ( + + { + if (methodName === 'license:getModules') { + return ['auditing'] as any; + } + + throw new Error('Method not mocked'); + }} + > + + + {children} + + + + + ), + }); + + await waitFor(() => Boolean(result.current.length)); + expect(result.current[0]).toEqual( + expect.objectContaining({ + id: 'auditLog', + }), + ); +}); diff --git a/apps/meteor/client/views/hooks/useUpgradeTabParams.ts b/apps/meteor/client/views/hooks/useUpgradeTabParams.ts index 13cb2850d836..e051b69db8fa 100644 --- a/apps/meteor/client/views/hooks/useUpgradeTabParams.ts +++ b/apps/meteor/client/views/hooks/useUpgradeTabParams.ts @@ -13,7 +13,7 @@ export const useUpgradeTabParams = (): { tabType: UpgradeTabVariant | false; tri const { data: registrationStatusData, isSuccess: isSuccessRegistrationStatus } = useRegistrationStatus(); const registered = registrationStatusData?.registrationStatus?.workspaceRegistered ?? false; - const hasValidLicense = licensesData?.licenses.some((licence) => licence.modules.length > 0) ?? false; + const hasValidLicense = licensesData?.licenses.some((license) => license.modules.length > 0) ?? false; const hadExpiredTrials = cloudWorkspaceHadTrial ?? false; const trialLicense = licensesData?.licenses?.find(({ meta }) => meta?.trial); diff --git a/apps/meteor/jest.client.config.ts b/apps/meteor/jest.config.ts similarity index 100% rename from apps/meteor/jest.client.config.ts rename to apps/meteor/jest.config.ts diff --git a/apps/meteor/package.json b/apps/meteor/package.json index ffef9505b2e6..f3e19d15a50c 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -39,7 +39,7 @@ "testapi": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' mocha --config ./.mocharc.api.js", "testunit": "npm run .testunit:definition && npm run .testunit:client && npm run .testunit:server", ".testunit:server": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' mocha --config ./.mocharc.js", - ".testunit:client": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' mocha --config ./.mocharc.client.js --exit", + ".testunit:client": "jest && TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' mocha --config ./.mocharc.client.js --exit", ".testunit:definition": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' mocha --config ./.mocharc.definition.js", "testunit-watch": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' mocha --watch --config ./.mocharc.js", "test": "npm run testapi && npm run testui", diff --git a/packages/mock-providers/src/MockedModalContext.tsx b/packages/mock-providers/src/MockedModalContext.tsx new file mode 100644 index 000000000000..4654b55ba135 --- /dev/null +++ b/packages/mock-providers/src/MockedModalContext.tsx @@ -0,0 +1,20 @@ +import type { ReactNode } from 'react'; +import React from 'react'; +import { ModalContext } from '@rocket.chat/ui-contexts'; + +export const MockedModalContext = ({ children }: { children: React.ReactNode }) => { + const [currentModal, setCurrentModal] = React.useState(null); + + return ( + + {children} + + ); +}; diff --git a/packages/mock-providers/src/MockedServerContext.tsx b/packages/mock-providers/src/MockedServerContext.tsx index 6b23664f8167..32b9fb6068f5 100644 --- a/packages/mock-providers/src/MockedServerContext.tsx +++ b/packages/mock-providers/src/MockedServerContext.tsx @@ -1,20 +1,25 @@ import React from 'react'; import type { Serialized } from '@rocket.chat/core-typings'; import type { Method, OperationParams, OperationResult, PathPattern, UrlParams } from '@rocket.chat/rest-typings'; -import type { ServerMethodName, ServerMethodParameters } from '@rocket.chat/ui-contexts'; +import type { ServerMethodName, ServerMethodParameters, ServerMethodReturn } from '@rocket.chat/ui-contexts'; import { ServerContext } from '@rocket.chat/ui-contexts'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; export const MockedServerContext = ({ handleRequest, + handleMethod, children, }: { - handleRequest: (args: { + handleRequest?: (args: { method: TMethod; pathPattern: TPathPattern; keys: UrlParams; params: OperationParams; }) => Promise>>; + handleMethod?: ( + methodName: MethodName, + ...args: ServerMethodParameters + ) => Promise>; children: React.ReactNode; }): any => { const [queryClient] = React.useState(() => new QueryClient()); @@ -23,15 +28,16 @@ export const MockedServerContext = ({ value={ { absoluteUrl: (path: string) => `http://localhost:3000/${path}`, - callMethod: (_methodName: MethodName, ..._args: ServerMethodParameters) => - Promise.reject('mock not implemented'), + callMethod: (methodName: MethodName, ...args: ServerMethodParameters) => { + return handleMethod?.(methodName, ...args); + }, callEndpoint: async (args: { method: TMethod; pathPattern: TPathPattern; keys: UrlParams; params: OperationParams; }) => { - return handleRequest(args); + return handleRequest?.(args); }, getStream: () => () => undefined, } as any diff --git a/packages/mock-providers/src/index.ts b/packages/mock-providers/src/index.ts new file mode 100644 index 000000000000..602316cbdd72 --- /dev/null +++ b/packages/mock-providers/src/index.ts @@ -0,0 +1,5 @@ +export * from './MockedAuthorizationContext'; +export * from './MockedModalContext'; +export * from './MockedServerContext'; +export * from './MockedSettingsContext'; +export * from './MockedUserContext'; diff --git a/packages/ui-client/src/hooks/useFeaturePreviewList.spec.tsx b/packages/ui-client/src/hooks/useFeaturePreviewList.spec.tsx index 5e1aacd7197b..2de617554115 100644 --- a/packages/ui-client/src/hooks/useFeaturePreviewList.spec.tsx +++ b/packages/ui-client/src/hooks/useFeaturePreviewList.spec.tsx @@ -71,3 +71,36 @@ it('should return 0 unseen features', () => { }), ); }); + +it('should ignore removed feature previews', () => { + const { result } = renderHook(() => useFeaturePreviewList(), { + wrapper: ({ children }) => ( + + + {children} + + + ), + }); + + expect(result.current).toEqual( + expect.objectContaining({ + featurePreviewEnabled: true, + unseenFeatures: defaultFeaturesPreview.length, + features: defaultFeaturesPreview, + }), + ); +}); From 3fb21241667a4b5f244c26c813c2cc5394154b3d Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Tue, 18 Jul 2023 19:57:01 +0530 Subject: [PATCH 03/14] fix: misleading of 'total' in team members & members fixed (#29090) Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com> Co-authored-by: Hugo Costa <20212776+hugocostadev@users.noreply.github.com> --- .changeset/lazy-ghosts-design.md | 5 +++++ .../views/room/contextualBar/RoomMembers/RoomMembers.tsx | 8 ++------ apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 .changeset/lazy-ghosts-design.md diff --git a/.changeset/lazy-ghosts-design.md b/.changeset/lazy-ghosts-design.md new file mode 100644 index 000000000000..080e9986cebb --- /dev/null +++ b/.changeset/lazy-ghosts-design.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixed misleading of 'total' in team members list inside Channel diff --git a/apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembers.tsx b/apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembers.tsx index 780f17084d59..95f2c43d1a95 100644 --- a/apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembers.tsx +++ b/apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembers.tsx @@ -120,15 +120,11 @@ const RoomMembers = ({ {!loading && members.length <= 0 && } - {!loading && members && members.length > 0 && ( + {!loading && members.length > 0 && ( <> - {t('Showing')}: {members.length} - - - - {t('Total')}: {total} + {t('Showing_current_of_total', { current: members.length, total })} diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 5b23d85fc71d..154bf6af2d6e 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -4640,6 +4640,7 @@ "Show_video": "Show video", "Showing": "Showing", "Showing_archived_results": "

Showing %s archived results

", + "Showing_current_of_total":"Showing {{current}} of {{total}}", "Showing_online_users": "Showing: {{total_showing}}, Online: {{online}}, Total: {{total}} users", "Showing_results": "

Showing %s results

", "Showing_results_of": "Showing results %s - %s of %s", From 817d29b4765ff63ca7ce9e0356a77ec9278a1a24 Mon Sep 17 00:00:00 2001 From: Tiago Evangelista Pinto Date: Tue, 18 Jul 2023 11:27:10 -0300 Subject: [PATCH 04/14] regression: Calling inexistent functions AppMenu on action change (#29834) Co-authored-by: Tasso Evangelista Co-authored-by: Guilherme Gazzo --- apps/meteor/client/views/marketplace/AppMenu.js | 4 +++- apps/meteor/ee/client/apps/communication/websockets.js | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/meteor/client/views/marketplace/AppMenu.js b/apps/meteor/client/views/marketplace/AppMenu.js index b243dde200bd..6f90781e6101 100644 --- a/apps/meteor/client/views/marketplace/AppMenu.js +++ b/apps/meteor/client/views/marketplace/AppMenu.js @@ -14,8 +14,10 @@ import semver from 'semver'; import WarningModal from '../../components/WarningModal'; import IframeModal from './IframeModal'; import UninstallGrandfatheredAppModal from './components/UninstallGrandfatheredAppModal/UninstallGrandfatheredAppModal'; -import { appEnabledStatuses, handleAPIError, appButtonProps, warnEnableDisableApp } from './helpers'; +import { appEnabledStatuses, appButtonProps } from './helpers'; +import { handleAPIError } from './helpers/handleAPIError'; import { marketplaceActions } from './helpers/marketplaceActions'; +import { warnEnableDisableApp } from './helpers/warnEnableDisableApp'; import { useAppInstallationHandler } from './hooks/useAppInstallationHandler'; import { useAppsCountQuery } from './hooks/useAppsCountQuery'; import { useOpenAppPermissionsReviewModal } from './hooks/useOpenAppPermissionsReviewModal'; diff --git a/apps/meteor/ee/client/apps/communication/websockets.js b/apps/meteor/ee/client/apps/communication/websockets.js index e8060539a665..932fd062168f 100644 --- a/apps/meteor/ee/client/apps/communication/websockets.js +++ b/apps/meteor/ee/client/apps/communication/websockets.js @@ -35,7 +35,6 @@ export class AppWebsocketReceiver extends Emitter { sdk.stream('apps', [AppEvents.COMMAND_UPDATED], this.onCommandAddedOrUpdated); sdk.stream('apps', [AppEvents.COMMAND_REMOVED], this.onCommandRemovedOrDisabled); sdk.stream('apps', [AppEvents.COMMAND_DISABLED], this.onCommandRemovedOrDisabled); - sdk.stream('apps', [AppEvents.ACTIONS_CHANGED], this.onActionsChanged); } registerListener(event, listener) { @@ -70,6 +69,4 @@ export class AppWebsocketReceiver extends Emitter { onCommandRemovedOrDisabled = (command) => { delete slashCommands.commands[command]; }; - - // onActionsChanged = () => loadButtons(); } From 682d0bc05a5c56a7f2364d25d761b35947f004cc Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Tue, 18 Jul 2023 21:07:00 +0530 Subject: [PATCH 05/14] fix: Time format of Retention Policy (#29651) Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com> --- .changeset/friendly-glasses-mate.md | 5 +++++ .../client/components/InfoPanel/RetentionPolicyCallout.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/friendly-glasses-mate.md diff --git a/.changeset/friendly-glasses-mate.md b/.changeset/friendly-glasses-mate.md new file mode 100644 index 000000000000..6a7a7b4f8546 --- /dev/null +++ b/.changeset/friendly-glasses-mate.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': minor +--- + +fix: Time format of Retention Policy diff --git a/apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.tsx b/apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.tsx index 9e261c88af77..27202afa496c 100644 --- a/apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.tsx +++ b/apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.tsx @@ -13,7 +13,7 @@ type RetentionPolicyCalloutProps = { const RetentionPolicyCallout: FC = ({ filesOnlyDefault, excludePinnedDefault, maxAgeDefault }) => { const t = useTranslation(); - const time = useFormattedRelativeTime(maxAgeDefault * 1000 * 60 * 60 * 24); + const time = useFormattedRelativeTime(maxAgeDefault); return ( From 0cb3c71d86b06b3880751c0c7d3325ed8e778e49 Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Tue, 18 Jul 2023 13:35:52 -0300 Subject: [PATCH 06/14] chore: Normalize `Contextualbar` footer buttons (#29789) --- .../admin/customEmoji/AddCustomEmoji.tsx | 84 ++-- .../admin/customEmoji/EditCustomEmoji.tsx | 93 ++-- .../admin/customSounds/AddCustomSound.tsx | 72 ++-- .../views/admin/customSounds/EditSound.tsx | 82 ++-- .../customUserStatus/CustomUserStatusForm.tsx | 80 ++-- .../client/views/admin/rooms/EditRoom.tsx | 274 ++++++------ .../client/views/admin/users/AddUser.js | 25 +- .../client/views/admin/users/EditUser.js | 27 +- .../client/views/admin/users/InviteUsers.tsx | 45 +- .../client/views/admin/users/UserForm.js | 400 +++++++++--------- .../Info/EditRoomInfo/EditChannel.js | 40 +- 11 files changed, 611 insertions(+), 611 deletions(-) diff --git a/apps/meteor/client/views/admin/customEmoji/AddCustomEmoji.tsx b/apps/meteor/client/views/admin/customEmoji/AddCustomEmoji.tsx index 8accf5c5e56c..6d12c25f5239 100644 --- a/apps/meteor/client/views/admin/customEmoji/AddCustomEmoji.tsx +++ b/apps/meteor/client/views/admin/customEmoji/AddCustomEmoji.tsx @@ -3,7 +3,7 @@ import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement, ChangeEvent } from 'react'; import React, { useCallback, useState } from 'react'; -import { ContextualbarScrollableContent } from '../../../components/Contextualbar'; +import { ContextualbarScrollableContent, ContextualbarFooter } from '../../../components/Contextualbar'; import { useEndpointUpload } from '../../../hooks/useEndpointUpload'; import { useFileInput } from '../../../hooks/useFileInput'; @@ -75,48 +75,48 @@ const AddCustomEmoji = ({ close, onChange, ...props }: AddCustomEmojiProps): Rea }; return ( - - - {t('Name')} - - - - {errors.name && {t('error-the-field-is-required', { field: t('Name') })}} - - - {t('Aliases')} - - - - {errors.aliases && {t('Custom_Emoji_Error_Same_Name_And_Alias')}} - - - - {t('Custom_Emoji')} - - - {errors.emoji && {t('error-the-field-is-required', { field: t('Custom_Emoji') })}} - {newEmojiPreview && ( - - - - - - )} - - - - - - - - - - + + {errors.emoji && {t('error-the-field-is-required', { field: t('Custom_Emoji') })}} + {newEmojiPreview && ( + + + + + + )} + + + + + + + + + ); }; diff --git a/apps/meteor/client/views/admin/customEmoji/EditCustomEmoji.tsx b/apps/meteor/client/views/admin/customEmoji/EditCustomEmoji.tsx index 19081fe6e901..188802bb7c87 100644 --- a/apps/meteor/client/views/admin/customEmoji/EditCustomEmoji.tsx +++ b/apps/meteor/client/views/admin/customEmoji/EditCustomEmoji.tsx @@ -3,7 +3,7 @@ import { useSetModal, useToastMessageDispatch, useAbsoluteUrl, useTranslation } import type { FC, ChangeEvent } from 'react'; import React, { useCallback, useState, useMemo, useEffect } from 'react'; -import { ContextualbarScrollableContent } from '../../../components/Contextualbar'; +import { ContextualbarScrollableContent, ContextualbarFooter } from '../../../components/Contextualbar'; import GenericModal from '../../../components/GenericModal'; import { useEndpointAction } from '../../../hooks/useEndpointAction'; import { useEndpointUpload } from '../../../hooks/useEndpointUpload'; @@ -130,50 +130,53 @@ const EditCustomEmoji: FC = ({ close, onChange, data, ...p }; return ( - - - - {t('Name')} - - - - {errors.name && {t('error-the-field-is-required', { field: t('Name') })}} - - - {t('Aliases')} - - - - {errors.aliases && {t('Custom_Emoji_Error_Same_Name_And_Alias')}} - - - - {t('Custom_Emoji')} - - - {newEmojiPreview && ( - - - - - - )} - - - - - - - - - - - + <> + + + + {t('Name')} + + + + {errors.name && {t('error-the-field-is-required', { field: t('Name') })}} + + + {t('Aliases')} + + + + {errors.aliases && {t('Custom_Emoji_Error_Same_Name_And_Alias')}} + + + + {t('Custom_Emoji')} + + + {newEmojiPreview && ( + + + + + + )} + + + + + + + + + + + + + ); }; diff --git a/apps/meteor/client/views/admin/customSounds/AddCustomSound.tsx b/apps/meteor/client/views/admin/customSounds/AddCustomSound.tsx index 986422ea7c7c..35feae9113cc 100644 --- a/apps/meteor/client/views/admin/customSounds/AddCustomSound.tsx +++ b/apps/meteor/client/views/admin/customSounds/AddCustomSound.tsx @@ -3,7 +3,7 @@ import { useToastMessageDispatch, useMethod, useTranslation } from '@rocket.chat import type { ReactElement, FormEvent } from 'react'; import React, { useState, useCallback } from 'react'; -import { ContextualbarScrollableContent } from '../../../components/Contextualbar'; +import { ContextualbarScrollableContent, ContextualbarFooter } from '../../../components/Contextualbar'; import { useFileInput } from '../../../hooks/useFileInput'; import { validate, createSoundData } from './lib'; @@ -81,41 +81,41 @@ const AddCustomSound = ({ goToNew, close, onChange, ...props }: AddCustomSoundPr }, [dispatchToastMessage, goToNew, name, onChange, saveAction, sound, t]); return ( - - - {t('Name')} - - ): void => setName(e.currentTarget.value)} - placeholder={t('Name')} - /> - - - - {t('Sound_File_mp3')} - - - - {sound?.name || t('None')} - - - - - - - - - - - - + <> + + + {t('Name')} + + ): void => setName(e.currentTarget.value)} + placeholder={t('Name')} + /> + + + + {t('Sound_File_mp3')} + + + + {sound?.name || t('None')} + + + + + + + + + + + ); }; diff --git a/apps/meteor/client/views/admin/customSounds/EditSound.tsx b/apps/meteor/client/views/admin/customSounds/EditSound.tsx index fdf45739cf7a..19e3958c74a0 100644 --- a/apps/meteor/client/views/admin/customSounds/EditSound.tsx +++ b/apps/meteor/client/views/admin/customSounds/EditSound.tsx @@ -3,7 +3,7 @@ import { useSetModal, useToastMessageDispatch, useMethod, useTranslation } from import type { ReactElement, SyntheticEvent } from 'react'; import React, { useCallback, useState, useMemo, useEffect } from 'react'; -import { ContextualbarScrollableContent } from '../../../components/Contextualbar'; +import { ContextualbarScrollableContent, ContextualbarFooter } from '../../../components/Contextualbar'; import GenericModal from '../../../components/GenericModal'; import { useFileInput } from '../../../hooks/useFileInput'; import { validate, createSoundData } from './lib'; @@ -117,49 +117,43 @@ function EditSound({ close, onChange, data, ...props }: EditSoundProps): ReactEl const [clickUpload] = useFileInput(handleChangeFile, 'audio/mp3'); return ( - - - {t('Name')} - - ): void => setName(e.currentTarget.value)} - placeholder={t('Name')} - /> - - - - - {t('Sound_File_mp3')} - - - - {sound?.name || 'none'} - - - - - - - - - - - - - - - - - - - - + <> + + + {t('Name')} + + ): void => setName(e.currentTarget.value)} + placeholder={t('Name')} + /> + + + + {t('Sound_File_mp3')} + + + + {sound?.name || 'none'} + + + + + + + + + + + + + + ); } diff --git a/apps/meteor/client/views/admin/customUserStatus/CustomUserStatusForm.tsx b/apps/meteor/client/views/admin/customUserStatus/CustomUserStatusForm.tsx index 2c21db402199..f85172533ee5 100644 --- a/apps/meteor/client/views/admin/customUserStatus/CustomUserStatusForm.tsx +++ b/apps/meteor/client/views/admin/customUserStatus/CustomUserStatusForm.tsx @@ -1,12 +1,13 @@ import type { IUserStatus } from '@rocket.chat/core-typings'; import type { SelectOption } from '@rocket.chat/fuselage'; import { FieldGroup, Button, ButtonGroup, TextInput, Field, Select, Icon } from '@rocket.chat/fuselage'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useSetModal, useRoute, useToastMessageDispatch, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React, { useCallback } from 'react'; import { useForm, Controller } from 'react-hook-form'; -import { ContextualbarScrollableContent } from '../../../components/Contextualbar'; +import { ContextualbarScrollableContent, ContextualbarFooter } from '../../../components/Contextualbar'; import GenericModal from '../../../components/GenericModal'; type CustomUserStatusFormProps = { @@ -21,6 +22,7 @@ const CustomUserStatusForm = ({ onClose, onReload, status }: CustomUserStatusFor const setModal = useSetModal(); const route = useRoute('user-status'); const dispatchToastMessage = useToastMessageDispatch(); + const formId = useUniqueId(); const { register, @@ -86,51 +88,47 @@ const CustomUserStatusForm = ({ onClose, onReload, status }: CustomUserStatusFor ]; return ( - - - - {t('Name')} - - - - {errors?.name && {t('error-the-field-is-required', { field: t('Name') })}} - - - {t('Presence')} - - } + /> + {errors?.statusType && {t('error-the-field-is-required', { field: t('Presence') })}} + + + + + + + + {_id && ( + + + )} - - + + ); }; diff --git a/apps/meteor/client/views/admin/rooms/EditRoom.tsx b/apps/meteor/client/views/admin/rooms/EditRoom.tsx index f8dd530f17ed..8f91054ebdf7 100644 --- a/apps/meteor/client/views/admin/rooms/EditRoom.tsx +++ b/apps/meteor/client/views/admin/rooms/EditRoom.tsx @@ -7,7 +7,7 @@ import type { ReactElement } from 'react'; import React, { useState, useMemo } from 'react'; import { RoomSettingsEnum } from '../../../../definition/IRoomTypeConfig'; -import { ContextualbarScrollableContent } from '../../../components/Contextualbar'; +import { ContextualbarScrollableContent, ContextualbarFooter } from '../../../components/Contextualbar'; import GenericModal from '../../../components/GenericModal'; import RoomAvatarEditor from '../../../components/avatar/RoomAvatarEditor'; import { useEndpointAction } from '../../../hooks/useEndpointAction'; @@ -208,156 +208,152 @@ const EditRoom = ({ room, onChange, onDelete }: EditRoomProps): ReactElement => }); return ( - e.preventDefault())}> - {room.t !== 'd' && ( - - - - )} - - {t('Name')} - - - - - {room.t !== 'd' && ( - <> - {room.u && ( - - {t('Owner')} - - {room.u?.username} - - - )} - {canViewDescription && ( - - {t('Description')} - - - - - )} - {canViewAnnouncement && ( - - {t('Announcement')} - - - - - )} - {canViewTopic && ( - - {t('Topic')} - - - - - )} - {canViewType && ( - - - {t('Private')} + <> + e.preventDefault())}> + {room.t !== 'd' && ( + + + + )} + + {t('Name')} + + + + + {room.t !== 'd' && ( + <> + {room.u && ( + + {t('Owner')} - + {room.u?.username} - - {t('Just_invited_people_can_access_this_channel')} - - )} - {canViewReadOnly && ( - - - {t('Read_only')} + + )} + {canViewDescription && ( + + {t('Description')} - + - - {t('Only_authorized_users_can_write_new_messages')} - - )} - {readOnly && ( - - - {t('React_when_read_only')} + + )} + {canViewAnnouncement && ( + + {t('Announcement')} - + - - {t('React_when_read_only_changed_successfully')} - - )} - {canViewArchived && ( - - - {t('Room_archivation_state_true')} + + )} + {canViewTopic && ( + + {t('Topic')} - + - - - )} - - )} - - - {t('Default')} - - - - - - - - {t('Favorite')} - - - - - - - - {t('Featured')} - - - - - - - - - - - - + + )} + {canViewType && ( + + + {t('Private')} + + + + + {t('Just_invited_people_can_access_this_channel')} + + )} + {canViewReadOnly && ( + + + {t('Read_only')} + + + + + {t('Only_authorized_users_can_write_new_messages')} + + )} + {readOnly && ( + + + {t('React_when_read_only')} + + + + + {t('React_when_read_only_changed_successfully')} + + )} + {canViewArchived && ( + + + {t('Room_archivation_state_true')} + + + + + + )} + + )} + + + {t('Default')} + + + + + + + + {t('Favorite')} + + + - - - - - + + + + - - - + + + ); }; diff --git a/apps/meteor/client/views/admin/users/AddUser.js b/apps/meteor/client/views/admin/users/AddUser.js index e7d439317cb0..1260ededbb0b 100644 --- a/apps/meteor/client/views/admin/users/AddUser.js +++ b/apps/meteor/client/views/admin/users/AddUser.js @@ -1,10 +1,11 @@ -import { Field, Box, Button } from '@rocket.chat/fuselage'; +import { ButtonGroup, Button } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useEndpoint, useRoute, useSetting, useTranslation } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; import React, { useMemo, useCallback, useState } from 'react'; import { parseCSV } from '../../../../lib/utils/parseCSV'; +import { ContextualbarFooter } from '../../../components/Contextualbar'; import { useEndpointAction } from '../../../hooks/useEndpointAction'; import { useForm } from '../../../hooks/useForm'; import UserForm from './UserForm'; @@ -119,18 +120,16 @@ const AddUser = ({ onReload, ...props }) => { const append = useMemo( () => ( - - - - - - - - + + + + + + ), [hasUnsavedChanges, reset, t, handleSave], ); diff --git a/apps/meteor/client/views/admin/users/EditUser.js b/apps/meteor/client/views/admin/users/EditUser.js index ae216dd4114a..59e37674685b 100644 --- a/apps/meteor/client/views/admin/users/EditUser.js +++ b/apps/meteor/client/views/admin/users/EditUser.js @@ -1,8 +1,9 @@ -import { Box, Field, Margins, Button } from '@rocket.chat/fuselage'; +import { ButtonGroup, Button } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useRoute, useTranslation } from '@rocket.chat/ui-contexts'; import React, { useMemo, useState, useCallback } from 'react'; +import { ContextualbarFooter } from '../../../components/Contextualbar'; import UserAvatarEditor from '../../../components/avatar/UserAvatarEditor'; import { useEndpointAction } from '../../../hooks/useEndpointAction'; import { useEndpointUpload } from '../../../hooks/useEndpointUpload'; @@ -127,20 +128,16 @@ function EditUser({ data, roles, onReload, ...props }) { const append = useMemo( () => ( - - - - - - - - - - + + + + + + ), [handleSave, canSaveOrReset, reset, t], ); diff --git a/apps/meteor/client/views/admin/users/InviteUsers.tsx b/apps/meteor/client/views/admin/users/InviteUsers.tsx index 70b9878bd989..cad5e8c93041 100644 --- a/apps/meteor/client/views/admin/users/InviteUsers.tsx +++ b/apps/meteor/client/views/admin/users/InviteUsers.tsx @@ -1,10 +1,21 @@ -import { Box, Button, Icon, States, StatesAction, StatesActions, StatesSubtitle, StatesTitle, TextAreaInput } from '@rocket.chat/fuselage'; +import { + Box, + Button, + ButtonGroup, + Icon, + States, + StatesAction, + StatesActions, + StatesSubtitle, + StatesTitle, + TextAreaInput, +} from '@rocket.chat/fuselage'; import { useTranslation, useRoute } from '@rocket.chat/ui-contexts'; import type { ReactElement, ChangeEvent, ComponentProps } from 'react'; import React, { useCallback, useState } from 'react'; import { validateEmail } from '../../../../lib/emailValidator'; -import { ContextualbarScrollableContent } from '../../../components/Contextualbar'; +import { ContextualbarScrollableContent, ContextualbarFooter } from '../../../components/Contextualbar'; import { useSendInvitationEmailMutation } from './hooks/useSendInvitationEmailMutation'; import { useSmtpConfig } from './hooks/useSmtpConfig'; @@ -39,18 +50,24 @@ const InviteUsers = (props: InviteUsersProps): ReactElement => { } return ( - - - {t('Send_invitation_email')} - - - {t('Send_invitation_email_info')} - - ): void => setText(e.currentTarget.value)} /> - - + <> + + + {t('Send_invitation_email')} + + + {t('Send_invitation_email_info')} + + ): void => setText(e.currentTarget.value)} /> + + + + + + + ); }; diff --git a/apps/meteor/client/views/admin/users/UserForm.js b/apps/meteor/client/views/admin/users/UserForm.js index b0ce0cfdfbf6..696ed87d28dc 100644 --- a/apps/meteor/client/views/admin/users/UserForm.js +++ b/apps/meteor/client/views/admin/users/UserForm.js @@ -68,213 +68,162 @@ export default function UserForm({ formValues, formHandlers, availableRoles, app }, [watch, handleCustomFields]); return ( - e.preventDefault(), [])} autoComplete='off'> - - {prepend} - {useMemo( - () => ( - - {t('Name')} - - - - {errors && errors.name && {errors.name}} - - ), - [t, name, handleName, errors], - )} - {useMemo( - () => ( - - {t('Username')} - - } - /> - - {errors && errors.username && {errors.username}} - - ), - [t, username, handleUsername, errors], - )} - {useMemo( - () => ( - - {t('Email')} - - 0 ? 'error' : undefined} - onChange={handleEmail} - addon={} - /> - - {errors && errors.email && {errors.email}} - - - - {t('Verified')} - - - - - - ), - [t, email, handleEmail, verified, handleVerified, errors], - )} - {useMemo( - () => ( - - {t('StatusMessage')} - - } /> - - - ), - [t, statusText, handleStatusText], - )} - {useMemo( - () => ( - - {t('Bio')} - - } - /> - - - ), - [bio, handleBio, t], - )} - {useMemo( - () => ( - - {t('Nickname')} - - } - /> - - - ), - [nickname, handleNickname, t], - )} - - - e.preventDefault(), [])} autoComplete='off'> - {useMemo( - () => - !setRandomPassword && ( + <> + e.preventDefault(), [])} autoComplete='off'> + + {prepend} + {useMemo( + () => ( + + {t('Name')} + + + + {errors && errors.name && {errors.name}} + + ), + [t, name, handleName, errors], + )} + {useMemo( + () => ( - {t('Password')} + {t('Username')} - } - autoComplete='new-password' + value={username} + onChange={handleUsername} + addon={} /> - {errors && errors.password && {errors.password}} + {errors && errors.username && {errors.username}} ), - [t, password, handlePassword, errors, setRandomPassword], - )} - {useMemo( - () => ( - - - - - {t('Require_password_change')} - - ( + + {t('Email')} + + 0 ? 'error' : undefined} + onChange={handleEmail} + addon={} /> - - - - ), - [t, setRandomPassword, requirePasswordChange, handleRequirePasswordChange], - )} - {useMemo( - () => ( - - - - - {t('Set_random_password_and_send_by_email')} + + {errors && errors.email && {errors.email}} + + + + {t('Verified')} + + - - - - {!isSmtpEnabled && ( - - )} - - ), - [t, setRandomPassword, handleSetRandomPassword, isSmtpEnabled], - )} - {useMemo( - () => ( - - {t('Roles')} - - - - - ), - [availableRoles, handleRoles, roles, t], - )} - {useMemo( - () => - handleJoinDefaultChannels && ( + + + ), + [t, email, handleEmail, verified, handleVerified, errors], + )} + {useMemo( + () => ( + + {t('StatusMessage')} + + } /> + + + ), + [t, statusText, handleStatusText], + )} + {useMemo( + () => ( + + {t('Bio')} + + } + /> + + + ), + [bio, handleBio, t], + )} + {useMemo( + () => ( + + {t('Nickname')} + + } + /> + + + ), + [nickname, handleNickname, t], + )} + + + e.preventDefault(), [])} autoComplete='off'> + {useMemo( + () => + !setRandomPassword && ( + + {t('Password')} + + } + autoComplete='new-password' + /> + + {errors && errors.password && {errors.password}} + + ), + [t, password, handlePassword, errors, setRandomPassword], + )} + {useMemo( + () => ( - {t('Join_default_channels')} + {t('Require_password_change')} - + ), - [handleJoinDefaultChannels, t, joinDefaultChannels], - )} - {useMemo( - () => - handleSendWelcomeEmail && ( + [t, setRandomPassword, requirePasswordChange, handleRequirePasswordChange], + )} + {useMemo( + () => ( - {t('Send_welcome_email')} + {t('Set_random_password_and_send_by_email')} - + {!isSmtpEnabled && ( @@ -282,21 +231,74 @@ export default function UserForm({ formValues, formHandlers, availableRoles, app )} ), - [handleSendWelcomeEmail, t, sendWelcomeEmail, isSmtpEnabled], - )} - {useMemo( - () => - customFieldsMetadata && ( - <> - - {t('Custom_Fields')} - - + [t, setRandomPassword, handleSetRandomPassword, isSmtpEnabled], + )} + {useMemo( + () => ( + + {t('Roles')} + + + + ), - [customFieldsMetadata, control, t], - )} - {append} - - + [availableRoles, handleRoles, roles, t], + )} + {useMemo( + () => + handleJoinDefaultChannels && ( + + + + + {t('Join_default_channels')} + + + + + + ), + [handleJoinDefaultChannels, t, joinDefaultChannels], + )} + {useMemo( + () => + handleSendWelcomeEmail && ( + + + + + {t('Send_welcome_email')} + + + + + {!isSmtpEnabled && ( + + )} + + ), + [handleSendWelcomeEmail, t, sendWelcomeEmail, isSmtpEnabled], + )} + {useMemo( + () => + customFieldsMetadata && ( + <> + + {t('Custom_Fields')} + + + ), + [customFieldsMetadata, control, t], + )} + + + {append} + ); } diff --git a/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditChannel.js b/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditChannel.js index 90234643f353..0b46f7077902 100644 --- a/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditChannel.js +++ b/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditChannel.js @@ -37,6 +37,7 @@ import { ContextualbarTitle, ContextualbarClose, ContextualbarScrollableContent, + ContextualbarFooter, } from '../../../../../components/Contextualbar'; import GenericModal from '../../../../../components/GenericModal'; import RawText from '../../../../../components/RawText'; @@ -304,7 +305,6 @@ function EditChannel({ room, onClickClose, onClickBack }) { {room.teamId ? t('edit-team') : t('edit-room')} {onClickClose && } - e.preventDefault())}> @@ -489,29 +489,23 @@ function EditChannel({ room, onClickClose, onClickBack }) { )} - - - - - - - - - - - - - - - + + + + + + + + + ); } From 6f820d5fc03b4d2eb28a250db425c6d84804429e Mon Sep 17 00:00:00 2001 From: Tasso Evangelista Date: Tue, 18 Jul 2023 13:45:04 -0300 Subject: [PATCH 07/14] refactor: Spread REST endpoints and methods types across EE code (#29849) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- apps/meteor/client/main.ts | 1 - .../api-enterprise/server/canned-responses.ts | 36 ++++++ .../server/api/business-hours.ts | 16 +++ .../livechat-enterprise/server/api/units.ts | 21 ++++ .../CannedResponseEditWithData.tsx | 1 - apps/meteor/ee/definition/.eslintrc.json | 3 - apps/meteor/ee/definition/index.ts | 2 - apps/meteor/ee/definition/methods/index.ts | 1 - apps/meteor/ee/definition/methods/license.ts | 10 -- apps/meteor/ee/definition/rest/index.ts | 7 -- apps/meteor/ee/definition/rest/v1/chat.ts | 34 ------ .../definition/rest/v1/engagementDashboard.ts | 111 ------------------ .../rest/v1/omnichannel/businessHours.ts | 15 --- .../rest/v1/omnichannel/businessUnits.ts | 25 ---- .../rest/v1/omnichannel/cannedResponses.ts | 36 ------ .../definition/rest/v1/omnichannel/index.ts | 3 - apps/meteor/ee/definition/rest/v1/roles.ts | 84 ------------- .../rest/v1/sessions/SessionsPaginateProps.ts | 28 ----- .../rest/v1/sessions/SessionsProps.ts | 18 --- .../ee/definition/rest/v1/sessions/index.ts | 4 - .../definition/rest/v1/sessions/sessions.ts | 29 ----- apps/meteor/ee/server/api/chat.ts | 16 +++ .../api/engagementDashboard/channels.ts | 27 +++++ .../api/engagementDashboard/messages.ts | 38 ++++++ .../server/api/engagementDashboard/users.ts | 60 ++++++++++ apps/meteor/ee/server/api/roles.ts | 85 +++++++++++++- apps/meteor/ee/server/api/sessions.ts | 70 ++++++++++- 27 files changed, 366 insertions(+), 415 deletions(-) delete mode 100644 apps/meteor/ee/definition/.eslintrc.json delete mode 100644 apps/meteor/ee/definition/index.ts delete mode 100644 apps/meteor/ee/definition/methods/index.ts delete mode 100644 apps/meteor/ee/definition/methods/license.ts delete mode 100644 apps/meteor/ee/definition/rest/index.ts delete mode 100644 apps/meteor/ee/definition/rest/v1/chat.ts delete mode 100644 apps/meteor/ee/definition/rest/v1/engagementDashboard.ts delete mode 100644 apps/meteor/ee/definition/rest/v1/omnichannel/businessHours.ts delete mode 100644 apps/meteor/ee/definition/rest/v1/omnichannel/businessUnits.ts delete mode 100644 apps/meteor/ee/definition/rest/v1/omnichannel/cannedResponses.ts delete mode 100644 apps/meteor/ee/definition/rest/v1/omnichannel/index.ts delete mode 100644 apps/meteor/ee/definition/rest/v1/roles.ts delete mode 100644 apps/meteor/ee/definition/rest/v1/sessions/SessionsPaginateProps.ts delete mode 100644 apps/meteor/ee/definition/rest/v1/sessions/SessionsProps.ts delete mode 100644 apps/meteor/ee/definition/rest/v1/sessions/index.ts delete mode 100644 apps/meteor/ee/definition/rest/v1/sessions/sessions.ts diff --git a/apps/meteor/client/main.ts b/apps/meteor/client/main.ts index ed98c06c3297..6bcf2789e819 100644 --- a/apps/meteor/client/main.ts +++ b/apps/meteor/client/main.ts @@ -1,4 +1,3 @@ -import '../ee/definition'; import '../ee/client/ecdh'; import './polyfills'; diff --git a/apps/meteor/ee/app/api-enterprise/server/canned-responses.ts b/apps/meteor/ee/app/api-enterprise/server/canned-responses.ts index 676c3e5fe6a5..55a5cd55fbe3 100644 --- a/apps/meteor/ee/app/api-enterprise/server/canned-responses.ts +++ b/apps/meteor/ee/app/api-enterprise/server/canned-responses.ts @@ -1,10 +1,46 @@ import { Meteor } from 'meteor/meteor'; import { isPOSTCannedResponsesProps, isDELETECannedResponsesProps, isCannedResponsesProps } from '@rocket.chat/rest-typings'; +import type { ILivechatDepartment, IOmnichannelCannedResponse, IUser } from '@rocket.chat/core-typings'; +import type { PaginatedResult, PaginatedRequest } from '@rocket.chat/rest-typings'; import { API } from '../../../../app/api/server'; import { findAllCannedResponses, findAllCannedResponsesFilter, findOneCannedResponse } from './lib/canned-responses'; import { getPaginationItems } from '../../../../app/api/server/helpers/getPaginationItems'; +declare module '@rocket.chat/rest-typings' { + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Endpoints { + '/v1/canned-responses': { + GET: ( + params: PaginatedRequest<{ + shortcut?: string; + text?: string; + scope?: string; + createdBy?: IUser['username']; + tags?: any; + departmentId?: ILivechatDepartment['_id']; + }>, + ) => PaginatedResult<{ + cannedResponses: IOmnichannelCannedResponse[]; + }>; + POST: (params: { + _id?: IOmnichannelCannedResponse['_id']; + shortcut: string; + text: string; + scope: string; + tags?: any; + departmentId?: ILivechatDepartment['_id']; + }) => void; + DELETE: (params: { _id: IOmnichannelCannedResponse['_id'] }) => void; + }; + '/v1/canned-responses/:_id': { + GET: () => { + cannedResponse: IOmnichannelCannedResponse; + }; + }; + } +} + API.v1.addRoute( 'canned-responses.get', { authRequired: true, permissionsRequired: ['view-canned-responses'] }, diff --git a/apps/meteor/ee/app/livechat-enterprise/server/api/business-hours.ts b/apps/meteor/ee/app/livechat-enterprise/server/api/business-hours.ts index 15d350798ac9..f0f7ea5646e6 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/api/business-hours.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/api/business-hours.ts @@ -1,7 +1,23 @@ +import type { ILivechatBusinessHour } from '@rocket.chat/core-typings'; + import { API } from '../../../../../app/api/server'; import { getPaginationItems } from '../../../../../app/api/server/helpers/getPaginationItems'; import { findBusinessHours } from '../business-hour/lib/business-hour'; +declare module '@rocket.chat/rest-typings' { + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Endpoints { + '/v1/livechat/business-hours': { + GET: (params: { name?: string; offset: number; count: number; sort: Record }) => { + businessHours: ILivechatBusinessHour[]; + count: number; + offset: number; + total: number; + }; + }; + } +} + API.v1.addRoute( 'livechat/business-hours', { authRequired: true, permissionsRequired: ['view-livechat-business-hours'] }, diff --git a/apps/meteor/ee/app/livechat-enterprise/server/api/units.ts b/apps/meteor/ee/app/livechat-enterprise/server/api/units.ts index ca7eff11aced..77e39f4780e5 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/api/units.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/api/units.ts @@ -1,9 +1,30 @@ +import type { ILivechatUnitMonitor, IOmnichannelBusinessUnit } from '@rocket.chat/core-typings'; +import type { PaginatedResult } from '@rocket.chat/rest-typings'; + import { API } from '../../../../../app/api/server'; import { findUnits, findUnitById, findUnitMonitors } from './lib/units'; import { LivechatEnterprise } from '../lib/LivechatEnterprise'; import { findAllDepartmentsAvailable, findAllDepartmentsByUnit } from '../lib/Department'; import { getPaginationItems } from '../../../../../app/api/server/helpers/getPaginationItems'; +declare module '@rocket.chat/rest-typings' { + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Endpoints { + '/v1/livechat/units/:unitId/monitors': { + GET: (params: { unitId: string }) => { monitors: ILivechatUnitMonitor[] }; + }; + '/v1/livechat/units': { + GET: (params: { text: string }) => PaginatedResult & { units: IOmnichannelBusinessUnit[] }; + POST: (params: { unitData: string; unitMonitors: string; unitDepartments: string }) => Omit; + }; + '/v1/livechat/units/:id': { + GET: () => IOmnichannelBusinessUnit | null; + POST: (params: { unitData: string; unitMonitors: string; unitDepartments: string }) => Omit; + DELETE: () => number; + }; + } +} + API.v1.addRoute( 'livechat/units/:unitId/monitors', { authRequired: true, permissionsRequired: ['manage-livechat-monitors'] }, diff --git a/apps/meteor/ee/client/omnichannel/cannedResponses/CannedResponseEditWithData.tsx b/apps/meteor/ee/client/omnichannel/cannedResponses/CannedResponseEditWithData.tsx index c2295685454a..73e39694adea 100644 --- a/apps/meteor/ee/client/omnichannel/cannedResponses/CannedResponseEditWithData.tsx +++ b/apps/meteor/ee/client/omnichannel/cannedResponses/CannedResponseEditWithData.tsx @@ -6,7 +6,6 @@ import React from 'react'; import { FormSkeleton } from '../../../../client/components/Skeleton'; import { AsyncStatePhase } from '../../../../client/hooks/useAsyncState'; import { useEndpointData } from '../../../../client/hooks/useEndpointData'; -import '../../../definition/rest'; import CannedResponseEdit from './CannedResponseEdit'; import CannedResponseEditWithDepartmentData from './CannedResponseEditWithDepartmentData'; diff --git a/apps/meteor/ee/definition/.eslintrc.json b/apps/meteor/ee/definition/.eslintrc.json deleted file mode 100644 index 03828d003760..000000000000 --- a/apps/meteor/ee/definition/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../client/.eslintrc.json" -} diff --git a/apps/meteor/ee/definition/index.ts b/apps/meteor/ee/definition/index.ts deleted file mode 100644 index ea24a13c33ae..000000000000 --- a/apps/meteor/ee/definition/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -import './methods'; -import './rest'; diff --git a/apps/meteor/ee/definition/methods/index.ts b/apps/meteor/ee/definition/methods/index.ts deleted file mode 100644 index 3986165b2481..000000000000 --- a/apps/meteor/ee/definition/methods/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './license'; diff --git a/apps/meteor/ee/definition/methods/license.ts b/apps/meteor/ee/definition/methods/license.ts deleted file mode 100644 index 9b5784596f8c..000000000000 --- a/apps/meteor/ee/definition/methods/license.ts +++ /dev/null @@ -1,10 +0,0 @@ -import '@rocket.chat/ui-contexts'; -import type { ILicenseTag } from '../../app/license/definition/ILicenseTag'; - -declare module '@rocket.chat/ui-contexts' { - // eslint-disable-next-line @typescript-eslint/naming-convention - export interface ServerMethods { - 'license:getModules': () => string[]; - 'license:getTags': () => ILicenseTag[]; - } -} diff --git a/apps/meteor/ee/definition/rest/index.ts b/apps/meteor/ee/definition/rest/index.ts deleted file mode 100644 index 1f206f8e8c52..000000000000 --- a/apps/meteor/ee/definition/rest/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -// TODO: chapter day backend - move to rest ee definitions to another package - -import './v1/engagementDashboard'; -import './v1/omnichannel'; -import './v1/sessions'; -import './v1/chat'; -import './v1/roles'; diff --git a/apps/meteor/ee/definition/rest/v1/chat.ts b/apps/meteor/ee/definition/rest/v1/chat.ts deleted file mode 100644 index dee7cadc6542..000000000000 --- a/apps/meteor/ee/definition/rest/v1/chat.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { IMessage, ReadReceipt } from '@rocket.chat/core-typings'; -import Ajv from 'ajv'; - -const ajv = new Ajv({ - coerceTypes: true, -}); - -type GetMessageReadReceiptsProps = { - messageId: IMessage['_id']; -}; - -const getMessageReadReceiptsPropsSchema = { - type: 'object', - properties: { - messageId: { - type: 'string', - }, - }, - required: ['messageId'], - additionalProperties: false, -}; - -export const isGetMessageReadReceiptsProps = ajv.compile(getMessageReadReceiptsPropsSchema); - -declare module '@rocket.chat/rest-typings' { - // eslint-disable-next-line @typescript-eslint/naming-convention - interface Endpoints { - '/v1/chat.getMessageReadReceipts': { - GET: (params: GetMessageReadReceiptsProps) => { - receipts: ReadReceipt[]; - }; - }; - } -} diff --git a/apps/meteor/ee/definition/rest/v1/engagementDashboard.ts b/apps/meteor/ee/definition/rest/v1/engagementDashboard.ts deleted file mode 100644 index 4a7a504f7731..000000000000 --- a/apps/meteor/ee/definition/rest/v1/engagementDashboard.ts +++ /dev/null @@ -1,111 +0,0 @@ -import type { IDirectMessageRoom, IRoom, IUser } from '@rocket.chat/core-typings'; - -declare module '@rocket.chat/rest-typings' { - // eslint-disable-next-line @typescript-eslint/naming-convention - interface Endpoints { - '/v1/engagement-dashboard/channels/list': { - GET: (params: { start: string; end: string; offset?: number; count?: number }) => { - channels: { - room: { - _id: IRoom['_id']; - name: IRoom['name'] | IRoom['fname']; - ts: IRoom['ts']; - t: IRoom['t']; - _updatedAt: IRoom['_updatedAt']; - usernames?: IDirectMessageRoom['usernames']; - }; - messages: number; - lastWeekMessages: number; - diffFromLastWeek: number; - }[]; - count: number; - offset: number; - total: number; - }; - }; - '/v1/engagement-dashboard/messages/origin': { - GET: (params: { start: string; end: string }) => { - origins: { - t: IRoom['t']; - messages: number; - }[]; - }; - }; - '/v1/engagement-dashboard/messages/top-five-popular-channels': { - GET: (params: { start: string; end: string }) => { - channels: { - t: IRoom['t']; - messages: number; - name: IRoom['name'] | IRoom['fname']; - usernames?: IDirectMessageRoom['usernames']; - }[]; - }; - }; - '/v1/engagement-dashboard/messages/messages-sent': { - GET: (params: { start: string; end: string }) => { - days: { day: Date; messages: number }[]; - period: { - count: number; - variation: number; - }; - yesterday: { - count: number; - variation: number; - }; - }; - }; - '/v1/engagement-dashboard/users/active-users': { - GET: (params: { start: string; end: string }) => { - month: { - day: number; - month: number; - year: number; - usersList: IUser['_id'][]; - users: number; - }[]; - }; - }; - '/v1/engagement-dashboard/users/chat-busier/weekly-data': { - GET: (params: { start: string }) => { - month: { - users: number; - day: number; - month: number; - year: number; - }[]; - }; - }; - '/v1/engagement-dashboard/users/chat-busier/hourly-data': { - GET: (params: { start: string }) => { - hours: { - users: number; - hour: number; - }[]; - }; - }; - '/v1/engagement-dashboard/users/users-by-time-of-the-day-in-a-week': { - GET: (params: { start: string; end: string }) => { - week: { - users: number; - hour: number; - day: number; - month: number; - year: number; - }[]; - }; - }; - '/v1/engagement-dashboard/users/new-users': { - GET: (params: { start: string; end: string }) => { - days: { day: Date; users: number }[]; - period: { - count: number; - variation: number; - }; - yesterday: { - count: number; - variation: number; - }; - }; - }; - } -} diff --git a/apps/meteor/ee/definition/rest/v1/omnichannel/businessHours.ts b/apps/meteor/ee/definition/rest/v1/omnichannel/businessHours.ts deleted file mode 100644 index 4de8be18bda6..000000000000 --- a/apps/meteor/ee/definition/rest/v1/omnichannel/businessHours.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { ILivechatBusinessHour } from '@rocket.chat/core-typings'; - -declare module '@rocket.chat/rest-typings' { - // eslint-disable-next-line @typescript-eslint/naming-convention - interface Endpoints { - '/v1/livechat/business-hours': { - GET: (params: { name?: string; offset: number; count: number; sort: Record }) => { - businessHours: ILivechatBusinessHour[]; - count: number; - offset: number; - total: number; - }; - }; - } -} diff --git a/apps/meteor/ee/definition/rest/v1/omnichannel/businessUnits.ts b/apps/meteor/ee/definition/rest/v1/omnichannel/businessUnits.ts deleted file mode 100644 index eff9f042132b..000000000000 --- a/apps/meteor/ee/definition/rest/v1/omnichannel/businessUnits.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { ILivechatUnitMonitor, IOmnichannelBusinessUnit } from '@rocket.chat/core-typings'; -import type { PaginatedResult } from '@rocket.chat/rest-typings'; - -declare module '@rocket.chat/rest-typings' { - // eslint-disable-next-line @typescript-eslint/naming-convention - interface Endpoints { - '/v1/livechat/units.list': { - GET: (params: { text: string }) => PaginatedResult & { - units: IOmnichannelBusinessUnit[]; - }; - }; - '/v1/livechat/units/:unitId/monitors': { - GET: (params: { unitId: string }) => { monitors: ILivechatUnitMonitor[] }; - }; - '/v1/livechat/units': { - GET: (params: { text: string }) => PaginatedResult & { units: IOmnichannelBusinessUnit[] }; - POST: (params: { unitData: string; unitMonitors: string; unitDepartments: string }) => Omit; - }; - '/v1/livechat/units/:id': { - GET: () => IOmnichannelBusinessUnit | null; - POST: (params: { unitData: string; unitMonitors: string; unitDepartments: string }) => Omit; - DELETE: () => number; - }; - } -} diff --git a/apps/meteor/ee/definition/rest/v1/omnichannel/cannedResponses.ts b/apps/meteor/ee/definition/rest/v1/omnichannel/cannedResponses.ts deleted file mode 100644 index f2c0fd042bfb..000000000000 --- a/apps/meteor/ee/definition/rest/v1/omnichannel/cannedResponses.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { ILivechatDepartment, IOmnichannelCannedResponse, IUser } from '@rocket.chat/core-typings'; -import type { PaginatedResult, PaginatedRequest } from '@rocket.chat/rest-typings'; - -declare module '@rocket.chat/rest-typings' { - // eslint-disable-next-line @typescript-eslint/naming-convention - interface Endpoints { - '/v1/canned-responses': { - GET: ( - params: PaginatedRequest<{ - shortcut?: string; - text?: string; - scope?: string; - createdBy?: IUser['username']; - tags?: any; - departmentId?: ILivechatDepartment['_id']; - }>, - ) => PaginatedResult<{ - cannedResponses: IOmnichannelCannedResponse[]; - }>; - POST: (params: { - _id?: IOmnichannelCannedResponse['_id']; - shortcut: string; - text: string; - scope: string; - tags?: any; - departmentId?: ILivechatDepartment['_id']; - }) => void; - DELETE: (params: { _id: IOmnichannelCannedResponse['_id'] }) => void; - }; - '/v1/canned-responses/:_id': { - GET: () => { - cannedResponse: IOmnichannelCannedResponse; - }; - }; - } -} diff --git a/apps/meteor/ee/definition/rest/v1/omnichannel/index.ts b/apps/meteor/ee/definition/rest/v1/omnichannel/index.ts deleted file mode 100644 index 324b4087895a..000000000000 --- a/apps/meteor/ee/definition/rest/v1/omnichannel/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './businessHours'; -import './businessUnits'; -import './cannedResponses'; diff --git a/apps/meteor/ee/definition/rest/v1/roles.ts b/apps/meteor/ee/definition/rest/v1/roles.ts deleted file mode 100644 index 49ea8c5d929e..000000000000 --- a/apps/meteor/ee/definition/rest/v1/roles.ts +++ /dev/null @@ -1,84 +0,0 @@ -import type { IRole } from '@rocket.chat/core-typings'; -import Ajv from 'ajv'; - -const ajv = new Ajv({ - coerceTypes: true, -}); - -type RoleCreateProps = Pick & Partial>; - -const roleCreatePropsSchema = { - type: 'object', - properties: { - name: { - type: 'string', - }, - description: { - type: 'string', - nullable: true, - }, - scope: { - type: 'string', - enum: ['Users', 'Subscriptions'], - nullable: true, - }, - mandatory2fa: { - type: 'boolean', - nullable: true, - }, - }, - required: ['name'], - additionalProperties: false, -}; - -export const isRoleCreateProps = ajv.compile(roleCreatePropsSchema); - -type RoleUpdateProps = { - roleId: IRole['_id']; - name: IRole['name']; -} & Partial; - -const roleUpdatePropsSchema = { - type: 'object', - properties: { - roleId: { - type: 'string', - }, - name: { - type: 'string', - }, - description: { - type: 'string', - nullable: true, - }, - scope: { - type: 'string', - enum: ['Users', 'Subscriptions'], - nullable: true, - }, - mandatory2fa: { - type: 'boolean', - nullable: true, - }, - }, - required: ['roleId', 'name'], - additionalProperties: false, -}; - -export const isRoleUpdateProps = ajv.compile(roleUpdatePropsSchema); - -declare module '@rocket.chat/rest-typings' { - // eslint-disable-next-line @typescript-eslint/naming-convention - interface Endpoints { - '/v1/roles.create': { - POST: (params: RoleCreateProps) => { - role: IRole; - }; - }; - '/v1/roles.update': { - POST: (role: RoleUpdateProps) => { - role: IRole; - }; - }; - } -} diff --git a/apps/meteor/ee/definition/rest/v1/sessions/SessionsPaginateProps.ts b/apps/meteor/ee/definition/rest/v1/sessions/SessionsPaginateProps.ts deleted file mode 100644 index 20a7b145ee01..000000000000 --- a/apps/meteor/ee/definition/rest/v1/sessions/SessionsPaginateProps.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { PaginatedRequest } from '@rocket.chat/rest-typings'; -import Ajv from 'ajv'; - -const ajv = new Ajv({ coerceTypes: true }); - -export type SessionsPaginateProps = PaginatedRequest<{ - filter?: string; -}>; - -export const isSessionsPaginateProps = ajv.compile({ - type: 'object', - properties: { - offset: { - type: 'number', - }, - count: { - type: 'number', - }, - filter: { - type: 'string', - }, - sort: { - type: 'string', - }, - }, - required: [], - additionalProperties: false, -}); diff --git a/apps/meteor/ee/definition/rest/v1/sessions/SessionsProps.ts b/apps/meteor/ee/definition/rest/v1/sessions/SessionsProps.ts deleted file mode 100644 index e014db56a9e7..000000000000 --- a/apps/meteor/ee/definition/rest/v1/sessions/SessionsProps.ts +++ /dev/null @@ -1,18 +0,0 @@ -import Ajv from 'ajv'; - -const ajv = new Ajv({ coerceTypes: true }); - -export type SessionsProps = { - sessionId: string; -}; - -export const isSessionsProps = ajv.compile({ - type: 'object', - properties: { - sessionId: { - type: 'string', - }, - }, - required: ['sessionId'], - additionalProperties: false, -}); diff --git a/apps/meteor/ee/definition/rest/v1/sessions/index.ts b/apps/meteor/ee/definition/rest/v1/sessions/index.ts deleted file mode 100644 index 445c557a74cf..000000000000 --- a/apps/meteor/ee/definition/rest/v1/sessions/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import './sessions'; - -export * from './SessionsProps'; -export * from './SessionsPaginateProps'; diff --git a/apps/meteor/ee/definition/rest/v1/sessions/sessions.ts b/apps/meteor/ee/definition/rest/v1/sessions/sessions.ts deleted file mode 100644 index 8f006e437af5..000000000000 --- a/apps/meteor/ee/definition/rest/v1/sessions/sessions.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { ISession, DeviceManagementSession, DeviceManagementPopulatedSession } from '@rocket.chat/core-typings'; -import type { PaginatedResult } from '@rocket.chat/rest-typings'; - -import type { SessionsPaginateProps } from './SessionsPaginateProps'; -import type { SessionsProps } from './SessionsProps'; - -declare module '@rocket.chat/rest-typings' { - // eslint-disable-next-line @typescript-eslint/naming-convention - interface Endpoints { - '/v1/sessions/list': { - GET: (params: SessionsPaginateProps) => PaginatedResult<{ sessions: Array }>; - }; - '/v1/sessions/info': { - GET: (params: SessionsProps) => DeviceManagementSession; - }; - '/v1/sessions/logout.me': { - POST: (params: SessionsProps) => Pick; - }; - '/v1/sessions/list.all': { - GET: (params: SessionsPaginateProps) => PaginatedResult<{ sessions: Array }>; - }; - '/v1/sessions/info.admin': { - GET: (params: SessionsProps) => DeviceManagementPopulatedSession; - }; - '/v1/sessions/logout': { - POST: (params: SessionsProps) => Pick; - }; - } -} diff --git a/apps/meteor/ee/server/api/chat.ts b/apps/meteor/ee/server/api/chat.ts index faeca9455bb0..43eaa3cccf9c 100644 --- a/apps/meteor/ee/server/api/chat.ts +++ b/apps/meteor/ee/server/api/chat.ts @@ -1,8 +1,24 @@ import { Meteor } from 'meteor/meteor'; +import type { IMessage, ReadReceipt } from '@rocket.chat/core-typings'; import { API } from '../../../app/api/server/api'; import { hasLicense } from '../../app/license/server/license'; +type GetMessageReadReceiptsProps = { + messageId: IMessage['_id']; +}; + +declare module '@rocket.chat/rest-typings' { + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Endpoints { + '/v1/chat.getMessageReadReceipts': { + GET: (params: GetMessageReadReceiptsProps) => { + receipts: ReadReceipt[]; + }; + }; + } +} + API.v1.addRoute( 'chat.getMessageReadReceipts', { authRequired: true }, diff --git a/apps/meteor/ee/server/api/engagementDashboard/channels.ts b/apps/meteor/ee/server/api/engagementDashboard/channels.ts index 8c2834253e06..b9d454ccf3e7 100644 --- a/apps/meteor/ee/server/api/engagementDashboard/channels.ts +++ b/apps/meteor/ee/server/api/engagementDashboard/channels.ts @@ -1,10 +1,37 @@ import { check, Match } from 'meteor/check'; +import type { IDirectMessageRoom, IRoom } from '@rocket.chat/core-typings'; import { API } from '../../../../app/api/server'; import { findAllChannelsWithNumberOfMessages } from '../../lib/engagementDashboard/channels'; import { isDateISOString, mapDateForAPI } from '../../lib/engagementDashboard/date'; import { getPaginationItems } from '../../../../app/api/server/helpers/getPaginationItems'; +declare module '@rocket.chat/rest-typings' { + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Endpoints { + '/v1/engagement-dashboard/channels/list': { + GET: (params: { start: string; end: string; offset?: number; count?: number }) => { + channels: { + room: { + _id: IRoom['_id']; + name: IRoom['name'] | IRoom['fname']; + ts: IRoom['ts']; + t: IRoom['t']; + _updatedAt: IRoom['_updatedAt']; + usernames?: IDirectMessageRoom['usernames']; + }; + messages: number; + lastWeekMessages: number; + diffFromLastWeek: number; + }[]; + count: number; + offset: number; + total: number; + }; + }; + } +} + API.v1.addRoute( 'engagement-dashboard/channels/list', { diff --git a/apps/meteor/ee/server/api/engagementDashboard/messages.ts b/apps/meteor/ee/server/api/engagementDashboard/messages.ts index 2aac85c38b5c..826e03f40af1 100644 --- a/apps/meteor/ee/server/api/engagementDashboard/messages.ts +++ b/apps/meteor/ee/server/api/engagementDashboard/messages.ts @@ -1,4 +1,5 @@ import { check, Match } from 'meteor/check'; +import type { IDirectMessageRoom, IRoom } from '@rocket.chat/core-typings'; import { API } from '../../../../app/api/server'; import { @@ -8,6 +9,43 @@ import { } from '../../lib/engagementDashboard/messages'; import { isDateISOString, transformDatesForAPI } from '../../lib/engagementDashboard/date'; +declare module '@rocket.chat/rest-typings' { + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Endpoints { + '/v1/engagement-dashboard/messages/origin': { + GET: (params: { start: string; end: string }) => { + origins: { + t: IRoom['t']; + messages: number; + }[]; + }; + }; + '/v1/engagement-dashboard/messages/top-five-popular-channels': { + GET: (params: { start: string; end: string }) => { + channels: { + t: IRoom['t']; + messages: number; + name: IRoom['name'] | IRoom['fname']; + usernames?: IDirectMessageRoom['usernames']; + }[]; + }; + }; + '/v1/engagement-dashboard/messages/messages-sent': { + GET: (params: { start: string; end: string }) => { + days: { day: Date; messages: number }[]; + period: { + count: number; + variation: number; + }; + yesterday: { + count: number; + variation: number; + }; + }; + }; + } +} + API.v1.addRoute( 'engagement-dashboard/messages/messages-sent', { diff --git a/apps/meteor/ee/server/api/engagementDashboard/users.ts b/apps/meteor/ee/server/api/engagementDashboard/users.ts index a5f921b24fa4..23b31a0d5236 100644 --- a/apps/meteor/ee/server/api/engagementDashboard/users.ts +++ b/apps/meteor/ee/server/api/engagementDashboard/users.ts @@ -1,4 +1,5 @@ import { check, Match } from 'meteor/check'; +import type { IUser } from '@rocket.chat/core-typings'; import { API } from '../../../../app/api/server'; import { @@ -10,6 +11,65 @@ import { } from '../../lib/engagementDashboard/users'; import { isDateISOString, transformDatesForAPI } from '../../lib/engagementDashboard/date'; +declare module '@rocket.chat/rest-typings' { + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Endpoints { + '/v1/engagement-dashboard/users/active-users': { + GET: (params: { start: string; end: string }) => { + month: { + day: number; + month: number; + year: number; + usersList: IUser['_id'][]; + users: number; + }[]; + }; + }; + '/v1/engagement-dashboard/users/chat-busier/weekly-data': { + GET: (params: { start: string }) => { + month: { + users: number; + day: number; + month: number; + year: number; + }[]; + }; + }; + '/v1/engagement-dashboard/users/chat-busier/hourly-data': { + GET: (params: { start: string }) => { + hours: { + users: number; + hour: number; + }[]; + }; + }; + '/v1/engagement-dashboard/users/users-by-time-of-the-day-in-a-week': { + GET: (params: { start: string; end: string }) => { + week: { + users: number; + hour: number; + day: number; + month: number; + year: number; + }[]; + }; + }; + '/v1/engagement-dashboard/users/new-users': { + GET: (params: { start: string; end: string }) => { + days: { day: Date; users: number }[]; + period: { + count: number; + variation: number; + }; + yesterday: { + count: number; + variation: number; + }; + }; + }; + } +} + API.v1.addRoute( 'engagement-dashboard/users/new-users', { diff --git a/apps/meteor/ee/server/api/roles.ts b/apps/meteor/ee/server/api/roles.ts index 5cad626fe99b..b3b666bd536a 100644 --- a/apps/meteor/ee/server/api/roles.ts +++ b/apps/meteor/ee/server/api/roles.ts @@ -1,13 +1,96 @@ import { Roles } from '@rocket.chat/models'; +import type { IRole } from '@rocket.chat/core-typings'; +import Ajv from 'ajv'; import { API } from '../../../app/api/server/api'; import { hasPermissionAsync } from '../../../app/authorization/server/functions/hasPermission'; import { settings } from '../../../app/settings/server/index'; import { isEnterprise } from '../../app/license/server'; -import { isRoleCreateProps, isRoleUpdateProps } from '../../definition/rest/v1/roles'; import { insertRoleAsync } from '../lib/roles/insertRole'; import { updateRole } from '../lib/roles/updateRole'; +const ajv = new Ajv({ + coerceTypes: true, +}); + +type RoleCreateProps = Pick & Partial>; + +const roleCreatePropsSchema = { + type: 'object', + properties: { + name: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + scope: { + type: 'string', + enum: ['Users', 'Subscriptions'], + nullable: true, + }, + mandatory2fa: { + type: 'boolean', + nullable: true, + }, + }, + required: ['name'], + additionalProperties: false, +}; + +export const isRoleCreateProps = ajv.compile(roleCreatePropsSchema); + +type RoleUpdateProps = { + roleId: IRole['_id']; + name: IRole['name']; +} & Partial; + +const roleUpdatePropsSchema = { + type: 'object', + properties: { + roleId: { + type: 'string', + }, + name: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + scope: { + type: 'string', + enum: ['Users', 'Subscriptions'], + nullable: true, + }, + mandatory2fa: { + type: 'boolean', + nullable: true, + }, + }, + required: ['roleId', 'name'], + additionalProperties: false, +}; + +export const isRoleUpdateProps = ajv.compile(roleUpdatePropsSchema); + +declare module '@rocket.chat/rest-typings' { + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Endpoints { + '/v1/roles.create': { + POST: (params: RoleCreateProps) => { + role: IRole; + }; + }; + '/v1/roles.update': { + POST: (role: RoleUpdateProps) => { + role: IRole; + }; + }; + } +} + API.v1.addRoute( 'roles.create', { authRequired: true }, diff --git a/apps/meteor/ee/server/api/sessions.ts b/apps/meteor/ee/server/api/sessions.ts index 24ad74eca446..05106b79f037 100644 --- a/apps/meteor/ee/server/api/sessions.ts +++ b/apps/meteor/ee/server/api/sessions.ts @@ -1,19 +1,85 @@ import { Users, Sessions } from '@rocket.chat/models'; -import type { IUser } from '@rocket.chat/core-typings'; +import type { IUser, ISession, DeviceManagementSession, DeviceManagementPopulatedSession } from '@rocket.chat/core-typings'; import { escapeRegExp } from '@rocket.chat/string-helpers'; +import type { PaginatedResult, PaginatedRequest } from '@rocket.chat/rest-typings'; +import Ajv from 'ajv'; -import { isSessionsPaginateProps, isSessionsProps } from '../../definition/rest/v1/sessions'; import { API } from '../../../app/api/server/api'; import { hasLicense } from '../../app/license/server/license'; import { Notifications } from '../../../app/notifications/server'; import { getPaginationItems } from '../../../app/api/server/helpers/getPaginationItems'; +const ajv = new Ajv({ coerceTypes: true }); + +type SessionsProps = { + sessionId: string; +}; + +const isSessionsProps = ajv.compile({ + type: 'object', + properties: { + sessionId: { + type: 'string', + }, + }, + required: ['sessionId'], + additionalProperties: false, +}); + +type SessionsPaginateProps = PaginatedRequest<{ + filter?: string; +}>; + +const isSessionsPaginateProps = ajv.compile({ + type: 'object', + properties: { + offset: { + type: 'number', + }, + count: { + type: 'number', + }, + filter: { + type: 'string', + }, + sort: { + type: 'string', + }, + }, + required: [], + additionalProperties: false, +}); + const validateSortKeys = (sortKeys: string[]): boolean => { const validSortKeys = ['loginAt', 'device.name', 'device.os.name', 'device.os.version', '_user.name', '_user.username']; return sortKeys.every((s) => validSortKeys.includes(s)); }; +declare module '@rocket.chat/rest-typings' { + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Endpoints { + '/v1/sessions/list': { + GET: (params: SessionsPaginateProps) => PaginatedResult<{ sessions: Array }>; + }; + '/v1/sessions/info': { + GET: (params: SessionsProps) => DeviceManagementSession; + }; + '/v1/sessions/logout.me': { + POST: (params: SessionsProps) => Pick; + }; + '/v1/sessions/list.all': { + GET: (params: SessionsPaginateProps) => PaginatedResult<{ sessions: Array }>; + }; + '/v1/sessions/info.admin': { + GET: (params: SessionsProps) => DeviceManagementPopulatedSession; + }; + '/v1/sessions/logout': { + POST: (params: SessionsProps) => Pick; + }; + } +} + API.v1.addRoute( 'sessions/list', { authRequired: true, validateParams: isSessionsPaginateProps }, From 8eaaafd0befeaeb146db39702727e70e5223d86a Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Tue, 18 Jul 2023 13:55:44 -0300 Subject: [PATCH 08/14] chore: Deprecate `cloud:checkRegisterStatus` method (#29853) --- apps/meteor/app/cloud/server/methods.ts | 4 +++ .../actions/hooks/useAdministrationItems.tsx | 5 ---- apps/meteor/client/startup/startup.ts | 4 ++- .../views/admin/cloud/RegisterWorkspace.tsx | 25 ++++++++----------- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/apps/meteor/app/cloud/server/methods.ts b/apps/meteor/app/cloud/server/methods.ts index 797ed964c171..e6a6402fe560 100644 --- a/apps/meteor/app/cloud/server/methods.ts +++ b/apps/meteor/app/cloud/server/methods.ts @@ -40,6 +40,10 @@ declare module '@rocket.chat/ui-contexts' { } Meteor.methods({ + /** + * @deprecated this method is deprecated and will be removed soon. + * Prefer using cloud.registrationStatus rest api. + */ async 'cloud:checkRegisterStatus'() { const uid = Meteor.userId(); diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.tsx index ea678413a16b..531545b20a43 100644 --- a/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.tsx +++ b/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.tsx @@ -65,11 +65,6 @@ export const useAdministrationItems = (): GenericMenuItemProps[] => { const isAdmin = useRole('admin'); const setModal = useSetModal(); - // TODO: DEPRECATE IT - // const checkCloudRegisterStatus = useMethod('cloud:checkRegisterStatus'); - // const result = useQuery(['admin/cloud/register-status'], async () => checkCloudRegisterStatus()); - // const { workspaceRegistered } = result.data || {}; - const { data: registrationStatusData } = useRegistrationStatus(); const workspaceRegistered = registrationStatusData?.registrationStatus?.workspaceRegistered ?? false; diff --git a/apps/meteor/client/startup/startup.ts b/apps/meteor/client/startup/startup.ts index 9295eacce245..440b55ce5e6d 100644 --- a/apps/meteor/client/startup/startup.ts +++ b/apps/meteor/client/startup/startup.ts @@ -71,7 +71,9 @@ Meteor.startup(() => { return; } - const { connectToCloud, workspaceRegistered } = await sdk.call('cloud:checkRegisterStatus'); + const { + registrationStatus: { connectToCloud, workspaceRegistered }, + } = await sdk.rest.get('/v1/cloud.registrationStatus'); c.stop(); if (connectToCloud === true && workspaceRegistered !== true) { diff --git a/apps/meteor/client/views/admin/cloud/RegisterWorkspace.tsx b/apps/meteor/client/views/admin/cloud/RegisterWorkspace.tsx index 9e4e479f16f9..694d437de8d3 100644 --- a/apps/meteor/client/views/admin/cloud/RegisterWorkspace.tsx +++ b/apps/meteor/client/views/admin/cloud/RegisterWorkspace.tsx @@ -1,10 +1,9 @@ import { Box, Tag } from '@rocket.chat/fuselage'; -import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; -import { useSetModal, useMethod, useTranslation } from '@rocket.chat/ui-contexts'; -import { useQuery } from '@tanstack/react-query'; +import { useSetModal, useTranslation } from '@rocket.chat/ui-contexts'; import React from 'react'; import Page from '../../../components/Page'; +import { useRegistrationStatus } from '../../../hooks/useRegistrationStatus'; import ManualWorkspaceRegistrationModal from './ManualWorkspaceRegistrationModal'; import RegisterWorkspaceCards from './components/RegisterWorkspaceCards'; import RegisterWorkspaceMenu from './components/RegisterWorkspaceMenu'; @@ -15,30 +14,28 @@ const RegisterWorkspace = () => { const t = useTranslation(); const setModal = useSetModal(); - const checkCloudRegisterStatus = useMethod('cloud:checkRegisterStatus'); - const result = useQuery(['admin/cloud/register-status'], async () => checkCloudRegisterStatus()); - const reload = useMutableCallback(() => result.refetch()); + const { data: registrationStatusData, isLoading, isError, refetch } = useRegistrationStatus(); + const isWorkspaceRegistered = registrationStatusData?.registrationStatus?.workspaceRegistered ?? false; + const isConnectedToCloud = registrationStatusData?.registrationStatus?.connectToCloud ?? false; - if (result.isLoading || result.isError) { + if (isLoading || isError) { return null; } - const { connectToCloud: isConnectedToCloud, workspaceRegistered: isWorkspaceRegistered } = result.data; - const handleRegisterWorkspaceClick = (): void => { const handleModalClose = (): void => { setModal(null); - reload(); + refetch(); }; if (isWorkspaceRegistered) { - setModal(); - } else setModal(); + setModal(); + } else setModal(); }; const handleManualWorkspaceRegistrationButton = (): void => { const handleModalClose = (): void => { setModal(null); - reload(); + refetch(); }; setModal(); }; @@ -70,7 +67,7 @@ const RegisterWorkspace = () => { isWorkspaceRegistered={isWorkspaceRegistered} isConnectedToCloud={isConnectedToCloud} onClick={handleRegisterWorkspaceClick} - onStatusChange={reload} + onStatusChange={refetch} onClickOfflineRegistration={handleManualWorkspaceRegistrationButton} /> From b31a880af8b164913108654736b0ce45f7f2f613 Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Tue, 18 Jul 2023 15:48:03 -0300 Subject: [PATCH 09/14] test: Cover `sortMenu` hook (#29858) --- .../hooks/useGroupingListItems.spec.tsx | 25 +++++++++++++++ .../actions/hooks/useSortModeItems.spec.tsx | 19 ++++++++++++ .../actions/hooks/useViewModeItems.spec.tsx | 31 +++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 apps/meteor/client/sidebar/header/actions/hooks/useGroupingListItems.spec.tsx create mode 100644 apps/meteor/client/sidebar/header/actions/hooks/useSortModeItems.spec.tsx create mode 100644 apps/meteor/client/sidebar/header/actions/hooks/useViewModeItems.spec.tsx diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useGroupingListItems.spec.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useGroupingListItems.spec.tsx new file mode 100644 index 000000000000..b5779d825202 --- /dev/null +++ b/apps/meteor/client/sidebar/header/actions/hooks/useGroupingListItems.spec.tsx @@ -0,0 +1,25 @@ +import { renderHook } from '@testing-library/react-hooks'; + +import { useGroupingListItems } from './useGroupingListItems'; + +it('should render groupingList items', async () => { + const { result } = renderHook(() => useGroupingListItems()); + + expect(result.current[0]).toEqual( + expect.objectContaining({ + id: 'unread', + }), + ); + + expect(result.current[1]).toEqual( + expect.objectContaining({ + id: 'favorites', + }), + ); + + expect(result.current[2]).toEqual( + expect.objectContaining({ + id: 'types', + }), + ); +}); diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useSortModeItems.spec.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useSortModeItems.spec.tsx new file mode 100644 index 000000000000..143d228fe7ca --- /dev/null +++ b/apps/meteor/client/sidebar/header/actions/hooks/useSortModeItems.spec.tsx @@ -0,0 +1,19 @@ +import { renderHook } from '@testing-library/react-hooks'; + +import { useSortModeItems } from './useSortModeItems'; + +it('should render sortMode items', async () => { + const { result } = renderHook(() => useSortModeItems()); + + expect(result.current[0]).toEqual( + expect.objectContaining({ + id: 'activity', + }), + ); + + expect(result.current[1]).toEqual( + expect.objectContaining({ + id: 'name', + }), + ); +}); diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useViewModeItems.spec.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useViewModeItems.spec.tsx new file mode 100644 index 000000000000..6c6dd7532e7e --- /dev/null +++ b/apps/meteor/client/sidebar/header/actions/hooks/useViewModeItems.spec.tsx @@ -0,0 +1,31 @@ +import { renderHook } from '@testing-library/react-hooks'; + +import { useViewModeItems } from './useViewModeItems'; + +it('should render viewMode items', async () => { + const { result } = renderHook(() => useViewModeItems()); + + expect(result.current[0]).toEqual( + expect.objectContaining({ + id: 'extended', + }), + ); + + expect(result.current[1]).toEqual( + expect.objectContaining({ + id: 'medium', + }), + ); + + expect(result.current[2]).toEqual( + expect.objectContaining({ + id: 'condensed', + }), + ); + + expect(result.current[3]).toEqual( + expect.objectContaining({ + id: 'avatars', + }), + ); +}); From 29b78ee655c4cb86bc9a295aca1bb0f957c78bba Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 18 Jul 2023 16:09:57 -0300 Subject: [PATCH 10/14] ci: Report Jest coverage (#29848) --- .github/workflows/ci-test-unit.yml | 5 + apps/meteor/.mocharc.client.js | 6 +- .../useToggleReactionMutation.spec.tsx | 106 ++++++++++++++++++ apps/meteor/jest.config.ts | 2 + codecov.yml | 10 ++ ee/packages/ddp-client/jest.config.ts | 1 + turbo.json | 2 +- 7 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 apps/meteor/client/components/message/content/reactions/useToggleReactionMutation.spec.tsx diff --git a/.github/workflows/ci-test-unit.yml b/.github/workflows/ci-test-unit.yml index f294ac2dda7b..03c6bc2352ab 100644 --- a/.github/workflows/ci-test-unit.yml +++ b/.github/workflows/ci-test-unit.yml @@ -31,3 +31,8 @@ jobs: - name: Unit Test run: yarn testunit + + - uses: codecov/codecov-action@v3 + with: + flags: unit + verbose: true diff --git a/apps/meteor/.mocharc.client.js b/apps/meteor/.mocharc.client.js index 6e522ee67363..029564d7729a 100644 --- a/apps/meteor/.mocharc.client.js +++ b/apps/meteor/.mocharc.client.js @@ -38,5 +38,9 @@ module.exports = { 'tests/unit/lib/**/*.tests.ts', 'tests/unit/client/**/*.test.ts', ], - exclude: ['client/hooks/*.spec.{ts,tsx}', 'client/sidebar/header/actions/hooks/*.spec.{ts,tsx}'], + exclude: [ + 'client/hooks/*.spec.{ts,tsx}', + 'client/sidebar/header/actions/hooks/*.spec.{ts,tsx}', + 'client/components/message/content/reactions/**.spec.{ts,tsx}', + ], }; diff --git a/apps/meteor/client/components/message/content/reactions/useToggleReactionMutation.spec.tsx b/apps/meteor/client/components/message/content/reactions/useToggleReactionMutation.spec.tsx new file mode 100644 index 000000000000..1ef4d84ddc91 --- /dev/null +++ b/apps/meteor/client/components/message/content/reactions/useToggleReactionMutation.spec.tsx @@ -0,0 +1,106 @@ +import { MockedAuthorizationContext } from '@rocket.chat/mock-providers/src/MockedAuthorizationContext'; +import { MockedServerContext } from '@rocket.chat/mock-providers/src/MockedServerContext'; +import { MockedSettingsContext } from '@rocket.chat/mock-providers/src/MockedSettingsContext'; +import { MockedUserContext } from '@rocket.chat/mock-providers/src/MockedUserContext'; +import { QueryClientProvider, QueryClient } from '@tanstack/react-query'; +import { renderHook, act } from '@testing-library/react-hooks'; +import React from 'react'; + +import { useToggleReactionMutation } from './useToggleReactionMutation'; + +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + // ✅ turns retries off + retry: false, + }, + }, + logger: { + log: (..._) => { + // Log debugging information + }, + warn: (..._) => { + // Log warning + }, + error: (..._) => { + // Log error + }, + }, +}); + +beforeEach(() => { + queryClient.clear(); +}); + +it('should be call rest `POST /v1/chat.react` method', async () => { + const fn = jest.fn(); + const { result, waitFor } = renderHook(() => useToggleReactionMutation(), { + wrapper: ({ children }) => ( + + { + if (method === 'POST' && pathPattern === '/v1/chat.react') { + fn(params); + return { success: true } as any; + } + + throw new Error(`Endpoint not mocked: ${method} ${pathPattern}`); + }} + > + + + {children} + + + + + ), + }); + + act(async () => { + await result.current.mutateAsync({ mid: 'MID', reaction: 'smile' }); + }); + + await waitFor(() => result.current.isLoading === false); + + expect(fn).toHaveBeenCalledWith({ + messageId: 'MID', + reaction: 'smile', + }); +}); + +it('should not work for non-logged in users', async () => { + const fn = jest.fn(); + const { result, waitForValueToChange } = renderHook(() => useToggleReactionMutation(), { + wrapper: ({ children }) => ( + + { + if (method === 'POST' && pathPattern === '/v1/chat.react') { + fn(params); + return { success: true } as any; + } + + throw new Error(`Endpoint not mocked: ${method} ${pathPattern}`); + }} + > + + {children} + + + + ), + }); + + act(() => { + return result.current.mutate({ mid: 'MID', reaction: 'smile' }); + }); + + await waitForValueToChange(() => result.current.status); + + expect(fn).not.toHaveBeenCalled(); + + expect(result.current.status).toBe('error'); + + expect(result.current.error).toEqual(new Error('Not logged in')); +}); diff --git a/apps/meteor/jest.config.ts b/apps/meteor/jest.config.ts index bcd9f8f5432a..9232c2065dad 100644 --- a/apps/meteor/jest.config.ts +++ b/apps/meteor/jest.config.ts @@ -6,6 +6,7 @@ export default { testMatch: [ '/client/hooks/**.spec.[jt]s?(x)', '/client/components/**.spec.[jt]s?(x)', + 'client/components/message/content/reactions/**.spec.[jt]s?(x)', '/client/sidebar/header/actions/hooks/**/**.spec.[jt]s?(x)', ], transform: { @@ -15,4 +16,5 @@ export default { '\\.css$': 'identity-obj-proxy', '^react($|/.+)': '/node_modules/react$1', }, + collectCoverage: true, }; diff --git a/codecov.yml b/codecov.yml index d9198cbf2443..0a3501678c1e 100644 --- a/codecov.yml +++ b/codecov.yml @@ -5,5 +5,15 @@ coverage: default: target: auto threshold: 1% + client: + target: auto + flags: + - client +flags: + client: + paths: + - apps/meteor/client + carryforward: true + comment: layout: 'reach, diff, flags' diff --git a/ee/packages/ddp-client/jest.config.ts b/ee/packages/ddp-client/jest.config.ts index 0739147f43fe..eb3f38119a73 100644 --- a/ee/packages/ddp-client/jest.config.ts +++ b/ee/packages/ddp-client/jest.config.ts @@ -10,4 +10,5 @@ export default { moduleNameMapper: { '\\.css$': 'identity-obj-proxy', }, + collectCoverage: true, }; diff --git a/turbo.json b/turbo.json index e617f46d0bea..061b9fe02582 100644 --- a/turbo.json +++ b/turbo.json @@ -11,7 +11,7 @@ }, "testunit": { "dependsOn": ["build"], - "outputs": [] + "outputs": ["coverage/**"] }, "lint": { "dependsOn": ["build"], From dd2b98ee1c2ac70f825c41357f04d74a9bd697ac Mon Sep 17 00:00:00 2001 From: "lingohub[bot]" <69908207+lingohub[bot]@users.noreply.github.com> Date: Tue, 18 Jul 2023 21:17:16 +0000 Subject: [PATCH 11/14] =?UTF-8?q?i18n:=20Language=20update=20from=20LingoH?= =?UTF-8?q?ub=20=F0=9F=A4=96=20on=202023-07-13Z=20(#29817)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com> --- apps/meteor/packages/rocketchat-i18n/i18n/af.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/ar.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/az.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/be-BY.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/bg.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/bs.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/ca.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/cs.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/cy.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/da.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/de-AT.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/de.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/el.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json | 3 +-- apps/meteor/packages/rocketchat-i18n/i18n/eo.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/es.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/eu.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/fa.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/fr.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/gl.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/he.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/hi-IN.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/hr.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/id.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/it.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/ja.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/ka-GE.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/km.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/ko.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/ku.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/lo.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/lt.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/lv.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/mn.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/ms-MY.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/nl.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/no.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/pl.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/pt.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/ro.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/ru.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/sk-SK.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/sl-SI.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/sq.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/sr.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/ta-IN.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/th-TH.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/tr.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/ug.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/uk.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/vi-VN.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/zh-HK.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/zh-TW.i18n.json | 1 + apps/meteor/packages/rocketchat-i18n/i18n/zh.i18n.json | 1 + 58 files changed, 58 insertions(+), 2 deletions(-) diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/af.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/af.i18n.json index cc915ea21186..858c2f4cf898 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/af.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/af.i18n.json @@ -1877,6 +1877,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR is slegs beskikbaar wanneer beide gebruikers aanlyn is", "Outgoing_WebHook": "Uitgaande WebHook", "Outgoing_WebHook_Description": "Kry data uit Rocket.Chat in real-time.", + "Outlook_Calendar_Enabled": "enabled", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Hersien URL aan watter lêers opgelaai word. Hierdie url word ook vir aflaai gebruik as 'n CDN nie gegee word nie", "Page_title": "Bladsy titel", "Page_URL": "Bladsy-URL", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ar.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ar.i18n.json index f2691bb674b5..110c20b10792 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ar.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ar.i18n.json @@ -3287,6 +3287,7 @@ "Outgoing": "صادر", "Outgoing_WebHook": "خطاف الويب الصادر", "Outgoing_WebHook_Description": "الحصول على البيانات من Rocket.Chat في الوقت الفعلي.", + "Outlook_Calendar_Enabled": "تم التمكين", "Output_format": "تنسيق الإخراج", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "تجاوز عنوان URL الذي يتم تحميل الملفات إليه. يستخدم عنوان URL هذا أيضًا للتنزيلات ما لم يتم إعطاء CDN.", "Page_title": "عنوان الصفحة", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/az.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/az.i18n.json index a44c25a1b95b..32f4af142ab4 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/az.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/az.i18n.json @@ -1877,6 +1877,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR yalnız hər iki istifadəçi online olduğunda istifadə edilə bilər", "Outgoing_WebHook": "Giden WebHook", "Outgoing_WebHook_Description": "Real-time Rocket.Chat-dən məlumat əldə edin.", + "Outlook_Calendar_Enabled": "Etkin", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Dosyaların yükləndiyi URL'yi silin. Bu url də bir CDN verilmədiyi təqdirdə yükləmələr üçün də istifadə olunur", "Page_title": "Səhifə başlığı", "Page_URL": "Səhifə URL", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/be-BY.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/be-BY.i18n.json index e448574f6b48..06c1ca5ce34d 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/be-BY.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/be-BY.i18n.json @@ -1893,6 +1893,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR даступны толькі тады, калі абодва карыстальніка знаходзяцца на сайце", "Outgoing_WebHook": "выходны WebHook", "Outgoing_WebHook_Description": "Атрымаць дадзеныя з Rocket.Chat ў рэжыме рэальнага часу.", + "Outlook_Calendar_Enabled": "Уключана", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Override URL, да якога файлы будуць загружаныя. Гэтага URL выкарыстоўваецца таксама для загрузкі, калі толькі ў CDN даецца", "Page_title": "тытульны ліст", "Page_URL": "URL старонкі", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/bg.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/bg.i18n.json index 35a907b728d3..7a50677816c4 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/bg.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/bg.i18n.json @@ -1874,6 +1874,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR е налице само когато и двамата потребители са онлайн", "Outgoing_WebHook": "Изходяща WebHook", "Outgoing_WebHook_Description": "Извличайте данни от Rocket.Chat в реално време.", + "Outlook_Calendar_Enabled": "Позволено", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Замяна на URL адреса, към който се качват файловете. Този URL адрес също се използва за изтегляне, освен ако не е даден CDN", "Page_title": "Заглавие на страница", "Page_URL": "URL адрес на страницата", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/bs.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/bs.i18n.json index 4776295db449..46d8f5f93d21 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/bs.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/bs.i18n.json @@ -1870,6 +1870,7 @@ "OTR_is_only_available_when_both_users_are_online": "SP je dostupan samo ako su oba korisnika online", "Outgoing_WebHook": "Odlazni WebHook", "Outgoing_WebHook_Description": "Dobijte podatke iz Rocket.Chat u stvarnom vremenu.", + "Outlook_Calendar_Enabled": "Omogućeno", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "URL mjesta na koji su postavljene datoteke. Ovaj url se također koristi za preuzimanje, osim ako je zadan CDN", "Page_title": "Naslov stranice", "Page_URL": "URL stranice", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ca.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ca.i18n.json index ddb2d9d3e259..b501f88a5000 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ca.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ca.i18n.json @@ -3248,6 +3248,7 @@ "Out_of_seats": "Sense llocs", "Outgoing_WebHook": "WebHook sortint", "Outgoing_WebHook_Description": "Extreu dades de Rocket.Chat en temps real.", + "Outlook_Calendar_Enabled": "Activat", "Output_format": "Format de sortida", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Reemplaça la URL a la qual es carreguen els fitxers. Aquest URL també es fa servir per a baixades a no ser que es proporcioni un CDN", "Page_title": "Titol de la pàgina", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/cs.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/cs.i18n.json index 4d5b1232d9d2..435f09f3d185 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/cs.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/cs.i18n.json @@ -2723,6 +2723,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR je k dispozici pouze pokud jsou oba uživatelé online", "Outgoing_WebHook": "Odchozí Webhook", "Outgoing_WebHook_Description": "Získávejte data z Rocket.Chat v reálném čase.", + "Outlook_Calendar_Enabled": "Povoleno", "Output_format": "Výstupní formát", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Přepsat URL, na které jsou nahrané soubory. Tato adresa se také používá pro stahování pokud není nastavena CDN", "Page_title": "Titulku stránky", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/cy.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/cy.i18n.json index 0c3bb7349d5d..eae2511cf07a 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/cy.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/cy.i18n.json @@ -1872,6 +1872,7 @@ "OTR_is_only_available_when_both_users_are_online": "Dim ond pan fydd y ddau ddefnyddiwr ar-lein mae OTR ar gael", "Outgoing_WebHook": "WebHook Allanol", "Outgoing_WebHook_Description": "Cael data allan o Rocket.Chat mewn amser real.", + "Outlook_Calendar_Enabled": "Wedi'i alluogi", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Anwybyddu'r URL y mae ffeiliau wedi'u llwytho i fyny. Defnyddiwyd yr url hwn hefyd i'w lawrlwytho oni bai bod CDN yn cael ei roi", "Page_title": "Teitl y dudalen", "Page_URL": "Tudalen URL", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/da.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/da.i18n.json index e45395e5ab8c..065fd1a6527d 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/da.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/da.i18n.json @@ -2736,6 +2736,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR er kun tilgængelig, når begge brugere er online", "Outgoing_WebHook": "Udgående WebHook", "Outgoing_WebHook_Description": "Få data ud af Rocket.Chat i realtid.", + "Outlook_Calendar_Enabled": "Aktiveret", "Output_format": "Outputformat", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Overstyr URL til hvilke filer der uploades. Denne url bruges også til download, medmindre en CDN er givet", "Page_title": "Sidetitel", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/de-AT.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/de-AT.i18n.json index 465367b67ae8..fa2d8612b1f4 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/de-AT.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/de-AT.i18n.json @@ -1880,6 +1880,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR ist nur möglich, wenn beide Benutzer online sind.", "Outgoing_WebHook": "Ausgehender WebHook", "Outgoing_WebHook_Description": "Holen Sie Daten in Echtzeit aus Rocket.Chat.", + "Outlook_Calendar_Enabled": "aktiviert", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "URL, wo die Dateien hochgeladen werden. Die URL wird auch für Downloads verwendet, wenn keine CDN angegeben wird.", "Page_title": "Seitentitel", "Page_URL": "Seiten-URL", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/de.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/de.i18n.json index 9645db821afc..65c79f66f5af 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/de.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/de.i18n.json @@ -3700,6 +3700,7 @@ "Outgoing": "Ausgehend", "Outgoing_WebHook": "Ausgehender Webhook", "Outgoing_WebHook_Description": "Daten aus Rocket.Chat heraus versenden.", + "Outlook_Calendar_Enabled": "aktiviert", "Output_format": "Ausgabeformat", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "URL, unter der die Dateien hochgeladen werden. Die URL wird auch für Downloads verwendet, wenn kein CDN angegeben wird", "Owner": "Eigentümer", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/el.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/el.i18n.json index 74c40707b40d..f81634b9ce3f 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/el.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/el.i18n.json @@ -1885,6 +1885,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR είναι διαθέσιμη μόνο όταν και οι δύο χρήστες είναι online", "Outgoing_WebHook": "Έξοδος WebHook", "Outgoing_WebHook_Description": "Αποκτήστε δεδομένα από το Rocket.Chat σε πραγματικό χρόνο.", + "Outlook_Calendar_Enabled": "Ενεργοποιήθηκε", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Παράκαμψη URL στο οποίο φορτώνονται τα αρχεία. Αυτή η διεύθυνση URL που χρησιμοποιείται επίσης για λήψεις εκτός εάν ένα CDN δίνεται", "Page_title": "Τίτλος σελίδας", "Page_URL": "Διεύθυνση Ιστοσελίδας", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 154bf6af2d6e..0140332a73b5 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -3849,7 +3849,6 @@ "Outgoing_WebHook_Description": "Get data out of Rocket.Chat in real-time.", "Outlook_authentication": "Outlook authentication", "Outlook_authentication_disabled": "Outlook authentication disabled", - "Outlook_authentication_description": "Disable this to clear any outlook credentials stored in this machine.", "Outlook_calendar": "Outlook calendar", "Outlook_calendar_event": "Outlook calendar event", @@ -5951,4 +5950,4 @@ "Uninstall_grandfathered_app": "Uninstall {{appName}}?", "App_will_lose_grandfathered_status": "**This {{context}} app will lose its grandfathered status.** \n \nWorkspaces on Community Edition can have up to {{limit}} {{context}} apps enabled. Grandfathered apps count towards the limit but the limit is not applied to them.", "Theme_Appearence": "Theme Appearence" -} +} \ No newline at end of file diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/eo.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/eo.i18n.json index 8006cd075d7a..e649f7f35387 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/eo.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/eo.i18n.json @@ -1877,6 +1877,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR estas nur havebla kiam ambaŭ uzantoj estas interrete", "Outgoing_WebHook": "Eliranta WebHook", "Outgoing_WebHook_Description": "Akiri datumojn el Rocket.Chat en reala tempo.", + "Outlook_Calendar_Enabled": "Enabled", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Anstataŭigi URL al kiu dosieroj estas alŝutitaj. Ĉi tiu url ankaŭ uzis por malŝarĝoj krom se ĝi ricevas CDN", "Page_title": "Paĝo-titolo", "Page_URL": "Paĝo URL", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/es.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/es.i18n.json index 7e2219b43fb2..739768a79124 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/es.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/es.i18n.json @@ -3262,6 +3262,7 @@ "Outgoing": "Saliente", "Outgoing_WebHook": "Webhook saliente", "Outgoing_WebHook_Description": "Obtener datos de Rocket.Chat en tiempo real.", + "Outlook_Calendar_Enabled": "Habilitado", "Output_format": "Formato de salida", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Reemplazar la URL a la que se suben los archivos. Esta URL también se usa para descargas a menos que se proporcione una CDN", "Page_title": "Título de página", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/eu.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/eu.i18n.json index 8b1e7125e15f..7585a29458f2 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/eu.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/eu.i18n.json @@ -96,6 +96,7 @@ "No_channels_yet": "Oraindik ez zara inongo kanalen partaide", "No_discussions_yet": "Ez dago eztabaidarik", "Options": "Aukerak", + "Outlook_Calendar_Enabled": "Gaituta", "Please_fill_name_and_email": "Sartu izena eta posta elektronikoa mesedez", "Private_Groups": "Talde Pribatuak", "Private_Groups_list": "Talde Pribatuen Zerrenda", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/fa.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/fa.i18n.json index c23985c99cbc..a66a48d1b61b 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/fa.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/fa.i18n.json @@ -2181,6 +2181,7 @@ "OTR_is_only_available_when_both_users_are_online": "تنها زمانی در دسترس است که دو طرف آنلاین باشند.", "Outgoing_WebHook": "خروجی WebHook", "Outgoing_WebHook_Description": "دریافت اطلاعات از Rocket.Chat در زمان واقعی.", + "Outlook_Calendar_Enabled": "فعال", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "URL نادیده گرفتن که فایل های آپلود شده است. این URL نیز برای دریافت مگر اینکه یک CDN استفاده شده است", "Page_title": "عنوان صفحه", "Page_URL": "آدرس صفحه", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json index f3deb4a3063e..087fa6a0b27a 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json @@ -3754,6 +3754,7 @@ "Outgoing": "Lähtevät", "Outgoing_WebHook": "Lähtevä WebHook", "Outgoing_WebHook_Description": "Hanki tiedot chatsovelluksesta reaaliaikaisesti.", + "Outlook_Calendar_Enabled": "Käytössä", "Output_format": "Tulostusmuoto", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Ohitus-URL, johon tiedostot ladataan. Tätä URL-osoitetta käytetään myös vastakkaisen suuntaiseen lataamiseen, ellei CDN:ää ole annettu", "Owner": "Omistaja", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/fr.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/fr.i18n.json index 5d956f706e85..776c3cfd7ae6 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/fr.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/fr.i18n.json @@ -3280,6 +3280,7 @@ "Outgoing": "Sortant", "Outgoing_WebHook": "Webhook sortant", "Outgoing_WebHook_Description": "Obtenez des données de Rocket.Chat en temps réel.", + "Outlook_Calendar_Enabled": "Activé", "Output_format": "Format de sortie", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Modifier l'URL vers laquelle les fichiers sont chargés. Cette URL est également utilisée pour les téléchargements sauf si un CDN est indiqué", "Page_title": "Titre de la page", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/gl.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/gl.i18n.json index 09dc9a004067..6952be4a7824 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/gl.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/gl.i18n.json @@ -231,6 +231,7 @@ "Online": "En liña", "Only_you_can_see_this_message": "So ti podes ver esta mensaxe", "Options": "Opcións", + "Outlook_Calendar_Enabled": "Activado", "Phone": "Teléfono", "Pin_Message": "Fixar mensaxe", "pin-message": "Fixar mensaxe", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/he.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/he.i18n.json index ee0c52ca4a39..80a8a97845cf 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/he.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/he.i18n.json @@ -1021,6 +1021,7 @@ "others": "אחרים", "OTR": "OTR", "OTR_is_only_available_when_both_users_are_online": "OTR זמינה רק כאשר המשתמשים הוא במצב מקוון", + "Outlook_Calendar_Enabled": "מופעל", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "כתובת אתר דרוס שאליו קבצים מועלים. url זה משמש גם עבור הורדות אלא אם CDN ניתן", "Password": "ססמה", "Password_Change_Disabled": "מנהל המערכת שלך ביטל את האפשרות לשנות סיסמאות", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/hi-IN.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/hi-IN.i18n.json index 0e74af00275e..33e3f43083f5 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/hi-IN.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/hi-IN.i18n.json @@ -191,6 +191,7 @@ "New_messages": "नए संदेश", "No": "नहीं", "Options": "विकल्प", + "Outlook_Calendar_Enabled": "सक्रिय", "Please_answer_survey": "कृपया इस चैट के बारे में त्वरित सर्वेक्षण का उत्तर देने के लिए एक क्षण लें", "Please_fill_name_and_email": "कृपया नाम और ईमेल भरें", "Public": "जनता", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/hr.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/hr.i18n.json index 0db25d33568a..4a09d901d5df 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/hr.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/hr.i18n.json @@ -2010,6 +2010,7 @@ "OTR_is_only_available_when_both_users_are_online": "SP je dostupan samo ako su oba korisnika online", "Outgoing_WebHook": "Odlazni WebHook", "Outgoing_WebHook_Description": "Dobijte podatke iz Rocket.Chat u stvarnom vremenu.", + "Outlook_Calendar_Enabled": "Omogućeno", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "URL mjesta na koji su postavljene datoteke. Ovaj url se također koristi za preuzimanje, osim ako je zadan CDN", "Page_title": "Naslov stranice", "Page_URL": "URL stranice", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json index 6cbd626f7526..d3ef06c2355a 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json @@ -3616,6 +3616,7 @@ "Outgoing": "Kimenő", "Outgoing_WebHook": "Kimenő webhorog", "Outgoing_WebHook_Description": "Adatok lekérése a Rocket.Chatből valós időben.", + "Outlook_Calendar_Enabled": "Engedélyezve", "Output_format": "Kimeneti formátum", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Az URL felülbírálása, ahová a fájlok feltöltésre kerülnek. Ez az URL letöltésekhez is használva van, kivéve ha tartalomkézbesítési hálózat van megadva.", "Owner": "Tulajdonos", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/id.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/id.i18n.json index 8a42c8f07318..636095f71f85 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/id.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/id.i18n.json @@ -1885,6 +1885,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR hanya tersedia jika kedua pengguna sedang online", "Outgoing_WebHook": "WebHook keluar", "Outgoing_WebHook_Description": "Dapatkan data dari Rocket.Chat secara real-time.", + "Outlook_Calendar_Enabled": "Diaktifkan", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "URL Override yang file-upload. url ini juga digunakan untuk download kecuali CDN diberikan", "Page_title": "Judul halaman", "Page_URL": "Halaman URL", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/it.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/it.i18n.json index decd72db4baa..e4745f79926a 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/it.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/it.i18n.json @@ -1946,6 +1946,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR è disponibile solo se entrambi gli utenti sono on-line", "Outgoing_WebHook": "WebHook in uscita", "Outgoing_WebHook_Description": "Ottieni i dati da Rocket.Chat in tempo reale.", + "Outlook_Calendar_Enabled": "Abilitato", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "URL sostitutiva in cui vengono caricati i file. Questo URL è utilizzato anche per i download a meno che una CDN sia impostata", "Page_title": "Titolo pagina", "Page_URL": "URL pagina", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ja.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ja.i18n.json index 18bd26b34c07..e5be1cb91ce5 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ja.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ja.i18n.json @@ -3254,6 +3254,7 @@ "Outgoing": "発信中", "Outgoing_WebHook": "発信Webhook", "Outgoing_WebHook_Description": "Rocket.Chatからリアルタイムでデータを取得します。", + "Outlook_Calendar_Enabled": "有効", "Output_format": "出力形式", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "アップロードされたファイルのURLを上書きします。このURLは、CDNからURLが提供されない場合にダウンロードでも使用されます", "Page_title": "ページタイトル", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ka-GE.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ka-GE.i18n.json index e95360251310..05d519a1f6c2 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ka-GE.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ka-GE.i18n.json @@ -2562,6 +2562,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR ხელმისაწვდომია მხოლოდ როდესაც ორივე მომხმარებელი ონლაინ არის", "Outgoing_WebHook": "გამავალი WebHook", "Outgoing_WebHook_Description": "მიიღეთ მონაცემები Rocket.Chat– დან რეალურ დროში.", + "Outlook_Calendar_Enabled": "ჩართულია", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "შეცვალეთ ლინკი რომელზეც ფაილები აიტვირთება. ეს ლინკი ასევე გამოიყენება გადმოწერებისთვის თუ სხვა CDN არ არის მოწოდებული", "Page_title": "გვერდის სათაური", "Page_URL": "გვერდის URL", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/km.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/km.i18n.json index 43f5ee0e1cd4..0dbd1d7c092c 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/km.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/km.i18n.json @@ -2187,6 +2187,7 @@ "OTR_is_only_available_when_both_users_are_online": "ប្រវត្តិគឺអាចប្រើបានតែនៅពេលដែលអ្នកប្រើប្រាស់ទាំងពីរគឺមាននៅលើបណ្ដាញ", "Outgoing_WebHook": "WebHook ចេញ", "Outgoing_WebHook_Description": "ទទួលបានទិន្នន័យចេញពី Rocket.Chat ក្នុងពេលវេលាពិតប្រាកដ។", + "Outlook_Calendar_Enabled": "បានបើក", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "URL ដែលបានបដិសេធទៅនឹងឯកសារដែលបានផ្ទុកឡើង។ URL នេះបានប្រើផងដែរសម្រាប់ការទាញយកបានទេលុះត្រាតែ CDN មួយត្រូវបានផ្ដល់", "Page_title": "ចំណងជើងទំព័រ", "Page_URL": "URL ទំព័រ", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ko.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ko.i18n.json index f660099b04c7..2efde93240dd 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ko.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ko.i18n.json @@ -2781,6 +2781,7 @@ "OTR_is_only_available_when_both_users_are_online": "두 사용자가 온라인 상태일 때만 비밀 대화를 사용할 수 있습니다.", "Outgoing_WebHook": "나가는 WebHook", "Outgoing_WebHook_Description": "Rocket.Chat에서 실시간으로 데이터를 가져옵니다.", + "Outlook_Calendar_Enabled": "사용", "Output_format": "출력 형식", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "파일이 업로드되는 재정의 URL. CDN이 지정되지 않으면, 다운로드 URL로 설정됩니다.", "Page_title": "페이지 제목", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ku.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ku.i18n.json index da57c23dec1c..a48e1bab4f1f 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ku.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ku.i18n.json @@ -1872,6 +1872,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR bi tenê dikarî de derbasdar e ku her du users are bike", "Outgoing_WebHook": "Outgoing WebHook", "Outgoing_WebHook_Description": "Agahdariya ji Rocket-ê dihêle.", + "Outlook_Calendar_Enabled": "çalake", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "URL Redkirin ji bo ku wêneyên barkirî bi. Ev url jî ji bo downloads eger CDN bikaranîn dayîn", "Page_title": "Title title", "Page_URL": "URL", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/lo.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/lo.i18n.json index 25ea4a1dd26f..7e332c00d551 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/lo.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/lo.i18n.json @@ -1914,6 +1914,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR ແມ່ນມີພຽງແຕ່ໃນເວລາທີ່ຜູ້ໃຊ້ທັງສອງອອນໄລນ໌", "Outgoing_WebHook": "Outgoing WebHook", "Outgoing_WebHook_Description": "ໄດ້ຮັບຂໍ້ມູນອອກຈາກ RocketChat ໃນເວລາທີ່ແທ້ຈິງ.", + "Outlook_Calendar_Enabled": "ເປີດການໃຊ້ງານ", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "URL ແທນທີ່ໄຟລ໌ໄດ້ຖືກອັບໂຫລດ. url ນີ້ຍັງສາມາດໃຊ້ສໍາລັບການດາວໂຫລດເວັ້ນເສຍແຕ່ວ່າແຄນາດາຈະໄດ້ຮັບ", "Page_title": "Page title", "Page_URL": "ຫນ້າ URL", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/lt.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/lt.i18n.json index 43d780cd153d..ba328eb2a2f5 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/lt.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/lt.i18n.json @@ -1932,6 +1932,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR galima tik tada, kai abu vartotojai yra prisijungę", "Outgoing_WebHook": "Išeinantis WebHook", "Outgoing_WebHook_Description": "Gauti duomenis iš \"Rocket.Chat\" realiuoju laiku.", + "Outlook_Calendar_Enabled": "Įjungtas", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Nepaisyti URL, į kurį įkelti failai. Šis URL taip pat naudojamas atsisiuntimui, jei nėra CDN", "Page_title": "Puslapio pavadinimas", "Page_URL": "Puslapio URL", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/lv.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/lv.i18n.json index b8e0f5d84a66..9b5187f13b17 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/lv.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/lv.i18n.json @@ -1890,6 +1890,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR ir pieejams tikai tad, ja abi lietotāji ir tiešsaistē", "Outgoing_WebHook": "Izejošais WebHook", "Outgoing_WebHook_Description": "Reāllaikā iegūt datus no Rocket.Chat.", + "Outlook_Calendar_Enabled": "Iespējots", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Pārrakstīt URL, uz kuru faili tika augšupielādēti. Šis URL tiek izmantots arī lejupielādei, ja nav norādīts CDN", "Page_title": "Lapas nosaukums", "Page_URL": "Lapas URL", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/mn.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/mn.i18n.json index a78f07857973..1900ae9e2554 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/mn.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/mn.i18n.json @@ -1872,6 +1872,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR нь хоёулаа онлайн байх үед л боломжтой", "Outgoing_WebHook": "Гарах WebHook", "Outgoing_WebHook_Description": "Рокет.Chat-ээс өгөгдлийг бодит цагт авах.", + "Outlook_Calendar_Enabled": "Идэвхжүүлсэн", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Файлуудыг байршуулсан URL-ыг хэтрүүлэх. Энэ url нь CDN өгөгдөөгүй бол татан авахад хэрэглэгддэг", "Page_title": "Хуудасны гарчиг", "Page_URL": "Хуудасны URL", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ms-MY.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ms-MY.i18n.json index 0749c30b656f..9c3437af7dda 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ms-MY.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ms-MY.i18n.json @@ -1884,6 +1884,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR hanya tersedia apabila kedua-dua pengguna sedang online", "Outgoing_WebHook": "WebHook keluar", "Outgoing_WebHook_Description": "Dapatkan data dari Rocket.Chat secara real-time.", + "Outlook_Calendar_Enabled": "didayakan", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "URL Override untuk fail yang dimuat naik. url ini juga digunakan untuk muat turun melainkan CDN diberikan", "Page_title": "Tajuk halaman", "Page_URL": "URL halaman", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/nl.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/nl.i18n.json index fdc52656a9c8..b132f58ad1c6 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/nl.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/nl.i18n.json @@ -3273,6 +3273,7 @@ "Outgoing": "Uitgaande", "Outgoing_WebHook": "Uitgaande WebHook", "Outgoing_WebHook_Description": "Haal uit Rocket.Chat in realtime.", + "Outlook_Calendar_Enabled": "Ingeschakeld", "Output_format": "Uitvoerformaat", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Overschrijf de URL waarnaar bestanden worden geüpload. Deze url wordt ook gebruikt voor downloads, tenzij een CDN is opgegeven", "Page_title": "Pagina titel", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/no.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/no.i18n.json index e3ce45d342d8..5f078e63f3b6 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/no.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/no.i18n.json @@ -1964,6 +1964,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR er bare tilgjengelig når begge brukerne er online", "Outgoing_WebHook": "Utgående WebHook", "Outgoing_WebHook_Description": "Få data ut av Rocket.Chat i sanntid.", + "Outlook_Calendar_Enabled": "aktivert", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Overstyr URL-adressen til hvilke filer som lastes opp. Denne nettadressen brukes også til nedlastinger med mindre en CDN er gitt", "Page_title": "Side tittel", "Page_URL": "Side URL", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/pl.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/pl.i18n.json index ee9d3c9a95f3..4d97d2559461 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/pl.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/pl.i18n.json @@ -3554,6 +3554,7 @@ "Outgoing": "Wychodzący", "Outgoing_WebHook": "Wychodzący WebHook", "Outgoing_WebHook_Description": "Uzyskaj dane z Rocket.Chat w czasie rzeczywistym.", + "Outlook_Calendar_Enabled": "Włączone", "Output_format": "Format wyjściowy", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Zastąp adres URL, do którego są przesyłane pliki. Ten url również wykorzystywane do pobrania, chyba że podano CDN", "Owner": "Właściciel", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json index efbe4b426654..7d85f1ae67e7 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json @@ -3310,6 +3310,7 @@ "Outgoing": "Enviado", "Outgoing_WebHook": "WebHook de saída", "Outgoing_WebHook_Description": "Obtenha dados de Rocket.Chat em tempo real.", + "Outlook_Calendar_Enabled": "Habilitado", "Output_format": "Formato de saída", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Substituir URL para os arquivos que foram carregados. Este URL também será usado para downloads, a menos que um CDN seja fornecido", "Page_title": "Título da página", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/pt.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/pt.i18n.json index 3e2ea1db9c0f..e1e827e21cdd 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/pt.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/pt.i18n.json @@ -2189,6 +2189,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR só está disponível quando os utilizadores estão online", "Outgoing_WebHook": "WebHook de saída", "Outgoing_WebHook_Description": "Obtenha os dados de Rocket.Chat em tempo real.", + "Outlook_Calendar_Enabled": "Habilitado", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Substituir URL para a qual os arquivos são carregados. Esta url também será usada para downloads, a menos que um CDN seja fornecido", "Page_title": "Título da página", "Page_URL": "URL da página", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ro.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ro.i18n.json index 4a9bf52c9456..8066a2a0bac5 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ro.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ro.i18n.json @@ -1876,6 +1876,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR este disponibilă numai atunci când ambii utilizatori sunt online", "Outgoing_WebHook": "WebHook de ieșire", "Outgoing_WebHook_Description": "Obțineți date din Rocket.Chat în timp real.", + "Outlook_Calendar_Enabled": "Activat", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "URL-ul supracontrol la care sunt încărcate fișiere. Această adresă URL, de asemenea, utilizat pentru download-uri decât dacă o CDN este dată", "Page_title": "Titlul paginii", "Page_URL": "Adresa URL a paginii", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ru.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ru.i18n.json index 42f750b956db..31c421a22be2 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ru.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ru.i18n.json @@ -3433,6 +3433,7 @@ "Outgoing": "Исходящие", "Outgoing_WebHook": "Исходящий WebHook", "Outgoing_WebHook_Description": "Получать данные из Rocket.Chat в режиме реального времени", + "Outlook_Calendar_Enabled": "Включено", "Output_format": "Формат вывода", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Переопределить URL-адрес, на который загружены файлы. Этот URL-адрес также используется для загрузок до тех пор, пока не указан CDN.", "Page_title": "Заголовок страницы", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/sk-SK.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/sk-SK.i18n.json index eb54defefe86..7504f0812efa 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/sk-SK.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/sk-SK.i18n.json @@ -1886,6 +1886,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR je k dispozícii iba vtedy, ak sú obaja používatelia online", "Outgoing_WebHook": "Odchádzajúci WebHook", "Outgoing_WebHook_Description": "Získajte dáta z Rocket.Chat v reálnom čase.", + "Outlook_Calendar_Enabled": "Povolené", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Prepísať adresu URL, do ktorej sú nahrané súbory. Táto adresa URL sa tiež používa na sťahovanie, ak nie je zadaná žiadosť o CDN", "Page_title": "Názov stránky", "Page_URL": "Adresa URL stránky", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/sl-SI.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/sl-SI.i18n.json index 954c54830717..89e48c8937a5 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/sl-SI.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/sl-SI.i18n.json @@ -1866,6 +1866,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR na voljo samo, ko sta oba uporabnika dosegljiva", "Outgoing_WebHook": "Odhodni WebHook", "Outgoing_WebHook_Description": "Pridobite podatke iz aplikacije Rocket.Chat v realnem času.", + "Outlook_Calendar_Enabled": "Omogočeno", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Prevozi URL, na katerega so naložene datoteke. Ta URL je bil uporabljen tudi za prenose, razen če je podan CDN", "Page_title": "Naslov strani", "Page_URL": "URL strani", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/sq.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/sq.i18n.json index fdd705dd663b..a98a96b6a10c 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/sq.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/sq.i18n.json @@ -1876,6 +1876,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR është në dispozicion vetëm kur të dy përdoruesit janë në internet", "Outgoing_WebHook": "WebHook që po largohet", "Outgoing_WebHook_Description": "Merrni të dhëna nga Rocket.Chat në kohë reale.", + "Outlook_Calendar_Enabled": "enabled", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Override URL të cilat fotografi janë ngarkuar. Kjo url përdorur edhe për shkarkime, përveç nëse një CDN është dhënë", "Page_title": "Titulli i faqes", "Page_URL": "URL e faqes", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/sr.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/sr.i18n.json index 725a094d4e2c..21eb34b49b3a 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/sr.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/sr.i18n.json @@ -1708,6 +1708,7 @@ "OTR": "ОТР", "Outgoing_WebHook": "Одлазни ВебХоок", "Outgoing_WebHook_Description": "Добијте податке из Роцкет.Цхат у реалном времену.", + "Outlook_Calendar_Enabled": "Омогућено", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Замени УРЛ адреса за датотеке које су уплоадед. Овај УРЛ се користи за преузимање, осим ако ЦДН дат", "Page_title": "Наслов странице", "Page_URL": "УРЛ адреса странице", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json index 873952ba420c..584725906cd2 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json @@ -3759,6 +3759,7 @@ "Outgoing": "Utgående", "Outgoing_WebHook": "Utgående WebHook", "Outgoing_WebHook_Description": "Hämta data från Rocket.Chat i realtid.", + "Outlook_Calendar_Enabled": "Aktiverad", "Output_format": "Utdataformat", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Åsidosätt URL till vilken filer som laddas upp. Denna url används också för nedladdning såvida inte en CDN anges", "Owner": "Ägare", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ta-IN.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ta-IN.i18n.json index fb9d1cffe1af..02682e3aeea0 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ta-IN.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ta-IN.i18n.json @@ -1877,6 +1877,7 @@ "OTR_is_only_available_when_both_users_are_online": "இரண்டு பயனர்கள் ஆன்லைனில் இருக்கும் போது OTR மட்டுமே உள்ளது", "Outgoing_WebHook": "வெளிச்செல்லும் WebHook", "Outgoing_WebHook_Description": "நிகழ்நேரத்தில் ராக்கெட்.சட்டை வெளியே தரவு கிடைக்கும்.", + "Outlook_Calendar_Enabled": "இயக்கப்பட்டது", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "மீறு URL ஐ கோப்புகளை பதிவேற்றப்படும் வேண்டும். ஒரு வலம்புரி வரை இறக்கம் பயன்படுத்தப்படும் இந்த URL வழங்கப்படும்", "Page_title": "பக்க தலைப்பு", "Page_URL": "பக்க URL", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/th-TH.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/th-TH.i18n.json index 7574fb516b5f..98c7f58e3130 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/th-TH.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/th-TH.i18n.json @@ -1870,6 +1870,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR จะใช้ได้เฉพาะเมื่อผู้ใช้ทั้งสองออนไลน์เท่านั้น", "Outgoing_WebHook": "WebHook ขาออก", "Outgoing_WebHook_Description": "รับข้อมูลจาก Rocket.Chat แบบเรียลไทม์", + "Outlook_Calendar_Enabled": "เปิดใช้งานแล้ว", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "แทนที่ URL ที่อัปโหลดไฟล์ URL นี้ใช้สำหรับการดาวน์โหลดเว้นแต่จะได้รับ CDN", "Page_title": "ชื่อหน้า", "Page_URL": "URL ของหน้าเว็บ", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/tr.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/tr.i18n.json index 4b5a57995436..5c78d413e7f6 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/tr.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/tr.i18n.json @@ -2245,6 +2245,7 @@ "OTR_is_only_available_when_both_users_are_online": "Kayıt Dışı, yalnızca her iki kullanıcı da çevrimiçi ise kullanılabilir.", "Outgoing_WebHook": "Giden WebHook", "Outgoing_WebHook_Description": "Gerçek zamanlı olarak Rocket.Chat'ten veri alın.", + "Outlook_Calendar_Enabled": "Etkin", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "dosyaların yüklendiği hangi geçersiz kıl URL. Ayrıca CDN sürece indirme için kullanılan bu url verilir", "Page_title": "Sayfa başlığı", "Page_URL": "Sayfa URL'si", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ug.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ug.i18n.json index e72486a80a6f..a007147fb810 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ug.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ug.i18n.json @@ -792,6 +792,7 @@ "others": "باشقا", "OTR": "خاتىرىلەنمەيدىغان دىيالوگ", "OTR_is_only_available_when_both_users_are_online": "خاتىرىلەنمەيدىغان دىيالوگ پەقەت ئىككى تەرەپ توردا بولغاندا ئاندىن ئىشلەتكىلى بولىدۇ", + "Outlook_Calendar_Enabled": "ئىشلىتىشكە باشلىدى", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "مۇ چۈشۈرۈش ئۇلانمىسى بولۇپ ئىشلىتىلىدۇ .urlنى تەڭشىمىگەن بولسىڭىز ، CDNنى قايتا يېزىپ ئۇنى ھۆججەت چىقىرىش ئادرېسى قىلىپ بېكىتىڭ. ئەگەر URL", "Password": "پارول", "Password_Change_Disabled": "باشقۇرغۇچىڭىز ئاللىبۇرۇن پارولنى ئۆزگەرتىش ئىقتىدارىنى چەكلىدىRocket.Chatسىزنىڭ", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/uk.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/uk.i18n.json index 9919c95fc36e..c7a1d9f5e576 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/uk.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/uk.i18n.json @@ -2406,6 +2406,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR доступний тільки тоді, коли обидва користувачі знаходяться в мережі", "Outgoing_WebHook": "Вихідний WebHook", "Outgoing_WebHook_Description": "Отримайте дані поза Rocket.Chat в режимі реального часу.", + "Outlook_Calendar_Enabled": "Включено", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Override URL, до якого файли завантажуються. Цей URL-адресу також використовується для завантаження, якщо тільки в CDN дається", "Page_title": "Назва сторінки", "Page_URL": "URL-адреса сторінки", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/vi-VN.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/vi-VN.i18n.json index d531bd034f62..d2f19f8d73ce 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/vi-VN.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/vi-VN.i18n.json @@ -1977,6 +1977,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR chỉ khả dụng khi cả người dùng trực tuyến", "Outgoing_WebHook": "WebHook gửi đi", "Outgoing_WebHook_Description": "Lấy dữ liệu ra khỏi Rocket.Chat theo thời gian thực.", + "Outlook_Calendar_Enabled": "Đã bật", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "Ghi đè URL mà tệp được tải lên. Url này cũng được sử dụng cho việc tải xuống trừ khi có CDN", "Page_title": "Tiêu đề trang", "Page_URL": "URL Trang", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/zh-HK.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/zh-HK.i18n.json index ed085a4b9630..49ec4bee3d66 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/zh-HK.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/zh-HK.i18n.json @@ -1901,6 +1901,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR仅在两个用户在线时才可用", "Outgoing_WebHook": "即将离任的WebHook", "Outgoing_WebHook_Description": "实时获取Rocket.Chat数据。", + "Outlook_Calendar_Enabled": "已啟用", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "覆盖文件上传到的URL。此网址也用于下载,除非提供CDN", "Page_title": "页面标题", "Page_URL": "页面URL", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/zh-TW.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/zh-TW.i18n.json index a23e2152c5cf..6e9480b1bb5a 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/zh-TW.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/zh-TW.i18n.json @@ -3159,6 +3159,7 @@ "Outgoing": "傳出", "Outgoing_WebHook": "外部的 WebHook", "Outgoing_WebHook_Description": "即時獲取 Rocket.Chat 資料。", + "Outlook_Calendar_Enabled": "啟用", "Output_format": "輸出格式", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "哪些檔案被上傳覆蓋網址。該網址也可用於下載,除非CDN放出", "Page_title": "頁面標題", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/zh.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/zh.i18n.json index 17b890b82245..84b95cc7cf02 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/zh.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/zh.i18n.json @@ -2843,6 +2843,7 @@ "OTR_is_only_available_when_both_users_are_online": "OTR 只能在双方均在线时使用", "Outgoing_WebHook": "出站 WebHook", "Outgoing_WebHook_Description": "实时获取Rocket.Chat数据。", + "Outlook_Calendar_Enabled": "已启用", "Output_format": "输出格式", "Override_URL_to_which_files_are_uploaded_This_url_also_used_for_downloads_unless_a_CDN_is_given": "重写 URL 为文件上传地址。如果没有设置 CDN,url 也会被当作下载链接。", "Page_title": "页面标题", From ffea6f4b74745dab85cbbf25ce26edb3f473f491 Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Tue, 18 Jul 2023 23:09:46 -0300 Subject: [PATCH 12/14] regression: Remove wrong navigation bar feature preview image (#29859) --- packages/ui-client/src/hooks/useFeaturePreviewList.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/ui-client/src/hooks/useFeaturePreviewList.ts b/packages/ui-client/src/hooks/useFeaturePreviewList.ts index 87a89e9d5a67..03d31c938e76 100644 --- a/packages/ui-client/src/hooks/useFeaturePreviewList.ts +++ b/packages/ui-client/src/hooks/useFeaturePreviewList.ts @@ -26,7 +26,6 @@ export const defaultFeaturesPreview: FeaturePreviewProps[] = [ i18n: 'Navigation_bar', description: 'Navigation_bar_description', group: 'Navigation', - imageUrl: 'images/featurePreview/quick-reactions.png', value: false, }, ]; From 287878c1eea0fd1140ca75a17dbd58e82eb7a10b Mon Sep 17 00:00:00 2001 From: Tasso Evangelista Date: Tue, 18 Jul 2023 23:35:45 -0300 Subject: [PATCH 13/14] chore(lint): Reinforce ESLint for React (#29857) --- apps/meteor/.eslintrc.json | 25 +------- .../ComposerBoxPopupPreview.tsx | 2 +- apps/meteor/client/.eslintrc.json | 25 +------- .../DefaultParentRoomField.tsx | 2 +- .../InfoPanel/InfoPanel.stories.tsx | 2 +- .../Omnichannel/modals/ForwardChatModal.tsx | 30 +++++----- .../urlPreviews/OEmbedPreviewContent.tsx | 2 +- .../content/urlPreviews/UrlImagePreview.tsx | 2 +- .../client/sidebar/Item/Condensed.stories.tsx | 6 +- apps/meteor/client/sidebar/Item/Condensed.tsx | 6 +- .../client/sidebar/Item/Extended.stories.tsx | 6 +- apps/meteor/client/sidebar/Item/Extended.tsx | 6 +- .../client/sidebar/Item/Medium.stories.tsx | 6 +- apps/meteor/client/sidebar/Item/Medium.tsx | 6 +- .../FederatedRoomListItem.tsx | 2 +- .../MatrixFederationManageServerModal.tsx | 2 +- .../actions/OmnichannelLivechatToggle.tsx | 2 +- .../AccountTokensTable/AccountTokensTable.tsx | 10 ++-- .../RegisterWorkspaceSetupStepOneModal.tsx | 2 +- .../moderation/ModerationConsoleTable.tsx | 18 ++---- .../permissions/CustomRoleUpsellModal.tsx | 2 +- .../views/admin/permissions/RoleForm.tsx | 2 +- .../client/views/admin/rooms/RoomsTable.tsx | 19 ++---- .../client/views/admin/settings/Section.tsx | 2 +- .../groups/voip/VoipExtensionsPage.tsx | 2 +- .../tabs/users/UsersTable/UsersTable.tsx | 4 +- apps/meteor/client/views/meet/CallPage.tsx | 2 +- apps/meteor/client/views/meet/MeetPage.tsx | 2 +- .../omnichannel/agents/AgentInfoActions.tsx | 4 +- .../MessageList/ContactHistoryMessage.tsx | 4 +- .../departments/EditDepartment.tsx | 12 ++-- .../directory/ChatsContextualBar.tsx | 2 +- .../directory/ContactContextualBar.tsx | 2 +- .../omnichannel/directory/calls/CallTable.tsx | 6 +- .../Omnichannel/OmnichannelRoomHeader.tsx | 2 +- apps/meteor/client/views/room/RoomOpener.tsx | 6 +- .../ExportMessages/MailExportForm.tsx | 2 +- .../contextualBar/Info/RoomInfo/RoomInfo.tsx | 2 +- .../NotificationPreferencesForm.tsx | 2 +- .../views/setupWizard/steps/AdminInfoStep.tsx | 2 +- .../teams/contextualBar/info/TeamsInfo.tsx | 16 +++-- .../cannedResponses/CannedResponsesTable.tsx | 2 +- .../components/cannedResponseForm.tsx | 2 +- .../priorities/PriorityEditForm.tsx | 2 +- .../omnichannel/slaPolicies/SlaTable.tsx | 2 +- .../client/omnichannel/units/UnitsTable.tsx | 6 +- .../DeviceManagementAccountTable.tsx | 10 ++-- .../DeviceManagementAdminTable.tsx | 16 ++--- .../channels/ChannelsOverview.tsx | 2 +- .../messages/MessagesPerChannelSection.tsx | 2 +- apps/meteor/tests/e2e/.eslintrc.json | 4 +- ee/packages/pdf-worker/.eslintrc.json | 2 +- ee/packages/ui-theming/.eslintrc.json | 2 +- .../ui-theming/src/PaletteStyleTag.tsx | 3 +- .../ui-theming/src/SidebarPaletteStyleTag.tsx | 2 +- .../ui-theming/src/hooks/useThemeMode.ts | 13 ++++- package.json | 2 +- packages/eslint-config/react.js | 32 ++++++++++ packages/fuselage-ui-kit/.eslintrc.js | 7 ++- packages/gazzodown/.eslintrc.json | 1 + packages/mock-providers/.eslintrc.json | 2 +- packages/ui-client/.eslintrc.json | 23 ++------ packages/ui-composer/.eslintrc.json | 21 +------ packages/ui-contexts/.eslintrc.json | 2 +- packages/ui-video-conf/.eslintrc.json | 23 ++------ packages/web-ui-registration/.eslintrc.json | 2 +- .../components/LoginSwitchLanguageFooter.tsx | 2 +- yarn.lock | 58 +++++++++---------- 68 files changed, 238 insertions(+), 266 deletions(-) create mode 100644 packages/eslint-config/react.js diff --git a/apps/meteor/.eslintrc.json b/apps/meteor/.eslintrc.json index 31d63e993611..a338ba226b3b 100644 --- a/apps/meteor/.eslintrc.json +++ b/apps/meteor/.eslintrc.json @@ -1,5 +1,5 @@ { - "extends": ["@rocket.chat/eslint-config", "plugin:you-dont-need-lodash-underscore/compatible"], + "extends": ["@rocket.chat/eslint-config", "@rocket.chat/eslint-config/react", "plugin:you-dont-need-lodash-underscore/compatible"], "globals": { "__meteor_bootstrap__": false, "__meteor_runtime_config__": false, @@ -7,13 +7,7 @@ "chrome": false, "jscolor": false }, - "plugins": ["react", "react-hooks"], "rules": { - "react/jsx-uses-react": "error", - "react/jsx-uses-vars": "error", - "react/jsx-no-undef": "error", - "react/jsx-fragments": ["error", "syntax"], - "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": [ "warn", { @@ -21,11 +15,6 @@ } ] }, - "settings": { - "react": { - "version": "detect" - } - }, "overrides": [ { "files": ["**/*.ts", "**/*.tsx"], @@ -33,12 +22,7 @@ "Atomics": "readonly", "SharedArrayBuffer": "readonly" }, - "plugins": ["react"], "rules": { - "react/jsx-uses-react": "error", - "react/jsx-uses-vars": "error", - "react/jsx-no-undef": "error", - "react/jsx-fragments": ["error", "syntax"], "@typescript-eslint/no-misused-promises": [ "error", { @@ -53,12 +37,7 @@ "parserOptions": { "project": ["./tsconfig.json"] }, - "excludedFiles": [".scripts/*.ts"], - "settings": { - "react": { - "version": "detect" - } - } + "excludedFiles": [".scripts/*.ts"] }, { "files": ["**/*.tests.js", "**/*.tests.ts", "**/*.spec.ts"], diff --git a/apps/meteor/app/ui-message/client/popup/components/composerBoxPopupPreview/ComposerBoxPopupPreview.tsx b/apps/meteor/app/ui-message/client/popup/components/composerBoxPopupPreview/ComposerBoxPopupPreview.tsx index 45188e62122c..89c7de840820 100644 --- a/apps/meteor/app/ui-message/client/popup/components/composerBoxPopupPreview/ComposerBoxPopupPreview.tsx +++ b/apps/meteor/app/ui-message/client/popup/components/composerBoxPopupPreview/ComposerBoxPopupPreview.tsx @@ -19,7 +19,7 @@ const ComposerBoxPopupPreview = forwardRef< tmid?: string; suspended?: boolean; } ->(({ focused, items, rid, tmid, select, suspended }, ref) => { +>(function ComposerBoxPopupPreview({ focused, items, rid, tmid, select, suspended }, ref) { const id = useUniqueId(); const chat = useChat(); const executeSlashCommandPreviewMethod = useMethod('executeSlashCommandPreview'); diff --git a/apps/meteor/client/.eslintrc.json b/apps/meteor/client/.eslintrc.json index 286fbb957017..f772d4366e0e 100644 --- a/apps/meteor/client/.eslintrc.json +++ b/apps/meteor/client/.eslintrc.json @@ -1,6 +1,6 @@ { "root": true, - "extends": ["@rocket.chat/eslint-config/original", "prettier", "plugin:you-dont-need-lodash-underscore/compatible"], + "extends": ["@rocket.chat/eslint-config/original", "@rocket.chat/eslint-config/react", "prettier", "plugin:you-dont-need-lodash-underscore/compatible"], "parser": "@babel/eslint-parser", "plugins": ["react", "react-hooks", "prettier", "testing-library", "anti-trojan-source"], "rules": { @@ -29,14 +29,6 @@ } ], "prettier/prettier": 2, - "react/display-name": "error", - "react/jsx-uses-react": "error", - "react/jsx-uses-vars": "error", - "react/jsx-no-undef": "error", - "react/jsx-fragments": ["error", "syntax"], - "react/jsx-key": ["error", { "checkFragmentShorthand": true, "checkKeyMustBeforeSpread": true, "warnOnDuplicates": true }], - "react/no-multi-comp": "error", - "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": [ "warn", { @@ -50,9 +42,6 @@ "node": { "extensions": [".js", ".ts", ".tsx"] } - }, - "react": { - "version": "detect" } }, "env": { @@ -63,7 +52,6 @@ { "files": ["**/*.ts", "**/*.tsx"], "extends": ["@rocket.chat/eslint-config"], - "plugins": ["react", "react-hooks"], "rules": { "@typescript-eslint/naming-convention": [ "error", @@ -136,14 +124,6 @@ } ], "prettier/prettier": 2, - "react/display-name": "error", - "react/jsx-uses-react": "error", - "react/jsx-uses-vars": "error", - "react/jsx-no-undef": "error", - "react/jsx-fragments": ["error", "syntax"], - "react/jsx-key": ["error", { "checkFragmentShorthand": true, "checkKeyMustBeforeSpread": true, "warnOnDuplicates": true }], - "react/no-multi-comp": "error", - "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": [ "warn", { @@ -160,9 +140,6 @@ "node": { "extensions": [".js", ".ts", ".tsx"] } - }, - "react": { - "version": "detect" } } }, diff --git a/apps/meteor/client/components/CreateDiscussion/DefaultParentRoomField.tsx b/apps/meteor/client/components/CreateDiscussion/DefaultParentRoomField.tsx index 88de1d35051f..0a2717a65552 100644 --- a/apps/meteor/client/components/CreateDiscussion/DefaultParentRoomField.tsx +++ b/apps/meteor/client/components/CreateDiscussion/DefaultParentRoomField.tsx @@ -23,7 +23,7 @@ const DefaultParentRoomField = ({ defaultParentRoom }: { defaultParentRoom: stri } if (!value || !value.room) { - return {t('Error')}; + return {t('Error')}; } return ( diff --git a/apps/meteor/client/components/InfoPanel/InfoPanel.stories.tsx b/apps/meteor/client/components/InfoPanel/InfoPanel.stories.tsx index 9d29007f9b90..4e8e44b1f932 100644 --- a/apps/meteor/client/components/InfoPanel/InfoPanel.stories.tsx +++ b/apps/meteor/client/components/InfoPanel/InfoPanel.stories.tsx @@ -24,7 +24,7 @@ export const Default: ComponentStory = () => ( - + diff --git a/apps/meteor/client/components/Omnichannel/modals/ForwardChatModal.tsx b/apps/meteor/client/components/Omnichannel/modals/ForwardChatModal.tsx index 9ff01a4b7d6c..4754e0bcbd63 100644 --- a/apps/meteor/client/components/Omnichannel/modals/ForwardChatModal.tsx +++ b/apps/meteor/client/components/Omnichannel/modals/ForwardChatModal.tsx @@ -101,24 +101,22 @@ const ForwardChatModal = ({ - + {t('Forward_to_department')} - { - { - setValue('department', value); - }} - flexGrow={1} - endReached={endReached} - /> - } + { + setValue('department', value); + }} + flexGrow={1} + endReached={endReached} + /> diff --git a/apps/meteor/client/components/message/content/urlPreviews/OEmbedPreviewContent.tsx b/apps/meteor/client/components/message/content/urlPreviews/OEmbedPreviewContent.tsx index 2955a1eb5b39..97a01c552523 100644 --- a/apps/meteor/client/components/message/content/urlPreviews/OEmbedPreviewContent.tsx +++ b/apps/meteor/client/components/message/content/urlPreviews/OEmbedPreviewContent.tsx @@ -39,7 +39,7 @@ const OEmbedPreviewContent = ({ {showSiteName && } - {showFooterSeparator && {'|'}} + {showFooterSeparator && |} {showAuthorName && } diff --git a/apps/meteor/client/components/message/content/urlPreviews/UrlImagePreview.tsx b/apps/meteor/client/components/message/content/urlPreviews/UrlImagePreview.tsx index 1227faee6eeb..f56adef8f12d 100644 --- a/apps/meteor/client/components/message/content/urlPreviews/UrlImagePreview.tsx +++ b/apps/meteor/client/components/message/content/urlPreviews/UrlImagePreview.tsx @@ -9,7 +9,7 @@ const UrlImagePreview = ({ url }: Pick): ReactElement const { maxHeight: oembedMaxHeight } = useOembedLayout(); return ( - + ); diff --git a/apps/meteor/client/sidebar/Item/Condensed.stories.tsx b/apps/meteor/client/sidebar/Item/Condensed.stories.tsx index bda4d9769276..915c4646f082 100644 --- a/apps/meteor/client/sidebar/Item/Condensed.stories.tsx +++ b/apps/meteor/client/sidebar/Item/Condensed.stories.tsx @@ -26,7 +26,11 @@ export default { const Template: ComponentStory = (args) => ( {}} + titleIcon={ + + + + } avatar={} /> ); diff --git a/apps/meteor/client/sidebar/Item/Condensed.tsx b/apps/meteor/client/sidebar/Item/Condensed.tsx index 9a8988a6ed0c..527d38a0879c 100644 --- a/apps/meteor/client/sidebar/Item/Condensed.tsx +++ b/apps/meteor/client/sidebar/Item/Condensed.tsx @@ -48,7 +48,11 @@ const Condensed: FC = ({ icon, title = '', avatar, actions, href )} - {actions && {{actions}}} + {actions && ( + + {actions} + + )} ); }; diff --git a/apps/meteor/client/sidebar/Item/Extended.stories.tsx b/apps/meteor/client/sidebar/Item/Extended.stories.tsx index b621ea3396b4..04c993bc963c 100644 --- a/apps/meteor/client/sidebar/Item/Extended.stories.tsx +++ b/apps/meteor/client/sidebar/Item/Extended.stories.tsx @@ -51,7 +51,11 @@ const Template: ComponentStory = (args) => ( } - titleIcon={{}} + titleIcon={ + + + + } avatar={} /> ); diff --git a/apps/meteor/client/sidebar/Item/Extended.tsx b/apps/meteor/client/sidebar/Item/Extended.tsx index a23b55ff10de..c896037d7f3d 100644 --- a/apps/meteor/client/sidebar/Item/Extended.tsx +++ b/apps/meteor/client/sidebar/Item/Extended.tsx @@ -78,7 +78,11 @@ const Extended: VFC = ({ - {actions && {{actions}}} + {actions && ( + + {actions} + + )} ); }; diff --git a/apps/meteor/client/sidebar/Item/Medium.stories.tsx b/apps/meteor/client/sidebar/Item/Medium.stories.tsx index 9fe712d95f87..d7698356f1b1 100644 --- a/apps/meteor/client/sidebar/Item/Medium.stories.tsx +++ b/apps/meteor/client/sidebar/Item/Medium.stories.tsx @@ -26,7 +26,11 @@ export default { const Template: ComponentStory = (args) => ( {}} + titleIcon={ + + + + } avatar={} /> ); diff --git a/apps/meteor/client/sidebar/Item/Medium.tsx b/apps/meteor/client/sidebar/Item/Medium.tsx index 16de09d151f8..2c97b890988f 100644 --- a/apps/meteor/client/sidebar/Item/Medium.tsx +++ b/apps/meteor/client/sidebar/Item/Medium.tsx @@ -46,7 +46,11 @@ const Medium: VFC = ({ icon, title = '', avatar, actions, href, bad )} - {actions && {{actions}}} + {actions && ( + + {actions} + + )} ); }; diff --git a/apps/meteor/client/sidebar/header/MatrixFederationSearch/FederatedRoomListItem.tsx b/apps/meteor/client/sidebar/header/MatrixFederationSearch/FederatedRoomListItem.tsx index 6afe313f636d..90d7885b4a62 100644 --- a/apps/meteor/client/sidebar/header/MatrixFederationSearch/FederatedRoomListItem.tsx +++ b/apps/meteor/client/sidebar/header/MatrixFederationSearch/FederatedRoomListItem.tsx @@ -39,7 +39,7 @@ const FederatedRoomListItem: VFC = ({ {/* Currently canJoin is only false when the ammount of members is too big. This property will be used in the future in case the matrix room is knock only. When that happens, the check for this should be based on the limit setting. */} {!canJoin && ( - + {t('Cant_join')} )} diff --git a/apps/meteor/client/sidebar/header/MatrixFederationSearch/MatrixFederationManageServerModal.tsx b/apps/meteor/client/sidebar/header/MatrixFederationSearch/MatrixFederationManageServerModal.tsx index 5dff5a642ec1..56752d5c3a68 100644 --- a/apps/meteor/client/sidebar/header/MatrixFederationSearch/MatrixFederationManageServerModal.tsx +++ b/apps/meteor/client/sidebar/header/MatrixFederationSearch/MatrixFederationManageServerModal.tsx @@ -56,7 +56,7 @@ const MatrixFederationAddServerModal: VFC = const { data, isLoading: isLoadingServerList } = useMatrixServerList(); return ( - + {t('Manage_servers')} diff --git a/apps/meteor/client/sidebar/sections/actions/OmnichannelLivechatToggle.tsx b/apps/meteor/client/sidebar/sections/actions/OmnichannelLivechatToggle.tsx index bf5867df254c..c0abb70b230d 100644 --- a/apps/meteor/client/sidebar/sections/actions/OmnichannelLivechatToggle.tsx +++ b/apps/meteor/client/sidebar/sections/actions/OmnichannelLivechatToggle.tsx @@ -23,7 +23,7 @@ export const OmnichannelLivechatToggle = (props: Omit { const headers = useMemo( () => [ - {t('API_Personal_Access_Token_Name')}, - isMedium && {t('Created_at')}, - {t('Last_token_part')}, - {t('Two Factor Authentication')}, - , + {t('API_Personal_Access_Token_Name')}, + isMedium && {t('Created_at')}, + {t('Last_token_part')}, + {t('Two Factor Authentication')}, + , ].filter(Boolean), [isMedium, t], ); diff --git a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepOneModal.tsx b/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepOneModal.tsx index 1f00584c0b64..09548b3349a9 100644 --- a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepOneModal.tsx +++ b/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepOneModal.tsx @@ -90,7 +90,7 @@ const RegisterWorkspaceSetupStepOneModal = ({ I agree with Terms and Conditions - and {''} + and Privacy Policy diff --git a/apps/meteor/client/views/admin/moderation/ModerationConsoleTable.tsx b/apps/meteor/client/views/admin/moderation/ModerationConsoleTable.tsx index c318f9fb8a3e..0c826fd1f176 100644 --- a/apps/meteor/client/views/admin/moderation/ModerationConsoleTable.tsx +++ b/apps/meteor/client/views/admin/moderation/ModerationConsoleTable.tsx @@ -74,7 +74,7 @@ const ModerationConsoleTable: FC = () => { const headers = useMemo( () => [ { ), { > {t('Moderation_Reported_message')} , - + {t('Room')} , - + {t('Moderation_Report_date')} , - + {t('Moderation_Report_plural')} , - , + , ], [sortDirection, sortBy, setSort, t, isDesktopOrLarger], ); diff --git a/apps/meteor/client/views/admin/permissions/CustomRoleUpsellModal.tsx b/apps/meteor/client/views/admin/permissions/CustomRoleUpsellModal.tsx index bbe841226bed..91224cd8ed3b 100644 --- a/apps/meteor/client/views/admin/permissions/CustomRoleUpsellModal.tsx +++ b/apps/meteor/client/views/admin/permissions/CustomRoleUpsellModal.tsx @@ -25,7 +25,7 @@ const CustomRoleUpsellModal: VFC = ({ onClose }) => variant='warning' icon={null} > - + {t('Custom_roles_upsell_add_custom_roles_workspace')} diff --git a/apps/meteor/client/views/admin/permissions/RoleForm.tsx b/apps/meteor/client/views/admin/permissions/RoleForm.tsx index 6fcae6b620b2..346b1064db1f 100644 --- a/apps/meteor/client/views/admin/permissions/RoleForm.tsx +++ b/apps/meteor/client/views/admin/permissions/RoleForm.tsx @@ -42,7 +42,7 @@ const RoleForm = ({ className, editing = false, isProtected = false, isDisabled - {'Leave the description field blank if you dont want to show the role'} + Leave the description field blank if you dont want to show the role {t('Scope')} diff --git a/apps/meteor/client/views/admin/rooms/RoomsTable.tsx b/apps/meteor/client/views/admin/rooms/RoomsTable.tsx index 0c36105d89ba..0f7d02bea814 100644 --- a/apps/meteor/client/views/admin/rooms/RoomsTable.tsx +++ b/apps/meteor/client/views/admin/rooms/RoomsTable.tsx @@ -119,14 +119,14 @@ const RoomsTable = ({ reload }: { reload: MutableRefObject<() => void> }): React const headers = useMemo( () => [ - + {t('Name')} , - + {t('Type')} , void> }): React {t('Users')} , mediaQuery && ( - + {t('Msgs')} ), mediaQuery && ( void> }): React ), mediaQuery && ( diff --git a/apps/meteor/client/views/admin/settings/groups/voip/VoipExtensionsPage.tsx b/apps/meteor/client/views/admin/settings/groups/voip/VoipExtensionsPage.tsx index a27ea9ac1564..978cd02a7f08 100644 --- a/apps/meteor/client/views/admin/settings/groups/voip/VoipExtensionsPage.tsx +++ b/apps/meteor/client/views/admin/settings/groups/voip/VoipExtensionsPage.tsx @@ -89,7 +89,7 @@ const VoipExtensionsPage = () => { {username ? ( - + diff --git a/apps/meteor/client/views/directory/tabs/users/UsersTable/UsersTable.tsx b/apps/meteor/client/views/directory/tabs/users/UsersTable/UsersTable.tsx index 768ba65a9b77..c67d408aa2a3 100644 --- a/apps/meteor/client/views/directory/tabs/users/UsersTable/UsersTable.tsx +++ b/apps/meteor/client/views/directory/tabs/users/UsersTable/UsersTable.tsx @@ -36,12 +36,12 @@ const UsersTable = ({ workspace = 'local' }): ReactElement => { const headers = useMemo( () => [ - + {t('Name')} , mediaQuery && canViewFullOtherUserInfo && ( = ({ size='x124' /> - {'Calling...'} + Calling... { className='rcx-message__avatar' size='x124' /> -

{'Call Ended!'}

+

Call Ended!

void }): ReactElement => { return ( <> - - + + ); }; diff --git a/apps/meteor/client/views/omnichannel/contactHistory/MessageList/ContactHistoryMessage.tsx b/apps/meteor/client/views/omnichannel/contactHistory/MessageList/ContactHistoryMessage.tsx index 7978903afe9c..88cd8ebdf0eb 100644 --- a/apps/meteor/client/views/omnichannel/contactHistory/MessageList/ContactHistoryMessage.tsx +++ b/apps/meteor/client/views/omnichannel/contactHistory/MessageList/ContactHistoryMessage.tsx @@ -51,7 +51,7 @@ const ContactHistoryMessage: FC<{ @@ -79,7 +79,7 @@ const ContactHistoryMessage: FC<{ diff --git a/apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx b/apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx index 6cb32e877397..a5821382ac5b 100644 --- a/apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx +++ b/apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx @@ -343,7 +343,7 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen )} @@ -360,7 +360,7 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen )} @@ -377,7 +377,7 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen )} @@ -394,8 +394,8 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen )} /> @@ -412,7 +412,7 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen departmentId={id ?? ''} value={value} handler={onChange} - label={'List_of_departments_for_forward'} + label='List_of_departments_for_forward' /> )} /> diff --git a/apps/meteor/client/views/omnichannel/directory/ChatsContextualBar.tsx b/apps/meteor/client/views/omnichannel/directory/ChatsContextualBar.tsx index aa92b72310eb..af02cc59d64f 100644 --- a/apps/meteor/client/views/omnichannel/directory/ChatsContextualBar.tsx +++ b/apps/meteor/client/views/omnichannel/directory/ChatsContextualBar.tsx @@ -62,7 +62,7 @@ const ChatsContextualBar: FC<{ chatReload?: () => void }> = ({ chatReload }) => <> {t('Room_Info')} - + )} {bar === 'edit' && ( diff --git a/apps/meteor/client/views/omnichannel/directory/ContactContextualBar.tsx b/apps/meteor/client/views/omnichannel/directory/ContactContextualBar.tsx index 6a51b6fa4b03..d31648aeaae2 100644 --- a/apps/meteor/client/views/omnichannel/directory/ContactContextualBar.tsx +++ b/apps/meteor/client/views/omnichannel/directory/ContactContextualBar.tsx @@ -38,7 +38,7 @@ const ContactContextualBar = () => { const header = useMemo(() => HEADER_OPTIONS[bar] || HEADER_OPTIONS.info, [bar]); return ( - + {t(header.title)} diff --git a/apps/meteor/client/views/omnichannel/directory/calls/CallTable.tsx b/apps/meteor/client/views/omnichannel/directory/calls/CallTable.tsx index 5aa474893476..89ae577f4bb8 100644 --- a/apps/meteor/client/views/omnichannel/directory/calls/CallTable.tsx +++ b/apps/meteor/client/views/omnichannel/directory/calls/CallTable.tsx @@ -60,14 +60,14 @@ const CallTable = () => { {t('Phone')} - + {t('Queue')} - + {t('Started_At')} = ({ slots: parentSl start: (!!isMobile || currentRouteName === 'omnichannel-directory' || currentRouteName === 'omnichannel-current-chats') && ( {isMobile && } - {} + ), posContent: , diff --git a/apps/meteor/client/views/room/RoomOpener.tsx b/apps/meteor/client/views/room/RoomOpener.tsx index fc7eba8d7f15..43c2bbed9027 100644 --- a/apps/meteor/client/views/room/RoomOpener.tsx +++ b/apps/meteor/client/views/room/RoomOpener.tsx @@ -29,7 +29,11 @@ const RoomOpener = ({ type, reference }: RoomOpenerProps): ReactElement => { return ( }> {isLoading && } - {isSuccess && {}} + {isSuccess && ( + + + + )} {isError && (() => { if (error instanceof RoomNotFoundError) { diff --git a/apps/meteor/client/views/room/contextualBar/ExportMessages/MailExportForm.tsx b/apps/meteor/client/views/room/contextualBar/ExportMessages/MailExportForm.tsx index 078ea3bd797a..31d327351ae8 100644 --- a/apps/meteor/client/views/room/contextualBar/ExportMessages/MailExportForm.tsx +++ b/apps/meteor/client/views/room/contextualBar/ExportMessages/MailExportForm.tsx @@ -139,7 +139,7 @@ const MailExportForm: FC = ({ onCancel, rid }) => { - {errorMessage && {errorMessage}} + {errorMessage && {errorMessage}} diff --git a/apps/meteor/client/views/room/contextualBar/Info/RoomInfo/RoomInfo.tsx b/apps/meteor/client/views/room/contextualBar/Info/RoomInfo/RoomInfo.tsx index bcfe97d6b816..3cb5d5f5ee58 100644 --- a/apps/meteor/client/views/room/contextualBar/Info/RoomInfo/RoomInfo.tsx +++ b/apps/meteor/client/views/room/contextualBar/Info/RoomInfo/RoomInfo.tsx @@ -77,7 +77,7 @@ const RoomInfo = ({ room, icon, onClickBack, onClickClose, onClickEnterRoom, onC - + {actions} diff --git a/apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesForm.tsx b/apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesForm.tsx index 8fa434f55255..7be5f929d12b 100644 --- a/apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesForm.tsx +++ b/apps/meteor/client/views/room/contextualBar/NotificationPreferences/NotificationPreferencesForm.tsx @@ -111,7 +111,7 @@ const NotificationPreferencesForm = ({ notificationOptions, handlePlaySound }: N )} /> - + { return ( password.length > 0} - passwordRulesHint={''} + passwordRulesHint='' validateUsername={validateUsername} validateEmail={validateEmail} currentStep={currentStep} diff --git a/apps/meteor/client/views/teams/contextualBar/info/TeamsInfo.tsx b/apps/meteor/client/views/teams/contextualBar/info/TeamsInfo.tsx index 1863434fcf4d..501baf796f7d 100644 --- a/apps/meteor/client/views/teams/contextualBar/info/TeamsInfo.tsx +++ b/apps/meteor/client/views/teams/contextualBar/info/TeamsInfo.tsx @@ -134,7 +134,7 @@ const TeamsInfo = ({ - + {actions} @@ -148,7 +148,7 @@ const TeamsInfo = ({ - + @@ -163,21 +163,27 @@ const TeamsInfo = ({ {room.description && ( {t('Description')} - {} + + + )} {room.announcement && ( {t('Announcement')} - {} + + + )} {room.topic && ( {t('Topic')} - {} + + + )} diff --git a/apps/meteor/ee/client/omnichannel/cannedResponses/CannedResponsesTable.tsx b/apps/meteor/ee/client/omnichannel/cannedResponses/CannedResponsesTable.tsx index 8a563e94bcc5..efc64a8a4e09 100644 --- a/apps/meteor/ee/client/omnichannel/cannedResponses/CannedResponsesTable.tsx +++ b/apps/meteor/ee/client/omnichannel/cannedResponses/CannedResponsesTable.tsx @@ -113,7 +113,7 @@ const CannedResponsesTable = () => { {t('Created_by')} {t('Shortcut')} v?.trim() !== '' }} render={({ field: { value, onChange } }): ReactElement => ( void> }) => { > {t('Estimated_wait_time')} - + {t('Remove')} diff --git a/apps/meteor/ee/client/omnichannel/units/UnitsTable.tsx b/apps/meteor/ee/client/omnichannel/units/UnitsTable.tsx index b354e52aa35b..2cc8b55c78f1 100644 --- a/apps/meteor/ee/client/omnichannel/units/UnitsTable.tsx +++ b/apps/meteor/ee/client/omnichannel/units/UnitsTable.tsx @@ -57,11 +57,11 @@ const UnitsTable = ({ reload }: { reload: MutableRefObject<() => void> }) => { ); const headers = ( <> - + {t('Name')} void> }) => { > {t('Visibility')} - + {t('Remove')} diff --git a/apps/meteor/ee/client/views/account/deviceManagement/DeviceManagementAccountTable/DeviceManagementAccountTable.tsx b/apps/meteor/ee/client/views/account/deviceManagement/DeviceManagementAccountTable/DeviceManagementAccountTable.tsx index b3f5fde30912..fe480928e543 100644 --- a/apps/meteor/ee/client/views/account/deviceManagement/DeviceManagementAccountTable/DeviceManagementAccountTable.tsx +++ b/apps/meteor/ee/client/views/account/deviceManagement/DeviceManagementAccountTable/DeviceManagementAccountTable.tsx @@ -36,17 +36,17 @@ const DeviceManagementAccountTable = (): ReactElement => { const headers = useMemo( () => [ - + {t('Client')} , - + {t('OS')} , - + {t('Last_login')} , - mediaQuery && {t('Device_ID')}, - , + mediaQuery && {t('Device_ID')}, + , ], [t, mediaQuery, sortDirection, sortBy, setSort], ); diff --git a/apps/meteor/ee/client/views/admin/deviceManagement/DeviceManagementAdminTable/DeviceManagementAdminTable.tsx b/apps/meteor/ee/client/views/admin/deviceManagement/DeviceManagementAdminTable/DeviceManagementAdminTable.tsx index db1c78f53ced..428242f987d0 100644 --- a/apps/meteor/ee/client/views/admin/deviceManagement/DeviceManagementAdminTable/DeviceManagementAdminTable.tsx +++ b/apps/meteor/ee/client/views/admin/deviceManagement/DeviceManagementAdminTable/DeviceManagementAdminTable.tsx @@ -52,24 +52,24 @@ const DeviceManagementAdminTable = ({ reloadRef }: { reloadRef: MutableRefObject const headers = useMemo( () => [ - + {t('Client')} , - {t('Version')}, - + {t('Version')}, + {t('OS')} , - + {t('User')} , mediaQuery && ( - + {t('Last_login')} ), - mediaQuery && {t('Device_ID')}, - mediaQuery && {t('IP_Address')}, - , + mediaQuery && {t('Device_ID')}, + mediaQuery && {t('IP_Address')}, + , ], [t, mediaQuery, setSort, sortDirection, sortBy], ); diff --git a/apps/meteor/ee/client/views/admin/engagementDashboard/channels/ChannelsOverview.tsx b/apps/meteor/ee/client/views/admin/engagementDashboard/channels/ChannelsOverview.tsx index 83c208dd0b2e..e34c34d62816 100644 --- a/apps/meteor/ee/client/views/admin/engagementDashboard/channels/ChannelsOverview.tsx +++ b/apps/meteor/ee/client/views/admin/engagementDashboard/channels/ChannelsOverview.tsx @@ -69,7 +69,7 @@ const ChannelsOverview = (): ReactElement => { - {'#'} + # {t('Channel')} {t('Created')} {t('Last_active')} diff --git a/apps/meteor/ee/client/views/admin/engagementDashboard/messages/MessagesPerChannelSection.tsx b/apps/meteor/ee/client/views/admin/engagementDashboard/messages/MessagesPerChannelSection.tsx index d151484116f0..1a7c0a0aeeee 100644 --- a/apps/meteor/ee/client/views/admin/engagementDashboard/messages/MessagesPerChannelSection.tsx +++ b/apps/meteor/ee/client/views/admin/engagementDashboard/messages/MessagesPerChannelSection.tsx @@ -182,7 +182,7 @@ const MessagesPerChannelSection = (): ReactElement => {
- {'#'} + # {t('Channel')} {t('Number_of_messages')} diff --git a/apps/meteor/tests/e2e/.eslintrc.json b/apps/meteor/tests/e2e/.eslintrc.json index df41734e7908..f22ce1e25a79 100644 --- a/apps/meteor/tests/e2e/.eslintrc.json +++ b/apps/meteor/tests/e2e/.eslintrc.json @@ -1,8 +1,8 @@ { "root": true, - "extends": ["@rocket.chat/eslint-config/original", "prettier", "plugin:@typescript-eslint/recommended"], + "extends": ["@rocket.chat/eslint-config/original", "@rocket.chat/eslint-config/react", "prettier", "plugin:@typescript-eslint/recommended"], "parser": "@typescript-eslint/parser", - "plugins": ["react", "react-hooks", "prettier", "testing-library", "anti-trojan-source", "no-floating-promise"], + "plugins": ["prettier", "testing-library", "anti-trojan-source", "no-floating-promise"], "rules": { "@typescript-eslint/no-unused-vars": [ "error", diff --git a/ee/packages/pdf-worker/.eslintrc.json b/ee/packages/pdf-worker/.eslintrc.json index ea50ca58bed9..98b4582994d2 100644 --- a/ee/packages/pdf-worker/.eslintrc.json +++ b/ee/packages/pdf-worker/.eslintrc.json @@ -1,5 +1,5 @@ { - "extends": ["@rocket.chat/eslint-config"], + "extends": ["@rocket.chat/eslint-config", "@rocket.chat/eslint-config/react"], "parser": "@typescript-eslint/parser", "ignorePatterns": ["**/dist"] } diff --git a/ee/packages/ui-theming/.eslintrc.json b/ee/packages/ui-theming/.eslintrc.json index a83aeda48e66..4c413c4080b3 100644 --- a/ee/packages/ui-theming/.eslintrc.json +++ b/ee/packages/ui-theming/.eslintrc.json @@ -1,4 +1,4 @@ { - "extends": ["@rocket.chat/eslint-config"], + "extends": ["@rocket.chat/eslint-config", "@rocket.chat/eslint-config/react"], "ignorePatterns": ["**/dist"] } diff --git a/ee/packages/ui-theming/src/PaletteStyleTag.tsx b/ee/packages/ui-theming/src/PaletteStyleTag.tsx index a63e2a20b766..8aa3f2c04ce2 100644 --- a/ee/packages/ui-theming/src/PaletteStyleTag.tsx +++ b/ee/packages/ui-theming/src/PaletteStyleTag.tsx @@ -1,4 +1,3 @@ -import type { ReactElement } from 'react'; import { memo } from 'react'; import { createPortal } from 'react-dom'; @@ -9,7 +8,7 @@ import { darkPalette } from './paletteDark'; import { useThemeMode } from './hooks/useThemeMode'; import { useCreateStyleContainer } from './hooks/useCreateStyleContainer'; -export const PaletteStyleTag = memo((): ReactElement | null => { +export const PaletteStyleTag = memo(function PaletteStyleTag() { const [, , theme] = useThemeMode(); const palette = diff --git a/ee/packages/ui-theming/src/SidebarPaletteStyleTag.tsx b/ee/packages/ui-theming/src/SidebarPaletteStyleTag.tsx index 02b9ee090a49..9af4d3e80f7b 100644 --- a/ee/packages/ui-theming/src/SidebarPaletteStyleTag.tsx +++ b/ee/packages/ui-theming/src/SidebarPaletteStyleTag.tsx @@ -7,7 +7,7 @@ import { darkPalette } from './paletteDark'; import { convertToCss } from './helpers/convertToCss'; import { useCreateStyleContainer } from './hooks/useCreateStyleContainer'; -export const SidebarPaletteStyleTag = memo((): ReactElement | null => { +export const SidebarPaletteStyleTag = memo(function SidebarPaletteStyleTag(): ReactElement | null { // Commented code below: sidebar palette currently the same in both themes. // const [, , theme] = useThemeMode(); diff --git a/ee/packages/ui-theming/src/hooks/useThemeMode.ts b/ee/packages/ui-theming/src/hooks/useThemeMode.ts index 84deebb28374..a467345f810a 100644 --- a/ee/packages/ui-theming/src/hooks/useThemeMode.ts +++ b/ee/packages/ui-theming/src/hooks/useThemeMode.ts @@ -1,6 +1,6 @@ import { useDarkMode } from '@rocket.chat/fuselage-hooks'; import { useEndpoint, useUserPreference } from '@rocket.chat/ui-contexts'; -import { useCallback } from 'react'; +import { useCallback, useState } from 'react'; type ThemeMode = 'light' | 'dark' | 'auto'; @@ -15,8 +15,15 @@ export const useThemeMode = (): [ThemeMode, (value: ThemeMode) => () => void, 'l const saveUserPreferences = useEndpoint('POST', '/v1/users.setPreferences'); - const setTheme = (value: ThemeMode): (() => void) => - useCallback(() => saveUserPreferences({ data: { themeAppearence: value } }), [value]); + const [updaters] = useState( + (): Record void> => ({ + light: () => saveUserPreferences({ data: { themeAppearence: 'light' } }), + dark: () => saveUserPreferences({ data: { themeAppearence: 'dark' } }), + auto: () => saveUserPreferences({ data: { themeAppearence: 'auto' } }), + }), + ); + + const setTheme = useCallback((value: ThemeMode): (() => void) => updaters[value], [updaters]); return [theme, setTheme, useDarkMode(theme === 'auto' ? undefined : theme === 'dark') ? 'dark' : 'light']; }; diff --git a/package.json b/package.json index a47523eefcea..0465f5ff5607 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@types/chart.js": "^2.9.37", "@types/js-yaml": "^4.0.5", "husky": "^7.0.4", - "turbo": "~1.10.7" + "turbo": "latest" }, "workspaces": [ "apps/*", diff --git a/packages/eslint-config/react.js b/packages/eslint-config/react.js new file mode 100644 index 000000000000..84a784cb7733 --- /dev/null +++ b/packages/eslint-config/react.js @@ -0,0 +1,32 @@ +/** @type {import('eslint').ESLint.ConfigData} */ +const config = { + plugins: ['react', 'react-hooks'], + rules: { + 'react-hooks/exhaustive-deps': 'error', + 'react-hooks/rules-of-hooks': 'error', + 'react/display-name': 'error', + 'react/jsx-curly-brace-presence': 'error', + 'react/jsx-fragments': ['error', 'syntax'], + 'react/jsx-key': ['error', { checkFragmentShorthand: true, checkKeyMustBeforeSpread: true, warnOnDuplicates: true }], + 'react/jsx-no-undef': 'error', + 'react/jsx-uses-react': 'error', + 'react/jsx-uses-vars': 'error', + 'react/no-multi-comp': 'error', + }, + settings: { + react: { + version: 'detect', + }, + }, + overrides: [ + { + files: ['**/*.stories.js', '**/*.stories.jsx', '**/*.stories.ts', '**/*.stories.tsx', '**/*.spec.tsx'], + rules: { + 'react/display-name': 'off', + 'react/no-multi-comp': 'off', + }, + }, + ], +}; + +module.exports = config; diff --git a/packages/fuselage-ui-kit/.eslintrc.js b/packages/fuselage-ui-kit/.eslintrc.js index 72e21b1a70e0..07c7ef53e979 100644 --- a/packages/fuselage-ui-kit/.eslintrc.js +++ b/packages/fuselage-ui-kit/.eslintrc.js @@ -1,3 +1,6 @@ -module.exports = { - extends: '@rocket.chat/eslint-config', +/** @type {import('eslint').ESLint.ConfigData} */ +const config = { + extends: ['@rocket.chat/eslint-config', '@rocket.chat/eslint-config/react'], }; + +module.exports = config; diff --git a/packages/gazzodown/.eslintrc.json b/packages/gazzodown/.eslintrc.json index f51d169592b8..35f767f96c01 100644 --- a/packages/gazzodown/.eslintrc.json +++ b/packages/gazzodown/.eslintrc.json @@ -3,6 +3,7 @@ "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/eslint-recommended", "@rocket.chat/eslint-config/original", + "@rocket.chat/eslint-config/react", "prettier", "plugin:anti-trojan-source/recommended", "plugin:react/jsx-runtime", diff --git a/packages/mock-providers/.eslintrc.json b/packages/mock-providers/.eslintrc.json index a83aeda48e66..4c413c4080b3 100644 --- a/packages/mock-providers/.eslintrc.json +++ b/packages/mock-providers/.eslintrc.json @@ -1,4 +1,4 @@ { - "extends": ["@rocket.chat/eslint-config"], + "extends": ["@rocket.chat/eslint-config", "@rocket.chat/eslint-config/react"], "ignorePatterns": ["**/dist"] } diff --git a/packages/ui-client/.eslintrc.json b/packages/ui-client/.eslintrc.json index ccfb12f9b975..d5db8560f3e8 100644 --- a/packages/ui-client/.eslintrc.json +++ b/packages/ui-client/.eslintrc.json @@ -3,13 +3,14 @@ "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/eslint-recommended", "@rocket.chat/eslint-config/original", + "@rocket.chat/eslint-config/react", "prettier", "plugin:anti-trojan-source/recommended", "plugin:react/jsx-runtime", "plugin:storybook/recommended" ], "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint", "react", "react-hooks", "prettier"], + "plugins": ["@typescript-eslint", "prettier"], "rules": { "func-call-spacing": "off", "import/named": "error", @@ -33,23 +34,13 @@ "no-useless-constructor": "off", "no-use-before-define": "off", "prefer-arrow-callback": ["error", { "allowNamedFunctions": true }], - "prettier/prettier": 2, - "react/display-name": "error", - "react/jsx-uses-vars": "error", - "react/jsx-no-undef": "error", - "react/jsx-fragments": ["error", "syntax"], - "react/no-multi-comp": "error", - "react-hooks/rules-of-hooks": "error", - "react-hooks/exhaustive-deps": "warn" + "prettier/prettier": 2 }, "settings": { "import/resolver": { "node": { "extensions": [".js", ".ts", ".tsx"] } - }, - "react": { - "version": "detect" } }, "ignorePatterns": ["**/dist"], @@ -69,12 +60,6 @@ ], "@typescript-eslint/prefer-optional-chain": "warn" } - }, - { - "files": ["*.stories.tsx"], - "rules": { - "react/no-multi-comp": "off" - } - } + } ] } diff --git a/packages/ui-composer/.eslintrc.json b/packages/ui-composer/.eslintrc.json index 1fc7e5497093..3a40997760d0 100644 --- a/packages/ui-composer/.eslintrc.json +++ b/packages/ui-composer/.eslintrc.json @@ -3,13 +3,14 @@ "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/eslint-recommended", "@rocket.chat/eslint-config/original", + "@rocket.chat/eslint-config/react", "prettier", "plugin:anti-trojan-source/recommended", "plugin:react/jsx-runtime", "plugin:storybook/recommended" ], "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint", "react", "react-hooks", "prettier"], + "plugins": ["@typescript-eslint", "prettier"], "rules": { "func-call-spacing": "off", "import/named": "error", @@ -33,23 +34,13 @@ "no-useless-constructor": "off", "no-use-before-define": "off", "prefer-arrow-callback": ["error", { "allowNamedFunctions": true }], - "prettier/prettier": 2, - "react/display-name": "error", - "react/jsx-uses-vars": "error", - "react/jsx-no-undef": "error", - "react/jsx-fragments": ["error", "syntax"], - "react/no-multi-comp": "error", - "react-hooks/rules-of-hooks": "error", - "react-hooks/exhaustive-deps": "warn" + "prettier/prettier": 2 }, "settings": { "import/resolver": { "node": { "extensions": [".js", ".ts", ".tsx"] } - }, - "react": { - "version": "detect" } }, "ignorePatterns": ["**/dist"], @@ -70,12 +61,6 @@ ], "@typescript-eslint/prefer-optional-chain": "warn" } - }, - { - "files": ["*.stories.tsx"], - "rules": { - "react/no-multi-comp": "off" - } } ] } diff --git a/packages/ui-contexts/.eslintrc.json b/packages/ui-contexts/.eslintrc.json index 5b4e017cb820..5fe546755bb7 100644 --- a/packages/ui-contexts/.eslintrc.json +++ b/packages/ui-contexts/.eslintrc.json @@ -1,4 +1,4 @@ { - "extends": ["@rocket.chat/eslint-config", "plugin:react-hooks/recommended"], + "extends": ["@rocket.chat/eslint-config", "@rocket.chat/eslint-config/react", "plugin:react-hooks/recommended"], "ignorePatterns": ["**/dist"] } diff --git a/packages/ui-video-conf/.eslintrc.json b/packages/ui-video-conf/.eslintrc.json index 662dc3790993..cbaa27e73b96 100644 --- a/packages/ui-video-conf/.eslintrc.json +++ b/packages/ui-video-conf/.eslintrc.json @@ -3,13 +3,14 @@ "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/eslint-recommended", "@rocket.chat/eslint-config/original", + "@rocket.chat/eslint-config/react", "prettier", "plugin:anti-trojan-source/recommended", "plugin:react/jsx-runtime", "plugin:storybook/recommended" ], "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint", "react", "react-hooks", "prettier"], + "plugins": ["@typescript-eslint", "prettier"], "rules": { "func-call-spacing": "off", "import/named": "error", @@ -33,23 +34,13 @@ "no-useless-constructor": "off", "no-use-before-define": "off", "prefer-arrow-callback": ["error", { "allowNamedFunctions": true }], - "prettier/prettier": 2, - "react/display-name": "error", - "react/jsx-uses-vars": "error", - "react/jsx-no-undef": "error", - "react/jsx-fragments": ["error", "syntax"], - "react/no-multi-comp": "error", - "react-hooks/rules-of-hooks": "error", - "react-hooks/exhaustive-deps": "warn" + "prettier/prettier": 2 }, "settings": { "import/resolver": { "node": { "extensions": [".js", ".ts", ".tsx"] } - }, - "react": { - "version": "detect" } }, "ignorePatterns": ["**/dist"], @@ -70,12 +61,6 @@ ], "@typescript-eslint/prefer-optional-chain": "warn" } - }, - { - "files": ["*.stories.tsx"], - "rules": { - "react/no-multi-comp": "off" - } - } + } ] } diff --git a/packages/web-ui-registration/.eslintrc.json b/packages/web-ui-registration/.eslintrc.json index a83aeda48e66..4c413c4080b3 100644 --- a/packages/web-ui-registration/.eslintrc.json +++ b/packages/web-ui-registration/.eslintrc.json @@ -1,4 +1,4 @@ { - "extends": ["@rocket.chat/eslint-config"], + "extends": ["@rocket.chat/eslint-config", "@rocket.chat/eslint-config/react"], "ignorePatterns": ["**/dist"] } diff --git a/packages/web-ui-registration/src/components/LoginSwitchLanguageFooter.tsx b/packages/web-ui-registration/src/components/LoginSwitchLanguageFooter.tsx index 2c81b79f8694..9a23039f9336 100644 --- a/packages/web-ui-registration/src/components/LoginSwitchLanguageFooter.tsx +++ b/packages/web-ui-registration/src/components/LoginSwitchLanguageFooter.tsx @@ -29,7 +29,7 @@ const LoginSwitchLanguageFooter = (): ReactElement | null => { return Array.from(potentialSuggestions).filter( (language) => language && language !== currentLanguage && Boolean(languages.find(({ key }) => key === language)), ); - }, [serverLanguage, browserLanguage, currentLanguage]); + }, [serverLanguage, currentLanguage, languages]); const handleSwitchLanguageClick = (language: string) => (): void => { loadLanguage(language); diff --git a/yarn.lock b/yarn.lock index f9b00db29e95..ecde951e5d8b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -36255,7 +36255,7 @@ __metadata: "@types/chart.js": ^2.9.37 "@types/js-yaml": ^4.0.5 husky: ^7.0.4 - turbo: ~1.10.7 + turbo: latest languageName: unknown linkType: soft @@ -39671,58 +39671,58 @@ __metadata: languageName: node linkType: hard -"turbo-darwin-64@npm:1.10.7": - version: 1.10.7 - resolution: "turbo-darwin-64@npm:1.10.7" +"turbo-darwin-64@npm:1.10.8": + version: 1.10.8 + resolution: "turbo-darwin-64@npm:1.10.8" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"turbo-darwin-arm64@npm:1.10.7": - version: 1.10.7 - resolution: "turbo-darwin-arm64@npm:1.10.7" +"turbo-darwin-arm64@npm:1.10.8": + version: 1.10.8 + resolution: "turbo-darwin-arm64@npm:1.10.8" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"turbo-linux-64@npm:1.10.7": - version: 1.10.7 - resolution: "turbo-linux-64@npm:1.10.7" +"turbo-linux-64@npm:1.10.8": + version: 1.10.8 + resolution: "turbo-linux-64@npm:1.10.8" conditions: os=linux & cpu=x64 languageName: node linkType: hard -"turbo-linux-arm64@npm:1.10.7": - version: 1.10.7 - resolution: "turbo-linux-arm64@npm:1.10.7" +"turbo-linux-arm64@npm:1.10.8": + version: 1.10.8 + resolution: "turbo-linux-arm64@npm:1.10.8" conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"turbo-windows-64@npm:1.10.7": - version: 1.10.7 - resolution: "turbo-windows-64@npm:1.10.7" +"turbo-windows-64@npm:1.10.8": + version: 1.10.8 + resolution: "turbo-windows-64@npm:1.10.8" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"turbo-windows-arm64@npm:1.10.7": - version: 1.10.7 - resolution: "turbo-windows-arm64@npm:1.10.7" +"turbo-windows-arm64@npm:1.10.8": + version: 1.10.8 + resolution: "turbo-windows-arm64@npm:1.10.8" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"turbo@npm:~1.10.7": - version: 1.10.7 - resolution: "turbo@npm:1.10.7" +"turbo@npm:latest": + version: 1.10.8 + resolution: "turbo@npm:1.10.8" dependencies: - turbo-darwin-64: 1.10.7 - turbo-darwin-arm64: 1.10.7 - turbo-linux-64: 1.10.7 - turbo-linux-arm64: 1.10.7 - turbo-windows-64: 1.10.7 - turbo-windows-arm64: 1.10.7 + turbo-darwin-64: 1.10.8 + turbo-darwin-arm64: 1.10.8 + turbo-linux-64: 1.10.8 + turbo-linux-arm64: 1.10.8 + turbo-windows-64: 1.10.8 + turbo-windows-arm64: 1.10.8 dependenciesMeta: turbo-darwin-64: optional: true @@ -39738,7 +39738,7 @@ __metadata: optional: true bin: turbo: bin/turbo - checksum: 58329caf13b5fef284ccfc21bd1f841023122371d75d2202be809a385aade84fd886cf5c2093323c115c497d503c9c34e1f7ae09e13d06d1dcb4b649883f60dd + checksum: 9fd2f9b17461a688e200329c4d910969e828b22c375e88759cd0e59f96db7aac115d289ed20af42db23030b4a4ae0334d1a37bf0a5caf2fdc8a618476742238f languageName: node linkType: hard From 5b3b7c55e072e4ba1f4c53cff60fba43d4ceb010 Mon Sep 17 00:00:00 2001 From: Hugo Costa Date: Wed, 19 Jul 2023 12:34:04 -0300 Subject: [PATCH 14/14] test: remove unnecessary and flaky e2e test (#29843) --- .../tests/e2e/engagement-dashboard.spec.ts | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 apps/meteor/tests/e2e/engagement-dashboard.spec.ts diff --git a/apps/meteor/tests/e2e/engagement-dashboard.spec.ts b/apps/meteor/tests/e2e/engagement-dashboard.spec.ts deleted file mode 100644 index a6389e62dfa2..000000000000 --- a/apps/meteor/tests/e2e/engagement-dashboard.spec.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { IS_EE } from './config/constants'; -import { Users } from './fixtures/userStates'; -import { test, expect } from './utils/test'; - -test.skip(!IS_EE, 'Engagement Dashboard > Enterprise Only'); - -test.use({ storageState: Users.admin.state }); - -test.describe('engagement-dashboard', () => { - test.beforeEach(async ({ page }) => { - await page.goto('/admin/engagement-dashboard'); - await page.route('**/api/v1/engagement-dashboard/**', (route) => route.abort()); - }); - test('expect to trigger fallback error component', async ({ page }) => { - await test.step('expect to show 4 fallback errors components inside widget at Users Tab', async () => { - await expect(page.locator('role=tab[name="Users"][selected]')).toBeVisible(); - - await page.waitForSelector('[data-qa="EngagementDashboardCardErrorBoundary"]'); - await expect(page.locator('[data-qa="EngagementDashboardCardErrorBoundary"]')).toHaveCount(4); - }); - - await test.step('expect to show 2 fallback errors components inside widget at Messages Tab', async () => { - await page.locator('role=tab[name="Messages"]').click(); - await expect(page.locator('role=tab[name="Messages"][selected]')).toBeVisible(); - - await page.waitForSelector('[data-qa="EngagementDashboardCardErrorBoundary"]'); - await expect(page.locator('[data-qa="EngagementDashboardCardErrorBoundary"]')).toHaveCount(2); - }); - - await test.step('expect to show a fallback error component inside widget at Channels Tab', async () => { - await page.locator('role=tab[name="Channels"]').click(); - await expect(page.locator('role=tab[name="Channels"][selected]')).toBeVisible(); - - await page.waitForSelector('[data-qa="EngagementDashboardCardErrorBoundary"]'); - await expect(page.locator('[data-qa="EngagementDashboardCardErrorBoundary"]')).toBeVisible(); - }); - }); -});