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.
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
Data views: Add ability to display fields as a badge in grid layout #60284
Data views: Add ability to display fields as a badge in grid layout #60284
Changes from 5 commits
f2a20f5
6415a4b
50a3721
1a4c96a
9d14dd5
0e2fc17
89f8a80
4998c22
8097196
8b79460
4926501
1c038c5
4fc6e50
ef9a806
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
It sounds like we may remove the
is-badge
class? It's only used inpackages/edit-site/src/components/page-patterns/style.scss
but it seems to be unnecessary?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 we should declare a badge fields once and has nothing to do with
asColumnFields
. Let me refactor the code a bit..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 terms of naming, I think we should remove the
displayAs
prefix everywhere. We already usebadgeFields
in the UI component below, and there's no difference from the existingprimaryField
andmediaField
(all of this is about "marking" a set of fields and display them differently).The same applies to
columnFields
, that can be changed in a different 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.
Sounds fine to me.
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'd prefer if we don't target dataviews classes in consumer code, as it implies it's a public API. Can we instead add a specific class in the
sync-status
field? We have access to the view type there.I've noticed that we do this for pagination, pattern actions, and templates/parts actions. cc @ntsekouras
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.
Personally I don't think it's bad to use a specific class with a field's id suffix and I wouldn't worry right now about indicating public API, since we can have breaking changes in the DataViews package.
Having said that, I agree with you that we don't need this right now. I updated the code.