Skip to content

Issue/13326 navigate to scan screen from detail#13924

Merged
ashiagr merged 6 commits intodevelopfrom
issue/13326-navigate-to-scan-screen-from-detail
Feb 2, 2021
Merged

Issue/13326 navigate to scan screen from detail#13924
ashiagr merged 6 commits intodevelopfrom
issue/13326-navigate-to-scan-screen-from-detail

Conversation

@malinajirka
Copy link
Copy Markdown
Contributor

Parent issue #13326

This PR update the approach used to propagate data from ThreatDetail screen to Scan screen.

The previous approach was using "startActivityForResult(ThreatDetail)/setResult". The ThreatDetail screen would set a flag in the result and the Scan screen would read this flag and force update the screen. This approach is great when the ThreatDetail screen is always started from Scan screen, but it's not the case anymore. We need to start ThreatDetail screen even from Scan History screen and perhaps even from notifications in the near future.

The new approach uses "startActivity(ThreatDetail)/startActivity(Scan)" . The ThreatDetail screen requests "startActivity(Scan screen)" with "clear top | single top" flags. If the Scan screen is already on the backstack, it's "onNewMethod" is invoked and the screen is force updated. If the Scan screen is not on the backstack, it's started from scratch in which case we don't need to force update it, because the screen always fetches new data on initialization.

Known issues:

  1. When "fix threat" action is invoked from a detail of an ignored threat, the progress indicator on the Scan screen is not visible.

To test:
Prerequisites:

  • A threat is added to the testing site. In case you run out of threats, re-install bad calendar plugin and re-run scan.
  • Scan feature flag is enabled
  1. Open Scan screen
  2. Start scan
  3. Open detail of the found threat
  4. Click on "Fix threat" button
  5. Notice the app redirects you back to the "Scan" screen and the correct progress state + snackbar is shown

Prerequisites:

  • A threat is added to the testing site. In case you run out of threats, re-install bad calendar plugin and re-run scan.
  • Scan feature flag is enabled
  1. Open Scan screen
  2. Start scan
  3. Open detail of the found threat
  4. Click on "Ignore threat" button
  5. Notice you get redirected back to the "scan" screen and snackbar is shown
  6. Open History
  7. Open detail of the ignored threat
  8. Click on "Fix threat" button
  9. Notice the app redirects you back to the "Scan" screen, snackbar is shown (there is a known bug, the progress indicator is not visible)

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.

@malinajirka malinajirka added this to the 16.7 milestone Feb 1, 2021
@malinajirka malinajirka requested a review from ashiagr February 1, 2021 09:47
@malinajirka malinajirka self-assigned this Feb 1, 2021
@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Feb 1, 2021

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 Feb 1, 2021

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

@ashiagr ashiagr self-assigned this Feb 2, 2021
@malinajirka malinajirka mentioned this pull request Feb 2, 2021
67 tasks
…detail

# Conflicts:
#	WordPress/src/main/java/org/wordpress/android/ui/jetpack/scan/ScanFragment.kt
@malinajirka malinajirka marked this pull request as ready for review February 2, 2021 08:37
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.

Works like a charm 🎉 except of the progress bar display issue which we discussed will be fixed in a separate PR.

Thanks for this refactoring to support fixing from scan history 👍!

@ashiagr ashiagr merged commit 1b8d61c into develop Feb 2, 2021
@ashiagr ashiagr deleted the issue/13326-navigate-to-scan-screen-from-detail branch February 2, 2021 09:22
@ashiagr ashiagr mentioned this pull request Feb 3, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants