fix: explore replace wrong standalone slice url (#12359)
diff --git a/.gitignore b/.gitignore
index 175e7e7..e8d8bb2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,6 +22,8 @@
*.swp
__pycache__
+.local
+.cache
.bento*
.cache-loader
.coverage
diff --git a/superset-frontend/spec/javascripts/explore/utils_spec.jsx b/superset-frontend/spec/javascripts/explore/utils_spec.jsx
index 251475a..9214400 100644
--- a/superset-frontend/spec/javascripts/explore/utils_spec.jsx
+++ b/superset-frontend/spec/javascripts/explore/utils_spec.jsx
@@ -199,6 +199,16 @@
URI('/superset/explore/').search({ form_data: sFormData }),
);
});
+
+ it('generates url with standalone', () => {
+ compareURI(
+ URI(getExploreLongUrl(formData, 'standalone')),
+ URI('/superset/explore/').search({
+ form_data: sFormData,
+ standalone: 'true',
+ }),
+ );
+ });
});
describe('buildV1ChartDataPayload', () => {
diff --git a/superset-frontend/src/explore/components/ExploreViewContainer.jsx b/superset-frontend/src/explore/components/ExploreViewContainer.jsx
index c539056..2cfe9f8 100644
--- a/superset-frontend/src/explore/components/ExploreViewContainer.jsx
+++ b/superset-frontend/src/explore/components/ExploreViewContainer.jsx
@@ -169,7 +169,11 @@
function addHistory({ isReplace = false, title } = {}) {
const payload = { ...props.form_data };
- const longUrl = getExploreLongUrl(props.form_data, null, false);
+ const longUrl = getExploreLongUrl(
+ props.form_data,
+ props.standalone ? 'standalone' : null,
+ false,
+ );
try {
if (isReplace) {
window.history.replaceState(payload, title, longUrl);