Skip to content

Commit

Permalink
DataViews: fix spacing when combining combined fields (#67226)
Browse files Browse the repository at this point in the history
Co-authored-by: oandregal <[email protected]>
Co-authored-by: youknowriad <[email protected]>
  • Loading branch information
3 people authored Nov 22, 2024
1 parent 2919c5c commit 4d2fb64
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ export const themeFields: Field< Theme >[] = [
},
{ id: 'requires', label: 'Requires at least' },
{ id: 'tested', label: 'Tested up to' },
{ id: 'icon', label: 'Icon', render: () => <Icon icon={ image } /> },
{
id: 'tags',
label: 'Tags',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,28 @@ export const FieldsNoSortableNoHidable = () => {
export const CombinedFields = () => {
const defaultLayoutsThemes = {
table: {
fields: [ 'theme', 'requires', 'tested' ],
fields: [ 'theme_with_combined', 'theme_with_simple' ],
layout: {
primaryField: 'name',
combinedFields: [
{
id: 'theme',
id: 'name_tested',
label: 'Theme',
children: [ 'name', 'description' ],
children: [ 'name', 'tested' ],
direction: 'vertical',
},
{
id: 'theme_with_combined',
label: 'Combine combined fields',
children: [ 'icon', 'name_tested' ],
direction: 'horizontal',
},
{
id: 'theme_with_simple',
label: 'Combine simple fields',
children: [ 'icon', 'name' ],
direction: 'horizontal',
},
] as CombinedField[],
styles: {
theme: {
Expand Down
6 changes: 5 additions & 1 deletion packages/dataviews/src/dataviews-layouts/table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ function TableColumnCombined< Item >( {
) );

if ( field.direction === 'horizontal' ) {
return <HStack spacing={ 3 }>{ children }</HStack>;
return (
<HStack spacing={ 3 } justify="flex-start">
{ children }
</HStack>
);
}
return <VStack spacing={ 0 }>{ children }</VStack>;
}
Expand Down

1 comment on commit 4d2fb64

@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 4d2fb64.
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/11970791121
📝 Reported issues:

Please sign in to comment.