From 2df5403169f3a148a70f00b986209b19d00fc416 Mon Sep 17 00:00:00 2001 From: Manzoor Wani Date: Thu, 17 Oct 2024 12:28:39 +0530 Subject: [PATCH] Clean up --- .../src/social-store/reducer/index.js | 1 - .../src/social-store/selectors/connection-data.js | 9 --------- .../src/social-store/selectors/index.js | 1 - .../src/social-store/selectors/site-data.js | 1 - .../selectors/test/connection-data.test.js | 13 ------------- .../publicize-components/src/types/types.ts | 1 - 6 files changed, 26 deletions(-) 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 9f8d335a59bbc..502e34d256f73 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 @@ -12,7 +12,6 @@ const reducer = combineReducers( { socialImageGeneratorSettings, shareStatus, hasPaidPlan: ( state = false ) => state, - userConnectionUrl: ( state = '' ) => state, hasPaidFeatures: ( state = false ) => state, } ); diff --git a/projects/js-packages/publicize-components/src/social-store/selectors/connection-data.js b/projects/js-packages/publicize-components/src/social-store/selectors/connection-data.js index 7cf7db17aba76..1a324a65d3cd7 100644 --- a/projects/js-packages/publicize-components/src/social-store/selectors/connection-data.js +++ b/projects/js-packages/publicize-components/src/social-store/selectors/connection-data.js @@ -54,15 +54,6 @@ export function getConnectionsByService( state, serviceName ) { return getConnections( state ).filter( ( { service_name } ) => service_name === serviceName ); } -/** - * Returns the connections admin URL from the store. - * @param {import("../types").SocialStoreState} state - State object. - * @return {string|null} The connections admin URL. - */ -export function getConnectionsAdminUrl( state ) { - return state.connectionData?.adminUrl ?? null; -} - /** * Returns whether there are connections in the store. * @param {import("../types").SocialStoreState} state - State object. diff --git a/projects/js-packages/publicize-components/src/social-store/selectors/index.js b/projects/js-packages/publicize-components/src/social-store/selectors/index.js index 66d134aee2229..9841e282af43e 100644 --- a/projects/js-packages/publicize-components/src/social-store/selectors/index.js +++ b/projects/js-packages/publicize-components/src/social-store/selectors/index.js @@ -10,7 +10,6 @@ const selectors = { ...jetpackSettingSelectors, ...socialImageGeneratorSettingsSelectors, ...shareStatusSelectors, - userConnectionUrl: state => state.userConnectionUrl, hasPaidFeatures: state => state.hasPaidFeatures, }; diff --git a/projects/js-packages/publicize-components/src/social-store/selectors/site-data.js b/projects/js-packages/publicize-components/src/social-store/selectors/site-data.js index 5f1d726f3082d..3b4ab1d22a8b4 100644 --- a/projects/js-packages/publicize-components/src/social-store/selectors/site-data.js +++ b/projects/js-packages/publicize-components/src/social-store/selectors/site-data.js @@ -1,5 +1,4 @@ const siteDataSelectors = { - getAdminUrl: state => state.siteData?.adminUrl ?? null, getAPIRootUrl: state => state.siteData?.apiRoot ?? null, getAPINonce: state => state.siteData?.apiNonce ?? null, getRegistrationNonce: state => state.siteData?.registrationNonce ?? null, diff --git a/projects/js-packages/publicize-components/src/social-store/selectors/test/connection-data.test.js b/projects/js-packages/publicize-components/src/social-store/selectors/test/connection-data.test.js index 61c92970b9325..b73f4d62f1c49 100644 --- a/projects/js-packages/publicize-components/src/social-store/selectors/test/connection-data.test.js +++ b/projects/js-packages/publicize-components/src/social-store/selectors/test/connection-data.test.js @@ -1,6 +1,5 @@ import { getConnections, - getConnectionsAdminUrl, hasConnections, getFailedConnections, getMustReauthConnections, @@ -11,7 +10,6 @@ import { const state = { connectionData: { - adminUrl: 'https://wordpress.com/some-url', connections: [ { id: '123456789', @@ -64,17 +62,6 @@ describe( 'Social store selectors: connectionData', () => { } ); } ); - describe( 'getConnectionsAdminUrl', () => { - it( 'should return null if no adminUrl', () => { - expect( getConnectionsAdminUrl( {} ) ).toBeNull(); - } ); - - it( 'should return adminUrl', () => { - const adminUrl = getConnectionsAdminUrl( state ); - expect( adminUrl ).toEqual( state.connectionData.adminUrl ); - } ); - } ); - describe( 'hasConnections', () => { it( 'should return false if no connections', () => { expect( hasConnections( {} ) ).toBe( false ); diff --git a/projects/js-packages/publicize-components/src/types/types.ts b/projects/js-packages/publicize-components/src/types/types.ts index b2d7cd344ef90..8264d46782842 100644 --- a/projects/js-packages/publicize-components/src/types/types.ts +++ b/projects/js-packages/publicize-components/src/types/types.ts @@ -52,7 +52,6 @@ type JetpackSettingsSelectors = { type ConnectionDataSelectors = { getConnections: () => Array< object >; - getConnectionsAdminUrl: () => string; hasConnections: () => boolean; };