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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vtadmin-web] Add replaceQuery + pushQuery to useURLQuery hook #7507

Merged

Conversation

doeg
Copy link
Contributor

@doeg doeg commented Feb 17, 2021

Signed-off-by: Sara Bee 855595+doeg@users.noreply.github.com

Description

This returns pushQuery and replaceQuery functions from the useURLQuery hook. A bit of refactoring to simplify pushing + replacing URL query parameters with common defaults.

Staged at http://vtadmin.puppy.software, although there's not much to see. Going to a URL like http://vtadmin.puppy.software/tablets?page=1234567890 will show replaceQuery in action.

Related Issue(s)

N/A

Checklist

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

Deployment Notes

Impacted Areas in Vitess

Components that this PR will affect:

  • Query Serving
  • VReplication
  • Cluster Management
  • Build/CI
  • VTAdmin

@doeg doeg changed the title Add replaceQuery + pushQuery to useURLQuery hook [vtadmin-web] Add replaceQuery + pushQuery to useURLQuery hook Feb 17, 2021
@doeg doeg force-pushed the sarabee-vtadmin-url-query-callbacks branch from 75100c7 to 93ff80a Compare February 17, 2021 14:40
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
@doeg doeg force-pushed the sarabee-vtadmin-url-query-callbacks branch from 93ff80a to 5bb242c Compare February 17, 2021 14:42
Copy link
Contributor

@ajm188 ajm188 left a comment

Choose a reason for hiding this comment

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

excellent as always ☺️

const history = useHistory();
const location = useLocation();

// A spicy note: typically, we always want to use the `location` from useLocation() instead of useHistory().
Copy link
Contributor

Choose a reason for hiding this comment

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

Fascinating!

@rohit-nayak-ps rohit-nayak-ps merged commit 5a79bb6 into vitessio:master Feb 18, 2021
@askdba askdba added the Component: VTAdmin VTadmin interface label Feb 22, 2021
@askdba askdba added this to the v10.0 milestone Feb 22, 2021
@doeg doeg added this to In progress in VTAdmin via automation Mar 16, 2021
@doeg doeg moved this from In progress to Done in VTAdmin Mar 16, 2021
@doeg doeg deleted the sarabee-vtadmin-url-query-callbacks branch November 1, 2021 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: VTAdmin VTadmin interface
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants