-
Notifications
You must be signed in to change notification settings - Fork 1.3k
jetpack: backup download notice banner #14147
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes #14030
This PR adds the Backup Download Banner to the activity log list and backup list.
Notable changes ( It may be easiest to review this PR by commits and I'm available if reviewer wants to pair review)
activity_log_list_notice_item.xml
- New layout file for the notice bannerstyles.xml
&strings.xml
- Added new styles for the banner and a few stringsActivityLogAdapter
,ActivitiyLogDiffCallback
- both updated to support theNotice
list item type and the newNoticeItemViewHolder
, so that the view will actually show in the listComplete
to include url and validUntil andGetBackupDownloadStatusUseCase
to send those values downstreamPostDismissBackupDownloadUseCase
which is post the dismiss request to the server. If there is an error, we log it and move on.JETPACK_BACKUP_DOWNLOAD_FILE_NOTICE_DOWNLOAD_TAPPED -
JETPACK_BACKUP_DOWNLOAD_FILE_NOTICE_DISMISSED_TAPPED,
ACTIVITY_LOG_DOWNLOAD_FILE_NOTICE_DOWNLOAD_TAPPED,
ACTIVITY_LOG_DOWNLOAD_FILE_NOTICE_DISMISSED_TAPPED
ActivityLogTracker
to make the tracks call reusableDownloadBackupFile
, which will forward the user to the web browser for file download. Updated the observer inActivityLogListFragment
to handle the browser launchJetpackBackupDownloadActionState
which will let the calling activity know which state the download is in on return. This was a precursor to showing the correct messaging when returning to the activity log list or backup list. Changes were made toBackupDownloadFragment
andBackupDownloadViewModel
to support this new intent extra.ActivityLogViewModel
, which include:backupDownloadEvent
with a displayNotice field, so whenreloadEvents
executes it uses this property to determine if the notice banner should be shown. Also included downloadId, url, and validUntil.onQueryBackupDownloadStatus
to use the JetpackBackupDownloadActionState to determine which snackbar message to be shown. Note that in the case of returning to the lists, we do want to show the snackbar in addition to the notice banner.handleBackupDownloadStatusForProgress
to no longer check if the progress item is shown, we always kick off a reloadEventshandleBackupDownloadStatusForComplete
to reloadEvents of the progressItem is not shownMerge Instructions:
To test:
Scenario.1 : BackupDownload Flow - Manual Exit
Activity Log
screen,Download backup
to launch theBackup Download
screen,Create downloadable file
button.X
toolbar button or pressing/swiping back).Activity Log
screen and a backup status will be triggered,Activity Log
screenScenario.2 : BackupDownload Flow - Wait for flow to end and then exit
Activity Log
screen,Download backup
to launch theBackup Download
screen,Create downloadable file
button.X
toolbar button or pressing/swiping back)Scenario.3 (Notice banner download)
Scenario.4 (Notice banner dismiss)
PR submission checklist:
RELEASE-NOTES.txt
if necessary.