diff --git a/packages/edit-site/src/components/layout/router.js b/packages/edit-site/src/components/layout/router.js index f91de7767f5bd..39955cfa1be5f 100644 --- a/packages/edit-site/src/components/layout/router.js +++ b/packages/edit-site/src/components/layout/router.js @@ -24,23 +24,28 @@ export default function useLayoutAreas() { // Regular page if ( path === '/page' ) { - const isListLayout = - isCustom !== 'true' && ( ! layout || layout === 'list' ); return { areas: { - content: window.__experimentalAdminViews ? ( - - ) : undefined, - preview: ( isListLayout || - ! window.__experimentalAdminViews ) && ( + content: undefined, + preview: , + }, + widths: { + content: undefined, + }, + }; + } + + if ( path === '/pages' && window?.__experimentalAdminViews ) { + const isListLayout = isCustom !== 'true' && layout === 'list'; + return { + areas: { + content: , + preview: isListLayout && ( ), }, widths: { - content: - window.__experimentalAdminViews && isListLayout - ? 380 - : undefined, + content: isListLayout ? 380 : undefined, }, }; } diff --git a/packages/edit-site/src/components/page-pages/index.js b/packages/edit-site/src/components/page-pages/index.js index 048821b048f6a..ffe03132fdf45 100644 --- a/packages/edit-site/src/components/page-pages/index.js +++ b/packages/edit-site/src/components/page-pages/index.js @@ -169,18 +169,6 @@ export default function PagePages() { [ history, params, view?.type, isCustom ] ); - const onDetailsChange = useCallback( - ( items ) => { - if ( !! postType && items?.length === 1 ) { - history.push( { - postId: items[ 0 ].id, - postType, - } ); - } - }, - [ history, postType ] - ); - const queryArgs = useMemo( () => { const filters = {}; view.filters.forEach( ( filter ) => { @@ -421,7 +409,6 @@ export default function PagePages() { view={ view } onChangeView={ onChangeView } onSelectionChange={ onSelectionChange } - onDetailsChange={ onDetailsChange } /> ); 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 329103bd2b97d..d6e7ebe72df21 100644 --- a/packages/edit-site/src/components/sidebar-dataviews/default-views.js +++ b/packages/edit-site/src/components/sidebar-dataviews/default-views.js @@ -29,7 +29,7 @@ export const DEFAULT_CONFIG_PER_VIEW_TYPE = { }; const DEFAULT_PAGE_BASE = { - type: LAYOUT_LIST, + type: LAYOUT_TABLE, search: '', filters: [], page: 1, diff --git a/packages/edit-site/src/components/sidebar-dataviews/index.js b/packages/edit-site/src/components/sidebar-dataviews/index.js index 9748600907e33..991a4a30e9973 100644 --- a/packages/edit-site/src/components/sidebar-dataviews/index.js +++ b/packages/edit-site/src/components/sidebar-dataviews/index.js @@ -15,7 +15,7 @@ import DataViewItem from './dataview-item'; import CustomDataViewsList from './custom-dataviews-list'; const PATH_TO_TYPE = { - '/page': 'page', + '/pages': 'page', }; export default function DataViewsSidebarContent() { diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-pages-dataviews/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-pages-dataviews/index.js index ade28989ff955..3bb3c9c0c8fe0 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-pages-dataviews/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-pages-dataviews/index.js @@ -78,6 +78,7 @@ export default function SidebarNavigationScreenPagesDataViews() { title={ __( 'Pages' ) } description={ __( 'Browse and manage pages.' ) } content={ } + backPath="/page" footer={ { templates?.map( ( item ) => ( diff --git a/packages/edit-site/src/components/sidebar/index.js b/packages/edit-site/src/components/sidebar/index.js index 73c6aea7e328c..fd2cfa67ce004 100644 --- a/packages/edit-site/src/components/sidebar/index.js +++ b/packages/edit-site/src/components/sidebar/index.js @@ -66,12 +66,13 @@ function SidebarScreens() { - { window?.__experimentalAdminViews ? ( - - ) : ( - - ) } + + { window?.__experimentalAdminViews && ( + + + + ) } diff --git a/packages/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js b/packages/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js index 4c2214b76abd3..32f2c5897e314 100644 --- a/packages/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +++ b/packages/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js @@ -160,7 +160,7 @@ function useResolveEditedEntityAndContext( { path, postId, postType } ) { } // Some URLs in list views are different - if ( path === '/page' && postId ) { + if ( path === '/pages' && postId ) { return resolveTemplateForPostTypeAndId( 'page', postId ); } @@ -196,7 +196,7 @@ function useResolveEditedEntityAndContext( { path, postId, postType } ) { } // Some URLs in list views are different - if ( path === '/page' && postId ) { + if ( path === '/pages' && postId ) { return { postType: 'page', postId }; } diff --git a/packages/edit-site/src/components/sync-state-with-url/use-sync-path-with-url.js b/packages/edit-site/src/components/sync-state-with-url/use-sync-path-with-url.js index 3eb6d6e6f4fad..cf110458d782f 100644 --- a/packages/edit-site/src/components/sync-state-with-url/use-sync-path-with-url.js +++ b/packages/edit-site/src/components/sync-state-with-url/use-sync-path-with-url.js @@ -104,7 +104,7 @@ export default function useSyncPathWithURL() { } else if ( // These sidebar paths are special in the sense that the url in these pages may or may not have a postId and we need to retain it if it has. // The "type" property should be kept as well. - ( navigatorLocation.path === '/page' && + ( navigatorLocation.path === '/pages' && window?.__experimentalAdminViews ) || ( navigatorLocation.path === '/wp_template' && window?.__experimentalAdminViews ) || diff --git a/packages/edit-site/src/utils/get-is-list-page.js b/packages/edit-site/src/utils/get-is-list-page.js index 9530cd85bf04b..d89c0e321679f 100644 --- a/packages/edit-site/src/utils/get-is-list-page.js +++ b/packages/edit-site/src/utils/get-is-list-page.js @@ -15,7 +15,7 @@ export default function getIsListPage( ) { return ( [ '/wp_template/all', '/wp_template_part/all' ].includes( path ) || - ( path === '/page' && window?.__experimentalAdminViews ) || + ( path === '/pages' && window?.__experimentalAdminViews ) || ( path === '/patterns' && // Don't treat "/patterns" without categoryType and categoryId as a // list page in mobile because the sidebar covers the whole page.