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

PCH: Update Sidebar and Tools Tab per design guidelines #2245

Merged
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
2 changes: 1 addition & 1 deletion build/content-helper/editor-sidebar.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => 'bdcf78fb4b4054d8bf81');
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '1fd817a371f72b1f5217');
10 changes: 4 additions & 6 deletions build/content-helper/editor-sidebar.js

Large diffs are not rendered by default.

36 changes: 1 addition & 35 deletions src/content-helper/editor-sidebar/editor-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
* WordPress dependencies
*/
import {
Button,
Panel,
PanelBody,
PanelRow,
TabPanel,
} from '@wordpress/components';
import { useSelect } from '@wordpress/data';
import { PluginSidebar } from '@wordpress/edit-post';
import { useEffect } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import { __ } from '@wordpress/i18n';
import { chartBar as ChartIcon } from '@wordpress/icons';
import { registerPlugin } from '@wordpress/plugins';

Expand All @@ -32,7 +29,6 @@ import {
Metric,
Period,
PostFilterType,
getPeriodDescription,
isInEnum,
} from '../common/utils/constants';
import {
Expand Down Expand Up @@ -205,36 +201,6 @@ const ContentHelperEditorSidebar = (): JSX.Element => {
endpoint="editor-sidebar-settings"
defaultSettings={ getSettingsFromJson() }
>
<Panel>
<PanelBody>
<PanelRow className="wp-parsely-sidebar-header">
{
/* translators: %1$s: how it performed, %2$s: period starting with 'last' */
sprintf( __( 'This post performed %1$s in the %2$s', 'wp-parsely' ),
'very well',
getPeriodDescription( settings.PerformanceStatsPeriod, true )
)
// TODO: Make the performance descriptor dynamic, and display a different message if the post is unpublished.
}
{ window.wpParselyPostUrl && (
<Button
variant={ 'primary' }
onClick={ () => {
Telemetry.trackEvent( 'editor_sidebar_view_post_pressed' );
} }
href={ window.wpParselyPostUrl }
rel="noopener"
target="_blank"
>
{
/* translators: %s: Post type */
sprintf( __( 'View this %s in Parse.ly', 'wp-parsely' ), 'post' )
}
</Button>
) }
</PanelRow>
</PanelBody>
</Panel>
<Panel className="wp-parsely-sidebar-main-panel">
<TabPanel
className="wp-parsely-sidebar-tabs"
Expand Down
7 changes: 2 additions & 5 deletions src/content-helper/editor-sidebar/tabs/sidebar-tools-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import { GutenbergFunction } from '../../../@types/gutenberg/types';
import { BetaBadge } from '../../common/components/beta-badge';
import { SidebarSettings, useSettings } from '../../common/settings';
import { VerifyCredentials } from '../../common/verify-credentials';
import { SidebarPostData } from '../editor-sidebar';
Expand Down Expand Up @@ -89,8 +88,7 @@ export const SidebarToolsTab = ( { trackToggle }: SidebarToolsTabProps ) => {
return (
<Panel>
<PanelBody
icon={ <BetaBadge /> }
title={ __( 'Title Suggestions', 'wp-parsely' ) }
title={ __( 'Title Suggestions (Beta)', 'wp-parsely' ) }
initialOpen={ settings.TitleSuggestionsOpen }
onToggle={ ( next ) => {
setSettings( {
Expand All @@ -105,8 +103,7 @@ export const SidebarToolsTab = ( { trackToggle }: SidebarToolsTabProps ) => {
</PanelBody>

<PanelBody
icon={ <BetaBadge /> }
title={ __( 'Smart Linking', 'wp-parsely' ) }
title={ __( 'Smart Linking (Beta)', 'wp-parsely' ) }
initialOpen={ settings.SmartLinkingOpen }
onToggle={ ( next ) => {
setSettings( {
Expand Down
Loading