-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(key-value): lost url_params after long-url feature #18846
Conversation
if value: | ||
initial_form_data = json.loads(value) | ||
initial_form_data = json.loads(value) if value else {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just code smell
@@ -175,6 +175,19 @@ const updateHistory = debounce( | |||
additionalParam[URL_PARAMS.datasetId.name] = datasetId; | |||
} | |||
|
|||
const urlParams = payload?.url_params || {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't be cleaner to just initialize additionalParam
with payload?.url_params
? If some of the parameters are already in the URL they will be overridden anyway. This way you don't need the forEach
and the if
check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't be cleaner to just initialize additionalParam with payload?.url_params?
formDataKey
in urlParams- it isn't known which url_params don't need to be put into
additionalParams
in the future.
If some of the parameters are already in the URL they will be overridden anyway. This way you don't need the forEach and the if check.
There needs to be a pattern that controls which params can be put in, and which do not.
BTW, chartId
and datasetId
come from elsewhere even though they are the same as urlParams. (link)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for fixing this!
(cherry picked from commit 4c16586)
🏷 preset:2022.7 |
SUMMARY
Currently, the parameters in the browser can't show in URL. This PR resolved it.
partial fix #16650
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION