canonical / react-components

A set of components based on Vanilla Framework
https://canonical.github.io/react-components
93 stars 51 forks source link

feat: implement externally controlled mode for TablePagination [WD-8505] #1034

Closed mas-who closed 6 months ago

mas-who commented 6 months ago

Done

QA

Storybook

To see rendered examples of all react-components, run:

yarn start

QA in your project

from react-components run:

yarn build
npm pack

Install the resulting tarball in your project with:

yarn add <path-to-tarball>

QA steps

webteam-app commented 6 months ago

Demo starting at https://react-components-1034.demos.haus

mas-who commented 6 months ago

Decided to move the presentation part of the component to TablePaginationControls, then inside TablePagination we will adjust component behaviour depending on the externallyControlled prop. It is okay to keep usePagination in TablePagination actually since we just pass it with no data if externallyControlled is true. I think having a completely separate component for un-controlled pagination will make things a little messy and result in duplicated code.

The cool thing is that the test I wrote previously for server-pagination didn't have to change at all, so it served as a bit of a setup for TDD :slightly_smiling_face:

github-actions[bot] commented 6 months ago

:tada: This PR is included in version 0.50.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: