DataViews: Use in patterns page#57333
Conversation
|
Size Change: +1.06 kB (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 6a58942. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7298932102
|
6a58942 to
d26df02
Compare
| totalPages: Math.ceil( totalItems / view.perPage ), | ||
| }, | ||
| }; | ||
| }, [ patterns, view, fields ] ); |
There was a problem hiding this comment.
Feels like the data views package could expose helpers for local filtering and sorting as I believe the logic here is probably very similar to the templates page as well and any data view where the filtering and sorting is done locally.
| }, [ patterns, view, fields ] ); | ||
|
|
||
| const actions = useMemo( () => [ renameAction, exportJSONaction ], [] ); | ||
| const onChangeView = useCallback( |
There was a problem hiding this comment.
At some point we should consider whether we could bundle this logic as well as it repeats itself across data views usage. We may be able to do so by adding the defaultConfigPerViewType as a prop.
Also, it seems we're adding more and more "config" props, maybe at some point we could have a "settings" prop with a lot of these instead of keeping them top level.
There was a problem hiding this comment.
Yeah. I'm thinking of landing an initial PR without all the actions too(to reduce the size of this PR) and have some follow ups to simplify things a bit.
68dba2c to
64632a8
Compare
Fixed that.
This is an issue we need to handle in general yes, but I'm not sure it's for this PR. I'm thinking that we could test and land this PR and continue with follow ups due to the big size of the PR. For example to add the What do you think? |

What?
Part of: #55083
This PR is the starting point of using DataViews in patterns page. There is a lots of stuff going on with patterns and this might be also an opportunity to try to simplify the code, but I'm planning to explore this iteratively.
This is a WIP so the description/screenshots and code will change.
Testing Instructions
Tasks
Screenshots or screencast