diff --git a/packages/edit-site/src/components/post-list/index.js b/packages/edit-site/src/components/post-list/index.js index 7f5eb3879bd802..250567f8c8279f 100644 --- a/packages/edit-site/src/components/post-list/index.js +++ b/packages/edit-site/src/components/post-list/index.js @@ -84,8 +84,8 @@ function useView( postType ) { if ( isCustom === 'false' && layout ) { return { ...defaultView, + ...defaultLayouts[ layout ], type: layout, - layout: defaultLayouts[ layout ]?.layout, }; } return defaultView; @@ -124,7 +124,7 @@ function useView( postType ) { return { ...storedView, - layout: defaultLayouts[ storedView?.type ]?.layout, + ...defaultLayouts[ layout ], }; }, [ editedViewRecord?.content ] ); diff --git a/packages/edit-site/src/components/sidebar-dataviews/default-views.js b/packages/edit-site/src/components/sidebar-dataviews/default-views.js index 2b8a9de4c2262d..1d880caeafe576 100644 --- a/packages/edit-site/src/components/sidebar-dataviews/default-views.js +++ b/packages/edit-site/src/components/sidebar-dataviews/default-views.js @@ -30,27 +30,38 @@ export const defaultLayouts = { [ LAYOUT_TABLE ]: { layout: { primaryField: 'title', + combinedFields: [ + { + id: 'post', + header: __( 'Title' ), + children: [ 'featured-image', 'title' ], + direction: 'horizontal', + }, + ], styles: { 'featured-image': { width: '1%', }, - title: { + post: { maxWidth: 300, }, }, }, + fields: [ 'post', 'author', 'status' ], }, [ LAYOUT_GRID ]: { layout: { mediaField: 'featured-image', primaryField: 'title', }, + fields: [ 'title', 'author', 'status' ], }, [ LAYOUT_LIST ]: { layout: { primaryField: 'title', mediaField: 'featured-image', }, + fields: [ 'title', 'author', 'status' ], }, }; @@ -64,8 +75,8 @@ const DEFAULT_POST_BASE = { field: 'date', direction: 'desc', }, - fields: [ 'title', 'author', 'status' ], layout: defaultLayouts[ LAYOUT_LIST ].layout, + fields: defaultLayouts[ LAYOUT_LIST ].fields, }; export function useDefaultViews( { postType } ) {