-
Notifications
You must be signed in to change notification settings - Fork 2k
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
BackupScheduleSetting: improve BackupScheduled view using useNextBackupSchedule hook #95638
Conversation
- Replaced the calculation with precise scheduling data from the useNextBackupSchedule hook. - Added logic to round up the hours when there are remaining minutes for more accurate time estimation.
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~227 bytes added 📈 [gzipped])
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. Generated by performance advisor bot at iscalypsofastyet.com. |
This reverts commit 66dc8cd.
@ilonagl here I included the changes on the changes on the scheduled setting message:
|
…ups-upcoming-view
const { date: nextBackupDate } = useNextBackupSchedule(); | ||
|
||
// Calculate the time difference for hours and minutes | ||
const hoursForNextBackup = nextBackupDate.diff( today, 'hours' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/16942926 Some locales (Hebrew, Japanese) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday. Thank you @Initsogar for including a screenshot in the description! This is really helpful for our translators. |
Related to https://github.com/Automattic/jetpack-backup-team/issues/715
This PR improves the precision of the next backup time estimation by leveraging the
useNextBackupSchedule
hook introduced in #95602 that returns the next scheduled backup date.Proposed Changes
useNextBackupSchedule
hook.Other minor changes:
RemovedUpdate: I was going to remove this, but it seems we have some types issues related to this, so I prefer to address it in a new PR.defaultProps
on ActionsButton component, which is now deprecated.useNextBackupSchedule
to named export instead of default export, so we could add more hooks in the samehooks
file without issues.Why are these changes being made?
The previous logic considered the last completed backup to calculate a relative date, which is not always accurate, especially since we introduced on-demand backups.
https://github.com/Automattic/jetpack-backup-team/issues/715
Testing Instructions
Backup
page.Backup Scheduled
view and the time should be relative to the site scheduled time.Pre-merge Checklist