diff --git a/projects/js-packages/publicize-components/changelog/update-social-nuke-has-paid-plan b/projects/js-packages/publicize-components/changelog/update-social-nuke-has-paid-plan new file mode 100644 index 0000000000000..59e08c72626b5 --- /dev/null +++ b/projects/js-packages/publicize-components/changelog/update-social-nuke-has-paid-plan @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Initial state: Removed unused hasPaidPlan flag + + diff --git a/projects/js-packages/publicize-components/src/hooks/use-publicize-config/index.js b/projects/js-packages/publicize-components/src/hooks/use-publicize-config/index.js index 0b093fb1100a1..0c8617a2d3168 100644 --- a/projects/js-packages/publicize-components/src/hooks/use-publicize-config/index.js +++ b/projects/js-packages/publicize-components/src/hooks/use-publicize-config/index.js @@ -80,12 +80,6 @@ export default function usePublicizeConfig() { */ const hidePublicizeFeature = isPostPublished && ! isRePublicizeFeatureAvailable; - /** - * hasPaidPlan: - * Whether the site has a paid plan. This could be either the Basic or the Advanced plan. - */ - const hasPaidPlan = !! getJetpackData()?.social?.hasPaidPlan; - /** * isEnhancedPublishingEnabled: * Whether the site has the enhanced publishing feature enabled. If true, it means that @@ -109,7 +103,6 @@ export default function usePublicizeConfig() { isRePublicizeUpgradableViaUpsell, hidePublicizeFeature, isPostAlreadyShared, - hasPaidPlan, isEnhancedPublishingEnabled, isSocialImageGeneratorAvailable: !! getJetpackData()?.social?.isSocialImageGeneratorAvailable && ! isJetpackSocialNote, diff --git a/projects/js-packages/publicize-components/src/social-store/reducer/index.js b/projects/js-packages/publicize-components/src/social-store/reducer/index.js index 502e34d256f73..738d5f5acdf9f 100644 --- a/projects/js-packages/publicize-components/src/social-store/reducer/index.js +++ b/projects/js-packages/publicize-components/src/social-store/reducer/index.js @@ -11,7 +11,6 @@ const reducer = combineReducers( { jetpackSettings, socialImageGeneratorSettings, shareStatus, - hasPaidPlan: ( state = false ) => state, hasPaidFeatures: ( state = false ) => state, } ); diff --git a/projects/js-packages/publicize-components/src/social-store/selectors/jetpack-settings.js b/projects/js-packages/publicize-components/src/social-store/selectors/jetpack-settings.js index 66fd71d5add49..5d67dea96547a 100644 --- a/projects/js-packages/publicize-components/src/social-store/selectors/jetpack-settings.js +++ b/projects/js-packages/publicize-components/src/social-store/selectors/jetpack-settings.js @@ -3,7 +3,6 @@ const jetpackSettingSelectors = { isModuleEnabled: state => state.jetpackSettings.publicize_active, showPricingPage: state => state.jetpackSettings.show_pricing_page, isUpdatingJetpackSettings: state => state.jetpackSettings.is_updating, - hasPaidPlan: state => ! ( state.jetpackSettings?.showNudge ?? true ), isEnhancedPublishingEnabled: state => state.jetpackSettings?.isEnhancedPublishingEnabled ?? false, getDismissedNotices: state => state.jetpackSettings?.dismissedNotices, isSocialNotesEnabled: state => state.jetpackSettings?.social_notes_enabled, diff --git a/projects/js-packages/publicize-components/src/social-store/types.ts b/projects/js-packages/publicize-components/src/social-store/types.ts index a391f53024082..5ade67abd1838 100644 --- a/projects/js-packages/publicize-components/src/social-store/types.ts +++ b/projects/js-packages/publicize-components/src/social-store/types.ts @@ -67,8 +67,6 @@ export type ShareStatus = { // TODO we should have a consistent structure across all the pages - editor, dashboard, admin page etc. export type SocialStoreState = { connectionData: ConnectionData; - // on post editor - hasPaidPlan?: boolean; // on Jetack Social admin page jetpackSettings?: JetpackSettings; shareStatus?: ShareStatus; diff --git a/projects/js-packages/publicize-components/src/types/types.ts b/projects/js-packages/publicize-components/src/types/types.ts index 8264d46782842..041b0bd18f8f4 100644 --- a/projects/js-packages/publicize-components/src/types/types.ts +++ b/projects/js-packages/publicize-components/src/types/types.ts @@ -47,7 +47,6 @@ type JetpackSettingsSelectors = { isModuleEnabled: () => boolean; showPricingPage: () => boolean; isUpdatingJetpackSettings: () => boolean; - hasPaidPlan: () => boolean; }; type ConnectionDataSelectors = { diff --git a/projects/plugins/social/changelog/update-social-nuke-has-paid-plan b/projects/plugins/social/changelog/update-social-nuke-has-paid-plan new file mode 100644 index 0000000000000..59e08c72626b5 --- /dev/null +++ b/projects/plugins/social/changelog/update-social-nuke-has-paid-plan @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Initial state: Removed unused hasPaidPlan flag + + diff --git a/projects/plugins/social/src/js/components/admin-page/test/index.test.jsx b/projects/plugins/social/src/js/components/admin-page/test/index.test.jsx index fe6184c585049..e24423098cdb0 100644 --- a/projects/plugins/social/src/js/components/admin-page/test/index.test.jsx +++ b/projects/plugins/social/src/js/components/admin-page/test/index.test.jsx @@ -13,7 +13,6 @@ describe( 'load the app', () => { let storeSelect; renderHook( () => useSelect( select => ( storeSelect = select( SOCIAL_STORE_ID ) ) ) ); jest.spyOn( storeSelect, 'showPricingPage' ).mockReset().mockReturnValue( true ); - jest.spyOn( storeSelect, 'hasPaidPlan' ).mockReset().mockReturnValue( true ); jest.spyOn( storeSelect, 'getPluginVersion' ).mockReset().mockReturnValue( version ); render( ); expect( screen.getByText( `Jetpack Social ${ version }` ) ).toBeInTheDocument(); diff --git a/projects/plugins/social/src/js/components/types/types.ts b/projects/plugins/social/src/js/components/types/types.ts index 9ce1d062591fb..ba7aed9023769 100644 --- a/projects/plugins/social/src/js/components/types/types.ts +++ b/projects/plugins/social/src/js/components/types/types.ts @@ -7,7 +7,6 @@ type JetpackSettingsSelectors = { isModuleEnabled: () => boolean; showPricingPage: () => boolean; isUpdatingJetpackSettings: () => boolean; - hasPaidPlan: () => boolean; hasPaidFeatures: () => boolean; };