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

Add Featured Banner to Image Block #14451

Merged
merged 52 commits into from
Apr 20, 2021
Merged

Add Featured Banner to Image Block #14451

merged 52 commits into from
Apr 20, 2021

Conversation

SiobhyB
Copy link
Contributor

@SiobhyB SiobhyB commented Apr 13, 2021

Paritial fix for: wordpress-mobile/gutenberg-mobile#1011

gutenberg-mobile: wordpress-mobile/gutenberg-mobile#3371
gutenberg: WordPress/gutenberg#30806

This PR introduces a Featured banner, which overlays a post's featured image when it's added to an image block. This will make it clear to users which of their images, if any, are set as the post's featured image.

To test: Please refer to the Gutenberg PR as the central place for steps to tests and screenshots.

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Siobhan added 30 commits March 5, 2021 13:09
This commit is mostly for testing purposes, I've updated GutenbergEditorFragment.java with a function called "onSetFeaturedImageButtonClicked" and want to test the results.
This commit updated reference to latest gutenberg-mobile commit.
This commit introduces code that sets a featured image when the "set as featured" button is clicked from an image block. A function within "EditPostSettingsFragment" is currently utilised for this purpose, though this is likely not the optimal approach.
This commit cleans up some of the changes that have been made to the GutenbergEditorFragment file, deleting unused/commented out code, etc.
Fix some issues with spacing
This commit introduces an "OnSetFeaturedImageListener" and moves new featured image related functions to it from "OnMediaLibraryButtonListener".
The main purpose of this commit is to replcace the current Toast confirmation when a featured image is set with a Snackbar.
…turedImageId"

This commit introduces a "removeFeaturedImage" function to allow users to remove a featured image directly from the image block. It also updates the name of the "onGetFeaturedImageId" to "checkIfFeaturedImage" in order to better reflect its current purpose.
…uredImageId"

This commit updates "onRequestFeaturedImageId" to "sendToJSFeaturedImageId", in order to clarify the purpose of the function.
The SnackBar is currently necessary for when a featured image is removed, so removing for now.
This commit enables tracking for the image block's two new featured image buttons ("set as featured image" and "remove as featured image").
@hypest
Copy link
Contributor

hypest commented Apr 14, 2021

👋 Siobhan. A quick comment on the branch name: we generally try to follow the git branch naming pattern of issue/<issue-id>-<description>. See https://make.wordpress.org/mobile/handbook/general-guides/git-branching/, also linked from the pull request guidelines of this repo. No need to change something for this PR at this point, just something to follow on the next ones, thanks!

In this particular case here, something like gb/1011-add-featured-badge could be a relevant one.

@hypest hypest self-requested a review April 14, 2021 15:05
@SiobhyB SiobhyB force-pushed the add-featured-badge branch from c31464f to 181c7d1 Compare April 15, 2021 10:19
build.gradle Outdated Show resolved Hide resolved
@SiobhyB SiobhyB added this to the 17.2 milestone Apr 16, 2021
@hypest
Copy link
Contributor

hypest commented Apr 16, 2021

Also tested setting and clearing the featured image for a classic editor post and works fine ✅

Copy link
Contributor

@hypest hypest left a comment

Choose a reason for hiding this comment

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

LGTM!

For visibility, I've left some info on how to move forward in WordPress/gutenberg#30806 (review).

@JavonDavis
Copy link
Contributor

Hey @SiobhyB! Bumping this to 17.2 for now, if you'd like to get it in for this release please merge this into release/17.2 and then DM me to release a new Beta version. If you'd like me to hold for this to get merged in the first beta release then let me know asap as well 🙂

@JavonDavis JavonDavis modified the milestones: 17.2, 17.3 Apr 19, 2021
@SiobhyB
Copy link
Contributor Author

SiobhyB commented Apr 20, 2021

@JavonDavis, thank you and apologies for not updating this myself! I can confirm that 17.3 is the release we're now aiming for with this PR.

Copy link
Contributor

@hypest hypest left a comment

Choose a reason for hiding this comment

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

LGTM!

@hypest hypest merged commit 596e059 into develop Apr 20, 2021
@hypest hypest deleted the add-featured-badge branch April 20, 2021 15:22
SiobhyB pushed a commit to wordpress-mobile/WordPress-iOS that referenced this pull request Apr 29, 2021
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.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Editing and display of Gutenberg blocks. [Type] Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants