Skip to content
Snippets Groups Projects
Commit 9bda760f authored by piotr.kupczyk@id.ethz.ch's avatar piotr.kupczyk@id.ethz.ch
Browse files

SSDM-13463 : Export selection of fields from tables - UI part - enable export...

SSDM-13463 : Export selection of fields from tables - UI part - enable export options form validation after "Export" button gets clicked
parent 341c76f8
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -38,6 +38,7 @@ class GridExports extends React.PureComponent { ...@@ -38,6 +38,7 @@ class GridExports extends React.PureComponent {
super(props) super(props)
this.state = { this.state = {
el: null, el: null,
validate: false,
importCompatibleError: null importCompatibleError: null
} }
this.handleOpen = this.handleOpen.bind(this) this.handleOpen = this.handleOpen.bind(this)
...@@ -57,6 +58,7 @@ class GridExports extends React.PureComponent { ...@@ -57,6 +58,7 @@ class GridExports extends React.PureComponent {
this.setState({ this.setState({
el: null, el: null,
validate: false,
importCompatibleError: null importCompatibleError: null
}) })
...@@ -91,16 +93,23 @@ class GridExports extends React.PureComponent { ...@@ -91,16 +93,23 @@ class GridExports extends React.PureComponent {
handleExport() { handleExport() {
const { onExport } = this.props const { onExport } = this.props
if (this.validate()) { this.setState({ validate: true }, () => {
this.handleClose() if (this.validate()) {
if (onExport) { this.handleClose()
onExport() if (onExport) {
onExport()
}
} }
} })
} }
validate() { validate() {
const { exportable } = this.props const { exportable } = this.props
const { validate } = this.state
if (!validate) {
return true
}
const isXLSExport = const isXLSExport =
exportable.fileFormat === GridExportOptions.FILE_FORMAT.XLS exportable.fileFormat === GridExportOptions.FILE_FORMAT.XLS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment