-
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.
feat: Export selected room messages as JSON file (#34076)
- Loading branch information
1 parent
082d3ce
commit 2d41274
Showing
35 changed files
with
647 additions
and
391 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@rocket.chat/ui-composer': minor | ||
'@rocket.chat/i18n': minor | ||
'@rocket.chat/meteor': minor | ||
--- | ||
|
||
Introduces a new option when exporting messages, allowing users to select and download a JSON file directly from client |
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
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
15 changes: 15 additions & 0 deletions
15
apps/meteor/client/views/room/body/hooks/useSelectAllAndScrollToTop.ts
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,15 @@ | ||
import { useRef } from 'react'; | ||
|
||
import { useToggleSelectAll } from '../../MessageList/contexts/SelectedMessagesContext'; | ||
|
||
export const useSelectAllAndScrollToTop = () => { | ||
const ref = useRef<HTMLElement>(null); | ||
const handleToggleAll = useToggleSelectAll(); | ||
|
||
const selectAllAndScrollToTop = () => { | ||
ref.current?.scrollTo({ top: 0, behavior: 'smooth' }); | ||
handleToggleAll(); | ||
}; | ||
|
||
return { innerRef: ref, selectAllAndScrollToTop }; | ||
}; |
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
34 changes: 34 additions & 0 deletions
34
apps/meteor/client/views/room/composer/ComposerSelectMessages.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,34 @@ | ||
import { Button, ButtonGroup } from '@rocket.chat/fuselage'; | ||
import { MessageFooterCallout, MessageFooterCalloutContent } from '@rocket.chat/ui-composer'; | ||
import type { ReactElement } from 'react'; | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import type { ComposerMessageProps } from './ComposerMessage'; | ||
import { useCountSelected, useClearSelection, useAvailableMessagesCount } from '../MessageList/contexts/SelectedMessagesContext'; | ||
|
||
const ComposerSelectMessages = ({ onClickSelectAll }: ComposerMessageProps): ReactElement => { | ||
const { t } = useTranslation(); | ||
|
||
const clearSelection = useClearSelection(); | ||
const countSelected = useCountSelected(); | ||
const countAvailable = useAvailableMessagesCount(); | ||
|
||
return ( | ||
<MessageFooterCallout> | ||
<MessageFooterCalloutContent textAlign='left'> | ||
{t('__count__messages_selected', { count: countSelected })} | ||
</MessageFooterCalloutContent> | ||
<ButtonGroup> | ||
<Button small disabled={countSelected === 0} onClick={clearSelection}> | ||
{t('Clear_selection')} | ||
</Button> | ||
<Button icon='arrow-up' small primary disabled={countAvailable === 0} onClick={onClickSelectAll}> | ||
{t('Select__count__messages', { count: countAvailable })} | ||
</Button> | ||
</ButtonGroup> | ||
</MessageFooterCallout> | ||
); | ||
}; | ||
|
||
export default ComposerSelectMessages; |
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
Oops, something went wrong.