-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
ui: use push instead of replace on browser history on SQL Activity page #71938
Conversation
Previously, when changing tabs on SQL Activity page the history would be replaced, this commits change to push to history, meaning when the user clicks Back on the browser it will return for the previous tab. Release note: None
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.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @maryliag)
bors r+ |
Build failed (retrying...): |
|
||
const onTabChange = (tabId: string): void => { | ||
setCurrentTab(tabId); | ||
util.clearHistory(props.history); | ||
util.syncHistory({ tab: tabId }, props.history); | ||
props.history.location.search = ""; |
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.
hmm, history.location.search
is already reset in line 83 in query.ts
, do we need to reset that here as well ?
util.clearHistory(props.history); | ||
util.syncHistory({ tab: tabId }, props.history); | ||
props.history.location.search = ""; | ||
util.syncHistory({ tab: tabId }, props.history, true); |
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.
super minor nit: add a inline comment here for the boolean literal /* push */
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.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @Azhng and @maryliag)
pkg/ui/workspaces/db-console/src/views/sqlActivity/sqlActivityPage.tsx, line 30 at r1 (raw file):
Previously, Azhng (Archer Zhang) wrote…
hmm,
history.location.search
is already reset in line 83 inquery.ts
, do we need to reset that here as well ?
yes, because the reset updates the current ones, but what I want is to remove all the query params before adding only the new tab selection
Build failed (retrying...): |
Build succeeded: |
Previously, when changing tabs on SQL Activity page the history
would be replaced, this commits change to push to history, meaning
when the user clicks Back on the browser it will return for the
previous tab.
Release note: None