Skip to content

Commit

Permalink
Licensing: Add conditional Protect redirect post Scan license activat…
Browse files Browse the repository at this point in the history
…ion (#39007)

* Add Protect redirect to activation-screen-success-info primary-link

* Revert unintended changes

* changelog

* Fix versions

* Revert version update

* Update redirect path
  • Loading branch information
dkmyta authored Sep 3, 2024
1 parent 6e2517d commit 64dca5e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Adds a conditional Protect redirect post scan license activation
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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 (
<Button className="jp-license-activation-screen-success-info--button" href={ redirectSource }>
{ __( 'View scan results', 'jetpack' ) }
</Button>
);
}

// If the user has not completed the first step of the Assistant, make the primary button link to it.
if ( currentRecommendationsStep === 'not-started' ) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' ),
Expand Down

0 comments on commit 64dca5e

Please sign in to comment.