Skip to content

[Modal Layout Picker] Filter layouts based on supported blocks#13018

Merged
antonis merged 10 commits intodevelopfrom
issue/2444-MLP_SupportedBlocks
Oct 13, 2020
Merged

[Modal Layout Picker] Filter layouts based on supported blocks#13018
antonis merged 10 commits intodevelopfrom
issue/2444-MLP_SupportedBlocks

Conversation

@antonis
Copy link
Copy Markdown
Contributor

@antonis antonis commented Sep 25, 2020

Fixes: wordpress-mobile/gutenberg-mobile#2444

Related PRs:

Description

This PR fetches adds supported blocks parameter in fetch block layouts call both for WPCom and self hosted site

To test:

Layout Picker should show when creating a new page from My Site or Site Pages the Modal Layout Picker appears.

WPCom Site

  1. Select a WPcom site and ensure a valid network connection
  2. Navigate to the Modal layout picker by either:
    • Selecting the FAB icon on the site page and selecting "Site page"
    • Selecting the ➕ on the Page List
  3. Using an earlier build from [Modal Layout Picker] Add support for Self-Hosted sites #13017 validate the number of layouts has decreased
  4. Using a network logger:
    • Expect to see a network request with:
https://public-api.wordpress.com/wpcom/v2/sites/{{SITEID}}/block-layouts?locale=en&supported_blocks=core/paragraph%2Ccore/heading%2Ccore/more%2Ccore/image%2Ccore/video%2Ccore/nextpage%2Ccore/separator%2Ccore/list%2Ccore/quote%2Ccore/media-text%2Ccore/preformatted%2Ccore/gallery%2Ccore/columns%2Ccore/column%2Ccore/group%2Ccore/freeform%2Ccore/button%2Ccore/spacer%2Ccore/shortcode%2Ccore/buttons%2Ccore/latest-posts%2Ccore/verse%2Ccore/cover%2Ccore/social-link%2Ccore/social-links%2Cjetpack/contact-info%2Cjetpack/email%2Cjetpack/phone%2Cjetpack/address%2Ccore/pullquote%2Ccore/code

Self-Hosted Site

  1. Select a Self-Hosted site and ensure a valid network connection
  2. Navigate to the Modal layout picker by either:
    • Selecting the FAB icon on the site page and selecting "Site page"
    • Selecting the ➕ on the Page List
  3. Using an earlier build from [Modal Layout Picker] Add support for Self-Hosted sites #13017 validate the number of layouts has decreased
  4. Using a network logger:
    • Expect to see a network request with:
https://public-api.wordpress.com/wpcom/v2/common-block-layouts?locale=en&supported_blocks=core/paragraph%2Ccore/heading%2Ccore/more%2Ccore/image%2Ccore/video%2Ccore/nextpage%2Ccore/separator%2Ccore/list%2Ccore/quote%2Ccore/media-text%2Ccore/preformatted%2Ccore/gallery%2Ccore/columns%2Ccore/column%2Ccore/group%2Ccore/freeform%2Ccore/button%2Ccore/spacer%2Ccore/shortcode%2Ccore/buttons%2Ccore/latest-posts%2Ccore/verse%2Ccore/cover%2Ccore/social-link%2Ccore/social-links%2Cjetpack/contact-info%2Cjetpack/email%2Cjetpack/phone%2Cjetpack/address%2Ccore/pullquote%2Ccore/code

PR submission checklist:

  • I have considered adding unit tests where possible.
  • 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.

@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Sep 25, 2020

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Sep 25, 2020

You can test the changes on this Pull Request by downloading the APK here.

…dBlocks

# Conflicts:
#	WordPress/src/test/java/org/wordpress/android/viewmodel/mlp/ModalLayoutPickerViewModelTest.kt
@antonis antonis marked this pull request as ready for review September 28, 2020 06:34
Copy link
Copy Markdown
Contributor

@malinajirka malinajirka left a comment

Choose a reason for hiding this comment

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

Thanks @antonis! I've left some minor comments. The app works as described. However, I found some issues which are probably not related to this PR.

Layouts are not cached

  1. Click on "Create Page"
  2. Wait for the layouts to load
  3. Click on back
  4. Turn on airplane mode
  5. Click on "Create Page"
  6. Notice the layouts are empty

Create blank page doesn't work in offline

  1. Turn on airplane mode
  2. Click on "Create Page"
  3. Click on "Create blank page"
  4. Notice nothing happens

@antonis
Copy link
Copy Markdown
Contributor Author

antonis commented Oct 8, 2020

Thanks again for taking the time to review this @malinajirka 👍
I'm grateful for your feedback 🙇

Layouts are not cached

Create blank page doesn't work in offline

If that's ok, I'll try to cover both of the above with a next pr as part of this to keep this one more focused.

I'll get back to you on your code comments with fixes ASAP 🙇‍♂️

@malinajirka
Copy link
Copy Markdown
Contributor

If that's ok, I'll try to cover both of the above with a next pr as part of this to keep this one more focused.

Sure thing. As long as it's recorded somewhere I don't mind merging this PR :).

@antonis
Copy link
Copy Markdown
Contributor Author

antonis commented Oct 8, 2020

Sure thing. As long as it's recorded somewhere I don't mind merging this PR :).

Ok ;)

ps. When this is approved let's keep it unmerged till #13017 and FluxC PRs are merge.

Copy link
Copy Markdown
Contributor

@malinajirka malinajirka left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

Base automatically changed from issue/2455-MLP_SelfHosted to develop October 13, 2020 05:42
@antonis antonis added this to the 16.0 milestone Oct 13, 2020
@antonis antonis merged commit eec8eaa into develop Oct 13, 2020
@antonis antonis deleted the issue/2444-MLP_SupportedBlocks branch October 13, 2020 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants