-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: Refactor to prepare exposing the underlying UI pieces #63694
Conversation
Size Change: +417 B (+0.02%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
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.
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. |
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 could not select patterns at all (the selectable ones are user-created patterns under my patterns). The selection checkbox just does not work for patterns.
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.
When sorting patterns by title the application crashes.
Both of these issues are present in trunk, I will fix them in separate PRs.
I'm not entirely sure how to duplicate this, I suspect that it's also independent of this refactor. |
Opened a quick PR for the title sorting bug noticed here. |
@@ -1,5 +1,5 @@ | |||
export { default as DataViews } from './dataviews'; | |||
export { default as DataViews } from './components/dataviews'; |
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.
What advantages do you see with adding an extra folder layer with components
folder? Additionally every sub folder here has the dataviews
prefix. Do you think we need this since we're in dataviews package?
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.
What advantages do you see with adding an extra folder layer with components folder?
- We have another folder called "layouts" for the default layouts
- We'll have more folders later (field types)
- Components might not be the perfect folder name here but I like that all the components that make up the dataviews and data forms are now in a folder to avoid being mixed with "layouts", "field types"...
Do you think we need this since we're in dataviews package?
Yes, because we have. DataViews
and DataForm
. DataForm can also potentially be composed later like the DataViews.
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.
Components might not be the perfect folder name here but I like that all the components that make up the dataviews and data forms are now in a folder to avoid being mixed with "layouts", "field types"
I'm fine with it, although my preference for this package is to organise without the components. I think it makes it easier find files related per 'function'. What I mean by this, is have the folder filters
for example and add there all related code (filters, global search, 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.
Other than filters, the other components don't really have sub components, so a folder doesn't really make sense IMO.
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.
This looks good in general, thank you! There are some z-index
issues with actions modals and some styling issues, but it needs more smoke testing to catch them all. I'd be fine to land sooner with quick follow ups if we find more style issues, since it's a big PR and will be a nightmare to rebase all the time.
For me the most important things to decide on is the file structure and maybe the prefixes of folders, and the BulkActions comment regarding conditional rendering per layout.
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.
The changes seem, good I guess we should just fix the styling issues, and it is ready to merge to avoid big conflicts.
I fixed the z-index issue, I was interestingly an issue because we were reusing classnames rather than reusing components. That's a reminder to avoid that as much as possible :) |
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 think this is good to land and have quick follow ups if needed to avoid the conflicts.
Still needs the rebase and for sure the:
Top checkbox for selecting all is bigger.
isn't fixed right now, so it could be either fixed here or in the first follow up.
Thanks!
Forgot about this one, I'll look into it. |
26a1be4
to
6110dc1
Compare
This was another case of "classname" reuse instead of "component reuse". Let's stop doing that please. |
Related #63646
What?
This PR refractors the DataViews components to prepare them to be exposed (in order to address the need for flexibility in how we render the dataviews).
This PR does the following things:
DataViewsContext
React context that is exposed at the top level.DataViews
component and consumed by the underlying composable components. That way the user won't have to pass the same props all over again to all the composable components.dataviews/src/components
folder.dataviews/style.scss
file and move the declarations close to each component.In a follow-up PR, I will be exposing the underlying components to allow users to adapt the dataviews UI to their liking.
Testing Instructions
There shouldn't be any change in behavior but because of the scale of this change, some small regressions can happen so I'd appreciate testing the different dataviews that we have.