Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inspector: Remove revisions panel #61867

Merged
merged 3 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading