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

Fix no-preview placeholder BlockIcon usage #9466

Conversation

notnownikki
Copy link
Member

@notnownikki notnownikki commented Aug 30, 2018

Description

Update the Placeholder used to URLs that can be embedded but can't be previewed in the editor due to sandbox security settings.

How has this been tested?

Create a new post, try to embed https://www.facebook.com/buzzfeedladylike/posts/2290362924583261

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@notnownikki
Copy link
Member Author

Resolves: #9444

@gziolo gziolo added the [Type] Bug An existing feature does not function as intended label Aug 30, 2018
Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

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

Looks good to me I think we just need to move the translator comment before the merge.

@@ -188,10 +188,10 @@ export function getEmbedEdit( title, icon ) {
);
}

const label = sprintf( __( '%s URL' ), title );

if ( ! preview || previewIsFallback || editingURL ) {
// translators: %s: type of embed e.g: "YouTube", "Twitter", etc. "Embed" is used when no specific type exists
Copy link
Member

Choose a reason for hiding this comment

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

I think the translator comment also needs to be moved to be in the line before the label.

Copy link
Member Author

Choose a reason for hiding this comment

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

Gah, I missed that one! Thanks :)

@notnownikki notnownikki merged commit 6406f62 into master Aug 31, 2018
@notnownikki notnownikki added this to the 3.8 milestone Aug 31, 2018
@notnownikki notnownikki deleted the fix/embed-block-update-for-blockicon-in-no-preview-placeholder branch August 31, 2018 11:52
@@ -237,7 +237,7 @@ export function getEmbedEdit( title, icon ) {
<figure className={ classnames( className, 'wp-block-embed', { 'is-video': 'video' === type } ) }>
{ controls }
{ ( cannotPreview ) ? (
<Placeholder icon={ icon } label={ __( 'Embed URL' ) }>
<Placeholder icon={ <BlockIcon icon={ icon } showColors /> } label={ label } className="wp-block-embed">
Copy link
Member

Choose a reason for hiding this comment

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

Why are we duplicating the class attribute here (it's already on the figure above)? cc @notnownikki @jorgefilipecosta

jorgefilipecosta added a commit that referenced this pull request Sep 7, 2018
Caused in #9466.
## Description
The class wp-block-embed was repeated on the placeholder and the figure. This PR just removes the class from the placeholder.

## How has this been tested?
I verified there were no design changes when adding an embed with a preview not available e.g: #9466.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants