From 64dca5e73a1c8d1126a8694ab3dcbfd1bb9b722d Mon Sep 17 00:00:00 2001 From: dkmyta <43220201+dkmyta@users.noreply.github.com> Date: Tue, 3 Sep 2024 12:18:26 -0700 Subject: [PATCH] Licensing: Add conditional Protect redirect post Scan license activation (#39007) * Add Protect redirect to activation-screen-success-info primary-link * Revert unintended changes * changelog * Fix versions * Revert version update * Update redirect path --- .../changelog/add-licensing-protect-redirect | 4 ++++ .../primary-link/index.jsx | 12 ++++++++++++ .../product-link/index.jsx | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 projects/js-packages/licensing/changelog/add-licensing-protect-redirect diff --git a/projects/js-packages/licensing/changelog/add-licensing-protect-redirect b/projects/js-packages/licensing/changelog/add-licensing-protect-redirect new file mode 100644 index 0000000000000..eb84a7c5ceab3 --- /dev/null +++ b/projects/js-packages/licensing/changelog/add-licensing-protect-redirect @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Adds a conditional Protect redirect post scan license activation diff --git a/projects/js-packages/licensing/components/activation-screen-success-info/primary-link/index.jsx b/projects/js-packages/licensing/components/activation-screen-success-info/primary-link/index.jsx index 620fb9ff00d43..6c5e696754757 100644 --- a/projects/js-packages/licensing/components/activation-screen-success-info/primary-link/index.jsx +++ b/projects/js-packages/licensing/components/activation-screen-success-info/primary-link/index.jsx @@ -20,6 +20,7 @@ const PrimaryLink = props => { const isJetpackSocialActive = isPluginActive( 'Jetpack Social' ); const isJetpackSocialProduct = productGroup === 'jetpack_social_advanced' || productGroup === 'jetpack_social_basic'; + const isJetpackProtectActive = isPluginActive( 'Jetpack Protect' ); if ( isFetching ) { return ( @@ -48,6 +49,17 @@ const PrimaryLink = props => { ); } + if ( productGroup === 'jetpack_scan' ) { + const redirectSource = isJetpackProtectActive + ? siteAdminUrl + 'admin.php?page=jetpack-protect' + : getRedirectUrl( 'jetpack-license-activation-success-scan', { site: siteRawUrl } ); + return ( + + ); + } + // If the user has not completed the first step of the Assistant, make the primary button link to it. if ( currentRecommendationsStep === 'not-started' ) { return ( diff --git a/projects/js-packages/licensing/components/activation-screen-success-info/product-link/index.jsx b/projects/js-packages/licensing/components/activation-screen-success-info/product-link/index.jsx index cdacf0a396fe4..b10cf25b8847a 100644 --- a/projects/js-packages/licensing/components/activation-screen-success-info/product-link/index.jsx +++ b/projects/js-packages/licensing/components/activation-screen-success-info/product-link/index.jsx @@ -20,8 +20,8 @@ const ProductLink = props => { redirectSource: 'jetpack-license-activation-success-backup', }, jetpack_scan: { - text: __( 'View scan results', 'jetpack' ), - redirectSource: 'jetpack-license-activation-success-scan', + text: __( 'View my plans', 'jetpack' ), + redirectSource: 'license-activation-view-my-plans', }, jetpack_search: { text: __( 'Configure search', 'jetpack' ),