Skip to content

Jetpack Mobile: Scan UiStates part(ii)#13605

Merged
ashiagr merged 18 commits intodevelopfrom
issue/13326-scan-ui-states-partii
Dec 18, 2020
Merged

Jetpack Mobile: Scan UiStates part(ii)#13605
ashiagr merged 18 commits intodevelopfrom
issue/13326-scan-ui-states-partii

Conversation

@ashiagr
Copy link
Copy Markdown
Contributor

@ashiagr ashiagr commented Dec 15, 2020

Parent #13326

PS: Size of the PR has increased because of new xml layouts, extracting of styles to a new class. I can split tests (last commit) into a separate PR if it helps in reviewing this PR.

Description

This PR is a step forward in refining UiStates for the Scan screen. It mainly includes changes to below classes:

ScanListItemState updated to include

  • ScanState - ButtonAction (FixAll, Scan) - (only display logic) do not perform any action yet.
  • ThreatItemState (corresponding ThreatViewHolder, layout etc added)

ScanStateListItemBuilder

  • Mapping for ScanState extracted in the new ScanStateListItemBuilder class, dynamic texts added

ScanViewModel

  • Content UiState updated to include ScanState buttons and threats

There will be more states (e.g. after fix action) later, this PR covers only below states, dynamic texts, buttons (displayed when screen is shown) and corresponding tests.
 

 ScanStateModel.State SCANNING IDLE IDLE
ScanListItemState  Scanning ThreatsNotFound ThreatsFound (none, some or all fixable)
icon ic_scan_scanning ic_scan_idle_threats_not_found ic_scan_idle_threats_found
title Preparing to scan Don't worry about a thing Your site may be at risk
description Welcome to Jetpack Scan, we are taking a first look at your site now and the result will be with you soon. \n \n We will send you a notification once the scan is complete. In the meantime feel free to continue to use your site as normal. You can check the progress at anytime. The last Jetpack scan ran {no. of hours/mins ago or in a few seconds} and everything looked great. Run a manual scan now or wait for Jetpack to scan your site later today. The scan found {no. of threats} potential threats with {site name or this site}. Please review them below and take action. We're {here to help} if you need us.
fix all button - - Fix all (visibility based on fixable status)
scan button - Scan now Scan again

To Test

Prerequisite: Make sure both Scan feature flag and MySiteImprovements flag are set to on in the App settings.

  • Select a site with scan capability on the My Site tab
  • Notice that scan menu is displayed
  • Click scan menu item
  • Notice that icons, (dynamic) texts, (dynamic) buttons display as per the table above corresponding to the mentioned states.
  • Notice that threats have started displaying (title, description based on threat type yet to be updated)

Notes

  1. Design, icons not final. Ignore all styles.
  2. ScanStatusService uses FluxC.ThreatStore to access threats (only basic details) temporarily just to start displaying the threats, threats count. It needs to be updated later on and so haven't included tests for ScanStatusService.
  3. "here to help" in the ThreatsFound state is not highlighted as a link.

Merge Instructions

  1. Make sure Jetpack Mobile: Scan Introduce UiState #13578 is merged
  2. Ping me for merge. We need to remove fluxc commit hash for getting threats temporarily.

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

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

Generated by 🚫 dangerJS

@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Dec 15, 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 Dec 15, 2020

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

@malinajirka malinajirka self-assigned this Dec 16, 2020
…scan-ui-states-partii

# Conflicts:
#	WordPress/src/main/java/org/wordpress/android/ui/jetpack/scan/ScanFragment.kt
#	WordPress/src/main/java/org/wordpress/android/ui/jetpack/scan/adapters/ScanAdapter.kt
#	WordPress/src/main/java/org/wordpress/android/ui/jetpack/scan/adapters/viewholders/ScanStateViewHolder.kt
#	WordPress/src/test/java/org/wordpress/android/ui/jetpack/scan/ScanStatusServiceTest.kt
#	libs/utils/WordPressUtils/src/main/java/org/wordpress/android/util/AppLog.java
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 @ashiagr! Really great job :). I left to very nitpicky comments, the code looks great. Feel free to merge this PR.

@ashiagr
Copy link
Copy Markdown
Contributor Author

ashiagr commented Dec 16, 2020

Thanks for the review @malinajirka ! I've addressed your comments. Ready for another look 🙏.

PS: Don't merge this PR yet. I have to integrate FluxC threats updates and remove temporary FluxC commit hash from this PR.

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 for the changes ;)! LGTM

Base automatically changed from issue/13326-scan-introduce-ui-states to develop December 17, 2020 10:27
@ashiagr ashiagr changed the title Issue/13326 Scan UiStates part(ii) Jetpack Mobile: Scan UiStates part(ii) Dec 17, 2020
@ashiagr ashiagr merged commit c873bfd into develop Dec 18, 2020
@ashiagr ashiagr deleted the issue/13326-scan-ui-states-partii branch December 18, 2020 08:36
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