From edf839c34cf586680978f496ba5347d790a9b90a Mon Sep 17 00:00:00 2001 From: Jessy Date: Wed, 6 Nov 2024 11:06:57 +0530 Subject: [PATCH 01/10] Draft payouts rename notice, with placeholder text and image. --- client/deposits/index.tsx | 2 + .../deposits/rename-notice/header-image.svg | 30 +++++++ client/deposits/rename-notice/index.tsx | 86 +++++++++++++++++++ client/deposits/rename-notice/style.scss | 67 +++++++++++++++ client/globals.d.ts | 1 + includes/admin/class-wc-payments-admin.php | 1 + includes/class-wc-payments-features.php | 9 ++ includes/class-wc-payments.php | 1 + 8 files changed, 197 insertions(+) create mode 100644 client/deposits/rename-notice/header-image.svg create mode 100644 client/deposits/rename-notice/index.tsx create mode 100644 client/deposits/rename-notice/style.scss diff --git a/client/deposits/index.tsx b/client/deposits/index.tsx index 60e18ec86b8..d799ff3d385 100644 --- a/client/deposits/index.tsx +++ b/client/deposits/index.tsx @@ -17,6 +17,7 @@ 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'; @@ -149,6 +150,7 @@ const DepositsPage: React.FC = () => { return ( + diff --git a/client/deposits/rename-notice/header-image.svg b/client/deposits/rename-notice/header-image.svg new file mode 100644 index 00000000000..563468de2b4 --- /dev/null +++ b/client/deposits/rename-notice/header-image.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/deposits/rename-notice/index.tsx b/client/deposits/rename-notice/index.tsx new file mode 100644 index 00000000000..9a9bf738a40 --- /dev/null +++ b/client/deposits/rename-notice/index.tsx @@ -0,0 +1,86 @@ +/** + * 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( true ); + + const onClose = () => { + updateOptions( { + wcpay_payouts_rename_notice_dismissed: true, + } ); + setShowTour( false ); + wcpaySettings.isPayoutsRenameNoticeDismissed = true; + }; + + useEffect( () => { + setShowTour( ! isPayoutsRenameNoticeDismissed ); + }, [ isPayoutsRenameNoticeDismissed ] ); + + if ( ! showTour ) return null; + + return ( + Learn More.", + 'woocommerce' + ), + { + 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 new file mode 100644 index 00000000000..319a4b607b8 --- /dev/null +++ b/client/deposits/rename-notice/style.scss @@ -0,0 +1,67 @@ +.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 ); + } + } + } + + a { + display: block; + text-decoration: none; + margin-top: 12px; + padding-block: 11px; + } +} diff --git a/client/globals.d.ts b/client/globals.d.ts index 1d208d50f74..0d10d7de86b 100644 --- a/client/globals.d.ts +++ b/client/globals.d.ts @@ -89,6 +89,7 @@ declare global { fraudProtection: { isWelcomeTourDismissed?: boolean; }; + isPayoutsRenameNoticeDismissed: boolean; progressiveOnboarding?: { isEnabled: boolean; isComplete: boolean; diff --git a/includes/admin/class-wc-payments-admin.php b/includes/admin/class-wc-payments-admin.php index 2f66134e68f..1afa2f08a9f 100644 --- a/includes/admin/class-wc-payments-admin.php +++ b/includes/admin/class-wc-payments-admin.php @@ -958,6 +958,7 @@ 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 161cd8e3935..e80cf6675f1 100644 --- a/includes/class-wc-payments-features.php +++ b/includes/class-wc-payments-features.php @@ -299,6 +299,15 @@ 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 a3e61337d3f..0eebb00b84f 100644 --- a/includes/class-wc-payments.php +++ b/includes/class-wc-payments.php @@ -1919,6 +1919,7 @@ 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', From 7ad20ac9cd0de28cd6c7c6dc637c2a00792707aa Mon Sep 17 00:00:00 2001 From: Jessy Date: Wed, 6 Nov 2024 11:11:44 +0530 Subject: [PATCH 02/10] added changelog --- changelog/add-9673-payouts-rename-notice | 5 + composer.lock | 242 +++++++++++------------ 2 files changed, 126 insertions(+), 121 deletions(-) create mode 100644 changelog/add-9673-payouts-rename-notice diff --git a/changelog/add-9673-payouts-rename-notice b/changelog/add-9673-payouts-rename-notice new file mode 100644 index 00000000000..31a258dee71 --- /dev/null +++ b/changelog/add-9673-payouts-rename-notice @@ -0,0 +1,5 @@ +Significance: patch +Type: add +Comment: Added notice to indicate the rename of Deposits to Payouts. User facing changelog will be added as part of feature branch + + diff --git a/composer.lock b/composer.lock index 2128df15f90..bc02d67bfbf 100644 --- a/composer.lock +++ b/composer.lock @@ -8,23 +8,23 @@ "packages": [ { "name": "automattic/jetpack-a8c-mc-stats", - "version": "v2.0.2", + "version": "v2.0.4", "source": { "type": "git", "url": "https://github.com/Automattic/jetpack-a8c-mc-stats.git", - "reference": "5753860f28e1a8629b3c6ab481c1ab75e38a244f" + "reference": "d1d726e4962d4bf6f9c51d01e63d613c3a9dd0bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-a8c-mc-stats/zipball/5753860f28e1a8629b3c6ab481c1ab75e38a244f", - "reference": "5753860f28e1a8629b3c6ab481c1ab75e38a244f", + "url": "https://api.github.com/repos/Automattic/jetpack-a8c-mc-stats/zipball/d1d726e4962d4bf6f9c51d01e63d613c3a9dd0bb", + "reference": "d1d726e4962d4bf6f9c51d01e63d613c3a9dd0bb", "shasum": "" }, "require": { "php": ">=7.0" }, "require-dev": { - "automattic/jetpack-changelogger": "^4.2.6", + "automattic/jetpack-changelogger": "^4.2.8", "yoast/phpunit-polyfills": "^1.1.1" }, "suggest": { @@ -52,30 +52,30 @@ ], "description": "Used to record internal usage stats for Automattic. Not visible to site owners.", "support": { - "source": "https://github.com/Automattic/jetpack-a8c-mc-stats/tree/v2.0.2" + "source": "https://github.com/Automattic/jetpack-a8c-mc-stats/tree/v2.0.4" }, - "time": "2024-08-23T14:28:10+00:00" + "time": "2024-11-04T09:23:35+00:00" }, { "name": "automattic/jetpack-admin-ui", - "version": "v0.4.5", + "version": "v0.4.6", "source": { "type": "git", "url": "https://github.com/Automattic/jetpack-admin-ui.git", - "reference": "7d5b8485ebe5984774375468ae52efe5c2849369" + "reference": "a7bef1b075e35e431c0112f97763df9c6196ae39" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-admin-ui/zipball/7d5b8485ebe5984774375468ae52efe5c2849369", - "reference": "7d5b8485ebe5984774375468ae52efe5c2849369", + "url": "https://api.github.com/repos/Automattic/jetpack-admin-ui/zipball/a7bef1b075e35e431c0112f97763df9c6196ae39", + "reference": "a7bef1b075e35e431c0112f97763df9c6196ae39", "shasum": "" }, "require": { "php": ">=7.0" }, "require-dev": { - "automattic/jetpack-changelogger": "^4.2.6", - "automattic/jetpack-logo": "^2.0.4", + "automattic/jetpack-changelogger": "^4.2.8", + "automattic/jetpack-logo": "^2.0.5", "automattic/wordbless": "dev-master", "yoast/phpunit-polyfills": "^1.1.1" }, @@ -108,30 +108,30 @@ ], "description": "Generic Jetpack wp-admin UI elements", "support": { - "source": "https://github.com/Automattic/jetpack-admin-ui/tree/v0.4.5" + "source": "https://github.com/Automattic/jetpack-admin-ui/tree/v0.4.6" }, - "time": "2024-09-05T12:38:36+00:00" + "time": "2024-11-04T09:23:52+00:00" }, { "name": "automattic/jetpack-assets", - "version": "v2.3.8", + "version": "v2.3.13", "source": { "type": "git", "url": "https://github.com/Automattic/jetpack-assets.git", - "reference": "3ddaff78c82ed7663b61961356585061dbb3410a" + "reference": "c520bffce576c823d7cbc851198201a820b7f981" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-assets/zipball/3ddaff78c82ed7663b61961356585061dbb3410a", - "reference": "3ddaff78c82ed7663b61961356585061dbb3410a", + "url": "https://api.github.com/repos/Automattic/jetpack-assets/zipball/c520bffce576c823d7cbc851198201a820b7f981", + "reference": "c520bffce576c823d7cbc851198201a820b7f981", "shasum": "" }, "require": { - "automattic/jetpack-constants": "^2.0.4", + "automattic/jetpack-constants": "^2.0.5", "php": ">=7.0" }, "require-dev": { - "automattic/jetpack-changelogger": "^4.2.6", + "automattic/jetpack-changelogger": "^4.2.8", "brain/monkey": "2.6.1", "wikimedia/testing-access-wrapper": "^1.0 || ^2.0 || ^3.0", "yoast/phpunit-polyfills": "^1.1.1" @@ -165,9 +165,9 @@ ], "description": "Asset management utilities for Jetpack ecosystem packages", "support": { - "source": "https://github.com/Automattic/jetpack-assets/tree/v2.3.8" + "source": "https://github.com/Automattic/jetpack-assets/tree/v2.3.13" }, - "time": "2024-09-10T11:21:54+00:00" + "time": "2024-11-04T09:24:17+00:00" }, { "name": "automattic/jetpack-autoloader", @@ -387,23 +387,23 @@ }, { "name": "automattic/jetpack-constants", - "version": "v2.0.4", + "version": "v2.0.5", "source": { "type": "git", "url": "https://github.com/Automattic/jetpack-constants.git", - "reference": "f6958c313a34c5e92171c45a57d9dc978e5975ed" + "reference": "0c2644d642b06ae2a31c561f5bfc6f74a4abc8f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-constants/zipball/f6958c313a34c5e92171c45a57d9dc978e5975ed", - "reference": "f6958c313a34c5e92171c45a57d9dc978e5975ed", + "url": "https://api.github.com/repos/Automattic/jetpack-constants/zipball/0c2644d642b06ae2a31c561f5bfc6f74a4abc8f1", + "reference": "0c2644d642b06ae2a31c561f5bfc6f74a4abc8f1", "shasum": "" }, "require": { "php": ">=7.0" }, "require-dev": { - "automattic/jetpack-changelogger": "^4.2.6", + "automattic/jetpack-changelogger": "^4.2.8", "brain/monkey": "2.6.1", "yoast/phpunit-polyfills": "^1.1.1" }, @@ -432,9 +432,9 @@ ], "description": "A wrapper for defining constants in a more testable way.", "support": { - "source": "https://github.com/Automattic/jetpack-constants/tree/v2.0.4" + "source": "https://github.com/Automattic/jetpack-constants/tree/v2.0.5" }, - "time": "2024-08-23T14:28:14+00:00" + "time": "2024-11-04T09:23:35+00:00" }, { "name": "automattic/jetpack-ip", @@ -493,23 +493,23 @@ }, { "name": "automattic/jetpack-password-checker", - "version": "v0.3.2", + "version": "v0.3.3", "source": { "type": "git", "url": "https://github.com/Automattic/jetpack-password-checker.git", - "reference": "bdf70591123932112e447e295d7f174b5c0e3a44" + "reference": "1812a38452575e7c8c7c06affeeca776a367225f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-password-checker/zipball/bdf70591123932112e447e295d7f174b5c0e3a44", - "reference": "bdf70591123932112e447e295d7f174b5c0e3a44", + "url": "https://api.github.com/repos/Automattic/jetpack-password-checker/zipball/1812a38452575e7c8c7c06affeeca776a367225f", + "reference": "1812a38452575e7c8c7c06affeeca776a367225f", "shasum": "" }, "require": { "php": ">=7.0" }, "require-dev": { - "automattic/jetpack-changelogger": "^4.2.6", + "automattic/jetpack-changelogger": "^4.2.8", "automattic/wordbless": "@dev", "yoast/phpunit-polyfills": "^1.1.1" }, @@ -539,9 +539,9 @@ ], "description": "Password Checker.", "support": { - "source": "https://github.com/Automattic/jetpack-password-checker/tree/v0.3.2" + "source": "https://github.com/Automattic/jetpack-password-checker/tree/v0.3.3" }, - "time": "2024-08-23T14:28:17+00:00" + "time": "2024-11-04T09:23:39+00:00" }, { "name": "automattic/jetpack-redirect", @@ -597,23 +597,23 @@ }, { "name": "automattic/jetpack-roles", - "version": "v2.0.3", + "version": "v2.0.4", "source": { "type": "git", "url": "https://github.com/Automattic/jetpack-roles.git", - "reference": "32e45299a6ff93de0b1f4c71e6669f15917220fb" + "reference": "2fa5361ce8ff271cc4ecfac5be9b957ab0e9912f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-roles/zipball/32e45299a6ff93de0b1f4c71e6669f15917220fb", - "reference": "32e45299a6ff93de0b1f4c71e6669f15917220fb", + "url": "https://api.github.com/repos/Automattic/jetpack-roles/zipball/2fa5361ce8ff271cc4ecfac5be9b957ab0e9912f", + "reference": "2fa5361ce8ff271cc4ecfac5be9b957ab0e9912f", "shasum": "" }, "require": { "php": ">=7.0" }, "require-dev": { - "automattic/jetpack-changelogger": "^4.2.6", + "automattic/jetpack-changelogger": "^4.2.8", "brain/monkey": "2.6.1", "yoast/phpunit-polyfills": "^1.1.1" }, @@ -642,9 +642,9 @@ ], "description": "Utilities, related with user roles and capabilities.", "support": { - "source": "https://github.com/Automattic/jetpack-roles/tree/v2.0.3" + "source": "https://github.com/Automattic/jetpack-roles/tree/v2.0.4" }, - "time": "2024-08-23T14:28:15+00:00" + "time": "2024-11-04T09:23:38+00:00" }, { "name": "automattic/jetpack-status", @@ -938,13 +938,6 @@ "reference": "81d809a476e87c260492d4cc0413818d85e123cc", "shasum": "" }, - "archive": { - "exclude": [ - "!/build", - "*.zip", - "node_modules" - ] - }, "require": { "composer/installers": "~1.2", "php": "^7.1" @@ -959,6 +952,13 @@ "extra": { "phpcodesniffer-search-depth": 2 }, + "archive": { + "exclude": [ + "!/build", + "*.zip", + "node_modules" + ] + }, "scripts": { "phpcs": [ "bin/phpcs.sh" @@ -1558,24 +1558,24 @@ }, { "name": "composer/semver", - "version": "3.4.2", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", - "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { @@ -1619,7 +1619,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.2" + "source": "https://github.com/composer/semver/tree/3.4.3" }, "funding": [ { @@ -1635,7 +1635,7 @@ "type": "tidelift" } ], - "time": "2024-07-12T11:35:52+00:00" + "time": "2024-09-19T14:15:21+00:00" }, { "name": "composer/xdebug-handler", @@ -2130,16 +2130,16 @@ }, { "name": "felixfbecker/language-server-protocol", - "version": "v1.5.2", + "version": "v1.5.3", "source": { "type": "git", "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842" + "reference": "a9e113dbc7d849e35b8776da39edaf4313b7b6c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/6e82196ffd7c62f7794d778ca52b69feec9f2842", - "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/a9e113dbc7d849e35b8776da39edaf4313b7b6c9", + "reference": "a9e113dbc7d849e35b8776da39edaf4313b7b6c9", "shasum": "" }, "require": { @@ -2180,9 +2180,9 @@ ], "support": { "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", - "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.2" + "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.3" }, - "time": "2022-03-02T22:36:06+00:00" + "time": "2024-04-30T00:40:11+00:00" }, { "name": "jolicode/jolinotif", @@ -2421,16 +2421,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.19.1", + "version": "v4.19.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b" + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b", - "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", "shasum": "" }, "require": { @@ -2439,7 +2439,7 @@ }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -2471,9 +2471,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" }, - "time": "2024-03-17T08:10:35+00:00" + "time": "2024-09-29T15:01:53+00:00" }, { "name": "openlss/lib-array2xml", @@ -3217,23 +3217,23 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.8.2", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "153ae662783729388a584b4361f2545e4d841e3c" + "reference": "1fb5ba8d045f5dd984ebded5b1cc66f29459422d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", - "reference": "153ae662783729388a584b4361f2545e4d841e3c", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/1fb5ba8d045f5dd984ebded5b1cc66f29459422d", + "reference": "1fb5ba8d045f5dd984ebded5b1cc66f29459422d", "shasum": "" }, "require": { "doctrine/deprecations": "^1.0", "php": "^7.3 || ^8.0", "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.13" + "phpstan/phpdoc-parser": "^1.18" }, "require-dev": { "ext-tokenizer": "*", @@ -3269,9 +3269,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.9.0" }, - "time": "2024-02-23T11:10:43+00:00" + "time": "2024-11-03T20:11:34+00:00" }, { "name": "phpspec/prophecy", @@ -3344,16 +3344,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.30.1", + "version": "1.33.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "51b95ec8670af41009e2b2b56873bad96682413e" + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/51b95ec8670af41009e2b2b56873bad96682413e", - "reference": "51b95ec8670af41009e2b2b56873bad96682413e", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", "shasum": "" }, "require": { @@ -3385,9 +3385,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.30.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" }, - "time": "2024-09-07T20:13:05+00:00" + "time": "2024-10-13T11:25:22+00:00" }, { "name": "phpunit/php-code-coverage", @@ -5255,16 +5255,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.10.2", + "version": "3.10.3", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" + "reference": "62d32998e820bddc40f99f8251958aed187a5c9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", - "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c", + "reference": "62d32998e820bddc40f99f8251958aed187a5c9c", "shasum": "" }, "require": { @@ -5331,20 +5331,20 @@ "type": "open_collective" } ], - "time": "2024-07-21T23:26:44+00:00" + "time": "2024-09-18T10:38:58+00:00" }, { "name": "symfony/console", - "version": "v5.4.43", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "e86f8554de667c16dde8aeb89a3990cfde924df9" + "reference": "108d436c2af470858bdaba3257baab3a74172017" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/e86f8554de667c16dde8aeb89a3990cfde924df9", - "reference": "e86f8554de667c16dde8aeb89a3990cfde924df9", + "url": "https://api.github.com/repos/symfony/console/zipball/108d436c2af470858bdaba3257baab3a74172017", + "reference": "108d436c2af470858bdaba3257baab3a74172017", "shasum": "" }, "require": { @@ -5414,7 +5414,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.43" + "source": "https://github.com/symfony/console/tree/v5.4.45" }, "funding": [ { @@ -5430,7 +5430,7 @@ "type": "tidelift" } ], - "time": "2024-08-13T16:31:56+00:00" + "time": "2024-10-08T07:27:17+00:00" }, { "name": "symfony/deprecation-contracts", @@ -5501,16 +5501,16 @@ }, { "name": "symfony/finder", - "version": "v5.4.43", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "ae25a9145a900764158d439653d5630191155ca0" + "reference": "63741784cd7b9967975eec610b256eed3ede022b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ae25a9145a900764158d439653d5630191155ca0", - "reference": "ae25a9145a900764158d439653d5630191155ca0", + "url": "https://api.github.com/repos/symfony/finder/zipball/63741784cd7b9967975eec610b256eed3ede022b", + "reference": "63741784cd7b9967975eec610b256eed3ede022b", "shasum": "" }, "require": { @@ -5544,7 +5544,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.43" + "source": "https://github.com/symfony/finder/tree/v5.4.45" }, "funding": [ { @@ -5560,7 +5560,7 @@ "type": "tidelift" } ], - "time": "2024-08-13T14:03:51+00:00" + "time": "2024-09-28T13:32:08+00:00" }, { "name": "symfony/polyfill-ctype", @@ -6038,16 +6038,16 @@ }, { "name": "symfony/process", - "version": "v5.4.40", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "deedcb3bb4669cae2148bc920eafd2b16dc7c046" + "reference": "95f3f19d0f8f06e4253c66a0828ddb69f8b8ede4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/deedcb3bb4669cae2148bc920eafd2b16dc7c046", - "reference": "deedcb3bb4669cae2148bc920eafd2b16dc7c046", + "url": "https://api.github.com/repos/symfony/process/zipball/95f3f19d0f8f06e4253c66a0828ddb69f8b8ede4", + "reference": "95f3f19d0f8f06e4253c66a0828ddb69f8b8ede4", "shasum": "" }, "require": { @@ -6080,7 +6080,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.40" + "source": "https://github.com/symfony/process/tree/v5.4.45" }, "funding": [ { @@ -6096,7 +6096,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/service-contracts", @@ -6183,16 +6183,16 @@ }, { "name": "symfony/string", - "version": "v5.4.43", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "8be1d484951ff5ca995eaf8edcbcb8b9a5888450" + "reference": "7f6807add88b1e2635f3c6de5e1ace631ed7cad2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/8be1d484951ff5ca995eaf8edcbcb8b9a5888450", - "reference": "8be1d484951ff5ca995eaf8edcbcb8b9a5888450", + "url": "https://api.github.com/repos/symfony/string/zipball/7f6807add88b1e2635f3c6de5e1ace631ed7cad2", + "reference": "7f6807add88b1e2635f3c6de5e1ace631ed7cad2", "shasum": "" }, "require": { @@ -6249,7 +6249,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.43" + "source": "https://github.com/symfony/string/tree/v5.4.45" }, "funding": [ { @@ -6265,20 +6265,20 @@ "type": "tidelift" } ], - "time": "2024-08-01T10:24:28+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/yaml", - "version": "v5.4.43", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "62f96e1cfd4cf518882a36bfedcf1fe4093c1299" + "reference": "a454d47278cc16a5db371fe73ae66a78a633371e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/62f96e1cfd4cf518882a36bfedcf1fe4093c1299", - "reference": "62f96e1cfd4cf518882a36bfedcf1fe4093c1299", + "url": "https://api.github.com/repos/symfony/yaml/zipball/a454d47278cc16a5db371fe73ae66a78a633371e", + "reference": "a454d47278cc16a5db371fe73ae66a78a633371e", "shasum": "" }, "require": { @@ -6324,7 +6324,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.43" + "source": "https://github.com/symfony/yaml/tree/v5.4.45" }, "funding": [ { @@ -6340,7 +6340,7 @@ "type": "tidelift" } ], - "time": "2024-08-11T17:40:32+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "theseer/tokenizer", @@ -6976,5 +6976,5 @@ "platform-overrides": { "php": "7.3" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.6.0" } From c2868a3346ba9a716e19a78f4868f3a3e22f127b Mon Sep 17 00:00:00 2001 From: Jessy Date: Wed, 6 Nov 2024 22:59:04 +0530 Subject: [PATCH 03/10] fixed missing arrow when popup positioned to the right --- client/deposits/rename-notice/style.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/deposits/rename-notice/style.scss b/client/deposits/rename-notice/style.scss index 319a4b607b8..3a2c51b7334 100644 --- a/client/deposits/rename-notice/style.scss +++ b/client/deposits/rename-notice/style.scss @@ -58,6 +58,16 @@ } } + .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; From 76e9556ffb59047765a9d708371201aedc7e382f Mon Sep 17 00:00:00 2001 From: Jessy Date: Wed, 6 Nov 2024 23:42:17 +0530 Subject: [PATCH 04/10] Avoid flickering effect when Payouts is loading but notice is dismissed. --- client/deposits/rename-notice/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/deposits/rename-notice/index.tsx b/client/deposits/rename-notice/index.tsx index 9a9bf738a40..5926fbd7eac 100644 --- a/client/deposits/rename-notice/index.tsx +++ b/client/deposits/rename-notice/index.tsx @@ -10,13 +10,14 @@ import { createInterpolateElement } from '@wordpress/element'; /** * Internal dependencies */ +import { useDeposits } from 'wcpay/data'; import './style.scss'; export const PayoutsRenameNotice = () => { const isPayoutsRenameNoticeDismissed = wcpaySettings.isPayoutsRenameNoticeDismissed; const { updateOptions } = useDispatch( 'wc/admin/options' ); - const [ showTour, setShowTour ] = useState( true ); + const [ showTour, setShowTour ] = useState( false ); const onClose = () => { updateOptions( { @@ -27,7 +28,9 @@ export const PayoutsRenameNotice = () => { }; useEffect( () => { - setShowTour( ! isPayoutsRenameNoticeDismissed ); + if ( ! isPayoutsRenameNoticeDismissed ) { + setShowTour( true ); + } }, [ isPayoutsRenameNoticeDismissed ] ); if ( ! showTour ) return null; From 391b931e6de3688e78886d375d6ca088d8f7e355 Mon Sep 17 00:00:00 2001 From: Jessy Date: Thu, 7 Nov 2024 10:12:22 +0530 Subject: [PATCH 05/10] Added basic rendering tests. --- .../test/__snapshots__/index.tsx.snap | 9 ++++ client/deposits/rename-notice/test/index.tsx | 52 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 client/deposits/rename-notice/test/__snapshots__/index.tsx.snap create mode 100644 client/deposits/rename-notice/test/index.tsx diff --git a/client/deposits/rename-notice/test/__snapshots__/index.tsx.snap b/client/deposits/rename-notice/test/__snapshots__/index.tsx.snap new file mode 100644 index 00000000000..8d2131ec55c --- /dev/null +++ b/client/deposits/rename-notice/test/__snapshots__/index.tsx.snap @@ -0,0 +1,9 @@ +// 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 new file mode 100644 index 00000000000..29f51ef828b --- /dev/null +++ b/client/deposits/rename-notice/test/index.tsx @@ -0,0 +1,52 @@ +/** @format */ +/** + * External dependencies + */ +import React from 'react'; +import { render, screen, waitFor } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import apiFetch from '@wordpress/api-fetch'; +import { log, error } from 'console'; + +/** + * 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(); + } ); +} ); From 278f60d79969156563acc0446439dfaf7dff1aaf Mon Sep 17 00:00:00 2001 From: Shendy <73803630+shendy-a8c@users.noreply.github.com> Date: Sat, 9 Nov 2024 02:52:32 +0700 Subject: [PATCH 06/10] Remove unused imports. --- client/deposits/rename-notice/index.tsx | 1 - client/deposits/rename-notice/test/index.tsx | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/client/deposits/rename-notice/index.tsx b/client/deposits/rename-notice/index.tsx index 5926fbd7eac..9d381c037e7 100644 --- a/client/deposits/rename-notice/index.tsx +++ b/client/deposits/rename-notice/index.tsx @@ -10,7 +10,6 @@ import { createInterpolateElement } from '@wordpress/element'; /** * Internal dependencies */ -import { useDeposits } from 'wcpay/data'; import './style.scss'; export const PayoutsRenameNotice = () => { diff --git a/client/deposits/rename-notice/test/index.tsx b/client/deposits/rename-notice/test/index.tsx index 29f51ef828b..9f9f2d0c7a8 100644 --- a/client/deposits/rename-notice/test/index.tsx +++ b/client/deposits/rename-notice/test/index.tsx @@ -3,10 +3,7 @@ * External dependencies */ import React from 'react'; -import { render, screen, waitFor } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; -import apiFetch from '@wordpress/api-fetch'; -import { log, error } from 'console'; +import { render } from '@testing-library/react'; /** * Internal dependencies From 45b4c4e0cfaa8df1ae4ca8692f20c9822300247f Mon Sep 17 00:00:00 2001 From: Shendy <73803630+shendy-a8c@users.noreply.github.com> Date: Sat, 9 Nov 2024 02:53:23 +0700 Subject: [PATCH 07/10] Show payout rename spotlight notice on Payments overview page and deposit details page. --- client/deposits/details/index.tsx | 2 ++ client/overview/index.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/client/deposits/details/index.tsx b/client/deposits/details/index.tsx index f8becf33703..2176b079377 100644 --- a/client/deposits/details/index.tsx +++ b/client/deposits/details/index.tsx @@ -40,6 +40,7 @@ import { } from 'multi-currency/interface/functions'; import { depositStatusLabels } from '../strings'; import './style.scss'; +import { PayoutsRenameNotice } from '../rename-notice'; /** * Renders the deposit status indicator UI, re-purposing the OrderStatus component from @woocommerce/components. @@ -246,6 +247,7 @@ export const DepositDetails: React.FC< DepositDetailsProps > = ( { return ( + { isLoading ? ( diff --git a/client/overview/index.js b/client/overview/index.js index f6d5afd4a72..edb215993c7 100644 --- a/client/overview/index.js +++ b/client/overview/index.js @@ -32,6 +32,7 @@ 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'; const OverviewPageError = () => { const queryParams = getQuery(); @@ -194,6 +195,7 @@ const OverviewPage = () => { { showConnectionSuccess && } { ! accountRejected && ! accountUnderReview && ( + { showTaskList && ( From ba2ffea3946f19fcdf9db72fb6e561d006555273 Mon Sep 17 00:00:00 2001 From: Shendy <73803630+shendy-a8c@users.noreply.github.com> Date: Sat, 9 Nov 2024 04:10:36 +0700 Subject: [PATCH 08/10] Copy change. --- client/deposits/rename-notice/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/deposits/rename-notice/index.tsx b/client/deposits/rename-notice/index.tsx index 9d381c037e7..45049a5bb46 100644 --- a/client/deposits/rename-notice/index.tsx +++ b/client/deposits/rename-notice/index.tsx @@ -57,13 +57,13 @@ export const PayoutsRenameNotice = () => { meta: { name: 'deposits-now-payouts', heading: __( - 'Deposits are now Payouts!', + 'Deposits are now known as Payouts!', 'woocommerce-payments' ), descriptions: { desktop: createInterpolateElement( __( - "Heads up! We've given Deposits a new industry approved alias: Payouts! Don't worry, it's still the same reliable function, just with a little more style. Learn More.", + "Same reliable system for quick access to your earnings — now with a clearer name. To enhance your experience, 'Deposits' will now be called 'Payouts'. Learn More.", 'woocommerce' ), { From 420321a6522634a07c04510dcb3a5ddbab5fb7af Mon Sep 17 00:00:00 2001 From: Shendy <73803630+shendy-a8c@users.noreply.github.com> Date: Sat, 9 Nov 2024 04:48:42 +0700 Subject: [PATCH 09/10] Update unit test for Payments Overview page to check the payout rename notice. --- client/overview/test/index.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/client/overview/test/index.js b/client/overview/test/index.js index f399e6488ce..f5429a59226 100644 --- a/client/overview/test/index.js +++ b/client/overview/test/index.js @@ -352,4 +352,24 @@ 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(); + } ); } ); From d09cff83d7c6d0a69b90fa5d61879af1929c5bd8 Mon Sep 17 00:00:00 2001 From: Shendy <73803630+shendy-a8c@users.noreply.github.com> Date: Sun, 10 Nov 2024 11:46:56 +0700 Subject: [PATCH 10/10] Update client/deposits/rename-notice/index.tsx --- client/deposits/rename-notice/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/deposits/rename-notice/index.tsx b/client/deposits/rename-notice/index.tsx index 45049a5bb46..61ff61b142e 100644 --- a/client/deposits/rename-notice/index.tsx +++ b/client/deposits/rename-notice/index.tsx @@ -64,7 +64,7 @@ export const PayoutsRenameNotice = () => { desktop: createInterpolateElement( __( "Same reliable system for quick access to your earnings — now with a clearer name. To enhance your experience, 'Deposits' will now be called 'Payouts'. Learn More.", - 'woocommerce' + 'woocommerce-payments' ), { link: (