Skip to content

[vtadmin-web] Add DataTable component with URL pagination#7487

Merged
rohit-nayak-ps merged 1 commit intovitessio:masterfrom
tinyspeck:sarabee-vtadmin-data-table-pagination
Feb 11, 2021
Merged

[vtadmin-web] Add DataTable component with URL pagination#7487
rohit-nayak-ps merged 1 commit intovitessio:masterfrom
tinyspeck:sarabee-vtadmin-data-table-pagination

Conversation

@doeg
Copy link
Contributor

@doeg doeg commented Feb 11, 2021

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

Description

✨ Staged at http://vtadmin.puppy.software, with a modified DEFAULT_PAGE_SIZE of 5 to show the pagination. :)

Changes in this PR:

  • Adds a DataTable component. At the moment, this only handles pagination. This will become more... robust.
  • Adds a couple of hooks for working with URL query parameters: useURLQuery and useURLPagination. Plus, lots of tests.

I've yet to spend much (any) time worrying about memoization or performance -- I'll do a performance pass when we have filtering, loading state, etc. in place.

I also pinky-promise that I will write some sort of (heavy scare quotes) "best practices" doc around testing. It's wonderfully easy... but not necessarily straightforward. 😈

pagination.mov

Related Issue(s)

N/A

Checklist

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

Deployment Notes

N/A

Impacted Areas in Vitess

Components that this PR will affect:

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

Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
@doeg doeg force-pushed the sarabee-vtadmin-data-table-pagination branch from 2ace135 to a37ed6d Compare February 11, 2021 21:06
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.

looks good and stellarly documented!!

import { useLocation } from 'react-router-dom';

/**
* useURLQuery is a hook for parsing query parameters from the current URL
Copy link
Contributor

Choose a reason for hiding this comment

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

:chefs-kiss:

@rohit-nayak-ps rohit-nayak-ps merged commit 27c07af into vitessio:master Feb 11, 2021
@askdba askdba added the Component: VTAdmin VTadmin interface label Feb 15, 2021
@askdba askdba added this to the v10.0 milestone Feb 15, 2021
@doeg doeg deleted the sarabee-vtadmin-data-table-pagination branch March 1, 2021 00:50
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