diff --git a/projects/packages/activity-log/changelog/manage-backup-action-deep-link-calypso b/projects/packages/activity-log/changelog/manage-backup-action-deep-link-calypso
new file mode 100644
index 000000000000..0de46b467fd0
--- /dev/null
+++ b/projects/packages/activity-log/changelog/manage-backup-action-deep-link-calypso
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+Activity Log: the "Manage backup" row action now opens the Jetpack Cloud Backup restore flow for that point in time, instead of being a disabled placeholder.
diff --git a/projects/packages/activity-log/changelog/restore-backup-action-label-and-temp-doc b/projects/packages/activity-log/changelog/restore-backup-action-label-and-temp-doc
new file mode 100644
index 000000000000..74cdc176759e
--- /dev/null
+++ b/projects/packages/activity-log/changelog/restore-backup-action-label-and-temp-doc
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+Activity Log: rename the row action to "Restore backup" so the label matches what clicking it actually does — open the restore flow.
diff --git a/projects/packages/activity-log/changelog/upsell-illustration-and-title-casing b/projects/packages/activity-log/changelog/upsell-illustration-and-title-casing
new file mode 100644
index 000000000000..03de6c28efde
--- /dev/null
+++ b/projects/packages/activity-log/changelog/upsell-illustration-and-title-casing
@@ -0,0 +1,4 @@
+Significance: patch
+Type: changed
+
+Activity Log: refreshed the free-tier upsell illustration to match Jetpack's branding.
diff --git a/projects/packages/activity-log/src/js/components/ActivityLog/UpsellCallout.tsx b/projects/packages/activity-log/src/js/components/ActivityLog/UpsellCallout.tsx
index 0bf291fb9a29..08a7f98fddd3 100644
--- a/projects/packages/activity-log/src/js/components/ActivityLog/UpsellCallout.tsx
+++ b/projects/packages/activity-log/src/js/components/ActivityLog/UpsellCallout.tsx
@@ -78,7 +78,7 @@ export function UpsellCallout() {
- { __( 'Track every action with Activity logs', 'jetpack-activity-log' ) }
+ { __( 'Track every action with activity logs', 'jetpack-activity-log' ) }
{ __(
diff --git a/projects/packages/activity-log/src/js/components/ActivityLog/actions.tsx b/projects/packages/activity-log/src/js/components/ActivityLog/actions.tsx
index 90b604bf6a32..a0ce3ce41bd0 100644
--- a/projects/packages/activity-log/src/js/components/ActivityLog/actions.tsx
+++ b/projects/packages/activity-log/src/js/components/ActivityLog/actions.tsx
@@ -5,36 +5,69 @@ import { useMemo } from 'react';
import type { Activity } from './types';
import type { Action } from '@wordpress/dataviews';
+interface InitialStateWithCalypsoSlug {
+ jetpackStatus?: { calypsoSlug?: string };
+}
+
+declare const JPACTIVITYLOG_INITIAL_STATE: InitialStateWithCalypsoSlug | undefined;
+
+// Read once at module load; the value doesn't change within a session.
+const calypsoSlug: string =
+ ( typeof JPACTIVITYLOG_INITIAL_STATE !== 'undefined'
+ ? JPACTIVITYLOG_INITIAL_STATE?.jetpackStatus?.calypsoSlug
+ : undefined ) ?? '';
+
+type Tracks = { recordEvent: ( name: string, props?: Record< string, unknown > ) => void };
+
type UseActivityActionsOptions = {
isLoading: boolean;
+ tracks?: Tracks;
};
/**
- * Row actions for the DataViews table. Phase 5 wires the "Manage backup"
- * action into the Backup package's admin page; for now the action is
- * present but disabled so the column space is preserved and the planned
- * feature is visible.
+ * Row actions for the DataViews table. The single primary action deep-
+ * links into the Jetpack Cloud Backup restore flow for the row's rewind
+ * point (`https://cloud.jetpack.com/backup/{slug}/restore/{rewindId}`)
+ * and opens in a new tab. Eligibility requires `activityIsRewindable`,
+ * a `rewindId`, and a `calypsoSlug` from Initial_State; rows missing
+ * any of those don't render the action.
+ *
+ * TEMPORARY: this off-site link is a stop-gap until the Backup wp-admin
+ * port (https://github.com/Automattic/jetpack/pull/48236) lands. Once
+ * that ships, every row action here should point at the in-admin
+ * Backup page instead of cloud.jetpack.com so users stay inside their
+ * own wp-admin for the restore flow.
*
* @param options - Hook options.
* @param options.isLoading - Whether the list is currently fetching. Kept
- * in the API so Phase 5 doesn't need to refactor
- * the call site.
+ * in the API for symmetry with the call site.
+ * @param options.tracks - Optional analytics handle for the click event.
* @return The actions array for ``.
*/
export function useActivityActions( {
isLoading,
+ tracks,
}: UseActivityActionsOptions ): Action< Activity >[] {
return useMemo( () => {
const backupAction: Action< Activity > = {
id: 'backup',
isPrimary: true,
- label: __( 'Manage backup', 'jetpack-activity-log' ),
+ label: __( 'Restore backup', 'jetpack-activity-log' ),
icon: ,
- // Phase 5: enable and deep-link into the Backup package's admin page.
- disabled: true,
- isEligible: item => item.activityIsRewindable,
- callback: async () => {
- /* no-op until Phase 5 */
+ isEligible: item => Boolean( item.activityIsRewindable && item.rewindId && calypsoSlug ),
+ callback: async items => {
+ const item = items[ 0 ];
+ if ( ! item?.rewindId || ! calypsoSlug ) {
+ return;
+ }
+ const url = `https://cloud.jetpack.com/backup/${ encodeURIComponent(
+ calypsoSlug
+ ) }/restore/${ encodeURIComponent( item.rewindId ) }`;
+ tracks?.recordEvent( 'jetpack_activity_log_restore_backup_click', {
+ rewind_id: item.rewindId,
+ activity_name: item.activityName,
+ } );
+ window.open( url, '_blank', 'noopener,noreferrer' );
},
};
@@ -42,5 +75,5 @@ export function useActivityActions( {
void isLoading;
return [ backupAction ];
- }, [ isLoading ] );
+ }, [ isLoading, tracks ] );
}
diff --git a/projects/packages/activity-log/src/js/components/ActivityLog/activity-logs-callout-illustration.svg b/projects/packages/activity-log/src/js/components/ActivityLog/activity-logs-callout-illustration.svg
index e6b0fb17ee8c..08990245ca79 100644
--- a/projects/packages/activity-log/src/js/components/ActivityLog/activity-logs-callout-illustration.svg
+++ b/projects/packages/activity-log/src/js/components/ActivityLog/activity-logs-callout-illustration.svg
@@ -1,52 +1,45 @@
-