-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[RNMobile] Parent PR: Add Setting to Set/Remove a Featured Image Directly from Image Block #16427
[RNMobile] Parent PR: Add Setting to Set/Remove a Featured Image Directly from Image Block #16427
Conversation
This protocol includes a method named didSetFeaturedImage, which will send a message to the JS side when a featured image is set from Post Settings.
… data over the bridge
The intention behind this change is to make the function's purpose clearer. It also moves the naming inline to this feature's Android counterpart. (See: wordpress-mobile/WordPress-Android#14451.)
…eId" This change is a bid align closer to the naming conventions of other functions in iOS.
…to gutenberg/add/featured-badge
This function will handle the logic for setting/removing a featured when the button is tapped.
This function accepts a media ID for an image and uses the "existingMediaWith" to determine its media object, which can then be used to assign the image as the post's featured image. Lastly, the ID of the new featured image is then sent to Gutenberg via featuredImageIdNativeUpdated().
This commit includes different notices that will be sent to Gutenberg, depending on whether an image is being removed (which will be the case when the media ID is zero) or set.
This function will be called when a post already has a featured image and will prompt the user on whether they wish to replace the current featured image or not.
This commit introduces logic into the gutenbergDidRequestToSetFeaturedImage() function. Specifically, an if/else statement is used to either set, remove, or show an alert to confirm a replacement, depending on the state of featured images in the post.
You can trigger an installable build for these changes by visiting CircleCI here. |
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
With this commit, the iPad-specific popoverController is centred in the middle of the screen. The "permittedArrowDirections" value is also changed to remove any arrow and ensure the dialog's message is displayed in full (rather than only the title).
…featured-button [RNMobile] Add "Set as Featured" Button to Image Block
d552f4a
to
674bcc7
Compare
1c973d5
to
d552f4a
Compare
👋 @illusaen, do you perhaps have any availability to review this PR either this week or next? This is the main feature branch for the There are two known issues that will be worked on separately and I don't believe to be blockers to this one being merged:
Let me know how that sounds to you and thanks in advance! |
@illusaen, just pinging again on this. :) Do you have any availability to review this PR? |
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.
Looks good to me!
@illusaen, thank you! Would you also be able to approve the Gutenberg and Gutenberg Mobile PRs? I can then go ahead to merge these. :) |
Fixes the iOS side of the following issue: wordpress-mobile/gutenberg-mobile#1011
gutenberg
: WordPress/gutenberg#31345gutenberg-mobile
: wordpress-mobile/gutenberg-mobile#3449Description
Introduces an option to set/remove an image as featured from the image block's settings, with a "featured" banner to denote when an image is already featured. The end goal is to make it easier for users to both identify and set/remove featured images directly from the post editor.
This PR builds on the work done in WordPress/gutenberg#30806 and WordPress/gutenberg#28854 to introduce this functionality to Android. For iOS, the work has been split up into the following PRs:
Featured
banner over any image block containing a post's featured imageSet/Remove as Featured
option in the image block's settings- Once the PR has been merged it will be updated with a ✅
How has this been tested? Screenshots? Types of changes?
Please refer to the first PR in each row (the Gutenberg PR) for test cases, screenshots, and further details of the types of changes involved.
Regression Notes
As this PR adds a banner over the image block, there is some potential for it to unintentionally have a negative impact on the existing UI and/or animations that take place when an image is replaced within the block (depending on whether it's featured or not).
It also adds another flow for users to set/remove featured images, so there is some potential for it to unintentionally have a negative impact on the existing flow (found via Post Settings).
A third unintended area of impact is the
wpios_editor_post_featured_image_changed
Track event. This event currently only fires when a featured image is changed via Post Settings. With this PR, it should also be fired when a featured image is changed via the image block, with agutenberg
property to differentiate it.The steps taken to test whether the intended flow works as expected can be found in the Gutenberg PRs here and here, with additional steps for verifying the Tracks event fires as expected listed in this PR.
No automated tests.
PR submission checklist:
RELEASE-NOTES.txt
if necessary.