Skip to content

Commit

Permalink
Remove unneeded pattern overrides translation strings (#59269)
Browse files Browse the repository at this point in the history
Co-authored-by: kevin940726 <[email protected]>
Co-authored-by: talldan <[email protected]>
  • Loading branch information
3 people committed Feb 22, 2024
1 parent 270ff99 commit c62690f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
6 changes: 3 additions & 3 deletions packages/patterns/src/components/partial-syncing-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { PARTIAL_SYNCING_SUPPORTED_BLOCKS } from '../constants';

function PartialSyncingControls( { name, attributes, setAttributes } ) {
const syncedAttributes = PARTIAL_SYNCING_SUPPORTED_BLOCKS[ name ];
const attributeSources = Object.keys( syncedAttributes ).map(
const attributeSources = syncedAttributes.map(
( attributeName ) =>
attributes.metadata?.bindings?.[ attributeName ]?.source
);
Expand All @@ -36,7 +36,7 @@ function PartialSyncingControls( { name, attributes, setAttributes } ) {
};

if ( ! isChecked ) {
for ( const attributeName of Object.keys( syncedAttributes ) ) {
for ( const attributeName of syncedAttributes ) {
if (
updatedBindings[ attributeName ]?.source ===
'core/pattern-overrides'
Expand All @@ -56,7 +56,7 @@ function PartialSyncingControls( { name, attributes, setAttributes } ) {
return;
}

for ( const attributeName of Object.keys( syncedAttributes ) ) {
for ( const attributeName of syncedAttributes ) {
if ( ! updatedBindings[ attributeName ] ) {
updatedBindings[ attributeName ] = {
source: 'core/pattern-overrides',
Expand Down
23 changes: 4 additions & 19 deletions packages/patterns/src/constants.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';

export const PATTERN_TYPES = {
theme: 'pattern',
user: 'wp_block',
Expand All @@ -22,18 +17,8 @@ export const PATTERN_SYNC_TYPES = {

// TODO: This should not be hardcoded. Maybe there should be a config and/or an UI.
export const PARTIAL_SYNCING_SUPPORTED_BLOCKS = {
'core/paragraph': { content: __( 'Content' ) },
'core/heading': { content: __( 'Content' ) },
'core/button': {
text: __( 'Text' ),
url: __( 'URL' ),
linkTarget: __( 'Link Target' ),
rel: __( 'Link Relationship' ),
},
'core/image': {
id: __( 'Image ID' ),
url: __( 'URL' ),
title: __( 'Title' ),
alt: __( 'Alt Text' ),
},
'core/paragraph': [ 'content' ],
'core/heading': [ 'content' ],
'core/button': [ 'text', 'url', 'linkTarget', 'rel' ],
'core/image': [ 'id', 'url', 'title', 'alt' ],
};

1 comment on commit c62690f

@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 c62690f.
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/8002087772
📝 Reported issues:

Please sign in to comment.