Skip to content

Commit

Permalink
Inspector: Remove revisions panel (#61867)
Browse files Browse the repository at this point in the history
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
  • Loading branch information
4 people authored May 27, 2024
1 parent 8c3a688 commit 5deecb2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion packages/editor/src/components/post-actions/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1108,14 +1108,15 @@ 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 [];
}

const actions = [
postTypeObject?.viewable && viewPostAction,
postRevisionsAction,
supportsRevisions && postRevisionsAction,
globalThis.IS_GUTENBERG_PLUGIN
? ! isTemplateOrTemplatePart &&
! isPattern &&
Expand Down Expand Up @@ -1181,5 +1182,6 @@ export function usePostActions( postType, onActionPerformed ) {
restorePostAction,
onActionPerformed,
isLoaded,
supportsRevisions,
] );
}
2 changes: 0 additions & 2 deletions packages/editor/src/components/sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -117,7 +116,6 @@ const SidebarContent = ( {
<TemplateContentPanel />
) }
<PostTransformPanel />
<PostLastRevisionPanel />
<PostTaxonomiesPanel />
<PageAttributesPanel />
<PatternOverridesPanel />
Expand Down
10 changes: 7 additions & 3 deletions test/e2e/specs/editor/various/footnotes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5deecb2

Please sign in to comment.