Skip to content

Commit

Permalink
Mobile Stories block (part 4): error handling (#17458)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mzorz authored Oct 22, 2020
1 parent 5bfd151 commit 6b7df13
Show file tree
Hide file tree
Showing 2 changed files with 151 additions and 153 deletions.
7 changes: 6 additions & 1 deletion extensions/blocks/contact-info/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ const TEMPLATE = [ [ 'jetpack/email' ], [ 'jetpack/phone' ], [ 'jetpack/address'
const ContactInfoEdit = () => {
return (
<View style={ styles.jetpackContactInfoBlock }>
<InnerBlocks allowedBlocks={ ALLOWED_BLOCKS } templateLock={ false } templateInsertUpdatesSelection={ false } template={ TEMPLATE } />
<InnerBlocks
allowedBlocks={ ALLOWED_BLOCKS }
templateLock={ false }
templateInsertUpdatesSelection={ false }
template={ TEMPLATE }
/>
</View>
);
};
Expand Down
Loading

0 comments on commit 6b7df13

Please sign in to comment.