diff --git a/src/dashboard/import-dashboard.js b/src/dashboard/import-dashboard.js index b44e1f8..47e5216 100644 --- a/src/dashboard/import-dashboard.js +++ b/src/dashboard/import-dashboard.js @@ -67,27 +67,6 @@ class ImportDashboardDialog extends React.Component { // read IC const dashboard = JSON.parse(event.target.result); - /*let defaultIC = ""; - if (self.props.configs != null) { - defaultIC = self.props.configs[0].icID; - } - - dashboard.widgets.forEach(widget => { - switch (widget.type) { - case 'Value': - case 'Plot': - case 'Table': - case 'PlotTable': - case 'Gauge': - break; - - default: - break; - } - }); - - */ - self.imported = true; self.valid = true; self.setState({ name: dashboard.name, widgets: dashboard.widgets, grid: dashboard.grid }); @@ -107,21 +86,36 @@ class ImportDashboardDialog extends React.Component { this.valid = name; // return state to control - if (target === 'name') return name ? "success" : "error"; + if (target === 'name'){ + return name; + } } render() { return ( - this.onClose(c)} onReset={() => this.resetState()} valid={this.valid}> + this.onClose(c)} + onReset={() => this.resetState()} + valid={this.valid}>
Dashboard File this.loadFile(e.target.files)} /> - + Name - this.handleChange(e)} /> + this.handleChange(e)} + />