Skip to content

Issue/13328 restore complete#13779

Merged
zwarm merged 11 commits intodevelopfrom
issue/13328-restore-complete
Jan 15, 2021
Merged

Issue/13328 restore complete#13779
zwarm merged 11 commits intodevelopfrom
issue/13328-restore-complete

Conversation

@zwarm
Copy link
Copy Markdown
Contributor

@zwarm zwarm commented Jan 14, 2021

Parent #13328

This PR implements the "complete" wizard step/view for the restore request and is mostly a clone of Backup Download complete. This PR also undoes the temporary navigations actions implemented in the progress PR #13778 .

Merge Instructions

Cloned Classes
RestoreCompleteAdapter
RestoreCompleteFragment
RestoreCompleteStateListItemBuilder
RestoreCompleteViewModel

Notes:

  • Ignore styling - this is being handled separately
  • Ignore unit test placement in packages - this is being handled separately
  • RestoreActivity & RestoreViewModel (+unit tests) will continue to get updated as I move throughout the steps of the wizard

To test:
Warning: The Restore site button is hooked up, so if you press it your site will be backed up!

  • Launch the app with RestoreFeatureConfig flag on and the BackupFeatureFlag on
  • Navigate to ActivityLog
  • Tap the more menu
  • Select the restore option
  • Tap the Restore Site button on the Details View
  • Tap the Confirm restore site on the Warning View
  • The Progress view will do it's thing - don't cancel out
    Verify
  • (1) The complete view is shown when the restore is finished
  • (2) Tapping the Visit Site button to launch the site url in an external browser
  • (3) Tap the Done button to close the wizard

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.

@zwarm zwarm added this to the 16.6 milestone Jan 14, 2021
@zwarm zwarm requested a review from ashiagr January 14, 2021 23:15
@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Jan 14, 2021

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

@peril-wordpress-mobile
Copy link
Copy Markdown

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS

@zwarm zwarm mentioned this pull request Jan 14, 2021
30 tasks
@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Jan 14, 2021

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

@ashiagr ashiagr self-assigned this Jan 15, 2021
Copy link
Copy Markdown
Contributor

@ashiagr ashiagr left a comment

Choose a reason for hiding this comment

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

Thanks @zwarm! Since most of the classes were cloned and reviewed originally, I found everything fine overall. Left very few minor comments.

Comment on lines +67 to +69
buildErrorIconState(),
buildErrorDescriptionState(),
buildErrorDoneActionState(onDoneClick)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick 🔍: Minor formatting required.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

in 2d240e8


<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick 🔍:MATCH_PARENT is not recommended for widgets contained in a ConstraintLayout.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll address this during consolidation, as all fragments restore/backup will use the same fragment file. Thanks.

Comment on lines +57 to +60
whenever(site.url).thenReturn("www.google.com")

viewModel.start(site, restoreState, parentViewModel)
whenever(site.url).thenReturn("www.google.com")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick 🔍: Duplicate stubbing?
whenever(site.url).thenReturn("www.google.com")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed in 2d240e8

}

@Test
fun `given visit site is clicked, then a navigationEvent is posted`() = test {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
fun `given visit site is clicked, then a navigationEvent is posted`() = test {
fun `when visit site is clicked, then VisitSite navigationEvent is posted`() = test {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

in 2d240e8

when (this) {
is VisitSite -> {
// todo annmarie add to ActivityLauncher
ActivityLauncher.openUrlExternal(this@RestoreActivity, url)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick 🔍: Short branches can be put on the same line as the condition, without braces.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ugh - for some reason my IDE pushes them back onto separate lines if I execute a clean up command. I'll have to Google this one so it stops happening. Thanks for pointing it out. in 2d240e8

@zwarm
Copy link
Copy Markdown
Contributor Author

zwarm commented Jan 15, 2021

@ashiagr - With the exception of one xml comment, I pushed the fixes. Once CI finished I'll merge. Thanks again. 🙏

Base automatically changed from issue/13328-restore-progress to develop January 15, 2021 15:09
@zwarm zwarm merged commit 8e45117 into develop Jan 15, 2021
@zwarm zwarm deleted the issue/13328-restore-complete branch January 15, 2021 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants