Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vtadmin-web] Fix default redirect on Tablet view #10010

Merged
merged 3 commits into from
Mar 30, 2022

Conversation

doeg
Copy link
Contributor

@doeg doeg commented Mar 30, 2022

Description

This fixes a bug where the ReadOnlyGate component was breaking redirects when used within a <Switch>:

Screen Shot 2022-03-30 at 11 25 08 AM

Turns out my comment was wholly incorrect! Writing these tests took way more time than it was worth! And, best of all, this will likely need to be rewritten when we upgrade to the next version of react-router anyway! 馃ぁ Oh well.

Related Issue(s)

N/A

Checklist

  • Should this PR be backported?
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

N/A

Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
@doeg doeg added this to In progress in VTAdmin via automation Mar 30, 2022
@@ -23,12 +23,26 @@ import { isReadOnlyMode } from '../util/env';
* <ReadOnlyGate>
* <SomeSpicyWriteAction />
* </ReadOnlyGate>
*
* Do not use ReadOnly gate in a react-router Switch statement as it will break
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the example!

Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
@doeg doeg merged commit dffc4a5 into vitessio:main Mar 30, 2022
VTAdmin automation moved this from In progress to Done Mar 30, 2022
@doeg doeg deleted the sarabee-tablet-redirect-bug branch March 30, 2022 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants