1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-12 09:04:14 +02:00

Merge pull request #178 from BharatKalluri/fix/message_on_export

[GH-174] Added message on export
This commit is contained in:
Jesús Espino 2021-03-25 16:09:38 +01:00 committed by GitHub
commit 11ff7eefdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

View File

@ -115,7 +115,9 @@
"ViewHeader.delete-template": "Delete",
"ViewHeader.edit-template": "Edit",
"ViewHeader.empty-card": "Empty card",
"ViewHeader.export-complete": "Export complete!",
"ViewHeader.export-csv": "Export to CSV",
"ViewHeader.export-failed": "Export failed!",
"ViewHeader.filter": "Filter",
"ViewHeader.group-by": "Group by: {property}",
"ViewHeader.new": "New",

View File

@ -30,6 +30,7 @@ import ModalWrapper from './modalWrapper'
import NewCardButton from './newCardButton'
import ShareBoardComponent from './shareBoardComponent'
import './viewHeader.scss'
import {sendFlashMessage} from './flashMessages'
type Props = {
boardTree: BoardTree
@ -68,6 +69,23 @@ class ViewHeader extends React.Component<Props, State> {
}
}
onExportCsvTrigger(boardTree: BoardTree) {
try {
CsvExporter.exportTableCsv(boardTree)
const exportCompleteMessage = this.props.intl.formatMessage({
id: 'ViewHeader.export-complete',
defaultMessage: 'Export complete!',
})
sendFlashMessage({content: exportCompleteMessage, severity: 'normal'})
} catch (e) {
const exportFailedMessage = this.props.intl.formatMessage({
id: 'ViewHeader.export-failed',
defaultMessage: 'Export failed!',
})
sendFlashMessage({content: exportFailedMessage, severity: 'high'})
}
}
render(): JSX.Element {
const {boardTree, showView, withGroupBy, intl} = this.props
const {board, activeView} = boardTree
@ -297,7 +315,7 @@ class ViewHeader extends React.Component<Props, State> {
<Menu.Text
id='exportCsv'
name={intl.formatMessage({id: 'ViewHeader.export-csv', defaultMessage: 'Export to CSV'})}
onClick={() => CsvExporter.exportTableCsv(boardTree)}
onClick={() => this.onExportCsvTrigger(boardTree)}
/>
{/* <Menu.Text
id='exportBoardArchive'