-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we'll see, but I think we can use tanstack for the other views too(at least the simpler ones like grid, etc..).
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.
Looks, good. Thanks!
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
view
andfields
object instead ofdataView
object 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...