Skip to content

Commit

Permalink
fix: explore replace wrong standalone slice url (#12359)
Browse files Browse the repository at this point in the history
  • Loading branch information
duynguyenhoang authored Jan 9, 2021
1 parent 3eb0470 commit 99de8a4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
*.swp
__pycache__

.local
.cache
.bento*
.cache-loader
.coverage
Expand Down
10 changes: 10 additions & 0 deletions superset-frontend/spec/javascripts/explore/utils_spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,16 @@ describe('exploreUtils', () => {
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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ function ExploreViewContainer(props) {

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);
Expand Down

0 comments on commit 99de8a4

Please sign in to comment.