mirror of
https://github.com/apache/superset.git
synced 2026-04-14 05:34:38 +00:00
[explore] force control validation before runQuery (#2544)
* [explore] force control validation before runQuery * Addressing comments
This commit is contained in:
committed by
GitHub
parent
493ba18362
commit
75a358c616
@@ -47,7 +47,7 @@ class ExploreViewContainer extends React.Component {
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
if (this.props.triggerQuery) {
|
||||
if (this.props.triggerQuery && !this.hasErrors()) {
|
||||
this.runQuery();
|
||||
}
|
||||
}
|
||||
@@ -95,6 +95,10 @@ class ExploreViewContainer extends React.Component {
|
||||
toggleModal() {
|
||||
this.setState({ showModal: !this.state.showModal });
|
||||
}
|
||||
hasErrors() {
|
||||
const ctrls = this.props.controls;
|
||||
return Object.keys(ctrls).some(k => ctrls[k].validationErrors.length > 0);
|
||||
}
|
||||
renderErrorMessage() {
|
||||
// Returns an error message as a node if any errors are in the store
|
||||
const errors = [];
|
||||
|
||||
Reference in New Issue
Block a user