Skip to content

Jetpack Section: Connect Restore with Activity Log/Backup Screen#13914

Merged
zwarm merged 17 commits intodevelopfrom
issue/13328-connect-restore-with-activity-log-backup-screen
Feb 1, 2021
Merged

Jetpack Section: Connect Restore with Activity Log/Backup Screen#13914
zwarm merged 17 commits intodevelopfrom
issue/13328-connect-restore-with-activity-log-backup-screen

Conversation

@ParaskP7
Copy link
Copy Markdown
Contributor

@ParaskP7 ParaskP7 commented Jan 29, 2021

Parent #13328

This PR connects the restore flow with the activity log/backup screens. This means that this PR makes sure that when a user presses the Ok, notify me! button or presses/swipes back (triggering the onBackPressed()), while restore is in progress from within the restore screen, then a restore progress row appears on the activity log screen immediately. Before, a user would had to do a manual re-launch or pull-to-refresh on the activity log/backup screen to get the progress row appear.

To test:

  • Open app and go to My Site tab,
  • Go to My Site -> Toolbar Avatar -> App Settings -> Test feature configuration.
  • Enable RestoreFeatureConfig, scroll down and click the RESTART THE APP button.
  • Launch Activity Log screen,
  • Find a rewindable item from the list, click on the ellipsis menu item and select Restore to this point to launch the Restore screen,
  • Click the Restore site button. On the confirmation screen, click on the Confirm restore site button.
  • Click the Ok, notify me! or navigate back manually (by clicking the X toolbar button or pressing/swiping back).
  • You should automatically be navigated back to the Activity Log screen and a restore status will be triggered,
  • The restore progress item should immediately appears. Make sure the restore timestamp is available on this progress item.
  • A snackbar should immediately appear informing that the restore just started. Make sure the restore timestamp is available on the snackbar.
  • Make sure the ellipsis menu item, for every rewindable item, is not shown while restore progress is ongoing.
  • Wait for restore to finish while having the Activity Log screen open both, within the app and the web (so you can see the actual progress),
  • When restore finishes (looking on the web), a restore (push) notification should appears.
  • Then, the restore progress item should disappear (after at least 5'' seconds, due to the while loop check status delay).
  • A pull-to-refresh should be automatically triggered and a new restore item might (or might not) appear (depending on how fast the restore progress item disappears and how fast this new item becomes available on the backend, via the activityLogStore.fetchActivities(...) API call). In case the new restore item does not appear, wait a bit (maybe 10'' seconds) and trigger a manual pull-to-refresh. Verify that the new restore item appears after some time.
  • A snackbar should immediately appear informing that the restore just completed. Make sure the restore timestamp is available on the snackbar.
  • Make sure the ellipsis menu items, for every rewindable item, is now shown again.

PS: As always, I suggest doing a commit-by-commit review, from within the IDE, as this will make it much easier for you to review the overall solution. If you need to focus on the feature itself and not the refactor or tests filter the commits by Feature to get a quick overall.

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.

This is done for consistency purposes with
'RequestCodes.ACTIVITY_LOG_DETAIL'.
This is done for consistency purposes with
'RequestCodes.ACTIVITY_LOG_DETAIL'.
In addition to 'restoreId, this 'rewindId' is necessary in order to show
the snackbar on the activity log/backup screen later on.
With this change the 'rewindId' and 'restoreId' are being passed from
the 'RestoreFragment' to the 'ActivityLogListFragment', which in turn
will trigger 'onQueryRestoreStatus(...)' on its view model layer.
These tests will fail as the implementation is not ready yet. The next
commit will make the tests pass (TDD).
This commit makes the previous failing test pass (TDD).
@ParaskP7 ParaskP7 added this to the 16.7 milestone Jan 29, 2021
@ParaskP7 ParaskP7 requested a review from zwarm January 29, 2021 11:22
@ParaskP7 ParaskP7 self-assigned this Jan 29, 2021
@peril-wordpress-mobile
Copy link
Copy Markdown

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

@peril-wordpress-mobile
Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

@zwarm zwarm left a comment

Choose a reason for hiding this comment

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

@ParaskP7 - Nice work. I was able to see the starting snackbar, the progress bar, and the final snackbar on complete. Dates were visible. I really like the improvements in the Viewmodels. 👍

@zwarm zwarm merged commit 612739f into develop Feb 1, 2021
@zwarm zwarm deleted the issue/13328-connect-restore-with-activity-log-backup-screen branch February 1, 2021 16:13
@ParaskP7
Copy link
Copy Markdown
Contributor Author

ParaskP7 commented Feb 1, 2021

@ParaskP7 - Nice work. I was able to see the starting snackbar, the progress bar, and the final snackbar on complete. Dates were visible. I really like the improvements in the Viewmodels. 👍

So many thanks @zwarm ! 🌟

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