diff --git a/projects/js-packages/publicize-components/changelog/update-social-enable-social-admin-page-for-all-sites b/projects/js-packages/publicize-components/changelog/update-social-enable-social-admin-page-for-all-sites new file mode 100644 index 0000000000000..21d8fa8e8fc70 --- /dev/null +++ b/projects/js-packages/publicize-components/changelog/update-social-enable-social-admin-page-for-all-sites @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Social | Hide upgrade nudge for Atomic sites diff --git a/projects/js-packages/publicize-components/src/components/admin-page/toggles/social-module-toggle/index.tsx b/projects/js-packages/publicize-components/src/components/admin-page/toggles/social-module-toggle/index.tsx index 7e6739c289b14..a8998e13304f1 100644 --- a/projects/js-packages/publicize-components/src/components/admin-page/toggles/social-module-toggle/index.tsx +++ b/projects/js-packages/publicize-components/src/components/admin-page/toggles/social-module-toggle/index.tsx @@ -5,7 +5,7 @@ import { getRedirectUrl, useBreakpointMatch, } from '@automattic/jetpack-components'; -import { getScriptData } from '@automattic/jetpack-script-data'; +import { getScriptData, isWpcomPlatformSite } from '@automattic/jetpack-script-data'; import { ExternalLink } from '@wordpress/components'; import { useSelect, useDispatch } from '@wordpress/data'; import { __, _x } from '@wordpress/i18n'; @@ -111,7 +111,7 @@ const SocialModuleToggle: React.FC = () => { { __( 'Learn more', 'jetpack-publicize-components' ) } - { ! is_wpcom && ! hasSocialPaidFeatures() ? ( + { ! isWpcomPlatformSite() && ! hasSocialPaidFeatures() ? ( } + * Values come from https://github.com/Automattic/jetpack/blob/128db0505a27dcdcdef5946d60f443173b2ef6cd/projects/packages/status/src/class-host.php#L240 */ -const NON_SELF_HOSTED_TYPES = [ 'woa', 'atomic', 'newspack', 'vip', 'wpcom' ]; +const NON_SELF_HOSTED_TYPES: Array< AdminSiteData[ 'host' ] > = [ + 'woa', + 'atomic', + 'newspack', + 'vip', + 'wpcom', +]; /** * Get the script data from the window object. @@ -82,16 +88,36 @@ export function siteHasFeature( feature: string ) { * @return {boolean} Whether the site host is wpcom. */ export function isSimpleSite() { - return getScriptData()?.site?.host === 'wpcom'; + return getScriptData().site?.host === 'wpcom'; } /** - * Check if the site host is woa. + * Check if the is an Atomic site. * - * @return {boolean} Whether the site host is woa. + * @return {boolean} Whether the site is an Atomic site. */ export function isAtomicSite() { - return getScriptData()?.site?.host === 'atomic'; + return getScriptData().site?.host === 'atomic'; +} + +/** + * Check if the site is a WoA site + * + * @return Whether the site is woa. + */ +export function isWoASite() { + return getScriptData().site?.host === 'woa'; +} + +/** + * Determine if this is a WordPress.com site. + * + * Includes both Simple and WoA platforms. + * + * @return Whether the site is a WordPress.com site. + */ +export function isWpcomPlatformSite() { + return isSimpleSite() || isWoASite(); } /** diff --git a/projects/plugins/wpcomsh/changelog/update-social-enable-social-admin-page-for-all-sites b/projects/plugins/wpcomsh/changelog/update-social-enable-social-admin-page-for-all-sites new file mode 100644 index 0000000000000..93f72e468bb99 --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/update-social-enable-social-admin-page-for-all-sites @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Social | Enable Social admin page for all WPCOM sites diff --git a/projects/plugins/wpcomsh/wpcom-features/class-wpcom-features.php b/projects/plugins/wpcomsh/wpcom-features/class-wpcom-features.php index 7b45eb2ba5a75..6b80bd906c0b6 100644 --- a/projects/plugins/wpcomsh/wpcom-features/class-wpcom-features.php +++ b/projects/plugins/wpcomsh/wpcom-features/class-wpcom-features.php @@ -1071,12 +1071,7 @@ class WPCOM_Features { self::JETPACK_GROWTH_PLANS, ), self::SOCIAL_ADMIN_PAGE => array( - array( - // This feature isn't launched yet, so we're ensuring that it's not available on any plans. - 'before' => '1900-01-01', - self::WPCOM_ALL_SITES, - self::JETPACK_ALL_SITES, - ), + self::WPCOM_ALL_SITES, ), self::SOCIAL_MASTODON_CONNECTION => array( array(