diff --git a/includes/cli/class-ras.php b/includes/cli/class-ras.php index e3ebc61902..f21ec83643 100644 --- a/includes/cli/class-ras.php +++ b/includes/cli/class-ras.php @@ -31,7 +31,6 @@ public static function cli_setup_ras() { WP_CLI::error( __( 'Newspack Campaigns plugin not found.', 'newspack-plugin' ) ); } - if ( ! class_exists( '\Newspack_Newsletters_Subscription' ) ) { WP_CLI::error( __( 'Newspack Newsletters plugin not found.', 'newspack-plugin' ) ); } diff --git a/includes/reader-activation/class-reader-activation.php b/includes/reader-activation/class-reader-activation.php index f8cba9f534..a6f6f86db6 100644 --- a/includes/reader-activation/class-reader-activation.php +++ b/includes/reader-activation/class-reader-activation.php @@ -432,11 +432,15 @@ public static function update_setting( $key, $value ) { * Activate RAS features and publish RAS prompts + segments. */ public static function activate() { - if ( ! method_exists( '\Newspack_Popups_Presets', 'activate_ras_presets' ) ) { + if ( ! method_exists( 'Newspack_Popups_Presets', 'activate_ras_presets' ) ) { return new \WP_Error( 'newspack_reader_activation_missing_dependencies', __( 'Newspack Campaigns plugin is required to activate Reader Activation features.', 'newspack-plugin' ) ); } - return \Newspack_Popups_Presets::activate_ras_presets(); + $activated = \Newspack_Popups_Presets::activate_ras_presets(); + if ( $activated ) { + self::skip( 'ras_campaign', false ); + } + return $activated; } /** @@ -674,12 +678,23 @@ public static function get_reader_revenue_required_plugins() { /** * Are the Legal Pages settings configured? * Allows for blank values. + * + * @param bool $skip Whether to skip the check. + * + * @return bool */ - public static function is_terms_configured() { + public static function is_terms_configured( $skip = false ) { $terms_text = \get_option( self::OPTIONS_PREFIX . 'terms_text', false ); $terms_url = \get_option( self::OPTIONS_PREFIX . 'terms_url', false ); + $is_valid = is_string( $terms_text ) && is_string( $terms_url ); + if ( $skip ) { + return $is_valid || self::is_skipped( 'terms_conditions' ); + } + if ( $is_valid ) { + self::skip( 'terms_conditions', false ); + } - return is_string( $terms_text ) && is_string( $terms_url ); + return $is_valid; } /** @@ -693,26 +708,104 @@ public static function is_transactional_email_configured() { return ! empty( $sender_name ) && ! empty( $sender_email ) && ! empty( $contact_email_address ); } + /** + * Is reCAPTCHA enabled? + * + * @param bool $skip Whether to skip the check. + * + * @return bool + */ + public static function is_recaptcha_enabled( $skip = false ) { + $is_valid = method_exists( '\Newspack\Recaptcha', 'can_use_captcha' ) && \Newspack\Recaptcha::can_use_captcha(); + if ( $skip ) { + return $is_valid || self::is_skipped( 'recaptcha' ); + } + if ( $is_valid ) { + self::skip( 'recaptcha', false ); + } + return $is_valid; + } + /** * Is the RAS campaign configured? * - * TODO: Make this dynamic once the third UI screen to generate the prompts is built. + * @param bool $skip Whether to skip the check. + * + * @return bool */ - public static function is_ras_campaign_configured() { - return self::is_enabled() || get_option( Audience_Wizard::SKIP_CAMPAIGN_SETUP_OPTION, '' ) === '1'; + public static function is_ras_campaign_configured( $skip = false ) { + $is_valid = class_exists( 'Newspack_Popups_Presets' ) && get_option( \Newspack_Popups_Presets::NEWSPACK_POPUPS_RAS_LAST_UPDATED, false ); + if ( $skip ) { + return $is_valid || self::is_skipped( 'ras_campaign' ); + } + if ( $is_valid ) { + self::skip( 'ras_campaign', false ); + } + return $is_valid; } /** * Are all prerequisites for Reader Activation complete? + * + * @return bool */ public static function is_ras_ready_to_configure() { - return self::is_terms_configured() && self::is_esp_configured() && self::is_transactional_email_configured() && method_exists( '\Newspack\Recaptcha', 'can_use_captcha' ) && \Newspack\Recaptcha::can_use_captcha() && self::is_woocommerce_active(); + $is_ready = self::is_terms_configured( true ) && self::is_esp_configured() && self::is_transactional_email_configured() && self::is_recaptcha_enabled( true ) && self::is_woocommerce_active(); + + // If all requirements are met or skipped, and RAS isn't yet enabled, enable it. + if ( $is_ready && self::is_ras_campaign_configured( true ) && ! self::is_enabled() ) { + self::update_setting( 'enabled', true ); + } + return $is_ready; + } + + /** + * Has the given prerequisite been skipped? + * + * @param string $prerequisite The prerequisite to check. + * + * @return bool + */ + public static function is_skipped( $prerequisite ) { + // Legacy option name compabitility. + $legacy_is_skipped = false; + if ( 'ras_campaign' === $prerequisite ) { + $legacy_is_skipped = get_option( Audience_Wizard::SKIP_CAMPAIGN_SETUP_OPTION, false ) === '1'; + } + + return boolval( get_option( self::OPTIONS_PREFIX . $prerequisite . '_skipped', $legacy_is_skipped ) ); + } + + /** + * Skip or unskip the given prerequisite. + * + * @param string $prerequisite The prerequisite to skip. + * @param bool $skip If true, skip the prerequisite. If false, unskip it. + * + * @return bool True if updated, false if not. + */ + public static function skip( $prerequisite, $skip = true ) { + if ( ( $skip && self::is_skipped( $prerequisite ) ) || ( ! $skip && ! self::is_skipped( $prerequisite ) ) ) { + return true; + } + + $updated = $skip ? update_option( self::OPTIONS_PREFIX . $prerequisite . '_skipped', '1' ) : delete_option( self::OPTIONS_PREFIX . $prerequisite . '_skipped' ); + + // Legacy option name compabitility. + if ( 'ras_campaign' === $prerequisite && ! $skip && ! $updated ) { + $updated = delete_option( Audience_Wizard::SKIP_CAMPAIGN_SETUP_OPTION ); + } + + // If all requirements are met or skipped, and RAS isn't yet enabled, enable it. + if ( $skip && self::is_ras_ready_to_configure() && self::is_ras_campaign_configured( true ) && ! self::is_enabled() ) { + self::update_setting( 'enabled', true ); + } + + return $updated; } /** * Get the status of the prerequisites for enabling reader activation. - * TODO: Finalize the list of prerequisites and all copy. - * TODO: Establish schema for input fields to be shown in expandable cards. * * @return array Array of prerequisites to complete. */ @@ -734,6 +827,8 @@ public static function get_prerequisites_status() { 'description' => __( 'URL to the page containing the privacy policy or terms of service.', 'newspack-plugin' ), ], ], + 'skippable' => true, + 'is_skipped' => self::is_skipped( 'terms_conditions' ), ], 'esp' => [ 'active' => self::is_esp_configured(), @@ -768,13 +863,15 @@ public static function get_prerequisites_status() { ], ], 'recaptcha' => [ - 'active' => method_exists( '\Newspack\Recaptcha', 'can_use_captcha' ) && \Newspack\Recaptcha::can_use_captcha(), + 'active' => self::is_recaptcha_enabled(), 'label' => __( 'reCAPTCHA', 'newspack-plugin' ), 'description' => __( 'Connecting to a Google reCAPTCHA account enables enhanced anti-spam for all Newspack sign-up blocks.', 'newspack-plugin' ), 'instructions' => __( 'Enable reCAPTCHA and enter your account credentials.', 'newspack-plugin' ), 'help_url' => 'https://help.newspack.com/engagement/audience-management-system/', 'href' => \admin_url( '/admin.php?page=newspack-settings&scrollTo=newspack-settings-recaptcha' ), 'action_text' => __( 'reCAPTCHA settings' ), + 'skippable' => true, + 'is_skipped' => self::is_skipped( 'recaptcha' ), ], 'reader_revenue' => [ 'active' => self::is_reader_revenue_ready(), @@ -788,7 +885,6 @@ public static function get_prerequisites_status() { ], 'ras_campaign' => [ 'active' => self::is_ras_campaign_configured(), - 'is_skipped' => get_option( Audience_Wizard::SKIP_CAMPAIGN_SETUP_OPTION, '' ) === '1', 'plugins' => [ 'newspack-popups' => class_exists( '\Newspack_Popups_Model' ), ], @@ -799,6 +895,8 @@ public static function get_prerequisites_status() { 'action_enabled' => self::is_ras_ready_to_configure(), 'action_text' => __( 'Audience Management campaign', 'newspack-plugin' ), 'disabled_text' => __( 'Waiting for all settings to be ready', 'newspack-plugin' ), + 'skippable' => true, + 'is_skipped' => self::is_skipped( 'ras_campaign' ), ], ]; diff --git a/includes/wizards/audience/class-audience-wizard.php b/includes/wizards/audience/class-audience-wizard.php index b288cdee6e..a54143841c 100644 --- a/includes/wizards/audience/class-audience-wizard.php +++ b/includes/wizards/audience/class-audience-wizard.php @@ -103,7 +103,7 @@ public function enqueue_scripts_and_styles() { $data['preview_archive'] = $newspack_popups->preview_archive(); } - $data['is_skipped_campaign_setup'] = get_option( static::SKIP_CAMPAIGN_SETUP_OPTION, '' ); + $data['is_skipped_campaign_setup'] = Reader_Activation::is_skipped( 'ras_campaign' ); wp_enqueue_script( 'newspack-wizards' ); @@ -185,20 +185,19 @@ public function register_api_endpoints() { ); register_rest_route( NEWSPACK_API_NAMESPACE, - '/wizard/' . $this->slug . '/audience-management/skip-campaign', + '/wizard/' . $this->slug . '/audience-management/skip', [ 'methods' => WP_REST_Server::EDITABLE, - 'callback' => function( $request ) { - $skip = $request->get_param( 'skip' ); - $skip_campaign_setup = update_option( static::SKIP_CAMPAIGN_SETUP_OPTION, $skip ); - return rest_ensure_response( - [ - 'skipped' => $skip, - 'updated' => $skip_campaign_setup, - ] - ); - }, + 'callback' => [ $this, 'api_skip_prerequisite' ], 'permission_callback' => [ $this, 'api_permissions_check' ], + 'args' => [ + 'prerequisite' => [ + 'sanitize_callback' => 'sanitize_text_field', + ], + 'skip' => [ + 'sanitize_callback' => 'Newspack\newspack_string_to_bool', + ], + ], ] ); register_rest_route( @@ -428,6 +427,7 @@ public function api_update_reader_activation_settings( $request ) { [ 'config' => Reader_Activation::get_settings(), 'prerequisites_status' => Reader_Activation::get_prerequisites_status(), + 'memberships' => self::get_memberships_settings(), 'can_esp_sync' => Reader_Activation\ESP_Sync::can_esp_sync( true ), ] ); @@ -492,6 +492,30 @@ public function api_activate_reader_activation( WP_REST_Request $request ) { return rest_ensure_response( $response ); } + /** + * Activate reader activation and publish RAS prompts/segments. + * + * @param WP_REST_Request $request WP Rest Request object. + * @return WP_REST_Response + */ + public function api_skip_prerequisite( WP_REST_Request $request ) { + $preqrequisite = $request->get_param( 'prerequisite' ); + $skip = $request->get_param( 'skip' ); + $skip_campaign_setup = Reader_Activation::skip( $preqrequisite, $skip ); + if ( ! $skip_campaign_setup ) { + return new WP_REST_Response( [ 'message' => __( 'Error skipping prerequisite.', 'newspack-plugin' ) ], 400 ); + } + + return rest_ensure_response( + [ + 'config' => Reader_Activation::get_settings(), + 'prerequisites_status' => Reader_Activation::get_prerequisites_status(), + 'memberships' => self::get_memberships_settings(), + 'can_esp_sync' => Reader_Activation\ESP_Sync::can_esp_sync( true ), + ] + ); + } + /** * Get content gating settings. * diff --git a/src/components/src/action-card/style.scss b/src/components/src/action-card/style.scss index 5f52c50a83..afc7a88385 100644 --- a/src/components/src/action-card/style.scss +++ b/src/components/src/action-card/style.scss @@ -434,6 +434,10 @@ .newspack-action-card__region-children { border-top: 1px solid wp-colors.$gray-100; padding-top: 24px; + + + .newspack-action-card__region-children { + border-top: none; + } } &.is-medium .newspack-action-card__region-children { diff --git a/src/components/src/modal/index.js b/src/components/src/modal/index.js index 514db445a1..028dbb6490 100644 --- a/src/components/src/modal/index.js +++ b/src/components/src/modal/index.js @@ -18,11 +18,12 @@ import './style.scss'; */ import classnames from 'classnames'; -function Modal( { className, isWide, isNarrow, ...otherProps }, ref ) { +function Modal( { className, isWide, isNarrow, hideTitle, ...otherProps }, ref ) { const classes = classnames( 'newspack-modal', isWide && 'newspack-modal--wide', isNarrow && 'newspack-modal--narrow', + hideTitle && 'newspack-modal--hide-title', // Note: also hides the X close button. className ); diff --git a/src/components/src/modal/style.scss b/src/components/src/modal/style.scss index 1e03eb0ec6..01de3604c8 100644 --- a/src/components/src/modal/style.scss +++ b/src/components/src/modal/style.scss @@ -28,6 +28,17 @@ width: 360px; } + &--hide-title { + .components-modal__header { + display: none; + } + + .components-modal__content { + margin-top: 0; + padding-top: 32px; + } + } + @media screen and ( min-width: 960px ) { max-height: calc(100% - 128px); } diff --git a/src/components/src/with-wizard/index.js b/src/components/src/with-wizard/index.js index 35f26c0fed..a10ae77b6d 100644 --- a/src/components/src/with-wizard/index.js +++ b/src/components/src/with-wizard/index.js @@ -28,6 +28,7 @@ export default function withWizard( WrappedComponent, requiredPlugins ) { error: null, loading: requiredPlugins && requiredPlugins.length > 0 ? 1 : 0, quietLoading: false, + confirmation: null, }; this.wrappedComponentRef = createRef(); } @@ -249,6 +250,69 @@ export default function withWizard( WrappedComponent, requiredPlugins ) { ); }; + /** + * Build a confirmation modal with the given title & message. + * Execute {callback} if confirmed. + * + * @property {Object} options Options for the confirmation modal. + * @property {string} options.title The title for the modal component. + * @property {string} options.message The message for the modal component body. + * @property {string} options.confirmText The text for the confirmation button. + * @property {string} options.cancelText The text for the cancel button. + * @property {Function} options.callback A function to call if the user confirms the action. + */ + confirmAction = ( options ) => { + const modalOptions = { + title: null, + message: __( 'Are you sure?', 'newpack-plugin' ), + confirmText: __( 'OK', 'newspack-plugin' ), + cancelText: __( 'Cancel', 'newspack-plugin' ), + callback: null, + ...options, + } + this.setState( { confirmation: modalOptions } ); + } + + /** + * Show a confirmation modal with the given title & message. + * Execute {callback} if confirmed. + * + * @return {Component} + */ + getModal = () => { + if ( ! this.state.confirmation ) { + return null; + } + const { title, message, confirmText, cancelText, callback } = this.state.confirmation; + return message && callback && ( + this.setState( { confirmation: null } ) } + > +

{ message }

+ + + + +
+ ); + } + getFallbackURL = () => { if ( typeof newspack_urls !== 'undefined' ) { return newspack_urls.dashboard; @@ -270,8 +334,10 @@ export default function withWizard( WrappedComponent, requiredPlugins ) { return ( { this.getError() } + { this.getModal() }
{ @@ -55,150 +58,167 @@ export default function Prerequisite( {

) } { - // Form fields. - prerequisite.fields && ( + ( prerequisite.fields || prerequisite.action_text ) && ( -
- { fieldKeys.map( fieldName => { - if ( - ! prerequisite.fields || - ! prerequisite.fields[ fieldName ] - ) { - return undefined; - } - return ( - + { + // Form fields. + prerequisite.fields && ( + <> + { fieldKeys.map( fieldName => { + if ( + ! prerequisite.fields || + ! prerequisite.fields[ fieldName ] + ) { + return undefined; } - help={ - prerequisite.fields[ fieldName ] - .description - } - { ...getSharedProps( - fieldName, - 'text' - ) } - /> - ); - } ) } + return ( + + ); + } ) } - + + ) + } + { + // Link to another settings page or update config in place. + href && prerequisite.action_text && ( + <> + { ( ! prerequisite.hasOwnProperty( + 'action_enabled' + ) || + prerequisite.action_enabled ) && ( + -
-
- ) - } - { - // Link to another settings page or update config in place. - href && prerequisite.action_text && ( - -
- { ( ! prerequisite.hasOwnProperty( - 'action_enabled' - ) || - prerequisite.action_enabled ) && ( + ) ) + prerequisite.action_text } + + ) } + { prerequisite.hasOwnProperty( 'action_enabled' ) && + ! prerequisite.action_enabled && ( + + ) } + + ) + } + + { prerequisite.skippable && ! prerequisite.active && ! isSkipped && ( - ) } - { prerequisite.hasOwnProperty( 'action_enabled' ) && - ! prerequisite.action_enabled && ( - - ) } -
-
- ) - } + ) } +
+ + ) } ); let status = __( 'Pending', 'newspack-plugin' ); if ( isValid ) { - status = `${ __( 'Ready', 'newspack-plugin' ) } ${ - prerequisite.is_skipped - ? `(${ __( 'Skipped', 'newspack-plugin' ) })` - : '' - }`; + status = __( 'Ready', 'newspack-plugin' ); + } + if ( isSkipped && ! prerequisite.active ) { + status = __( 'Skipped', 'newspack-plugin' ); } if ( prerequisite.is_unavailable ) { status = __( 'Unavailable', 'newspack-plugin' ); @@ -216,7 +236,7 @@ export default function Prerequisite( { __( 'Status: %s', 'newspack-plugin' ), status ) } - checkbox={ isValid ? 'checked' : 'unchecked' } + checkbox={ isValid && ! isSkipped ? 'checked' : 'unchecked' } notificationLevel="info" notification={ hasEmptyFields() } > diff --git a/src/wizards/audience/types/index.d.ts b/src/wizards/audience/types/index.d.ts index 0e2fa50cca..43c3db8d40 100644 --- a/src/wizards/audience/types/index.d.ts +++ b/src/wizards/audience/types/index.d.ts @@ -73,6 +73,7 @@ type ConfigKey = keyof Config; // Props for the Prequisite component. type PrequisiteProps = { config: Config; + slug: string; getSharedProps: ( configKey: string, type: string @@ -84,6 +85,12 @@ type PrequisiteProps = { }; inFlight: boolean; saveConfig: ( config: Config ) => void; + skipPrerequisite: ( + data: { + prerequisite: string; + skip: boolean; + } + ) => void; // Schema for prequisite object is defined in PHP class Reader_Activation::get_prerequisites_status(). prerequisite: { @@ -108,6 +115,7 @@ type PrequisiteProps = { disabled_text?: string; is_unavailable?: boolean; is_skipped?: boolean; + skippable?: boolean; }; }; diff --git a/src/wizards/audience/views/setup/campaign.js b/src/wizards/audience/views/setup/campaign.js index 2ba9952624..ab8a7556e8 100644 --- a/src/wizards/audience/views/setup/campaign.js +++ b/src/wizards/audience/views/setup/campaign.js @@ -16,7 +16,6 @@ import { Notice, Waiting, withWizardScreen, - utils, } from '../../../../components/src'; import Prompt from '../../components/prompt'; import Router from '../../../../components/src/proxied-imports/router'; @@ -24,18 +23,11 @@ import './style.scss'; const { useHistory } = Router; -export default withWizardScreen( () => { - const { is_skipped_campaign_setup, reader_activation_url } = - newspackAudience; - +const AudienceCampaign = withWizardScreen( ( { error, setError, skipPrerequisite } ) => { + const { reader_activation_url } = newspackAudience; const [ inFlight, setInFlight ] = useState( false ); - const [ error, setError ] = useState( false ); const [ prompts, setPrompts ] = useState( null ); const [ allReady, setAllReady ] = useState( false ); - const [ skipped, setSkipped ] = useState( { - status: '', - isSkipped: is_skipped_campaign_setup === '1', - } ); const history = useHistory(); const fetchPrompts = () => { @@ -51,48 +43,6 @@ export default withWizardScreen( () => { .finally( () => setInFlight( false ) ); }; - /** - * Display prompt requiring editors to confirm skipping, on confirmation send request to - * server to store skipped option in options table and redirect back to RAS - * - * @return {void} - */ - async function onSkipCampaignSetup() { - if ( - ! utils.confirmAction( - __( - 'Are you sure you want to skip setting up an Audience Management campaign?', - 'newspack-plugin' - ) - ) - ) { - return; - } - setError( false ); - setSkipped( { ...skipped, status: 'pending' } ); - try { - const request = await apiFetch( { - path: '/newspack/v1/wizard/newspack-audience/audience-management/skip-campaign', - method: 'POST', - data: { skip: ! skipped.isSkipped }, - } ); - if ( ! request.updated ) { - setError( { - message: __( 'Server not updated', 'newspack-plugin' ), - } ); - setSkipped( { isSkipped: false, status: '' } ); - return; - } - setSkipped( { isSkipped: Boolean( request.skipped ), status: '' } ); - newspackAudience.is_skipped_campaign_setup = - request.skipped ? '1' : ''; - history.push( '/complete' ); - } catch ( err ) { - setError( err ); - setSkipped( { isSkipped: false, status: '' } ); - } - } - useEffect( () => { window.scrollTo( 0, 0 ); fetchPrompts(); @@ -142,26 +92,24 @@ export default withWizardScreen( () => { ) ) }
diff --git a/src/wizards/audience/views/setup/index.js b/src/wizards/audience/views/setup/index.js index 44a7dd23a1..09e6694a09 100644 --- a/src/wizards/audience/views/setup/index.js +++ b/src/wizards/audience/views/setup/index.js @@ -23,7 +23,7 @@ import Payment from './payment'; const { HashRouter, Redirect, Route, Switch } = Router; -function AudienceWizard( { pluginRequirements, wizardApiFetch } ) { +function AudienceWizard( { confirmAction, pluginRequirements, wizardApiFetch } ) { const [ inFlight, setInFlight ] = useState( false ); const [ config, setConfig ] = useState( {} ); const [ prerequisites, setPrerequisites ] = useState( null ); @@ -64,6 +64,37 @@ function AudienceWizard( { pluginRequirements, wizardApiFetch } ) { .catch( setError ) .finally( () => setInFlight( false ) ); }; + const skipPrerequisite = ( data, callback = null ) => { + confirmAction( + { + message: __( + 'Are you sure you want to skip this step? You can always come back later.', + 'newspack-plugin' + ), + confirmText: __( 'Skip', 'newspack-plugin' ), + callback: () => { + setError( false ); + setInFlight( true ); + wizardApiFetch( { + path: '/newspack/v1/wizard/newspack-audience/audience-management/skip', + method: 'post', + quiet: true, + data, + } ) + .then( ( { config: fetchedConfig, prerequisites_status, can_esp_sync } ) => { + setPrerequisites( prerequisites_status ); + setConfig( fetchedConfig ); + setEspSyncErrors( can_esp_sync.errors ); + if ( callback ) { + callback(); + } + } ) + .catch( setError ) + .finally( () => setInFlight( false ) ); + }, + } + ); + }; useEffect( () => { window.scrollTo( 0, 0 ); @@ -127,6 +158,7 @@ function AudienceWizard( { pluginRequirements, wizardApiFetch } ) { fetchConfig, updateConfig, saveConfig, + skipPrerequisite, setInFlight, setError, getSharedProps, diff --git a/src/wizards/audience/views/setup/setup.js b/src/wizards/audience/views/setup/setup.js index 37471addcc..8371ad7e2f 100644 --- a/src/wizards/audience/views/setup/setup.js +++ b/src/wizards/audience/views/setup/setup.js @@ -30,7 +30,21 @@ import { HANDOFF_KEY } from '../../../../components/src/consts'; import SortableNewsletterListControl from '../../../../components/src/sortable-newsletter-list-control'; import Salesforce from '../../components/salesforce'; -export default withWizardScreen( ( { config, fetchConfig, updateConfig, getSharedProps, saveConfig, prerequisites, espSyncErrors, error, inFlight } ) => { +export default withWizardScreen( + ( + { + config, + fetchConfig, + updateConfig, + getSharedProps, + saveConfig, + skipPrerequisite, + prerequisites, + espSyncErrors, + error, + inFlight + } + ) => { const [ allReady, setAllReady ] = useState( false ); const [ isActiveCampaign, setIsActiveCampaign ] = useState( false ); const [ isMailchimp, setIsMailchimp ] = useState( false ); @@ -60,7 +74,7 @@ export default withWizardScreen( ( { config, fetchConfig, updateConfig, getShare ! missingPlugins.length && prerequisites && Object.keys( prerequisites ).every( - key => prerequisites[ key ]?.active || prerequisites[ key ]?.skipped + key => prerequisites[ key ]?.active || prerequisites[ key ]?.is_skipped ); setAllReady( _allReady ); @@ -155,12 +169,14 @@ export default withWizardScreen( ( { config, fetchConfig, updateConfig, getShare Object.keys( prerequisites ).map( key => ( ) ) } { config.enabled && ( diff --git a/src/wizards/audience/views/setup/style.scss b/src/wizards/audience/views/setup/style.scss index ac8694b6bf..f5602972a5 100644 --- a/src/wizards/audience/views/setup/style.scss +++ b/src/wizards/audience/views/setup/style.scss @@ -111,5 +111,8 @@ span.is-skipped { .newspack-action-card__notification.newspack-action-card__region-children .newspack-notice { margin-top: 0; } + .button-group button { + margin-right: 8px; + } } } diff --git a/src/wizards/newspack/views/settings/connections/index.tsx b/src/wizards/newspack/views/settings/connections/index.tsx index 98302f0b48..8d5ab07f08 100644 --- a/src/wizards/newspack/views/settings/connections/index.tsx +++ b/src/wizards/newspack/views/settings/connections/index.tsx @@ -51,7 +51,7 @@ function Connections() { { /* reCAPTCHA */ }