-
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: make the move left/right controls in table header always available #64646
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. |
I'm kind of curious, why would we want to disable moving for a field. Also disabling moving for a field doesn't mean it can't move if you can move the fields around it. So I'm failing to see why we need this API personally. |
I want to prevent the opposite: it'll be hidden if we disable sorting & "is hidden". There are valid cases where those two can be disabled but we still want the "move tools" to be available. Without this PR, it'd be hidden. An alternative would be to make it always available. That would work for me but I want to prevent cases where consumers use hacky ways to hide this control: providing it as an API helps them to tweak DataViews in a proper way. |
Riad and I talked about this and I'm going to prepare the alternative: make the "moving controls always available". There should also be a drag&drop or arrows in the properties section of the view config that it's related to this. If it comes to making this configurable, it perhaps makes more sense to enable/disable at the view level rather than the field level. |
Pushed the alternative. |
enableMoving
to field API
Something slightly related that we're missing is that the "combined fields" doesn't support this dropdown menu yet. (Can be done later) |
Maybe we can mention this in the changelog. |
…vailable (WordPress#64646) Co-authored-by: oandregal <[email protected]> Co-authored-by: youknowriad <[email protected]>
What?
Introduce a
enableMoving
that controls whether the "move to left"/"move to right" controls are visible in the table layout:Why?
Without this setting, the visibility of those controls depends on the other conditions:
true
by default.true
by default.There are situations where the field can be hidden, it's not sortable, and doesn't have a filter, but we still want to display the move left/right controls.
How?
Introduce a new
enableMoving
setting to the fields API. It's true by default.Testing Instructions
Nothing changes in terms of UI.
For testing the feature, go to the post-fields configuration and set the
title
field toenableSorting: false
. Reload and verify that the table header controls are still displayed: