-
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: set primary field styles #57846
Conversation
Size Change: +36 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
@@ -15,7 +15,9 @@ import { | |||
} from '../../utils/constants'; | |||
|
|||
export const DEFAULT_CONFIG_PER_VIEW_TYPE = { | |||
[ LAYOUT_TABLE ]: {}, | |||
[ LAYOUT_TABLE ]: { | |||
primaryField: 'title', |
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 table layout wasn't defining what's the primary field. This is necessary for the primary field class to be serialized into the HTML.
} | ||
|
||
return ( | ||
<VStack spacing={ 1 }> |
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.
Removes extra divs (VStack/View) that were no longer necessary.
@@ -224,32 +220,22 @@ export default function PagePages() { | |||
id: 'title', | |||
getValue: ( { item } ) => item.title?.rendered, | |||
render: ( { item } ) => { | |||
return ( | |||
<VStack spacing={ 1 }> |
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.
Removes extra divs (VStack/View) that were no longer necessary.
@@ -210,7 +208,6 @@ function Title( { item, categoryId } ) { | |||
// Required for the grid's roving tab index system. | |||
// See https://github.com/WordPress/gutenberg/pull/51898#discussion_r1243399243. | |||
tabIndex="-1" | |||
className="dataviews-view-grid__title-field" |
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.
We should not use internal dataviews classes in the consumer code.
0a583fb
to
ed93d63
Compare
…t-overflow" This reverts commit 6b3b92c.
Part of #55083
What?
Makes the styles for the primary field (title) equal for all views.
Why?
We want to make it coherent, style wise:
How?
dataviews-view-grid__title-field
class in consumer code (Pages, Templates, Patterns pages) to style the title. Consumers should not use dataviews defined classes.Testing Instructions
title
for all of them).TODO