Skip to content

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

Merged
rohit-nayak-ps merged 1 commit intovitessio:masterfrom
tinyspeck:sarabee-vtadmin-url-query-callbacks
Feb 18, 2021
Merged

[vtadmin-web] Add replaceQuery + pushQuery to useURLQuery hook#7507
rohit-nayak-ps merged 1 commit intovitessio:masterfrom
tinyspeck:sarabee-vtadmin-url-query-callbacks

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 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

None yet

Development

Successfully merging this pull request may close these issues.

4 participants