mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
add explicit message display for 'Fetching Annotation Layer' error (#3631)
This commit is contained in:
committed by
Maxime Beauchemin
parent
b866b33dee
commit
bd45e3b19a
@@ -42,19 +42,20 @@ class AsyncSelect extends React.PureComponent {
|
||||
fetchOptions() {
|
||||
this.setState({ isLoading: true });
|
||||
const mutator = this.props.mutator;
|
||||
$.get(this.props.dataEndpoint, (data) => {
|
||||
this.setState({ options: mutator ? mutator(data) : data, isLoading: false });
|
||||
$.get(this.props.dataEndpoint)
|
||||
.done((data) => {
|
||||
this.setState({ options: mutator ? mutator(data) : data, isLoading: false });
|
||||
|
||||
if (!this.props.value && this.props.autoSelect && this.state.options.length) {
|
||||
this.onChange(this.state.options[0]);
|
||||
}
|
||||
})
|
||||
.fail(() => {
|
||||
this.props.onAsyncError();
|
||||
})
|
||||
.always(() => {
|
||||
this.setState({ isLoading: false });
|
||||
});
|
||||
if (!this.props.value && this.props.autoSelect && this.state.options.length) {
|
||||
this.onChange(this.state.options[0]);
|
||||
}
|
||||
})
|
||||
.fail((xhr) => {
|
||||
this.props.onAsyncError(xhr.responseText);
|
||||
})
|
||||
.always(() => {
|
||||
this.setState({ isLoading: false });
|
||||
});
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user