-
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/cluster-ui: fix routing to statement details page #70600
Conversation
Note that I pulled relevant changes from #70282, and have rebased that branch on top of this one, since it makes more sense to include those changes relevant to the routing here. |
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! 0 of 0 LGTMs obtained (waiting on @maryliag and @xinhaoz)
pkg/ui/workspaces/db-console/src/app.tsx, line 191 at r1 (raw file):
component={StatementDetails} /> <Route
Instead of getting rid of the old routes, we should do a reroute, at least for now, in case users bookmark a statement they frequently check or something like that
eeb3571
to
3f23d7f
Compare
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! 0 of 0 LGTMs obtained (waiting on @maryliag)
pkg/ui/workspaces/db-console/src/app.tsx, line 191 at r1 (raw file):
Previously, maryliag (Marylia Gutierrez) wrote…
Instead of getting rid of the old routes, we should do a reroute, at least for now, in case users bookmark a statement they frequently check or something like that
Done.
3f23d7f
to
5db9e2a
Compare
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.
When there is no App selected on the filter, you're passing the value All
as a parameters, and on the details page is not returning anything because it can find an app called All
. Make sure that you're only passing parameters on the url if a value was selected
Reviewed 9 of 14 files at r1, 2 of 4 files at r2.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @maryliag)
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.
I notice the issue I mentioned above only happens when any of the other filters was selected (database, SQL type, etc). If no filter is selected the App is empty on the url and it works, so make sure that when any of the filters is selected, the App name is being handled properly
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @maryliag)
5db9e2a
to
f86c194
Compare
@maryliag Done. Nice catch -- I was erroneously pulling the app name from the query string in the statements page, when that page still uses the route param. |
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 1 of 14 files at r1, 2 of 4 files at r2, 4 of 6 files at r3, 1 of 2 files at r4, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @maryliag)
Partially addresses cockroachdb#68843 Previously, we used two different bases for the statement details page, which depended on which route parameters were included. `/statements/` was used when the app name was included in the path, and otherwise `/statement/` was used. The database name was also optionally included in the path name, further complicating routing to the statement details page as these optional route params lead to the need to include all combinations of route parameters for statement detail paths, This commit turns all optional route parameters into query string parameters, removing the necessity for different base paths and route param combinations. Release note (ui change): For statement detail URLs, the app name and database name are now query string parameters. The route to statement details is now definitively `/statement/:implicitTxn/:statement?{queryStringParams}`. e.g. `statement/true/SELECT%20city%2C%20id%20FROM%20vehicles%20WHERE%20city%20%3D%20%241?database=movr&app=movr`
f86c194
to
b7b53a5
Compare
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, is there anything special about implicitTxn
that we want to make it part of the path instead of also turning it into query param ?
Reviewed 3 of 14 files at r1, 1 of 4 files at r2, 3 of 6 files at r3, 1 of 2 files at r4.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @Azhng and @maryliag)
bors r=maryliag |
Build failed (retrying...): |
Build succeeded: |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from b7b53a5 to blathers/backport-release-21.2-70600: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 21.2.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Partially addresses #68843
Previously, we used two different bases for the statement details page, which
depended on which route parameters were included.
/statements/
was used whenthe app name was included in the path, and otherwise
/statement/
was used.The database name was also optionally included in the path name, further
complicating routing to the statement details page as these optional route
params lead to the need to include all combinations of route parameters for
statement detail paths,
This commit turns all optional route parameters into query string parameters,
removing the necessity for different base paths and route param combinations.
Release note (ui change): For statement detail URLs, the app name and database
name are now query string parameters. The route to statement details is
now definitively
/statement/:implicitTxn/:statement?{queryStringParams}
.e.g.
statement/true/SELECT%20city%2C%20id%20FROM%20vehicles%20WHERE%20city%20%3D%20%241?database=movr&app=movr