mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
chore(explore): Update chart save to use API endpoints (#20498)
* Update SaveModal to use v1 API instead of POST /explore. * Refactor SaveModal tests and remove obsolete ones. * Fix redirect to /explore on save. * Add toasts (but they don't work). * Move logic inside try block, clarify unary-plus use. * Add tests. * Fix owners bug in updateSlice, enable navigation to dashboard w/o reload. * Fix toasts. * Fix translated strings. * Fix unintended removal from dashboard bug. * Fix native filters bug. * Don't refresh Explore page after saving * Use JSON payload shorthand. * Prevent current dashboards being overwritten on viz type change.
This commit is contained in:
@@ -464,6 +464,14 @@ function ExploreViewContainer(props) {
|
||||
return false;
|
||||
}, [lastQueriedControls, props.controls]);
|
||||
|
||||
const saveAction = getUrlParam(URL_PARAMS.saveAction);
|
||||
useChangeEffect(saveAction, () => {
|
||||
if (['saveas', 'overwrite'].includes(saveAction)) {
|
||||
onQuery();
|
||||
addHistory({ isReplace: true });
|
||||
}
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (props.ownState !== undefined) {
|
||||
onQuery();
|
||||
@@ -586,6 +594,7 @@ function ExploreViewContainer(props) {
|
||||
form_data={props.form_data}
|
||||
sliceName={props.sliceName}
|
||||
dashboardId={props.dashboardId}
|
||||
sliceDashboards={props.exploreState.sliceDashboards ?? []}
|
||||
/>
|
||||
)}
|
||||
<Resizable
|
||||
|
||||
Reference in New Issue
Block a user