-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into improve/home
- Loading branch information
Showing
50 changed files
with
689 additions
and
315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/meteor/client/views/room/MessageList/MessageListErrorBoundary.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
apps/meteor/ee/client/views/admin/engagementDashboard/EngagementDashboardCard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Box } from '@rocket.chat/fuselage'; | ||
import React, { ReactElement, ReactNode } from 'react'; | ||
|
||
import Card from '../../../../../client/components/Card'; | ||
import EngagementDashboardCardErrorBoundary from './EngagementDashboardCardErrorBoundary'; | ||
|
||
type EngagementDashboardCardProps = { | ||
children?: ReactNode; | ||
title?: string; | ||
}; | ||
|
||
const EngagementDashboardCard = ({ children, title = undefined }: EngagementDashboardCardProps): ReactElement => ( | ||
<Box mb='x16'> | ||
<Card variant='light'> | ||
{title && <Card.Title>{title}</Card.Title>} | ||
<Card.Body> | ||
<Card.Col> | ||
<EngagementDashboardCardErrorBoundary> | ||
<Box>{children}</Box> | ||
</EngagementDashboardCardErrorBoundary> | ||
</Card.Col> | ||
</Card.Body> | ||
</Card> | ||
</Box> | ||
); | ||
|
||
export default EngagementDashboardCard; |
45 changes: 45 additions & 0 deletions
45
...meteor/ee/client/views/admin/engagementDashboard/EngagementDashboardCardErrorBoundary.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { States, StatesAction, StatesActions, StatesIcon, StatesSubtitle, StatesTitle } from '@rocket.chat/fuselage'; | ||
import { useTranslation } from '@rocket.chat/ui-contexts'; | ||
import { QueryErrorResetBoundary } from '@tanstack/react-query'; | ||
import React, { ReactElement, ReactNode, useState } from 'react'; | ||
import { ErrorBoundary } from 'react-error-boundary'; | ||
|
||
export type EngagementDashboardCardErrorBoundaryProps = { | ||
children?: ReactNode; | ||
}; | ||
|
||
const EngagementDashboardCardErrorBoundary = ({ children }: EngagementDashboardCardErrorBoundaryProps): ReactElement => { | ||
const t = useTranslation(); | ||
|
||
const [error, setError] = useState<Error>(); | ||
const isError = (error: unknown): error is Error => error instanceof Error; | ||
|
||
const errorHandler = (error: Error, info: { componentStack: string }): void => { | ||
setError(error); | ||
console.error('Uncaught Error:', error, info); | ||
}; | ||
|
||
return ( | ||
<QueryErrorResetBoundary> | ||
{({ reset }): ReactElement => ( | ||
<ErrorBoundary | ||
children={children} | ||
onError={errorHandler} | ||
onReset={reset} | ||
fallbackRender={({ resetErrorBoundary }): ReactElement => ( | ||
<States> | ||
<StatesIcon name='circle-exclamation' /> | ||
<StatesTitle>{t('Something_Went_Wrong')}</StatesTitle> | ||
<StatesSubtitle>{isError(error) && error?.message}</StatesSubtitle> | ||
<StatesActions data-qa='EngagementDashboardCardErrorBoundary'> | ||
<StatesAction onClick={(): void => resetErrorBoundary()}>{t('Retry')}</StatesAction> | ||
</StatesActions> | ||
</States> | ||
)} | ||
/> | ||
)} | ||
</QueryErrorResetBoundary> | ||
); | ||
}; | ||
|
||
export default EngagementDashboardCardErrorBoundary; |
14 changes: 14 additions & 0 deletions
14
apps/meteor/ee/client/views/admin/engagementDashboard/EngagementDashboardCardFilter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Box, Flex, InputBox } from '@rocket.chat/fuselage'; | ||
import React, { ReactElement, ReactNode } from 'react'; | ||
|
||
type EngagementDashboardCardFilterProps = { | ||
children?: ReactNode; | ||
}; | ||
|
||
const EngagementDashboardCardFilter = ({ children = <InputBox.Skeleton /> }: EngagementDashboardCardFilterProps): ReactElement => ( | ||
<Box display='flex' justifyContent='flex-end' alignItems='center' wrap='no-wrap'> | ||
{children && <Flex.Item grow={0}>{children}</Flex.Item>} | ||
</Box> | ||
); | ||
|
||
export default EngagementDashboardCardFilter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
apps/meteor/ee/client/views/admin/engagementDashboard/Section.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.