diff --git a/projects/packages/my-jetpack/changelog/Disabling Newsletter settings controls for not connected users. b/projects/packages/my-jetpack/changelog/Disabling Newsletter settings controls for not connected users. deleted file mode 100644 index 15d8dbfa578d7..0000000000000 --- a/projects/packages/my-jetpack/changelog/Disabling Newsletter settings controls for not connected users. +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: fixed -Comment: Disabling controls that are already visually disabled. - - diff --git a/projects/packages/my-jetpack/changelog/newsletter-settings-visuals-for-active-elements. b/projects/packages/my-jetpack/changelog/newsletter-settings-visuals-for-active-elements. new file mode 100644 index 0000000000000..ef662db21772f --- /dev/null +++ b/projects/packages/my-jetpack/changelog/newsletter-settings-visuals-for-active-elements. @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Remove disabled visuals from controls that are active. + + diff --git a/projects/plugins/jetpack/_inc/client/newsletter/email-settings.jsx b/projects/plugins/jetpack/_inc/client/newsletter/email-settings.jsx index bbd1e8c4094d7..ac47162612b0e 100644 --- a/projects/plugins/jetpack/_inc/client/newsletter/email-settings.jsx +++ b/projects/plugins/jetpack/_inc/client/newsletter/email-settings.jsx @@ -20,7 +20,7 @@ import TextInput from 'components/text-input'; import analytics from 'lib/analytics'; import { useCallback, useState } from 'react'; import { connect } from 'react-redux'; -import { isUnavailableInOfflineMode, isUnavailableInSiteConnectionMode } from 'state/connection'; +import { isUnavailableInOfflineMode } from 'state/connection'; import { getSiteTitle, getUserGravatar, @@ -58,7 +58,6 @@ const EmailSettings = props => { subscriptionReplyTo, subscriptionFromName, updateFormStateAndSaveOptionValue, - unavailableInSiteConnectionMode, gravatar, email, adminUrl, @@ -67,8 +66,7 @@ const EmailSettings = props => { siteName, } = props; - const disabled = - ! isSubscriptionsActive || unavailableInOfflineMode || unavailableInSiteConnectionMode; + const disabled = ! isSubscriptionsActive || unavailableInOfflineMode; const gravatarInputDisabled = disabled || isSavingAnyOption( [ GRAVATER_OPTION ] ); const authorInputDisabled = disabled || isSavingAnyOption( [ AUTHOR_OPTION ] ); const postDateInputDisabled = disabled || isSavingAnyOption( [ POST_DATE_OPTION ] ); @@ -185,7 +183,6 @@ const EmailSettings = props => { { @@ -319,7 +315,6 @@ const EmailSettings = props => { { { onOptionChange, welcomeMessage, unavailableInOfflineMode, - unavailableInSiteConnectionMode, } = props; const changeWelcomeMessageState = useCallback( @@ -34,11 +33,7 @@ const MessagesSetting = props => { ); const isSaving = isSavingAnyOption( [ SUBSCRIPTION_OPTIONS ] ); - const disabled = - ! isSubscriptionsActive || - unavailableInOfflineMode || - unavailableInSiteConnectionMode || - isSaving; + const disabled = ! isSubscriptionsActive || unavailableInOfflineMode || isSaving; return ( { saveDisabled={ isSaving } isDisabled={ disabled } > - +

{ __( 'These settings change the emails sent from your site to your readers.', @@ -92,10 +82,6 @@ export default withModuleSettingsFormHelpers( onOptionChange: ownProps.onOptionChange, welcomeMessage: ownProps.getOptionValue( SUBSCRIPTION_OPTIONS )?.welcome || '', unavailableInOfflineMode: isUnavailableInOfflineMode( state, SUBSCRIPTIONS_MODULE_NAME ), - unavailableInSiteConnectionMode: isUnavailableInSiteConnectionMode( - state, - SUBSCRIPTIONS_MODULE_NAME - ), }; } )( MessagesSetting ) ); diff --git a/projects/plugins/jetpack/_inc/client/newsletter/newsletter-categories.jsx b/projects/plugins/jetpack/_inc/client/newsletter/newsletter-categories.jsx index 8da948e484f50..096ca62a47d47 100644 --- a/projects/plugins/jetpack/_inc/client/newsletter/newsletter-categories.jsx +++ b/projects/plugins/jetpack/_inc/client/newsletter/newsletter-categories.jsx @@ -5,11 +5,7 @@ import SettingsCard from 'components/settings-card'; import SettingsGroup from 'components/settings-group'; import React, { useCallback, useMemo } from 'react'; import { connect } from 'react-redux'; -import { - isUnavailableInOfflineMode, - isUnavailableInSiteConnectionMode, - requiresConnection, -} from 'state/connection'; +import { isUnavailableInOfflineMode, requiresConnection } from 'state/connection'; import { getModule } from 'state/modules'; import Card from '../components/card'; import { withModuleSettingsFormHelpers } from '../components/module-settings/with-module-settings-form-helpers'; @@ -44,7 +40,6 @@ function NewsletterCategories( props ) { newsletterCategories, categories, unavailableInOfflineMode, - unavailableInSiteConnectionMode, subscriptionsModule, updateFormStateOptionValue, isSavingAnyOption, @@ -85,11 +80,7 @@ function NewsletterCategories( props ) { NEWSLETTER_CATEGORIES_ENABLED_OPTION, NEWSLETTER_CATEGORIES_OPTION, ] ); - const disabled = - ! isSubscriptionsActive || - unavailableInOfflineMode || - unavailableInSiteConnectionMode || - isSaving; + const disabled = ! isSubscriptionsActive || unavailableInOfflineMode || isSaving; return ( { analytics.tracks.recordJetpackClick( 'newsletter_settings_setup_payment_plans_button_click' ); @@ -34,11 +28,7 @@ function PaidNewsletter( props ) { return ( - +

{ __( 'Earn money through your Newsletter. Reward your most loyal subscribers with exclusive content or add a paywall to monetize content.', @@ -67,10 +57,6 @@ export default withModuleSettingsFormHelpers( setupPaymentPlansUrl: getJetpackCloudUrl( state, 'monetize/payments' ), subscriptionsModule: getModule( state, SUBSCRIPTIONS_MODULE_NAME ), isOffline: isOfflineMode( state ), - unavailableInSiteConnectionMode: isUnavailableInSiteConnectionMode( - state, - SUBSCRIPTIONS_MODULE_NAME - ), }; } )( PaidNewsletter ) ); diff --git a/projects/plugins/jetpack/_inc/client/newsletter/subscriptions-settings.jsx b/projects/plugins/jetpack/_inc/client/newsletter/subscriptions-settings.jsx index dddeae32cb90a..f489dee9b8b9d 100644 --- a/projects/plugins/jetpack/_inc/client/newsletter/subscriptions-settings.jsx +++ b/projects/plugins/jetpack/_inc/client/newsletter/subscriptions-settings.jsx @@ -8,12 +8,7 @@ import SettingsCard from 'components/settings-card'; import SettingsGroup from 'components/settings-group'; import React, { useCallback } from 'react'; import { connect } from 'react-redux'; -import { - isCurrentUserLinked, - isUnavailableInOfflineMode, - isOfflineMode, - isUnavailableInSiteConnectionMode, -} from 'state/connection'; +import { isCurrentUserLinked, isUnavailableInOfflineMode, isOfflineMode } from 'state/connection'; import { currentThemeIsBlockTheme, currentThemeStylesheet, @@ -32,7 +27,6 @@ import { SUBSCRIPTIONS_MODULE_NAME } from './constants'; function SubscriptionsSettings( props ) { const { unavailableInOfflineMode, - unavailableInSiteConnectionMode, isSavingAnyOption, isStbEnabled, isStcEnabled, @@ -119,8 +113,7 @@ function SubscriptionsSettings( props ) { ); }, [ updateFormStateModuleOption ] ); - const isDisabled = - ! isSubscriptionsActive || unavailableInOfflineMode || unavailableInSiteConnectionMode; + const isDisabled = ! isSubscriptionsActive || unavailableInOfflineMode; return ( - +

{ __( 'Automatically add subscription forms to your site and turn visitors into subscribers.', @@ -282,10 +275,6 @@ export default withModuleSettingsFormHelpers( isOffline: isOfflineMode( state ), isSubscriptionsActive: ownProps.getOptionValue( SUBSCRIPTIONS_MODULE_NAME ), unavailableInOfflineMode: isUnavailableInOfflineMode( state, SUBSCRIPTIONS_MODULE_NAME ), - unavailableInSiteConnectionMode: isUnavailableInSiteConnectionMode( - state, - SUBSCRIPTIONS_MODULE_NAME - ), subscriptions: getModule( state, SUBSCRIPTIONS_MODULE_NAME ), isStbEnabled: ownProps.getOptionValue( 'stb_enabled' ), isStcEnabled: ownProps.getOptionValue( 'stc_enabled' ), diff --git a/projects/plugins/jetpack/changelog/Disabling Newsletter settings controls for not connected users. b/projects/plugins/jetpack/changelog/Disabling Newsletter settings controls for not connected users. deleted file mode 100644 index 5f8bbb2967d1b..0000000000000 --- a/projects/plugins/jetpack/changelog/Disabling Newsletter settings controls for not connected users. +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: other -Comment: Disabling controls that are already visually disabled. - - diff --git a/projects/plugins/jetpack/changelog/newsletter-settings-visuals-for-active-elements b/projects/plugins/jetpack/changelog/newsletter-settings-visuals-for-active-elements new file mode 100644 index 0000000000000..926a2162e0fe8 --- /dev/null +++ b/projects/plugins/jetpack/changelog/newsletter-settings-visuals-for-active-elements @@ -0,0 +1,5 @@ +Significance: patch +Type: other +Comment: Remove disabled visuals from controls that are active. + +