Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/sso-enqueue
Browse files Browse the repository at this point in the history
  • Loading branch information
agrullon95 authored Feb 1, 2024
2 parents f9e768f + ca5ff93 commit 9e85b73
Show file tree
Hide file tree
Showing 139 changed files with 1,795 additions and 447 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Allow using blog ID instead of site suffix in checkout URL.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Allow using blog ID instead of site suffix in checkout URL.
2 changes: 1 addition & 1 deletion projects/js-packages/connection/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-connection",
"version": "0.31.2",
"version": "0.32.0-alpha",
"description": "Jetpack Connection Component",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/connection/#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Added social specific success card on Jetpack Social license activation.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const ActivationSuccessInfo = props => {
currentRecommendationsStep={ currentRecommendationsStep }
siteAdminUrl={ siteAdminUrl }
siteRawUrl={ siteRawUrl }
productId={ productId }
/>
<ProductLink siteRawUrl={ siteRawUrl } productId={ productId } />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,51 @@ import { Button } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import React from 'react';
import { getProductGroup, isPluginActive } from '../../activation-screen/utils';

import './style.scss';

const PrimaryLink = props => {
const { currentRecommendationsStep, siteAdminUrl, siteRawUrl } = props;
const { currentRecommendationsStep, siteAdminUrl, siteRawUrl, productId } = props;

const productGroup = getProductGroup( productId );
if (
productGroup === 'jetpack_social_advanced' &&
( isPluginActive( 'jetpack/jetpack.php' ) || isPluginActive( 'jetpack/jetpack-social.php' ) )
) {
return (
<Button
className="jp-license-activation-screen-success-info--button"
href={
siteAdminUrl +
( isPluginActive( 'jetpack/jetpack.php' )
? 'admin.php?page=jetpack#/recommendations/welcome-social-advanced'
: 'admin.php?page=jetpack-social' )
}
>
{ __( 'Configure my site', 'jetpack' ) }
</Button>
);
}

if (
productGroup === 'jetpack_social_basic' &&
( isPluginActive( 'jetpack/jetpack.php' ) || isPluginActive( 'jetpack/jetpack-social.php' ) )
) {
return (
<Button
className="jp-license-activation-screen-success-info--button"
href={
siteAdminUrl +
( isPluginActive( 'jetpack/jetpack.php' )
? 'admin.php?page=jetpack#/recommendations/welcome-social-basic'
: 'admin.php?page=jetpack-social' )
}
>
{ __( 'Configure my site', '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' ) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getRedirectUrl } from '@automattic/jetpack-components';
import { createInterpolateElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
Expand Down Expand Up @@ -88,6 +89,32 @@ const JetpackProductDetails = props => {
'jetpack'
),
},
jetpack_social_advanced: {
title: __( 'Jetpack Social Advanced is active!', 'jetpack' ),
text: createInterpolateElement(
__(
'Create amazing link previews for your posts using Social Image Generator. Learn more <a>here</a>.<br/><br/>Learn how to make the most out of Jetpack Social <link>here</link>.<br/><br/>',
'jetpack'
),
{
a: <a href={ getRedirectUrl( 'jetpack-social-sig-support-page' ) } />,
br: <br />,
link: <a href={ getRedirectUrl( 'social-plugin-publicize-support-admin-page' ) } />,
}
),
},
jetpack_social_basic: {
title: __( 'Jetpack Social Basic is active!', 'jetpack' ),
text: createInterpolateElement(
__(
'Enjoy unlimited shares with Jetpack Social Basic. Learn how to make the most out of Jetpack Social <a>here</a>.',
'jetpack'
),
{
a: <a href={ getRedirectUrl( 'social-plugin-publicize-support-admin-page' ) } />,
}
),
},
default: {
title: __( 'Your product is active!', 'jetpack' ),
text: __( "You're all set!", 'jetpack' ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ const JETPACK_SECURITY_PRODUCT_IDS = [

const JETPACK_VIDEOPRESS_PRODUCT_IDS = [ 2116, 2117 ];

const JETPACK_SOCIAL_ADVANCED_PRODUCT_IDS = [ 2602, 2603, 2604 ];

const JETPACK_SOCIAL_BASIC_PRODUCT_IDS = [ 2503, 2504, 2037 ];

const PRODUCT_GROUPS = {
jetpack_anti_spam: JETPACK_ANTI_SPAM_PRODUCT_IDS,
jetpack_backup: JETPACK_BACKUP_PRODUCT_IDS,
Expand All @@ -43,6 +47,8 @@ const PRODUCT_GROUPS = {
jetpack_search: JETPACK_SEARCH_PRODUCT_IDS,
jetpack_security: JETPACK_SECURITY_PRODUCT_IDS,
jetpack_videopress: JETPACK_VIDEOPRESS_PRODUCT_IDS,
jetpack_social_advanced: JETPACK_SOCIAL_ADVANCED_PRODUCT_IDS,
jetpack_social_basic: JETPACK_SOCIAL_BASIC_PRODUCT_IDS,
};

/**
Expand All @@ -57,3 +63,13 @@ export function getProductGroup( productId ) {
'default'
);
}

/**
* Check if a plugin is active.
*
* @param {string} plugin -- The name of the plugin such as jetpack/jetpack.php, social/jetpack-social.php, backup/jetpack-backup.php.
* @returns {boolean} -- True or False.
*/
export function isPluginActive( plugin ) {
return window.myJetpackInitialState?.plugins?.[ plugin ]?.active;
}
2 changes: 1 addition & 1 deletion projects/js-packages/licensing/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-licensing",
"version": "0.11.20",
"version": "0.12.0-alpha",
"description": "Jetpack licensing flow",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/licensing/#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

React DataSync Client: Enhanced Error Handling and Debugging
Loading

0 comments on commit 9e85b73

Please sign in to comment.