Skip to content

Commit

Permalink
fix(key-value): lost url_params after long-url feature (apache#18846)
Browse files Browse the repository at this point in the history
(cherry picked from commit 4c16586)
  • Loading branch information
zhaoyongjie authored and rosemarie-chiu committed Feb 22, 2022
1 parent 37de381 commit cbab107
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,19 @@ const updateHistory = debounce(
additionalParam[URL_PARAMS.datasetId.name] = datasetId;
}

const urlParams = payload?.url_params || {};
Object.entries(urlParams).forEach(([key, value]) => {
if (
![
URL_PARAMS.sliceId.name,
URL_PARAMS.formDataKey.name,
URL_PARAMS.datasetId.name,
].includes(key)
) {
additionalParam[key] = value;
}
});

try {
let key;
let stateModifier;
Expand Down
3 changes: 1 addition & 2 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,8 +744,7 @@ def explore(
if form_data_key:
parameters = CommandParameters(actor=g.user, key=form_data_key,)
value = GetFormDataCommand(parameters).run()
if value:
initial_form_data = json.loads(value)
initial_form_data = json.loads(value) if value else {}

if not initial_form_data:
slice_id = request.args.get("slice_id")
Expand Down

0 comments on commit cbab107

Please sign in to comment.