Skip to content

Adds Fix All button action#15661

Merged
emilylaguna merged 11 commits intodevelopfrom
task/15190-fix-actions
Jan 20, 2021
Merged

Adds Fix All button action#15661
emilylaguna merged 11 commits intodevelopfrom
task/15190-fix-actions

Conversation

@emilylaguna
Copy link
Copy Markdown
Contributor

@emilylaguna emilylaguna commented Jan 18, 2021

Project: #15190
Related PR: wordpress-mobile/WordPressKit-iOS#329

To test:

  1. Launch the app
  2. Tap the My Site tab
  3. Tap on a Jetpack Site with fixable threats
  4. You should see a 'Fix All' button
  5. Tap it
  6. You should see a localized confirmation alert
  7. Tap Cancel
  8. Nothing should happen
  9. Tap 'Fix All' Again
  10. Tap on the 'Fix all threats' button
  11. It will appear as if nothing happened
  12. Refresh after a minute and there should be no fixable threats

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 Jan 18, 2021

You can trigger an installable build for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Jan 18, 2021

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

Copy link
Copy Markdown
Contributor

@momo-ozawa momo-ozawa left a comment

Choose a reason for hiding this comment

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

@emilylaguna

Tap on the 'Fix all threats' button
It will appear as if nothing happened
Refresh after a minute and there should be no fixable threats

I tested on the Digital Ocean Jetpack test site, and wasn't able to get rid of the fixable threats after refreshing.

Also, I found it a bit confusing how the message says "5 potential threats", but the alert shows "3 active threats". It would be nice to match the web and display "Jetpack can autofix 3 of 5 found threats". Not sure if you were already planning on addressing this in a different PR, but just in case!

Screen Shot 2021-01-19 at 10 45 28


private struct Strings {
static let fixAllAlertTitleFormat = NSLocalizedString("Please confirm you want to fix all %1$d active threats", comment: "Confirmation title presented before fixing all the threats, displays the number of threats to be fixed")
static let fixAllSingleAlertTitle = NSLocalizedString("Please confirm you want to fix all %1$d active threat", comment: "Confirmation title presented before fixing a single threat")
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.

Single threat string 👀

Suggested change
static let fixAllSingleAlertTitle = NSLocalizedString("Please confirm you want to fix all %1$d active threat", comment: "Confirmation title presented before fixing a single threat")
static let fixSingleAlertTitle = NSLocalizedString("Please confirm you want to fix this threat", comment: "Confirmation title presented before fixing a single threat")

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.

🤦‍♀️ Good catch. Fixed in: f67b820

static let fixAllAlertTitleFormat = NSLocalizedString("Please confirm you want to fix all %1$d active threats", comment: "Confirmation title presented before fixing all the threats, displays the number of threats to be fixed")
static let fixAllSingleAlertTitle = NSLocalizedString("Please confirm you want to fix all %1$d active threat", comment: "Confirmation title presented before fixing a single threat")
static let fixAllAlertTitleMessage = NSLocalizedString("Jetpack will be fixing all the detected active threats.", comment: "Confirmation message presented before fixing all the threats, displays the number of threats to be fixed")
static let fixAllSingleAlertMessage = NSLocalizedString("Jetpack will be fixing all the detected active threat.", comment: "Confirmation message presented before fixing a single threat")
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.

Single threat string 👀

Suggested change
static let fixAllSingleAlertMessage = NSLocalizedString("Jetpack will be fixing all the detected active threat.", comment: "Confirmation message presented before fixing a single threat")
static let fixSingleAlertMessage = NSLocalizedString("Jetpack will be fixing the detected active threat.", comment: "Confirmation message presented before fixing a single threat")

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'd been staring at strings for too long 😆 Fixed in: f67b820

@emilylaguna
Copy link
Copy Markdown
Contributor Author

I tested on the Digital Ocean Jetpack test site, and wasn't able to get rid of the fixable threats after refreshing.

That's odd, do these threats get fixed when trigger on the web?

@emilylaguna
Copy link
Copy Markdown
Contributor Author

Also, I found it a bit confusing how the message says "5 potential threats", but the alert shows "3 active threats". It would be nice to match the web and display "Jetpack can autofix 3 of 5 found threats". Not sure if you were already planning on addressing this in a different PR, but just in case!

The alert confirmation uses the wording from the web and only displays the number of threats that can be fixed. I can address this in a later PR when we do design review.

Copy link
Copy Markdown
Contributor

@leandroalonso leandroalonso left a comment

Choose a reason for hiding this comment

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

@momo-ozawa Did a small exploration here and the fix is not working because the SFTP user doesn't have write permission. On the web there's a notice stating that "not all threats were fixed".

@emilylaguna is this part of handling errors and it will be addressed in another PR?

Besides that, tested the instructions on another site and it worked just fine.

@emilylaguna
Copy link
Copy Markdown
Contributor Author

@emilylaguna is this part of handling errors and it will be addressed in another PR?

Yep! I have a whole task for error handling for the section.

@emilylaguna emilylaguna merged commit fbc9bbe into develop Jan 20, 2021
@emilylaguna emilylaguna deleted the task/15190-fix-actions branch January 20, 2021 22:11
@emilylaguna emilylaguna mentioned this pull request Jan 20, 2021
55 tasks
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.

3 participants