DataViews: Update the view actions menu to be independent from current view APIs - #55294
Conversation
|
Size Change: +124 B (0%) Total Size: 1.65 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in d6ffd2323bb76461d2883b0c3bd1d5955e59475f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6493945706
|
|
Just did a quick test and it breaks when we reset the sorting. |
d6ffd23 to
43b8b10
Compare
|
@ntsekouras Rebased and fixed the reset issue. |
| onSelect={ ( event ) => { | ||
| event.preventDefault(); | ||
| if ( sortedDirection === direction ) { | ||
| dataView.resetSorting(); |
There was a problem hiding this comment.
I see you separated the code again here. That's fine, but the plan is to update the code here to update the view, right?
There was a problem hiding this comment.
I don't really know whether we should merge the two, especially since list view heavily depends on tanstack. We'll see how that menu grows.
There was a problem hiding this comment.
Yeah, we'll see, but I think we can use tanstack for the other views too(at least the simpler ones like grid, etc..).
Related #55083
What?
This is PR is a prerequisite to implement alternative views (grid) for the DataViews component. The "DataViews" menu is common to all view types, so it shouldn't be using internal APIs that are specific to one given view type (tan stack APIs). So this PR refactors that component to rely on the
viewandfieldsobject instead ofdataViewobject that we receive from tanstack.Testing Instructions
1- Open the browse all pages in the site editor
2- Use the view actions menu (top right) to tweak the sort, the visibility of fields...