Add a "Set as Featured Image" Button to Image Block - Refactor for Featured Image PostModel update#14521
Conversation
|
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
SiobhyB
left a comment
There was a problem hiding this comment.
@jd-alexander, this works perfectly for me once I add the @Inject annotation to the UpdateFeaturedImageUseCase.kt file. I added what I used to get this working as a suggestion as part of the review, let me know if this is correct or if there's a different syntax that'd be preferable.
I also submitted a couple of commits to fix small issues:
WordPress/src/main/java/org/wordpress/android/ui/posts/UpdateFeaturedImageUseCase.kt
Outdated
Show resolved
Hide resolved
|
You can test the changes on this Pull Request by downloading the APK here. |
0eac50d to
f0ff0ba
Compare
fec86e2 to
d1e7eda
Compare
… Gutenberg editor This commit adds a "IMAGE_REMOVED_GUTENBERG_EDITOR" event to complement the "IMAGE_PICKED_GUTENBERG_EDITOR" event, for when an image is removed via the image block.
WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Hey @jd-alexander 👋!
All works as described, good job 👍. Also from your regression notes, I've tested that the older track events for (featured image on post settings) are not broken, even though the event label got changed.
The only odd thing I noticed: UpdateFeaturedImageUseCase is formatted in commit 70dff2c but I still see it unformatted, can you re-check it? Feel free to merge after it.
Thanks much for the review @ashiagr it's appreciated 🙇🏾
Thanks for spotting. I will do that! |
Description
The main purpose of this PR is to refactor the logic that was being utilized to update the featured image id on the
PostModelpreviously, we were utilizing thePostRepositorythat was within theEditPostSettingsFragment.This approach was deemed an area that needed improvement since, the Gutenberg side of things would be calling functionality within a fragment when the main point of entry is theEditPostActivity. I am also assuming there could have been app states where the fragment isn't created so this refactor ensures that the updates to thePostModelare done in an object that will be retained during the editing experience -EditPostActivity. Let us know what you think about the refactor done. Any improvements or ideas are more than welcomed.To be merged into the following PR: #14503
Testing
The test cases below are from the main Gutenberg PR related to these changes. In addition, we should verify that the Tracks events edited/introduced with this PR work as expected.
Image Block - Set and Remove Featured Image
Image Block - Tracks Verification
wpandroid_featured_image_picked_gutenberg_editorinto the tool's Events field and then the username associated with the account you tested with in the Username field. Click Search.wpandroid_featured_image_removed_gutenberg_editorevent, in order to verify that this event fires after the steps to remove a featured image via the editor were followed.Post Settings - Set and Remove Featured Image
Post Settings - Tracks Verification
wpandroid_featured_image_set_clicked_post_settingsinto the tool's Events field and then the username associated with the account you tested with in the Username field. Click Search.wpandroid_featured_image_remove_clicked_post_settingsevent, in order to verify that this event fires after the steps to remove a featured image via Post Settings were followed.Regression Notes
The main unintended issues with these changes could be:
To ensure that these areas aren't impacted we will test these paths thoroughly.
What I did to test those areas of impact (or what existing automated tests I relied on)
To test the areas of impact, the flows above were utilized.
What automated tests I added (or what prevented me from doing so)
N/A
PR submission checklist:
RELEASE-NOTES.txtif necessary.