|
|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
import React, { useState, useEffect, useMemo } from 'react'; |
|
|
|
|
import { Field, TextInput, Select, ButtonGroup, Button, Box, Icon, Callout } from '@rocket.chat/fuselage'; |
|
|
|
|
import { Field, TextInput, Select, ButtonGroup, Button, Box, Icon, Callout, FieldGroup } from '@rocket.chat/fuselage'; |
|
|
|
|
import { css } from '@rocket.chat/css-in-js'; |
|
|
|
|
import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; |
|
|
|
|
import toastr from 'toastr'; |
|
|
|
|
@ -61,7 +61,7 @@ const FileExport = ({ onCancel, rid }) => { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<> |
|
|
|
|
<FieldGroup> |
|
|
|
|
<Field> |
|
|
|
|
<Field.Label>{t('Date')}</Field.Label> |
|
|
|
|
<Field.Row> |
|
|
|
|
@ -83,7 +83,7 @@ const FileExport = ({ onCancel, rid }) => { |
|
|
|
|
{t('Export')} |
|
|
|
|
</Button> |
|
|
|
|
</ButtonGroup> |
|
|
|
|
</> |
|
|
|
|
</FieldGroup> |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
@ -185,12 +185,14 @@ const MailExportForm = ({ onCancel, rid }) => { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<> |
|
|
|
|
<FieldGroup> |
|
|
|
|
<Field> |
|
|
|
|
<Callout onClick={reset} title={t('Messages selected')} type={selectedMessages.length > 0 ? 'success' : 'info'}> |
|
|
|
|
<p>{`${ selectedMessages.length } Messages selected`}</p> |
|
|
|
|
{ selectedMessages.length > 0 && <Box is='p' className={clickable} >{t('Click here to clear the selection')}</Box> } |
|
|
|
|
{ selectedMessages.length === 0 && <Box is='p'>{t('Click_the_messages_you_would_like_to_send_by_email')}</Box> } |
|
|
|
|
</Callout> |
|
|
|
|
</Field> |
|
|
|
|
<Field> |
|
|
|
|
<Field.Label>{t('To_users')}</Field.Label> |
|
|
|
|
<Field.Row> |
|
|
|
|
@ -220,7 +222,7 @@ const MailExportForm = ({ onCancel, rid }) => { |
|
|
|
|
{t('Send')} |
|
|
|
|
</Button> |
|
|
|
|
</ButtonGroup> |
|
|
|
|
</> |
|
|
|
|
</FieldGroup> |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
@ -240,16 +242,18 @@ export const ExportMessages = function ExportMessages({ rid, tabBar }) { |
|
|
|
|
{t('Export_Messages')} |
|
|
|
|
<VerticalBar.Close onClick={() => tabBar.close()} /> |
|
|
|
|
</VerticalBar.Header> |
|
|
|
|
<VerticalBar.Content> |
|
|
|
|
<VerticalBar.ScrollableContent> |
|
|
|
|
<FieldGroup> |
|
|
|
|
<Field> |
|
|
|
|
<Field.Label>{t('Method')}</Field.Label> |
|
|
|
|
<Field.Row> |
|
|
|
|
<Select value={type} onChange={(value) => setType(value)} placeholder={t('Type')} options={exportOptions}/> |
|
|
|
|
</Field.Row> |
|
|
|
|
</Field> |
|
|
|
|
</FieldGroup> |
|
|
|
|
{type && type === 'file' && <FileExport rid={rid} onCancel={() => tabBar.close()} />} |
|
|
|
|
{type && type === 'email' && <MailExportForm rid={rid} onCancel={() => tabBar.close()} />} |
|
|
|
|
</VerticalBar.Content> |
|
|
|
|
</VerticalBar.ScrollableContent> |
|
|
|
|
</VerticalBar> |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
|