fix: chart disappears in standalone slice (#12606)
This commit is contained in:
parent
68fe2208ba
commit
862ddd9cb4
|
|
@ -203,6 +203,11 @@ const ExploreChartPanel = props => {
|
|||
[chartRef, renderChart],
|
||||
);
|
||||
|
||||
const standaloneChartBody = useMemo(
|
||||
() => <div ref={chartRef}>{renderChart()}</div>,
|
||||
[chartRef, renderChart],
|
||||
);
|
||||
|
||||
if (props.standalone) {
|
||||
// dom manipulation hack to get rid of the boostrap theme's body background
|
||||
const standaloneClass = 'background-transparent';
|
||||
|
|
@ -210,7 +215,7 @@ const ExploreChartPanel = props => {
|
|||
if (!bodyClasses.includes(standaloneClass)) {
|
||||
document.body.className += ` ${standaloneClass}`;
|
||||
}
|
||||
return renderChart();
|
||||
return standaloneChartBody;
|
||||
}
|
||||
|
||||
const header = (
|
||||
|
|
|
|||
|
|
@ -557,7 +557,7 @@ class ChartRestApi(BaseSupersetModelRestApi):
|
|||
try:
|
||||
json_body = json.loads(request.form["form_data"])
|
||||
except (TypeError, json.JSONDecodeError):
|
||||
json_body = None
|
||||
pass
|
||||
|
||||
if json_body is None:
|
||||
return self.response_400(message=_("Request is not JSON"))
|
||||
|
|
|
|||
Loading…
Reference in New Issue