-
Notifications
You must be signed in to change notification settings - Fork 3
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
Unsplash image block #143
Unsplash image block #143
Conversation
Are translation files being load correctly in the block editor? |
await page.waitForSelector( '.wp-block-unsplash-image' ); | ||
|
||
// Image is inserted. | ||
expect( await page.$$( '.wp-block-unsplash-image' ) ).toHaveLength( 1 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has the same issue I had with my e2e tests, as it times out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the test to import a smaller size image ~500kb, let's see if it resolves travis timeout issue
php/class-block-type.php
Outdated
remove_filter( 'wp_get_attachment_url', [ $this->plugin->hotlink, 'wp_get_attachment_url' ], 10 ); | ||
remove_filter( 'image_downsize', [ $this->plugin->hotlink, 'image_downsize' ], 10 ); | ||
|
||
$image = wp_get_attachment_image_src( $id, $attributes['sizeSlug'] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if sizeSlug
are not set for some reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or set to full?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added code to check for sizeSlug
and set it to full if it does not exist. But this value would always be set in the block editor.
Code cover is down 3%. |
return createBlock( 'core/image', attributes ); | ||
}, | ||
}, | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be able to transform to a img block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that's what we were discussing last week ? The block should be able to transform into the core image block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, as in, add a transform from img to an unsplash. Leave the current one there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing view, as did not work with gutenberg plugin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved!
Summary
Fixes #127 #128 #131
Checklist