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:
commit
11ff7eefdd
@ -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",
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user