mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
Use Alert for visualization error (#1639)
This commit is contained in:
parent
a8480f5492
commit
f64a205603
@ -108,28 +108,12 @@ class ChartContainer extends React.Component {
|
||||
// finished rendering callback
|
||||
},
|
||||
|
||||
error(msg, xhr) {
|
||||
let errorMsg = msg;
|
||||
let errHtml = '';
|
||||
try {
|
||||
const o = JSON.parse(msg);
|
||||
if (o.error) {
|
||||
errorMsg = o.error;
|
||||
}
|
||||
} catch (e) {
|
||||
// pass
|
||||
}
|
||||
errHtml = `<div class="alert alert-danger">${errorMsg}</div>`;
|
||||
if (xhr) {
|
||||
const extendedMsg = this.getErrorMsg(xhr);
|
||||
if (extendedMsg) {
|
||||
errHtml += `<div class="alert alert-danger">${extendedMsg}</div>`;
|
||||
}
|
||||
}
|
||||
$(this.state.selector).html(errHtml);
|
||||
this.render();
|
||||
$('span.query').removeClass('disabled');
|
||||
$('.query-and-save button').removeAttr('disabled');
|
||||
clearError: () => {
|
||||
this.props.actions.removeChartAlert();
|
||||
},
|
||||
|
||||
error(msg) {
|
||||
this.props.actions.chartUpdateFailed(msg);
|
||||
},
|
||||
|
||||
d3format: (col, number) => {
|
||||
|
Loading…
Reference in New Issue
Block a user