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

Story block set inserter support to false for web, but keep it for native #17690

Merged

Conversation

mzorz
Copy link
Contributor

@mzorz mzorz commented Nov 2, 2020

With this PR https://github.com/Automattic/jetpack/pull/17536/files the story block was hidden from the inserter altogether but we want it to be available on mobile behind a feature flag as per wordpress-mobile/gutenberg-mobile#2762

This PR fixes that (which otherwise would make the Story block not available in the inserter for all platforms), by making the supports.inserter flag false for the web, and true for native platforms.

@mzorz mzorz added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it Touches WP.com Files [Block] Story labels Nov 2, 2020
@mzorz mzorz requested review from Tug and aforcier November 2, 2020 15:46
@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello mzorz! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer and confirm D52156-code works as expected before merging this PR. Once this PR is merged, please commit the changes to WP.com. Thank you!
This revision will be updated with each commit to this PR

@etoledom
Copy link
Contributor

etoledom commented Nov 3, 2020

Tested this on iOS (adding .mediaFilesCollectionBlock: true, to the capabilities in the example project) and works perfectly as expected ✅

Copy link
Contributor

@aforcier aforcier left a comment

Choose a reason for hiding this comment

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

Tested on web, confirmed that the block still doesn't show up in the picker. ✅

Copy link
Contributor

@Tug Tug left a comment

Choose a reason for hiding this comment

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

LGTM

@aforcier
Copy link
Contributor

aforcier commented Nov 4, 2020

@jeherve since this is targeting a feature branch are we okay to ignore the wpcom patch and sort it out when the parent PR is merged to the main branch?

@aforcier aforcier added the [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. label Nov 4, 2020
@jeherve
Copy link
Member

jeherve commented Nov 4, 2020

since this is targeting a feature branch are we okay to ignore the wpcom patch and sort it out when the parent PR is merged to the main branch?

Yes, exactly.

@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Nov 4, 2020
@mzorz
Copy link
Contributor Author

mzorz commented Nov 4, 2020

thank you all @etoledom @Tug @aforcier @jeherve 🎉

@mzorz mzorz merged commit 699eaea into try/jetpack-stories-block-mobile Nov 4, 2020
@mzorz mzorz deleted the try/jetpack-stories-block-mobile-fix branch November 4, 2020 09:48
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Nov 4, 2020
mzorz added a commit that referenced this pull request Nov 10, 2020
* 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
@jeherve jeherve added this to the 9.2 milestone Nov 11, 2020
cameronvoell pushed a commit that referenced this pull request Nov 14, 2020
* 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
mzorz added a commit that referenced this pull request Nov 14, 2020
* 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

Co-authored-by: mzorz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Story Touches WP.com Files [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants