diff --git a/changelog/update-9704-remove-payouts-rename-overlay b/changelog/update-9704-remove-payouts-rename-overlay new file mode 100644 index 00000000000..d6eacc2ada1 --- /dev/null +++ b/changelog/update-9704-remove-payouts-rename-overlay @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +Remove the overlay that announces the rename from deposits to payouts. diff --git a/client/deposits/details/index.tsx b/client/deposits/details/index.tsx index 4e15a8653a8..795135f16cc 100644 --- a/client/deposits/details/index.tsx +++ b/client/deposits/details/index.tsx @@ -38,7 +38,6 @@ import { } from 'multi-currency/interface/functions'; import { depositStatusLabels } from '../strings'; import './style.scss'; -import { PayoutsRenameNotice } from '../rename-notice'; import { formatDateTimeFromString } from 'wcpay/utils/date-time'; import DateFormatNotice from 'wcpay/components/date-format-notice'; @@ -243,7 +242,6 @@ export const DepositDetails: React.FC< DepositDetailsProps > = ( { return ( - diff --git a/client/deposits/index.tsx b/client/deposits/index.tsx index 229acdbbb09..d500a05a6a5 100644 --- a/client/deposits/index.tsx +++ b/client/deposits/index.tsx @@ -17,7 +17,6 @@ import { __ } from '@wordpress/i18n'; import { TestModeNotice } from 'components/test-mode-notice'; import BannerNotice from 'components/banner-notice'; import DepositSchedule from 'components/deposits-overview/deposit-schedule'; -import { PayoutsRenameNotice } from './rename-notice'; import { useAllDepositsOverviews } from 'data'; import { useSettings } from 'wcpay/data'; import DepositsList from './list'; @@ -152,7 +151,6 @@ const DepositsPage: React.FC = () => { - diff --git a/client/deposits/rename-notice/header-image.svg b/client/deposits/rename-notice/header-image.svg deleted file mode 100644 index 8a96d1df244..00000000000 --- a/client/deposits/rename-notice/header-image.svg +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/client/deposits/rename-notice/index.tsx b/client/deposits/rename-notice/index.tsx deleted file mode 100644 index 61ff61b142e..00000000000 --- a/client/deposits/rename-notice/index.tsx +++ /dev/null @@ -1,88 +0,0 @@ -/** - * External dependencies - */ -import { __ } from '@wordpress/i18n'; -import React, { useState, useEffect } from 'react'; -import { TourKit } from '@woocommerce/components'; -import { useDispatch } from '@wordpress/data'; -import { createInterpolateElement } from '@wordpress/element'; - -/** - * Internal dependencies - */ -import './style.scss'; - -export const PayoutsRenameNotice = () => { - const isPayoutsRenameNoticeDismissed = - wcpaySettings.isPayoutsRenameNoticeDismissed; - const { updateOptions } = useDispatch( 'wc/admin/options' ); - const [ showTour, setShowTour ] = useState( false ); - - const onClose = () => { - updateOptions( { - wcpay_payouts_rename_notice_dismissed: true, - } ); - setShowTour( false ); - wcpaySettings.isPayoutsRenameNoticeDismissed = true; - }; - - useEffect( () => { - if ( ! isPayoutsRenameNoticeDismissed ) { - setShowTour( true ); - } - }, [ isPayoutsRenameNoticeDismissed ] ); - - if ( ! showTour ) return null; - - return ( - Learn More.", - 'woocommerce-payments' - ), - { - link: ( - // eslint-disable-next-line jsx-a11y/anchor-has-content - - ), - } - ), - }, - }, - }, - ], - closeHandler: onClose, - } } - > - ); -}; diff --git a/client/deposits/rename-notice/style.scss b/client/deposits/rename-notice/style.scss deleted file mode 100644 index 3a2c51b7334..00000000000 --- a/client/deposits/rename-notice/style.scss +++ /dev/null @@ -1,77 +0,0 @@ -.wc-admin-payments-overview-payouts-rename-tour { - color: #1e1e1e; - - .woocommerce-tour-kit-step { - border-radius: 8px; - border: 1px solid #dcdcdc; - - /* Shadow / Popover */ - box-shadow: 0 2px 6px 0 rgba( 0, 0, 0, 0.05 ); - width: 257px; - padding-bottom: 0; - } - - .components-card__footer { - display: none; - } - - .tour-kit-frame__container { - box-shadow: none; - background: none; - } - - .components-elevation { - display: none; - } - - .woocommerce-tour-kit-step__body { - background-image: url( './header-image.svg' ); - background-repeat: no-repeat; - background-position-x: center; - background-position-y: 5px; - padding-bottom: 24px; - } - .woocommerce-tour-kit-step-navigation { - display: none; - } - h2 { - padding-top: 100px; - font-size: 14px; - line-height: 24px; - } - p.woocommerce-tour-kit-step__description { - font-size: 13px; - line-height: 18px; - margin-top: 8px; - } - .tour-kit-frame__arrow::before { - box-shadow: none !important; - } - - .tour-kit-frame__container[data-popper-placement^='bottom'] { - & > .tour-kit-frame__arrow { - background: #fff; - &::before { - border-top: 1px solid var( --gutenberg-gray-300, #ddd ); - border-left: 1px solid var( --gutenberg-gray-300, #ddd ); - } - } - } - - .tour-kit-frame__container[data-popper-placement^='right'] { - & > .tour-kit-frame__arrow { - background: #fff; - &::before { - border-bottom: 1px solid var( --gutenberg-gray-300, #ddd ); - border-left: 1px solid var( --gutenberg-gray-300, #ddd ); - } - } - } - - a { - display: block; - text-decoration: none; - margin-top: 12px; - padding-block: 11px; - } -} diff --git a/client/deposits/rename-notice/test/__snapshots__/index.tsx.snap b/client/deposits/rename-notice/test/__snapshots__/index.tsx.snap deleted file mode 100644 index 8d2131ec55c..00000000000 --- a/client/deposits/rename-notice/test/__snapshots__/index.tsx.snap +++ /dev/null @@ -1,9 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`PayoutsRenameNotice should render notice if isPayoutsRenameNoticeDismissed is false 1`] = ` -
-
- Tour Component -
-
-`; diff --git a/client/deposits/rename-notice/test/index.tsx b/client/deposits/rename-notice/test/index.tsx deleted file mode 100644 index 9f9f2d0c7a8..00000000000 --- a/client/deposits/rename-notice/test/index.tsx +++ /dev/null @@ -1,49 +0,0 @@ -/** @format */ -/** - * External dependencies - */ -import React from 'react'; -import { render } from '@testing-library/react'; - -/** - * Internal dependencies - */ -import { PayoutsRenameNotice } from '..'; - -jest.mock( '@wordpress/api-fetch', () => jest.fn() ); - -jest.mock( '@wordpress/data', () => ( { - useDispatch: jest.fn().mockReturnValue( { updateOptions: jest.fn() } ), -} ) ); - -jest.mock( '@woocommerce/components', () => ( { - TourKit: () =>
Tour Component
, -} ) ); - -declare const global: { - wcpaySettings: { - isPayoutsRenameNoticeDismissed: boolean; - }; -}; - -describe( 'PayoutsRenameNotice', () => { - afterEach( () => { - jest.clearAllMocks(); - } ); - - test( 'should render null if isPayoutsRenameNoticeDismissed is true', () => { - global.wcpaySettings = { - isPayoutsRenameNoticeDismissed: true, - }; - const { container } = render( ); - expect( container.firstChild ).toBeNull(); - } ); - - test( 'should render notice if isPayoutsRenameNoticeDismissed is false', () => { - global.wcpaySettings = { - isPayoutsRenameNoticeDismissed: false, - }; - const { container } = render( ); - expect( container ).toMatchSnapshot(); - } ); -} ); diff --git a/client/globals.d.ts b/client/globals.d.ts index 8b91ee4b05f..482b6a436d7 100644 --- a/client/globals.d.ts +++ b/client/globals.d.ts @@ -89,7 +89,6 @@ declare global { fraudProtection: { isWelcomeTourDismissed?: boolean; }; - isPayoutsRenameNoticeDismissed: boolean; progressiveOnboarding?: { isEnabled: boolean; isComplete: boolean; diff --git a/client/overview/index.js b/client/overview/index.js index 5d6d06a52c2..4bce8041b07 100644 --- a/client/overview/index.js +++ b/client/overview/index.js @@ -32,7 +32,6 @@ import { useDisputes, useGetSettings, useSettings } from 'data'; import SandboxModeSwitchToLiveNotice from 'wcpay/components/sandbox-mode-switch-to-live-notice'; import './style.scss'; import BannerNotice from 'wcpay/components/banner-notice'; -import { PayoutsRenameNotice } from 'wcpay/deposits/rename-notice'; import DateFormatNotice from 'wcpay/components/date-format-notice'; const OverviewPageError = () => { @@ -197,7 +196,6 @@ const OverviewPage = () => { { showConnectionSuccess && } { ! accountRejected && ! accountUnderReview && ( - { showTaskList && ( diff --git a/client/overview/test/index.js b/client/overview/test/index.js index b0abd762054..f9fe1181b2f 100644 --- a/client/overview/test/index.js +++ b/client/overview/test/index.js @@ -352,24 +352,4 @@ describe( 'Overview page', () => { expect( query() ).not.toBeInTheDocument(); } ); - - it( 'shows payout rename notice if not yet dismissed', () => { - global.wcpaySettings.isPayoutsRenameNoticeDismissed = false; - - render( ); - - expect( - screen.queryByText( 'Deposits are now known as Payouts!' ) - ).toBeInTheDocument(); - } ); - - it( 'does not display payout rename notice if already dismissed', () => { - global.wcpaySettings.isPayoutsRenameNoticeDismissed = true; - - render( ); - - expect( - screen.queryByText( 'Deposits are now known as Payouts!' ) - ).not.toBeInTheDocument(); - } ); } ); diff --git a/includes/admin/class-wc-payments-admin.php b/includes/admin/class-wc-payments-admin.php index 392dec5c611..92010e4c302 100644 --- a/includes/admin/class-wc-payments-admin.php +++ b/includes/admin/class-wc-payments-admin.php @@ -959,7 +959,6 @@ private function get_js_settings(): array { 'fraudProtection' => [ 'isWelcomeTourDismissed' => WC_Payments_Features::is_fraud_protection_welcome_tour_dismissed(), ], - 'isPayoutsRenameNoticeDismissed' => WC_Payments_Features::is_payouts_rename_notice_dismissed(), 'enabledPaymentMethods' => $this->get_enabled_payment_method_ids(), 'progressiveOnboarding' => $this->account->get_progressive_onboarding_details(), 'accountDefaultCurrency' => $this->account->get_account_default_currency(), diff --git a/includes/class-wc-payments-features.php b/includes/class-wc-payments-features.php index fa1748f5311..6eefb80fb9b 100644 --- a/includes/class-wc-payments-features.php +++ b/includes/class-wc-payments-features.php @@ -298,15 +298,6 @@ public static function is_fraud_protection_welcome_tour_dismissed(): bool { return '1' === get_option( 'wcpay_fraud_protection_welcome_tour_dismissed', '0' ); } - /** - * Checks whether the Payouts Rename Spotlight notice was dismissed. - * - * @return bool - */ - public static function is_payouts_rename_notice_dismissed(): bool { - return '1' === get_option( 'wcpay_payouts_rename_notice_dismissed', '0' ); - } - /** * Checks whether the Stripe Billing feature is enabled. * diff --git a/includes/class-wc-payments.php b/includes/class-wc-payments.php index 7b4ae0750c2..a10e44d3fdf 100644 --- a/includes/class-wc-payments.php +++ b/includes/class-wc-payments.php @@ -1923,7 +1923,6 @@ public static function add_wcpay_options_to_woocommerce_permissions_list( $permi 'woocommerce_remind_me_later_todo_tasks', 'woocommerce_deleted_todo_tasks', 'wcpay_fraud_protection_welcome_tour_dismissed', - 'wcpay_payouts_rename_notice_dismissed', 'wcpay_capability_request_dismissed_notices', 'wcpay_onboarding_eligibility_modal_dismissed', 'wcpay_next_deposit_notice_dismissed',