mirror of https://github.com/apache/superset.git
fix: explore replace wrong standalone slice url (#12359)
This commit is contained in:
parent
3eb0470a2f
commit
99de8a49b6
|
@ -22,6 +22,8 @@
|
||||||
*.swp
|
*.swp
|
||||||
__pycache__
|
__pycache__
|
||||||
|
|
||||||
|
.local
|
||||||
|
.cache
|
||||||
.bento*
|
.bento*
|
||||||
.cache-loader
|
.cache-loader
|
||||||
.coverage
|
.coverage
|
||||||
|
|
|
@ -199,6 +199,16 @@ describe('exploreUtils', () => {
|
||||||
URI('/superset/explore/').search({ form_data: sFormData }),
|
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', () => {
|
describe('buildV1ChartDataPayload', () => {
|
||||||
|
|
|
@ -169,7 +169,11 @@ function ExploreViewContainer(props) {
|
||||||
|
|
||||||
function addHistory({ isReplace = false, title } = {}) {
|
function addHistory({ isReplace = false, title } = {}) {
|
||||||
const payload = { ...props.form_data };
|
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 {
|
try {
|
||||||
if (isReplace) {
|
if (isReplace) {
|
||||||
window.history.replaceState(payload, title, longUrl);
|
window.history.replaceState(payload, title, longUrl);
|
||||||
|
|
Loading…
Reference in New Issue