diff --git a/packages/editor/src/components/post-actions/actions.js b/packages/editor/src/components/post-actions/actions.js index a4937dc6a75d7..bd7552b642fad 100644 --- a/packages/editor/src/components/post-actions/actions.js +++ b/packages/editor/src/components/post-actions/actions.js @@ -1108,6 +1108,7 @@ export function usePostActions( postType, onActionPerformed ) { ].includes( postType ); const isPattern = postType === PATTERN_POST_TYPE; const isLoaded = !! postTypeObject; + const supportsRevisions = !! postTypeObject?.supports?.revisions; return useMemo( () => { if ( ! isLoaded ) { return []; @@ -1115,7 +1116,7 @@ export function usePostActions( postType, onActionPerformed ) { const actions = [ postTypeObject?.viewable && viewPostAction, - postRevisionsAction, + supportsRevisions && postRevisionsAction, globalThis.IS_GUTENBERG_PLUGIN ? ! isTemplateOrTemplatePart && ! isPattern && @@ -1181,5 +1182,6 @@ export function usePostActions( postType, onActionPerformed ) { restorePostAction, onActionPerformed, isLoaded, + supportsRevisions, ] ); } diff --git a/packages/editor/src/components/sidebar/index.js b/packages/editor/src/components/sidebar/index.js index 30d27a8c5db30..7a6a1d1028273 100644 --- a/packages/editor/src/components/sidebar/index.js +++ b/packages/editor/src/components/sidebar/index.js @@ -26,7 +26,6 @@ import PageAttributesPanel from '../page-attributes/panel'; import PatternOverridesPanel from '../pattern-overrides-panel'; import PluginDocumentSettingPanel from '../plugin-document-setting-panel'; import PluginSidebar from '../plugin-sidebar'; -import PostLastRevisionPanel from '../post-last-revision/panel'; import PostSummary from './post-summary'; import PostTaxonomiesPanel from '../post-taxonomies/panel'; import PostTransformPanel from '../post-transform-panel'; @@ -117,7 +116,6 @@ const SidebarContent = ( { ) } - diff --git a/test/e2e/specs/editor/various/footnotes.spec.js b/test/e2e/specs/editor/various/footnotes.spec.js index 01017b2d2ea2e..e7fd380470647 100644 --- a/test/e2e/specs/editor/various/footnotes.spec.js +++ b/test/e2e/specs/editor/various/footnotes.spec.js @@ -363,11 +363,15 @@ test.describe( 'Footnotes', () => { // Open revisions. await editor.openDocumentSettingsSidebar(); + const editorSettings = page.getByRole( 'region', { + name: 'Editor settings', + } ); + await editorSettings.getByRole( 'tab', { name: 'Post' } ).click(); + await editorSettings.getByRole( 'button', { name: 'Actions' } ).click(); await page - .getByRole( 'region', { name: 'Editor settings' } ) - .getByRole( 'tab', { name: 'Post' } ) + .getByRole( 'menu' ) + .getByRole( 'menuitem', { name: 'View revisions' } ) .click(); - await page.locator( 'a:text("Revisions (2)")' ).click(); await page.locator( '.revisions-controls .ui-slider-handle' ).focus(); await page.keyboard.press( 'ArrowLeft' ); await page.locator( 'input:text("Restore This Revision")' ).click();