-
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: fix field reordering and visibility logic #64999
Merged
oandregal
merged 12 commits into
trunk
from
fix/dataviews-field-reordering-and-visibility
Sep 3, 2024
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
efbac20
Centralize logic in FieldControl
oandregal 6042f92
Logic for combined fields
oandregal e1d2cd7
Add comment
oandregal 7a47ded
Extract utils
oandregal 56d8a67
Table: use getVisibleFieldIds util
oandregal 27a1b8d
Sort properties by view.fields order
oandregal d8549d9
Hidden fields should not include the special media field
oandregal 98ec9d3
Allow re-ordering when view.fields is undefined
oandregal 4a0602d
Consider combined field in visibleFields if no view.fields is provided
oandregal ed9b897
Use fieldId instead of field.id
oandregal d34fec7
Fix column reordering when no view.fields is provided
oandregal 2c2d801
Display moving controls for combined fields
oandregal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 works for now, but my thinking is that ultimately, we should find a way for the layouts to actually "inject" logic here. Or (which is what I had in mind) to have some kind of a slot and the "properties" area be specific per layout. For instance in "table", we should be able to "combine" fields if we want.
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 agree. If we aim to make the layouts "registerable/unregisterable" by 3rd parties we cannot have this kind of logic in the view config (or any other component).
I've looked at the current usage of layouts in this component and this is what I see:
All of them could be solved by providing a
layout.supports
thing somewhere. Using that approach, it'd still be DataViews' responsibility to define which "features" are supported.This approach would be a lot more open. However, every layout would have to implement the same actions (reordering, visibility, 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.
In any case, not for this PR 😅
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.
Actually,
layout.supports
could also be a nice thing to have for consumers that want to "lock in" (aka remove options) a bit more the user experience.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.
Yes, but for list view we have badges..., for grid we have columns and rows...