Skip to content

[Modal Layout Picker] Cache the results of the fetched the layouts call#13105

Merged
antonis merged 35 commits intodevelopfrom
issue/2456-Cache
Oct 16, 2020
Merged

[Modal Layout Picker] Cache the results of the fetched the layouts call#13105
antonis merged 35 commits intodevelopfrom
issue/2456-Cache

Conversation

@antonis
Copy link
Copy Markdown
Contributor

@antonis antonis commented Oct 12, 2020

Fixes: wordpress-mobile/gutenberg-mobile#2456

Related PRs:

Description

This PR implements caching of the data as a result of the call made in #2443 and as modified by related issues.

Note

  • Caching of the fetched data is implemented in FluxC
  • Caching of thumbnail images was already handled by ImageManager and Glide library
  • Caching of layout image data was already handled by Gutenberg

To test:

An easy way to test for these analytics is to debug the app and filter Logcat to look for the string 🔵 Tracked:

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

Browse Modal Layout Picker

  1. Open the Modal Layout Picker
    • Optionally scroll through to load a few preview images.
  2. Exit the Modal Layout Picker
  3. Take your device offline
  4. Return to Modal Layout Picker
    Expect to see picker loaded with the same results previously viewed.

Create Page

  1. After performing the steps of Browse Modal Layout Picker
  2. Select a layout
  3. Select "Create Page"
    Expect to see the editor load with the populated data from the template

Preview Template

  1. After performing the steps of Browse Modal Layout Picker
  2. Select a layout
  3. Select "Preview"
    Expect to see the preview load with the cached data

Create Page From Preview

  1. After performing the steps of Preview Template
  2. Select "Create Page"
    Expect to see the editor load with the populated data from the template

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 Oct 12, 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 Oct 12, 2020

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

# Conflicts:
#	WordPress/src/main/java/org/wordpress/android/ui/mlp/ModalLayoutPickerFragment.kt
#	WordPress/src/main/java/org/wordpress/android/viewmodel/mlp/ModalLayoutPickerViewModel.kt
#	build.gradle
# Conflicts:
#	WordPress/src/main/java/org/wordpress/android/viewmodel/mlp/ModalLayoutPickerViewModel.kt
@antonis antonis marked this pull request as ready for review October 14, 2020 07:52
Copy link
Copy Markdown
Contributor

@mkevins mkevins left a comment

Choose a reason for hiding this comment

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

I've reviewed and tested this via the steps in the description, and everything is working as expected. Tested all flows via Pixel 3a on a free and premium site, w/ the wasabi build. Also, I ran all unit tests, and everything is passing.

Great work Antonis! 🎉

Base automatically changed from issue/2454-MLP_Analytics to develop October 16, 2020 14:30
# Conflicts:
#	WordPress/src/main/java/org/wordpress/android/viewmodel/mlp/ModalLayoutPickerViewModel.kt
#	WordPress/src/test/java/org/wordpress/android/viewmodel/mlp/ModalLayoutPickerViewModelTest.kt
@antonis antonis merged commit a8def37 into develop Oct 16, 2020
@antonis antonis deleted the issue/2456-Cache branch October 16, 2020 14:58
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