Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apps/meteor/client/views/directory/DirectoryPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Tabs } from '@rocket.chat/fuselage';
import { Page, PageHeader, PageContent } from '@rocket.chat/ui-client';
import { useRouter, useRouteParameter, useSetting } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import { useEffect, useCallback } from 'react';
import { useTranslation } from 'react-i18next';

Expand All @@ -11,7 +10,7 @@ import UsersTab from './tabs/users/UsersTab';

type TabName = 'users' | 'channels' | 'teams' | 'external';

const DirectoryPage = (): ReactElement => {
const DirectoryPage = () => {
const { t } = useTranslation();

const defaultTab = useSetting<TabName>('Accounts_Directory_DefaultView', 'users');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { usePermission } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';

import ChannelsTable from './ChannelsTable';
import NotAuthorizedPage from '../../../notAuthorized/NotAuthorizedPage';

const ChannelsTab = (): ReactElement => {
const ChannelsTab = () => {
const canViewPublicRooms = usePermission('view-c-room');

if (canViewPublicRooms) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { usePermission } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';

import TeamsTable from './TeamsTable';
import NotAuthorizedPage from '../../../notAuthorized/NotAuthorizedPage';

const TeamsTab = (): ReactElement => {
const TeamsTab = () => {
const canViewPublicRooms = usePermission('view-c-room');

if (canViewPublicRooms) {
Expand Down
7 changes: 5 additions & 2 deletions apps/meteor/client/views/directory/tabs/users/UsersTab.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { usePermission } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';

import UsersTable from './UsersTable';
import NotAuthorizedPage from '../../../notAuthorized/NotAuthorizedPage';

const UsersTab = (props: { workspace?: 'external' | 'local' }): ReactElement => {
type UsersTabProps = {
workspace?: 'external' | 'local';
};

const UsersTab = (props: UsersTabProps) => {
const canViewOutsideRoom = usePermission('view-outside-room');
const canViewDM = usePermission('view-d-room');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ import {
} from '@rocket.chat/ui-client';
import { usePermission, useRoute, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts';
import { useQuery } from '@tanstack/react-query';
import type { KeyboardEvent, MouseEvent, ReactElement } from 'react';
import type { KeyboardEvent, MouseEvent } from 'react';
import { useCallback, useMemo, useState } from 'react';

import UsersTableRow from './UsersTableRow';
import FilterByText from '../../../../../components/FilterByText';
import GenericNoResults from '../../../../../components/GenericNoResults';
import { useDirectoryQuery } from '../../../hooks/useDirectoryQuery';

const UsersTable = ({ workspace = 'local' }): ReactElement => {
type UsersTableProps = {
workspace?: 'external' | 'local';
};

const UsersTable = ({ workspace = 'local' }: UsersTableProps) => {
const t = useTranslation();
const mediaQuery = useMediaQuery('(min-width: 1024px)');

Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/e2e/SaveE2EPasswordModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Box, CodeSnippet } from '@rocket.chat/fuselage';
import { useClipboard } from '@rocket.chat/fuselage-hooks';
import { ExternalLink, GenericModal } from '@rocket.chat/ui-client';
import { useId, type ReactElement } from 'react';
import { useId } from 'react';
import { useTranslation } from 'react-i18next';

import { links } from '../../lib/links';
Expand All @@ -15,7 +15,7 @@ type SaveE2EPasswordModalProps = {

const DOCS_URL = links.go.e2eeGuide;

const SaveE2EPasswordModal = ({ randomPassword, onClose, onCancel, onConfirm }: SaveE2EPasswordModalProps): ReactElement => {
const SaveE2EPasswordModal = ({ randomPassword, onClose, onCancel, onConfirm }: SaveE2EPasswordModalProps) => {
const { t } = useTranslation();
const { copy, hasCopied } = useClipboard(randomPassword);
const passwordId = useId();
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/client/views/home/CustomHomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Page, PageScrollableContentWithShadow } from '@rocket.chat/ui-client';
import type { ReactElement } from 'react';

import HomePageHeader from './HomePageHeader';
import CustomContentCard from './cards/CustomContentCard';

const CustomHomePage = (): ReactElement => {
const CustomHomePage = () => {
return (
<Page color='default' background='tint'>
<HomePageHeader />
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/home/CustomHomePageContent.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Box } from '@rocket.chat/fuselage';
import { useSetting } from '@rocket.chat/ui-contexts';
import type { ComponentProps, ReactElement } from 'react';
import type { ComponentProps } from 'react';

const CustomHomePageContent = (props: ComponentProps<typeof Box>): ReactElement => {
const CustomHomePageContent = (props: ComponentProps<typeof Box>) => {
const body = useSetting('Layout_Home_Body', '');

return <Box withRichContent dangerouslySetInnerHTML={{ __html: body }} {...props} />;
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/client/views/home/DefaultHomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Box, CardGroup } from '@rocket.chat/fuselage';
import { PageScrollableContent, Page } from '@rocket.chat/ui-client';
import { useAtLeastOnePermission, useSetting, useTranslation, useRole, usePermission } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';

import HomePageHeader from './HomePageHeader';
import AddUsersCard from './cards/AddUsersCard';
Expand All @@ -14,7 +13,7 @@ import MobileAppsCard from './cards/MobileAppsCard';

const CREATE_CHANNEL_PERMISSIONS = ['create-c', 'create-p'];

const DefaultHomePage = (): ReactElement => {
const DefaultHomePage = () => {
const t = useTranslation();
const canAddUsers = usePermission('view-user-administration');
const isAdmin = useRole('admin');
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/client/views/home/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { useSetting } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';

import CustomHomePage from './CustomHomePage';
import DefaultHomePage from './DefaultHomePage';

const HomePage = (): ReactElement => {
const HomePage = () => {
const customOnly = useSetting('Layout_Custom_Body_Only');

if (customOnly) {
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/client/views/home/HomePageHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Button } from '@rocket.chat/fuselage';
import { PageHeader } from '@rocket.chat/ui-client';
import { useSetting, useTranslation, useAllPermissions, useRoute } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';

const EDIT_LAYOUT_PERMISSIONS = ['view-privileged-setting', 'edit-privileged-setting', 'manage-selected-settings'];

const HomepageHeader = (): ReactElement => {
const HomepageHeader = () => {
const t = useTranslation();
const title = useSetting('Layout_Home_Title', 'Home');
const canEditLayout = useAllPermissions(EDIT_LAYOUT_PERMISSIONS);
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/home/HomepageGridItem.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { GridItem } from '@rocket.chat/fuselage';
import { useBreakpoints } from '@rocket.chat/fuselage-hooks';
import type { ReactNode, ReactElement } from 'react';
import type { ReactNode } from 'react';

const HomepageGridItem = ({ children }: { children: ReactNode }): ReactElement => {
const HomepageGridItem = ({ children }: { children: ReactNode }) => {
const breakpoints = useBreakpoints();

const isMedium = !breakpoints.includes('lg');
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/home/cards/AddUsersCard.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Card } from '@rocket.chat/fuselage';
import { useTranslation, useRouter } from '@rocket.chat/ui-contexts';
import type { ComponentProps, ReactElement } from 'react';
import type { ComponentProps } from 'react';

import { GenericCard, GenericCardButton } from '../../../components/GenericCard';

const AddUsersCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): ReactElement => {
const AddUsersCard = (props: Omit<ComponentProps<typeof Card>, 'type'>) => {
const t = useTranslation();

const router = useRouter();
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/home/cards/CreateChannelsCard.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { Card } from '@rocket.chat/fuselage';
import { useTranslation, useSetModal } from '@rocket.chat/ui-contexts';
import type { ComponentProps, ReactElement } from 'react';
import type { ComponentProps } from 'react';

import { GenericCard, GenericCardButton } from '../../../components/GenericCard';
import CreateChannelModal from '../../../navbar/NavBarPagesGroup/actions/CreateChannelModal';

const CreateChannelsCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): ReactElement => {
const CreateChannelsCard = (props: Omit<ComponentProps<typeof Card>, 'type'>) => {
const t = useTranslation();
const setModal = useSetModal();

Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/home/cards/CustomContentCard.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Box, Button, Card, CardBody, CardControls, CardHeader, Icon, Tag } from '@rocket.chat/fuselage';
import { useRole, useSettingSetValue, useSetting, useToastMessageDispatch, useRouter } from '@rocket.chat/ui-contexts';
import type { ComponentProps, ReactElement } from 'react';
import type { ComponentProps } from 'react';
import { useTranslation } from 'react-i18next';

import { useIsEnterprise } from '../../../hooks/useIsEnterprise';
import CustomHomepageContent from '../CustomHomePageContent';

const CustomContentCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): ReactElement | null => {
const CustomContentCard = (props: Omit<ComponentProps<typeof Card>, 'type'>) => {
const { t } = useTranslation();
const dispatchToastMessage = useToastMessageDispatch();
const router = useRouter();
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/home/cards/DesktopAppsCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Card } from '@rocket.chat/fuselage';
import type { ComponentProps, ReactElement } from 'react';
import type { ComponentProps } from 'react';
import { useTranslation } from 'react-i18next';

import { GenericCard, GenericCardButton } from '../../../components/GenericCard';
Expand All @@ -10,7 +10,7 @@ const WINDOWS_APP_URL = links.go.desktopAppWindows;
const LINUX_APP_URL = links.go.desktopAppLinux;
const MAC_APP_URL = links.go.desktopAppMac;

const DesktopAppsCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): ReactElement => {
const DesktopAppsCard = (props: Omit<ComponentProps<typeof Card>, 'type'>) => {
const { t } = useTranslation();
const handleOpenLink = useExternalLink();

Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/home/cards/DocumentationCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Card } from '@rocket.chat/fuselage';
import type { ComponentProps, ReactElement } from 'react';
import type { ComponentProps } from 'react';
import { useTranslation } from 'react-i18next';

import { GenericCard, GenericCardButton } from '../../../components/GenericCard';
Expand All @@ -8,7 +8,7 @@ import { links } from '../../../lib/links';

const DOCS_URL = links.go.documentation;

const DocumentationCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): ReactElement => {
const DocumentationCard = (props: Omit<ComponentProps<typeof Card>, 'type'>) => {
const { t } = useTranslation();
const handleOpenLink = useExternalLink();

Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/home/cards/JoinRoomsCard.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Card } from '@rocket.chat/fuselage';
import { useTranslation, useRouter } from '@rocket.chat/ui-contexts';
import type { ComponentProps, ReactElement } from 'react';
import type { ComponentProps } from 'react';

import { GenericCard, GenericCardButton } from '../../../components/GenericCard';

const JoinRoomsCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): ReactElement => {
const JoinRoomsCard = (props: Omit<ComponentProps<typeof Card>, 'type'>) => {
const t = useTranslation();

const router = useRouter();
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/home/cards/MobileAppsCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Card } from '@rocket.chat/fuselage';
import type { ComponentProps, ReactElement } from 'react';
import type { ComponentProps } from 'react';
import { useTranslation } from 'react-i18next';

import { GenericCard, GenericCardButton } from '../../../components/GenericCard';
Expand All @@ -9,7 +9,7 @@ import { links } from '../../../lib/links';
const GOOGLE_PLAY_URL = links.go.mobileAppGoogle;
const APP_STORE_URL = links.go.mobileAppApple;

const MobileAppsCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): ReactElement => {
const MobileAppsCard = (props: Omit<ComponentProps<typeof Card>, 'type'>) => {
const { t } = useTranslation();
const handleOpenLink = useExternalLink();

Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/client/views/invite/InvitePage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { HeroLayout, HeroLayoutTitle } from '@rocket.chat/layout';
import { useRouteParameter, useUserId } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import { useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';

Expand All @@ -10,7 +9,7 @@ import { useInviteTokenMutation } from './hooks/useInviteTokenMutation';
import { useSamlInviteToken } from './hooks/useSamlInviteToken';
import { useValidateInviteQuery } from './hooks/useValidateInviteQuery';

const InvitePage = (): ReactElement => {
const InvitePage = () => {
const { t } = useTranslation();

const token = useRouteParameter('hash');
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/client/views/invite/SecretURLPage.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { useUserId, useRouter } from '@rocket.chat/ui-contexts';
import RegistrationPageRouter from '@rocket.chat/web-ui-registration';
import type { ReactElement } from 'react';
import { useEffect } from 'react';

const SecretURLPage = (): ReactElement | null => {
const SecretURLPage = () => {
const uid = useUserId();
const router = useRouter();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import type { ISetting } from '@rocket.chat/apps-engine/definition/settings';
import type { App, SettingValue } from '@rocket.chat/core-typings';
import { Button, ButtonGroup, Box } from '@rocket.chat/fuselage';
import { useEffectEvent } from '@rocket.chat/fuselage-hooks';
import { Page, PageFooter, PageHeader, PageScrollableContentWithShadow } from '@rocket.chat/ui-client';
import { useTranslation, useRouteParameter, useToastMessageDispatch, usePermission, useRouter } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import { useMemo, useCallback } from 'react';
import { FormProvider, useForm } from 'react-hook-form';

Expand All @@ -31,7 +29,7 @@ type AppDetailsPageProps = {
id: App['id'];
};

const AppDetailsPage = ({ id }: AppDetailsPageProps): ReactElement => {
const AppDetailsPage = ({ id }: AppDetailsPageProps) => {
const t = useTranslation();
const router = useRouter();
const dispatchToastMessage = useToastMessageDispatch();
Expand Down Expand Up @@ -92,7 +90,7 @@ const AppDetailsPage = ({ id }: AppDetailsPageProps): ReactElement => {
try {
await AppClientOrchestratorInstance.setAppSettings(
id,
(Object.values(settings || {}) as ISetting[]).map((setting) => ({
Object.values(settings || {}).map((setting) => ({
...setting,
value: data[setting.id],
})),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { App } from '@rocket.chat/core-typings';
import { Box, Tag } from '@rocket.chat/fuselage';
import { AppAvatar } from '@rocket.chat/ui-avatar';
import { formatDistanceToNow } from 'date-fns';
import type { ReactElement } from 'react';
import { useTranslation } from 'react-i18next';

import AppMenu from '../AppMenu';
Expand All @@ -16,7 +15,7 @@ const versioni18nKey = (app: App): string => {
return installed ? version : marketplaceVersion;
};

const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => {
const AppDetailsPageHeader = ({ app }: { app: App }) => {
const { t } = useTranslation();
const {
iconFileData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Tabs } from '@rocket.chat/fuselage';
import { usePermission, useRouter } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import { useTranslation } from 'react-i18next';

import type { ISettings } from '../../../apps/@types/IOrchestrator';
Expand All @@ -21,7 +20,7 @@ const AppDetailsPageTabs = ({
settings,
tab,
hasCluster = false,
}: AppDetailsPageTabsProps): ReactElement => {
}: AppDetailsPageTabsProps) => {
const { t } = useTranslation();
const isAdminUser = usePermission('manage-apps');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
GenericTableRow,
} from '@rocket.chat/ui-client';
import { useRouter } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import { useTranslation } from 'react-i18next';

import GenericNoResults from '../../../../../components/GenericNoResults';
Expand All @@ -23,7 +22,7 @@ type AppInstanceProps = {
id: string;
};

const AppInstances = ({ id }: AppInstanceProps): ReactElement => {
const AppInstances = ({ id }: AppInstanceProps) => {
const { t } = useTranslation();
const { data, isSuccess, isError, isLoading } = useAppInstances({ appId: id });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ILogItem } from '@rocket.chat/core-typings';
import { Box, Pagination } from '@rocket.chat/fuselage';
import { CustomScrollbars, usePagination } from '@rocket.chat/ui-client';
import { useRouter } from '@rocket.chat/ui-contexts';
import { useEffect, useMemo, useReducer, type ReactElement } from 'react';
import { useEffect, useMemo, useReducer } from 'react';
import { useTranslation } from 'react-i18next';

import AppLogsItem from './AppLogsItem';
Expand Down Expand Up @@ -40,7 +40,7 @@ function expandedReducer(
}
}

const AppLogs = ({ id }: { id: string }): ReactElement => {
const AppLogs = ({ id }: { id: string }) => {
const { t } = useTranslation();

const router = useRouter();
Expand Down
Loading
Loading