Skip to content

Commit

Permalink
Follow up of 66451 - leftovers from removed styles (#66472)
Browse files Browse the repository at this point in the history
Co-authored-by: ntsekouras <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
  • Loading branch information
3 people authored Oct 25, 2024
1 parent 8a2480a commit 6347583
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 32 deletions.
6 changes: 1 addition & 5 deletions packages/editor/src/components/document-bar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { decodeEntities } from '@wordpress/html-entities';
/**
* Internal dependencies
*/
import { TEMPLATE_POST_TYPES, GLOBAL_POST_TYPES } from '../../store/constants';
import { TEMPLATE_POST_TYPES } from '../../store/constants';
import { store as editorStore } from '../../store';

/** @typedef {import("@wordpress/components").IconType} IconType */
Expand Down Expand Up @@ -56,7 +56,6 @@ export default function DocumentBar( props ) {
postTypeLabel,
documentTitle,
isNotFound,
isUnsyncedPattern,
templateTitle,
onNavigateToPreviousEntityRecord,
} = useSelect( ( select ) => {
Expand Down Expand Up @@ -93,7 +92,6 @@ export default function DocumentBar( props ) {
_postType,
_postId
),
isUnsyncedPattern: _document?.wp_pattern_sync_status === 'unsynced',
templateTitle: _templateInfo.title,
onNavigateToPreviousEntityRecord:
getEditorSettings().onNavigateToPreviousEntityRecord,
Expand All @@ -104,7 +102,6 @@ export default function DocumentBar( props ) {
const isReducedMotion = useReducedMotion();

const isTemplate = TEMPLATE_POST_TYPES.includes( postType );
const isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );
const hasBackButton = !! onNavigateToPreviousEntityRecord;
const entityTitle = isTemplate ? templateTitle : documentTitle;
const title = props.title || entityTitle;
Expand All @@ -119,7 +116,6 @@ export default function DocumentBar( props ) {
<div
className={ clsx( 'editor-document-bar', {
'has-back-button': hasBackButton,
'is-global': isGlobalEntity && ! isUnsyncedPattern,
} ) }
>
<AnimatePresence>
Expand Down
29 changes: 2 additions & 27 deletions packages/editor/src/components/post-card-panel/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/**
* External dependencies
*/
import clsx from 'clsx';
/**
* WordPress dependencies
*/
Expand All @@ -22,8 +18,6 @@ import { store as editorStore } from '../../store';
import {
TEMPLATE_POST_TYPE,
TEMPLATE_PART_POST_TYPE,
PATTERN_POST_TYPE,
GLOBAL_POST_TYPES,
} from '../../store/constants';
import { unlock } from '../../lock-unlock';
import PostActions from '../post-actions';
Expand All @@ -33,7 +27,7 @@ export default function PostCardPanel( {
postId,
onActionPerformed,
} ) {
const { isFrontPage, isPostsPage, title, icon, isSync } = useSelect(
const { isFrontPage, isPostsPage, title, icon } = useSelect(
( select ) => {
const { __experimentalGetTemplateInfo } = select( editorStore );
const { canUser, getEditedEntityRecord } = select( coreStore );
Expand All @@ -52,25 +46,11 @@ export default function PostCardPanel( {
[ TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE ].includes(
postType
) && __experimentalGetTemplateInfo( _record );
let _isSync = false;
if ( GLOBAL_POST_TYPES.includes( postType ) ) {
if ( PATTERN_POST_TYPE === postType ) {
// When the post is first created, the top level wp_pattern_sync_status is not set so get meta value instead.
const currentSyncStatus =
_record?.meta?.wp_pattern_sync_status === 'unsynced'
? 'unsynced'
: _record?.wp_pattern_sync_status;
_isSync = currentSyncStatus !== 'unsynced';
} else {
_isSync = true;
}
}
return {
title: _templateInfo?.title || _record?.title,
icon: unlock( select( editorStore ) ).getPostIcon( postType, {
area: _record?.area,
} ),
isSync: _isSync,
isFrontPage: siteSettings?.page_on_front === postId,
isPostsPage: siteSettings?.page_for_posts === postId,
};
Expand All @@ -84,12 +64,7 @@ export default function PostCardPanel( {
className="editor-post-card-panel__header"
align="flex-start"
>
<Icon
className={ clsx( 'editor-post-card-panel__icon', {
'is-sync': isSync,
} ) }
icon={ icon }
/>
<Icon className="editor-post-card-panel__icon" icon={ icon } />
<Text
numberOfLines={ 2 }
truncate
Expand Down

1 comment on commit 6347583

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 6347583.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11519053367
📝 Reported issues:

Please sign in to comment.