-
Notifications
You must be signed in to change notification settings - Fork 798
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] Reimplement (#17140) Mobile stories block for release 1.41.1 #17806
Merged
mzorz
merged 1 commit into
gutenberg/integrate_release_1.41.1
from
rnmobile/jetpack-stories-block-base-1.41.1
Nov 14, 2020
Merged
[RNMobile] Reimplement (#17140) Mobile stories block for release 1.41.1 #17806
mzorz
merged 1 commit into
gutenberg/integrate_release_1.41.1
from
rnmobile/jetpack-stories-block-base-1.41.1
Nov 14, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* basic scaffolding for the Story block on mobile editor * added flex alignment and actual mediaFiles attribute rendering * applying styles to stories block view * removed unused alignment * added StoryEditingButton and showing it when the story block is selected * connecting StoryEditingButton with bridge's requestStoryCreatorLoad * updated requestStoryCreatorLoad call to pass block's mediaFiles and clientId over the bridge * added new component StoryUpdateProgress * Revert "added new component StoryUpdateProgress", not belonging to this branch This reverts commit 86fb956. * fixed lint warnings * changed the no longer existing color dark-gray-500 removed in WordPress/gutenberg@162bc50 with gray-700 * added package-lock.json * Mobile Stories block (part 2): introduce StoryUpdateProgress (#17222) * Revert "Revert "added new component StoryUpdateProgress", not belonging to this branch" This reverts commit 34349b1. * added mediaSave statuses listeners definitions * moved StoryEdit to a React.Component class and implemented StoryUpdateProgress overlay * added onStorySaveResult handling to Story block * edit mode: replacing urls by id for saving process * added onMediaModelCreated() callback so we can re-assign the mediaID to the mediaFiles attribute of a Story block once such a mediaModel is created * update the mediaFile id and URL of a given story frame when finished uploading succesfully * removed commented imports * added explicit TODO comments to make sure to follow up on them for error handling * make sure to call mediaUploadSync and storySaveSync if any of the mediaFiles contained in this block is not a remote url - also call onRemoveBlockCheckUpload() action under the same conditions in componentWillUnmount() * Mobile Stories block (part 3): rename using BlockMediaUpdateProgress (#17456) * using BlockMediaUpdateProgress * method rename * updated (automatically modified) package-lock.json * removed package-lock.json * moved condition check for http or https to helper method isUrlRemote() * calling mediaUploadSync and mediaSaveSync regardless of ids, we always will want to receive updates on all 3 stages * fixed spelling * Mobile Stories block (part 4): error handling (#17458) * Revert "Revert "added new component StoryUpdateProgress", not belonging to this branch" This reverts commit 34349b1. * added mediaSave statuses listeners definitions * moved StoryEdit to a React.Component class and implemented StoryUpdateProgress overlay * added onStorySaveResult handling to Story block * edit mode: replacing urls by id for saving process * added onMediaModelCreated() callback so we can re-assign the mediaID to the mediaFiles attribute of a Story block once such a mediaModel is created * update the mediaFile id and URL of a given story frame when finished uploading succesfully * removed commented imports * added explicit TODO comments to make sure to follow up on them for error handling * make sure to call mediaUploadSync and storySaveSync if any of the mediaFiles contained in this block is not a remote url - also call onRemoveBlockCheckUpload() action under the same conditions in componentWillUnmount() * using BlockMediaUpdateProgress * method rename * updated story block to represent error state * added cancel and retry bridge methods specific for mediaFiles collection based blocks * using a deep copy of mediaFiles when replacing ids and mediaUrl, given mediaFiles attribute needs to be replaced again and cannot be modified in place as per React conventions * added requestMediaFilesSaveCancelDialog bridge method * changed props name onMediaModelCreated to more generic onMediaIdChanged * removed commented code * replaced for loops with map * Mobile Stories block (part 5): add empty placeholder (#17539) * Revert "Revert "added new component StoryUpdateProgress", not belonging to this branch" This reverts commit 34349b1. * added mediaSave statuses listeners definitions * moved StoryEdit to a React.Component class and implemented StoryUpdateProgress overlay * added onStorySaveResult handling to Story block * edit mode: replacing urls by id for saving process * added onMediaModelCreated() callback so we can re-assign the mediaID to the mediaFiles attribute of a Story block once such a mediaModel is created * update the mediaFile id and URL of a given story frame when finished uploading succesfully * removed commented imports * added explicit TODO comments to make sure to follow up on them for error handling * make sure to call mediaUploadSync and storySaveSync if any of the mediaFiles contained in this block is not a remote url - also call onRemoveBlockCheckUpload() action under the same conditions in componentWillUnmount() * using BlockMediaUpdateProgress * method rename * updated story block to represent error state * added cancel and retry bridge methods specific for mediaFiles collection based blocks * using a deep copy of mediaFiles when replacing ids and mediaUrl, given mediaFiles attribute needs to be replaced again and cannot be modified in place as per React conventions * added requestMediaFilesSaveCancelDialog bridge method * changed props name onMediaModelCreated to more generic onMediaIdChanged * removed commented code * added MediaPlaceholder, wrapped in a pointerEvents=none View so we can handle media picking from the StoryComposer * replaced for loops with map * importing defined const MEDIA_TYPE_IMAGE, MEDIA_TYPE_VIDEO instead of re-defining * made placeholder container look as per any other media placeholder, reservign the Story style container for populated Story blocks * Mobile Stories block (part 6): rewrote StoryEdit class as a function (#17549) * Revert "Revert "added new component StoryUpdateProgress", not belonging to this branch" This reverts commit 34349b1. * added mediaSave statuses listeners definitions * moved StoryEdit to a React.Component class and implemented StoryUpdateProgress overlay * added onStorySaveResult handling to Story block * edit mode: replacing urls by id for saving process * added onMediaModelCreated() callback so we can re-assign the mediaID to the mediaFiles attribute of a Story block once such a mediaModel is created * update the mediaFile id and URL of a given story frame when finished uploading succesfully * removed commented imports * added explicit TODO comments to make sure to follow up on them for error handling * make sure to call mediaUploadSync and storySaveSync if any of the mediaFiles contained in this block is not a remote url - also call onRemoveBlockCheckUpload() action under the same conditions in componentWillUnmount() * using BlockMediaUpdateProgress * method rename * updated story block to represent error state * added cancel and retry bridge methods specific for mediaFiles collection based blocks * using a deep copy of mediaFiles when replacing ids and mediaUrl, given mediaFiles attribute needs to be replaced again and cannot be modified in place as per React conventions * added requestMediaFilesSaveCancelDialog bridge method * changed props name onMediaModelCreated to more generic onMediaIdChanged * removed commented code * added MediaPlaceholder, wrapped in a pointerEvents=none View so we can handle media picking from the StoryComposer * replaced for loops with map * rewrote StoryEdit class as a function * removed unused imports * removed unused function * story block: set inserter support to false for web, but keep it for mobile (#17690) * renamed params to avoid name shadowing
This was referenced Nov 14, 2020
mzorz
approved these changes
Nov 14, 2020
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.
LGTM - smoke tested and reviewed code, it's got all we had, merging back in 👍
4 tasks
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.
Edit: removed link to unrelated issue.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry-picking changes from #17140 onto rnmobile/release_1.41.1, See #17140 description for more info
Related PRs:
Gutenberg: WordPress/gutenberg#26978
Jetpack: #17806
Gutenberg-Mobile: wordpress-mobile/gutenberg-mobile#2807
WordPress-Android: wordpress-mobile/WordPress-Android#13395
Proposed changelog entry for your changes:
*No Change log needed