Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jetpack Backup: Redirect back to main backup page when clicking on Back up now button #90834

Merged
merged 7 commits into from
May 20, 2024

Conversation

Initsogar
Copy link
Contributor

@Initsogar Initsogar commented May 17, 2024

Resolves https://github.com/Automattic/jetpack-backup-team/issues/482

Proposed Changes

  • Add a custom onClick handler on BackupNowButton, that will give us more flexibility on adding custom logic when clicking that button.
  • Redirect to the main backup page when clicking on Back up now button, so the user can monitor the progress of the backup being created

Why are these changes being made?

  • Currently, if the user clicks on Back up now, it indicates their interest in securing their latest changes. Therefore, we want to ensure they can monitor the progress of the backup being created.

Testing Instructions

  • Spin up a Calypso Blue or Jetpack Cloud live branch
  • Pick a site with Jetpack VaultPress Backup plan with more than 1 backup
  • Navigate to the backup page
  • Pick a date on the calendar rather than Today
  • Click on Back up now
  • You should be redirected back to Today and you should see the progress of the backup being created.

To validate how it was working before, you can try the same steps in production.

Demo

CleanShot.2024-05-16.at.22.32.00.mp4

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@Initsogar Initsogar self-assigned this May 17, 2024
@matticbot
Copy link
Contributor

matticbot commented May 17, 2024

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~0 bytes added 📈 [gzipped])

name                           parsed_size           gzip_size
jetpack-cloud-agency-sites-v2        -59 B  (-0.0%)       +0 B
backup                               -59 B  (-0.0%)       +0 B
a8c-for-agencies-sites               -59 B  (-0.0%)       +0 B

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@@ -81,15 +89,13 @@ const BackupNowButton: FunctionComponent< Props > = ( {
}
}, [ areBackupsStopped, backupCurrentlyInProgress, tooltipText, translate, enqueued, children ] );

// TODO: If we want to re-enable the backup button we can set enqueue to false once we detect a backup in progress
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This comment is no longer necessary.

@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/on-demand-backup-redirect on your sandbox.

@Initsogar Initsogar requested a review from a team May 17, 2024 04:28
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 17, 2024
@mavegaf
Copy link
Contributor

mavegaf commented May 17, 2024

Tested with Calypso and with Jetpack Cloud. It seems it only works in Jetpack Cloud, Is that expected

@Initsogar
Copy link
Contributor Author

Tested with Calypso and with Jetpack Cloud. It seems it only works in Jetpack Cloud, Is that expected

@mavegaf Hmm, it should work on both. I'll take a look. Thanks!

Removing siteSlug as a prop, and getting it from a selector inside the component. Add the logic to decide if we should show the `Copy site` button and add the onBackupNowClick inside this component.
@Initsogar
Copy link
Contributor Author

Tested with Calypso and with Jetpack Cloud. It seems it only works in Jetpack Cloud, Is that expected

@mavegaf fixed! I did forget that we were rendering only the BackupNowButton directly when the user is navigating on Calypso Blue. So I refactored the BackupActionsToolbar in a way that we could use that component for both cases, and inside we decide if we need to display or not the Copy site button.

Could you take another look? :)

Copy link
Contributor

@mavegaf mavegaf left a comment

Choose a reason for hiding this comment

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

Tested in both, no errors in console 👍

@Initsogar Initsogar added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels May 18, 2024
@Initsogar Initsogar merged commit deb59bc into trunk May 20, 2024
12 checks passed
@Initsogar Initsogar deleted the update/on-demand-backup-redirect branch May 20, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Backups The Jetpack Backup product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants