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

[RNMobile] Add Featured Banner to Image Block (iOS Only) #30957

Closed
wants to merge 75 commits into from
Closed

Conversation

SiobhyB
Copy link
Contributor

@SiobhyB SiobhyB commented Apr 19, 2021

Edit: Closing in favour of #31347.

Description

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 easier for users to identify which of the images in their posts, if any, are set as featured directly from the editor.

How has this been tested?

Screenshots

Types of changes

New feature (non-breaking change which adds functionality).

  • gutenbergFeaturedImageId is used to gather the initial featured image ID from the post.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

SiobhyB and others added 30 commits February 8, 2021 13:52
This commit adds a "set as featured image" button to the image block's settings and also styles it.
With this commit, a "setFeaturedImage" function has been added to the React Native bridge code.
This commit adds the setFeaturedImage function to the MainApplication file, so that it works as expected with the demo apps.
This commit sets up a listener called "OnSetFeaturedImageListener" in order to allow communication with the native apps.
This commit updates edit.native.js with small syntax correction, there was a missing comma at the end of a statement.
This commit updates WPAndroidGlue.java in order to set up a "OnSetFeaturedImageListener" function that will communicate with the Android app when a user clicks a "set as featured image" button.
This commit seeks to send information about a post's featured image ID to Gutenberg by utlising functions from Android.
Accidentally removed a curly brace with the last commit, so restoring it with this one.
This commit including updates to featured-banner.native.js, a component for the "featured" banner that will overlay the image block when an image is featured. "payload.featuredImageId" logs the ID of a featured image after it's updated.
This commit includes attempts to select a post's featured image using getEditedPostAttribute().
With this commit, I'm updating featured-banner.native.js with the latest changes to that component's UI.
With this commit, a featured banner is added to the image component.
This commit updates the styles for the featured image banner and button that overlay the image compoonent.
This commit includes a new getFeaturedImageId function, for grabbing a post's featured image when a component is mounted and also cleans up some unused code.
Update AndroidGlueCode to include OnFocalPointPickerTooltipShownEventListener.
…Current"

With this commit, I'm updating a function's name from "featuredImageIdChange" to "featuredImageIdCurrent" in order to more accurately reflect its purpose.
This commit renames "featuredImageIdNotifier" to "onRequestFeaturedImageId" in order to clarify the function's purpose.
This commit introduces an "OnSetFeaturedImageListener" and moves new featured image related functions to it from "OnMediaLibraryButtonListener".
This commit introduces a "onRemoveFeatured" button that displays in the image block's settings when an image is featured. It also changes the name of the "onGetFeaturedImageId" function to "checkIfFeaturedImage", to better reflect its current functionality.
This commit updates "onRequestFeaturedImageId" to "sendToJSFeaturedImageId" and "getFeaturedImageId" to "checkIfFeaturedImage". In both cases, this has been done to clarify the purpose of the functions.
This commit converts the FeaturedBanner component to a more generic Badge component. This is to make it more re-usable. There are also some small styling tweaks included in this commit, including changes to the component's border-radius.
This commit is an attempt to correct this PR's merge conflict with GutenbergBridgeJS2Parent.java.
Siobhan and others added 19 commits April 13, 2021 10:16
This commit also changes the "featured" banner so that it's accessible to all.
This PR branches off #28854 in order to simplify PRs for a new feature that makes it easier for users to set a featured image from the image block. With this commit, I'm removing redundant code that isn't necessary for this specific PR (which will only include code that adds a "featured" banner to the image block).
This commit updates the Badge component so that it works by wrapping around another component. This is designed to make the component easier to re-use.
…t-edit/edit.native.js

This components lifts the subscribeFeaturedImageIdCurrent function so that the data isn't managed directly from within the image component.
This commit also removes a redundant empty space in a bridge file.
The androidOnly const is not in use and can be removed.
"add" should have been "adds". This commit corrects that.
This commit replaces the direct call to the 'core' store with a call to 'coreStore', in line with preferred patterns followed elsewhere in the project.
This commit destructures props in the componentDidMount function to improve readability
Following discussion, this commit renames "featuredImageIdCurrent" to "featuredImageIdNativeUpdated" in order to more clearly describe the function's purpose.
subscribeFeaturedImageIdNativeUpdated is currently only supported in the Android app, so this commit limits its usage to prevent errors on iOS.
@SiobhyB SiobhyB changed the base branch from trunk to add/featured-functionality-to-image-block-ios April 23, 2021 10:30
@SiobhyB SiobhyB added the Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) label Apr 29, 2021
@SiobhyB
Copy link
Contributor Author

SiobhyB commented Apr 29, 2021

Edit: Closing in favour of #31347.

@SiobhyB SiobhyB closed this Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant