Skip to content

Commit

Permalink
Data Views: Rename displayAsColumnFields to columnFields API (#60504)
Browse files Browse the repository at this point in the history
Co-authored-by: ntsekouras <[email protected]>
Co-authored-by: oandregal <[email protected]>
  • Loading branch information
3 people authored Apr 5, 2024
1 parent 5379531 commit 95b2a3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions packages/dataviews/src/view-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function GridItem( {
primaryField,
visibleFields,
badgeFields,
displayAsColumnFields,
columnFields,
} ) {
const hasBulkAction = useHasAPossibleBulkAction( actions, item );
const id = getItemId( item );
Expand Down Expand Up @@ -139,7 +139,7 @@ function GridItem( {
<Flex
className={ classnames(
'dataviews-view-grid__field',
displayAsColumnFields?.includes( field.id )
columnFields?.includes( field.id )
? 'is-column'
: 'is-row'
) }
Expand All @@ -149,7 +149,7 @@ function GridItem( {
expanded
style={ { height: 'auto' } }
direction={
displayAsColumnFields?.includes( field.id )
columnFields?.includes( field.id )
? 'column'
: 'row'
}
Expand Down Expand Up @@ -235,9 +235,7 @@ export default function ViewGrid( {
primaryField={ primaryField }
visibleFields={ visibleFields }
badgeFields={ badgeFields }
displayAsColumnFields={
view.layout.displayAsColumnFields
}
columnFields={ view.layout.columnFields }
/>
);
} ) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const defaultConfigPerViewType = {
[ LAYOUT_GRID ]: {
mediaField: 'preview',
primaryField: 'title',
displayAsColumnFields: [ 'description' ],
columnFields: [ 'description' ],
},
[ LAYOUT_LIST ]: {
primaryField: 'title',
Expand Down

1 comment on commit 95b2a3e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 95b2a3e.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/8568942015
📝 Reported issues:

Please sign in to comment.