Skip to content
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

Licensing: Add conditional Protect redirect post Scan license activation #39007

Merged
merged 10 commits into from
Sep 3, 2024
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#/scan'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
? siteAdminUrl + 'admin.php?page=jetpack-protect#/scan'
? 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
Loading