-
Notifications
You must be signed in to change notification settings - Fork 4.5k
DataViews: Introduce perPageSizes
to control the available sizes of the items per page
#70604
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
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
titleField: 'title', | ||
descriptionField: 'description', | ||
mediaField: 'image', | ||
perPageSizes: [ 3, 6, 12, 24 ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking that this is not really a "view" configuration but more a prop of DataViews no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we already have a perPage
view config—wouldn't it be better to bundle them together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an important difference IMO. perPage impacts the layout itself, what is being rendered. So it's really the config of the "view". perPageSizes is more about the "form" that is used to configure the view, not the view itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Changed to the props of the DataViews
via 48a1e90 🙂
@@ -27,6 +27,7 @@ | |||
- Add `label-position-side` classes to labels in the form field layouts. Ensure that labels in the panel view do not align center, and that all side labels are center aligned. | |||
- Allow readonly fields in DataForm when `readOnly` is set to `true`. | |||
- Adjust the padding when the component is placed inside a `Card`. | |||
- Introduce `perPageSizes` to control the available sizes of the items per page |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love if we document this new prop in the README.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done by 831aa1e.
@oandregal When you get back, I'd love a sanity check here. For me it looks good enough. |
@youknowriad I've prepared #71004 with the things I've noticed. |
What?
Introduce
perPageSizes
to control the available sizes of the items per pageWhy?
The consumer would like to customize the number of items per page based on their layout requirements.
How?
Introduce the
perPageSizes
option to the view configTesting Instructions
npm run storybook:dev
to start the storybookDataViews > Custom Per Page Sizes
Testing Instructions for Keyboard
Screenshots or screencast