mirror of
https://github.com/apache/superset.git
synced 2026-05-07 08:54:23 +00:00
fix: chart disappears in standalone slice (#12606)
This commit is contained in:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user