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

Add Featured Image, Title and Excerpt to top of the settings sidebar #42352

Closed
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* External dependencies
*/
import classnames from 'classnames';

/**
* WordPress dependencies
*/
Expand All @@ -13,13 +18,20 @@ import { closeSmall } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';

export default function InspectorPopoverHeader( {
className,
title,
help,
actions = [],
onClose,
} ) {
return (
<VStack className="block-editor-inspector-popover-header" spacing={ 4 }>
<VStack
className={ classnames(
'block-editor-inspector-popover-header',
className
) }
spacing={ 4 }
>
<HStack alignment="center">
<Heading
className="block-editor-inspector-popover-header__heading"
Expand Down
5 changes: 5 additions & 0 deletions packages/components/src/menu-item/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
opacity: 0.3;
}
}

// Don't show red outline on destructive menu items.
&.is-destructive {
box-shadow: none;
}
}

.components-menu-item__info-wrapper {
Expand Down
15 changes: 4 additions & 11 deletions packages/e2e-tests/specs/editor/plugins/meta-boxes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
activatePlugin,
createNewPost,
deactivatePlugin,
findSidebarPanelToggleButtonWithTitle,
insertBlock,
openDocumentSettingsSidebar,
publishPost,
Expand Down Expand Up @@ -101,19 +100,13 @@ describe( 'Meta boxes', () => {
await page.keyboard.type( 'Excerpt from content.' );
await page.type( '.editor-post-title__input', 'A published post' );

// Open the excerpt panel.
// Add an excerpt.
await openDocumentSettingsSidebar();
const excerptButton = await findSidebarPanelToggleButtonWithTitle(
'Excerpt'
await page.waitForSelector(
'*[aria-label="Editor settings"] *[aria-label="Add excerpt"]'
);
if ( excerptButton ) {
await excerptButton.click( 'button' );
}

await page.waitForSelector( '.editor-post-excerpt textarea' );

await page.type(
'.editor-post-excerpt textarea',
'*[aria-label="Editor settings"] *[aria-label="Add excerpt"]',
'Explicitly set excerpt.'
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
activatePlugin,
createNewPost,
deactivatePlugin,
findSidebarPanelToggleButtonWithTitle,
getEditedPostContent,
openDocumentSettingsSidebar,
} from '@wordpress/e2e-test-utils';
Expand Down Expand Up @@ -33,14 +32,8 @@ describe( 'new editor filtered state', () => {

// open the sidebar, we want to see the excerpt.
await openDocumentSettingsSidebar();
const excerptButton = await findSidebarPanelToggleButtonWithTitle(
'Excerpt'
);
if ( excerptButton ) {
await excerptButton.click( 'button' );
}
const excerpt = await page.$eval(
'.editor-post-excerpt textarea',
'*[aria-label="Editor settings"] *[aria-label="Add excerpt"]',
( element ) => element.innerHTML
);

Expand Down
12 changes: 0 additions & 12 deletions packages/e2e-tests/specs/editor/various/sidebar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ describe( 'Sidebar', () => {

expect( await findSidebarPanelWithTitle( 'Categories' ) ).toBeDefined();
expect( await findSidebarPanelWithTitle( 'Tags' ) ).toBeDefined();
expect(
await findSidebarPanelWithTitle( 'Featured image' )
).toBeDefined();
expect( await findSidebarPanelWithTitle( 'Excerpt' ) ).toBeDefined();
expect( await findSidebarPanelWithTitle( 'Discussion' ) ).toBeDefined();
expect( await findSidebarPanelWithTitle( 'Summary' ) ).toBeDefined();

Expand All @@ -138,8 +134,6 @@ describe( 'Sidebar', () => {

removeEditorPanel( 'taxonomy-panel-category' );
removeEditorPanel( 'taxonomy-panel-post_tag' );
removeEditorPanel( 'featured-image' );
removeEditorPanel( 'post-excerpt' );
removeEditorPanel( 'discussion-panel' );
removeEditorPanel( 'post-status' );
} );
Expand All @@ -154,12 +148,6 @@ describe( 'Sidebar', () => {
expect( await page.$x( getPanelToggleSelector( 'Tags' ) ) ).toEqual(
[]
);
expect(
await page.$x( getPanelToggleSelector( 'Featured image' ) )
).toEqual( [] );
expect( await page.$x( getPanelToggleSelector( 'Excerpt' ) ) ).toEqual(
[]
);
expect(
await page.$x( getPanelToggleSelector( 'Discussion' ) )
).toEqual( [] );
Expand Down
1 change: 1 addition & 0 deletions packages/edit-post/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@wordpress/editor": "file:../editor",
"@wordpress/element": "file:../element",
"@wordpress/hooks": "file:../hooks",
"@wordpress/html-entities": "file:../html-entities",
"@wordpress/i18n": "file:../i18n",
"@wordpress/icons": "file:../icons",
"@wordpress/interface": "file:../interface",
Expand Down
14 changes: 0 additions & 14 deletions packages/edit-post/src/components/preferences-modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import { useSelect, useDispatch } from '@wordpress/data';
import { useMemo } from '@wordpress/element';
import {
PostTaxonomies,
PostExcerptCheck,
PageAttributesCheck,
PostFeaturedImageCheck,
PostTypeSupportCheck,
store as editorStore,
} from '@wordpress/editor';
Expand Down Expand Up @@ -205,18 +203,6 @@ export default function EditPostPreferencesModal() {
/>
) }
/>
<PostFeaturedImageCheck>
<EnablePanelOption
label={ __( 'Featured image' ) }
panelName="featured-image"
/>
</PostFeaturedImageCheck>
<PostExcerptCheck>
<EnablePanelOption
label={ __( 'Excerpt' ) }
panelName="post-excerpt"
/>
</PostExcerptCheck>
<PostTypeSupportCheck
supportKeys={ [ 'comments', 'trackbacks' ] }
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
<WithSelect(PostTaxonomies)
taxonomyWrapper={[Function]}
/>
<PostFeaturedImageCheck>
<WithSelect(IfCondition(WithDispatch(BaseOption)))
label="Featured image"
panelName="featured-image"
/>
</PostFeaturedImageCheck>
<PostExcerptCheck>
<WithSelect(IfCondition(WithDispatch(BaseOption)))
label="Excerpt"
panelName="post-excerpt"
/>
</PostExcerptCheck>
<WithSelect(PostTypeSupportCheck)
<PostTypeSupportCheck
supportKeys={
Array [
"comments",
Expand All @@ -118,7 +106,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
label="Discussion"
panelName="discussion-panel"
/>
</WithSelect(PostTypeSupportCheck)>
</PostTypeSupportCheck>
<PageAttributesCheck>
<WithSelect(IfCondition(WithDispatch(BaseOption)))
label="Page attributes"
Expand Down Expand Up @@ -225,19 +213,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
<WithSelect(PostTaxonomies)
taxonomyWrapper={[Function]}
/>
<PostFeaturedImageCheck>
<WithSelect(IfCondition(WithDispatch(BaseOption)))
label="Featured image"
panelName="featured-image"
/>
</PostFeaturedImageCheck>
<PostExcerptCheck>
<WithSelect(IfCondition(WithDispatch(BaseOption)))
label="Excerpt"
panelName="post-excerpt"
/>
</PostExcerptCheck>
<WithSelect(PostTypeSupportCheck)
<PostTypeSupportCheck
supportKeys={
Array [
"comments",
Expand All @@ -249,7 +225,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
label="Discussion"
panelName="discussion-panel"
/>
</WithSelect(PostTypeSupportCheck)>
</PostTypeSupportCheck>
<PageAttributesCheck>
<WithSelect(IfCondition(WithDispatch(BaseOption)))
label="Page attributes"
Expand Down
73 changes: 0 additions & 73 deletions packages/edit-post/src/components/sidebar/featured-image/index.js

This file was deleted.

56 changes: 0 additions & 56 deletions packages/edit-post/src/components/sidebar/post-excerpt/index.js

This file was deleted.

Loading