From 8dc16fa48da31bf95bbadd2de6da8705ba4b78e3 Mon Sep 17 00:00:00 2001 From: James Collins Date: Tue, 16 May 2023 22:23:10 +0800 Subject: [PATCH 1/4] Re-assign existing webhooks during user deletion (#37814) Co-authored-by: James Collins Co-authored-by: Nestor Soriano Includes UI detailing how many webhooks are assigned to each of the users being deleted, and explaining how the re-assignment works. --- plugins/woocommerce/changelog/fix-37806 | 4 + .../includes/class-woocommerce.php | 2 + .../class-wc-webhook-data-store.php | 7 + .../UtilsClassesServiceProvider.php | 3 + .../src/Internal/Utilities/WebhookUtil.php | 136 ++++++++++++++++++ .../php/includes/class-wc-webhook-tests.php | 78 ++++++++++ .../class-wc-webhook-data-store-test.php | 49 +++++++ 7 files changed, 279 insertions(+) create mode 100644 plugins/woocommerce/changelog/fix-37806 create mode 100644 plugins/woocommerce/src/Internal/Utilities/WebhookUtil.php create mode 100644 plugins/woocommerce/tests/php/includes/data-stores/class-wc-webhook-data-store-test.php diff --git a/plugins/woocommerce/changelog/fix-37806 b/plugins/woocommerce/changelog/fix-37806 new file mode 100644 index 00000000000..fe00a2ff37d --- /dev/null +++ b/plugins/woocommerce/changelog/fix-37806 @@ -0,0 +1,4 @@ +Significance: minor +Type: enhancement + +When deleting an administrator user, any existing webhook(s) owned to the user being deleted are re-assigned to the nominated user if the "Attribute all content to" option is chosen, or re-assigned to user id zero. This helps avoid `woocommerce_rest_cannot_view` webhook payload errors. diff --git a/plugins/woocommerce/includes/class-woocommerce.php b/plugins/woocommerce/includes/class-woocommerce.php index 5b83720053b..9ca227c7ee6 100644 --- a/plugins/woocommerce/includes/class-woocommerce.php +++ b/plugins/woocommerce/includes/class-woocommerce.php @@ -18,6 +18,7 @@ use Automattic\WooCommerce\Internal\ProductAttributesLookup\LookupDataStore; use Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories\Register as ProductDownloadDirectories; use Automattic\WooCommerce\Internal\RestockRefundedItemsAdjuster; use Automattic\WooCommerce\Internal\Settings\OptionSanitizer; +use Automattic\WooCommerce\Internal\Utilities\WebhookUtil; use Automattic\WooCommerce\Proxies\LegacyProxy; /** @@ -240,6 +241,7 @@ final class WooCommerce { $container->get( OptionSanitizer::class ); $container->get( BatchProcessingController::class ); $container->get( FeaturesController::class ); + $container->get( WebhookUtil::class ); } /** diff --git a/plugins/woocommerce/includes/data-stores/class-wc-webhook-data-store.php b/plugins/woocommerce/includes/data-stores/class-wc-webhook-data-store.php index e8b417e3a8f..adb0f36be22 100644 --- a/plugins/woocommerce/includes/data-stores/class-wc-webhook-data-store.php +++ b/plugins/woocommerce/includes/data-stores/class-wc-webhook-data-store.php @@ -282,6 +282,7 @@ class WC_Webhook_Data_Store implements WC_Webhook_Data_Store_Interface { $exclude = ''; $date_created = ''; $date_modified = ''; + $user_id = ''; if ( ! empty( $args['include'] ) ) { $args['include'] = implode( ',', wp_parse_id_list( $args['include'] ) ); @@ -293,6 +294,10 @@ class WC_Webhook_Data_Store implements WC_Webhook_Data_Store_Interface { $exclude = 'AND webhook_id NOT IN (' . $args['exclude'] . ')'; } + if ( ! empty( $args['user_id'] ) ) { + $user_id = $wpdb->prepare( 'AND `user_id` = %d', absint( $args['user_id'] ) ); + } + if ( ! empty( $args['after'] ) || ! empty( $args['before'] ) ) { $args['after'] = empty( $args['after'] ) ? '0000-00-00' : $args['after']; $args['before'] = empty( $args['before'] ) ? current_time( 'mysql', 1 ) : $args['before']; @@ -326,6 +331,7 @@ class WC_Webhook_Data_Store implements WC_Webhook_Data_Store_Interface { {$exclude} {$date_created} {$date_modified} + {$user_id} {$order} {$limit} {$offset}" @@ -349,6 +355,7 @@ class WC_Webhook_Data_Store implements WC_Webhook_Data_Store_Interface { {$exclude} {$date_created} {$date_modified} + {$user_id} {$order} {$limit} {$offset}" diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/UtilsClassesServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/UtilsClassesServiceProvider.php index c6d6ea53fd3..52e25ba49f8 100644 --- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/UtilsClassesServiceProvider.php +++ b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/UtilsClassesServiceProvider.php @@ -11,6 +11,7 @@ use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider use Automattic\WooCommerce\Internal\Utilities\COTMigrationUtil; use Automattic\WooCommerce\Internal\Utilities\DatabaseUtil; use Automattic\WooCommerce\Internal\Utilities\HtmlSanitizer; +use Automattic\WooCommerce\Internal\Utilities\WebhookUtil; use Automattic\WooCommerce\Proxies\LegacyProxy; use Automattic\WooCommerce\Utilities\PluginUtil; use Automattic\WooCommerce\Utilities\OrderUtil; @@ -31,6 +32,7 @@ class UtilsClassesServiceProvider extends AbstractServiceProvider { OrderUtil::class, PluginUtil::class, COTMigrationUtil::class, + WebhookUtil::class, ); /** @@ -44,5 +46,6 @@ class UtilsClassesServiceProvider extends AbstractServiceProvider { ->addArgument( LegacyProxy::class ); $this->share( COTMigrationUtil::class ) ->addArguments( array( CustomOrdersTableController::class, DataSynchronizer::class ) ); + $this->share( WebhookUtil::class ); } } diff --git a/plugins/woocommerce/src/Internal/Utilities/WebhookUtil.php b/plugins/woocommerce/src/Internal/Utilities/WebhookUtil.php new file mode 100644 index 00000000000..e6ff21320f5 --- /dev/null +++ b/plugins/woocommerce/src/Internal/Utilities/WebhookUtil.php @@ -0,0 +1,136 @@ +get_webhook_ids_for_user( $old_user_id ); + + foreach ( $webhook_ids as $webhook_id ) { + $webhook = new \WC_Webhook( $webhook_id ); + $webhook->set_user_id( $new_user_id ?? 0 ); + $webhook->save(); + } + } + + /** + * When users are about to be deleted show an informative text if they have webhooks assigned. + * + * @param \WP_User $current_user The current logged in user. + * @param array $userids Array with the ids of the users that are about to be deleted. + * @return void + * @since 7.8.0 + */ + private function maybe_render_user_with_webhooks_warning( \WP_User $current_user, array $userids ): void { + global $wpdb; + + $at_least_one_user_with_webhooks = false; + + foreach ( $userids as $user_id ) { + $webhook_ids = $this->get_webhook_ids_for_user( $user_id ); + if ( empty( $webhook_ids ) ) { + continue; + } + + $at_least_one_user_with_webhooks = true; + + $user_data = get_userdata( $user_id ); + $user_login = false === $user_data ? '' : $user_data->user_login; + $webhooks_count = count( $webhook_ids ); + + $text = sprintf( + /* translators: 1 = user id, 2 = user login, 3 = webhooks count */ + _nx( + 'User #%1$s %2$s has created %3$d WooCommerce webhook.', + 'User #%1$s %2$s has created %3$d WooCommerce webhooks.', + $webhooks_count, + 'user webhook count', + 'woocommerce' + ), + $user_id, + $user_login, + $webhooks_count + ); + + echo '

' . esc_html( $text ) . '

'; + } + + if ( ! $at_least_one_user_with_webhooks ) { + return; + } + + $webhooks_settings_url = esc_url_raw( admin_url( 'admin.php?page=wc-settings&tab=advanced§ion=webhooks' ) ); + + // This block of code is copied from WordPress' users.php. + // phpcs:disable WooCommerce.Commenting.CommentHooks, WordPress.DB.PreparedSQL.NotPrepared + $users_have_content = (bool) apply_filters( 'users_have_additional_content', false, $userids ); + if ( ! $users_have_content ) { + if ( $wpdb->get_var( "SELECT ID FROM {$wpdb->posts} WHERE post_author IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) { + $users_have_content = true; + } elseif ( $wpdb->get_var( "SELECT link_id FROM {$wpdb->links} WHERE link_owner IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) { + $users_have_content = true; + } + } + // phpcs:enable WooCommerce.Commenting.CommentHooks, WordPress.DB.PreparedSQL.NotPrepared + + if ( $users_have_content ) { + $text = __( 'If the "Delete all content" option is selected, the affected WooCommerce webhooks will not be deleted and will be attributed to user id 0.
', 'woocommerce' ); + } else { + $text = __( 'The affected WooCommerce webhooks will not be deleted and will be attributed to user id 0.
', 'woocommerce' ); + } + + $text .= sprintf( + /* translators: 1 = url of the WooCommerce webhooks settings page */ + __( 'After that they can be reassigned to the logged-in user by going to the WooCommerce webhooks settings page and re-saving them.', 'woocommerce' ), + $webhooks_settings_url + ); + + echo '

' . wp_kses_post( $text ) . '

'; + } + + /** + * Get the ids of the webhooks assigned to a given user. + * + * @param int $user_id User id. + * @return int[] Array of webhook ids. + */ + private function get_webhook_ids_for_user( int $user_id ): array { + $data_store = \WC_Data_Store::load( 'webhook' ); + return $data_store->search_webhooks( + array( + 'user_id' => $user_id, + ) + ); + } +} diff --git a/plugins/woocommerce/tests/php/includes/class-wc-webhook-tests.php b/plugins/woocommerce/tests/php/includes/class-wc-webhook-tests.php index a17b544d1fb..f1f51120993 100644 --- a/plugins/woocommerce/tests/php/includes/class-wc-webhook-tests.php +++ b/plugins/woocommerce/tests/php/includes/class-wc-webhook-tests.php @@ -34,4 +34,82 @@ class WC_Webhook_Test extends WC_Unit_Test_Case { $this->assertFalse( $call_is_valid_function->call( $webhook, $product->get_id() ) ); } + /** + * @testDox Check that a deleted administrator user (with content re-assigned to another user) + * does not cause webhook payloads to fail. + */ + public function test_payload_for_deleted_user_id_with_reassign() { + $admin_user_id_1 = wp_insert_user( + array( + 'user_login' => 'test_admin', + 'user_pass' => 'password', + 'role' => 'administrator', + ) + ); + + $webhook = new WC_Webhook(); + $webhook->set_topic( 'order.created' ); + $webhook->set_user_id( $admin_user_id_1 ); + $webhook->save(); + + $order = \Automattic\WooCommerce\RestApi\UnitTests\Helpers\OrderHelper::create_order(); + + $payload = $webhook->build_payload( $order->get_id() ); + $this->assertArrayNotHasKey( 'code', $payload ); + $this->assertArrayHasKey( 'id', $payload ); + $this->assertSame( $order->get_id(), $payload['id'] ); + + // Create a second admin user and delete the first one, reassigning existing content to the second user. + $admin_user_id_2 = wp_insert_user( + array( + 'user_login' => 'test_admin2', + 'user_pass' => 'password', + 'role' => 'administrator', + ) + ); + wp_delete_user( $admin_user_id_1, $admin_user_id_2 ); + + // Re-load the webhook from the database. + $webhook = new WC_Webhook( $webhook->get_id() ); + // Confirm user_id has been updated to the second admin user. + $this->assertSame( $admin_user_id_2, $webhook->get_user_id() ); + + $this->assertArrayNotHasKey( 'code', $payload ); + $this->assertArrayHasKey( 'id', $payload ); + $this->assertSame( $order->get_id(), $payload['id'] ); + } + + /** + * @testDox Check that a deleted administrator user (without content re-assigned to another user) + * has all webhooks changed to user_id zero. + */ + public function test_payload_for_deleted_user_id_without_reassign() { + $admin_user_id = wp_insert_user( + array( + 'user_login' => 'test_admin', + 'user_pass' => 'password', + 'role' => 'administrator', + ) + ); + + $webhook1 = new WC_Webhook(); + $webhook1->set_topic( 'order.created' ); + $webhook1->set_user_id( $admin_user_id ); + $webhook1->save(); + + $webhook2 = new WC_Webhook(); + $webhook2->set_topic( 'order.created' ); + $webhook2->set_user_id( 999 ); + $webhook2->save(); + + wp_delete_user( $admin_user_id ); + + // Re-load the webhooks from the database. + $webhook1 = new WC_Webhook( $webhook1->get_id() ); + $webhook2 = new WC_Webhook( $webhook2->get_id() ); + // Confirm user_id has been updated to zero for the first webhook only. + $this->assertSame( 0, $webhook1->get_user_id() ); + $this->assertSame( 999, $webhook2->get_user_id() ); + } + } diff --git a/plugins/woocommerce/tests/php/includes/data-stores/class-wc-webhook-data-store-test.php b/plugins/woocommerce/tests/php/includes/data-stores/class-wc-webhook-data-store-test.php new file mode 100644 index 00000000000..92b736cc42b --- /dev/null +++ b/plugins/woocommerce/tests/php/includes/data-stores/class-wc-webhook-data-store-test.php @@ -0,0 +1,49 @@ +assertEmpty( + $store->search_webhooks( + array( + 'user_id' => 1, + ) + ) + ); + + $webhook1 = new WC_Webhook(); + $webhook1->set_user_id( 1 ); + $webhook1->save(); + + $webhook2 = new WC_Webhook(); + $webhook2->set_user_id( 2 ); + $webhook2->save(); + + $this->assertSame( + array( $webhook1->get_id() ), + $store->search_webhooks( + array( + 'user_id' => 1, + ) + ) + ); + $this->assertSame( + array( $webhook2->get_id() ), + $store->search_webhooks( + array( + 'user_id' => 2, + ) + ) + ); + } + +} From 5b50bbc44239f4b31a922c8c69c5c08312af3e16 Mon Sep 17 00:00:00 2001 From: Joshua T Flowers Date: Tue, 16 May 2023 15:15:26 -0700 Subject: [PATCH 2/4] Wrap selected items in experimental select control (#38284) --- packages/js/components/changelog/fix-38210 | 4 ++++ .../src/experimental-select-control/combo-box.scss | 1 - .../experimental-select-control/selected-items.scss | 12 ++++++++---- 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 packages/js/components/changelog/fix-38210 diff --git a/packages/js/components/changelog/fix-38210 b/packages/js/components/changelog/fix-38210 new file mode 100644 index 00000000000..26520bd3a91 --- /dev/null +++ b/packages/js/components/changelog/fix-38210 @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +Wrap selected items in experimental select control diff --git a/packages/js/components/src/experimental-select-control/combo-box.scss b/packages/js/components/src/experimental-select-control/combo-box.scss index 7faddd52a83..acb2426f6dc 100644 --- a/packages/js/components/src/experimental-select-control/combo-box.scss +++ b/packages/js/components/src/experimental-select-control/combo-box.scss @@ -18,7 +18,6 @@ .woocommerce-experimental-select-control__items-wrapper { display: flex; flex-grow: 1; - flex-wrap: wrap; align-items: center; padding: 2px $gap-smaller; diff --git a/packages/js/components/src/experimental-select-control/selected-items.scss b/packages/js/components/src/experimental-select-control/selected-items.scss index e9565582172..424bb40b9b9 100644 --- a/packages/js/components/src/experimental-select-control/selected-items.scss +++ b/packages/js/components/src/experimental-select-control/selected-items.scss @@ -1,7 +1,11 @@ -.woocommerce-experimental-select-control__selected-items.is-read-only { - font-size: 13px; - color: $gray-900; - font-family: var(--wp--preset--font-family--system-font); +.woocommerce-experimental-select-control__selected-items { + flex-wrap: wrap; + + &.is-read-only { + font-size: 13px; + color: $gray-900; + font-family: var(--wp--preset--font-family--system-font); + } } .woocommerce-experimental-select-control__selected-item { From dcbfbe27485fc0332c6c0316ccd05b6eacc7ba0f Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Wed, 17 May 2023 09:54:31 +0800 Subject: [PATCH 3/4] Cleanup task list and re-organize file structure (#38271) * Deprecate onboarding task snooze APIs * Cleanup task list and organize tasks file structure * Add changelog * Fix lint * Fix tests * Remove two-columns check logic * Fix mock path --- .../client/activity-panel/activity-panel.js | 2 +- .../panels/setup-tasks/setup-tasks-panel.tsx | 4 +- .../woocommerce-admin/client/header/index.js | 2 +- .../client/homescreen/layout.js | 19 ++- .../woocommerce-admin/client/layout/index.js | 2 +- .../test/payment-recommendations.test.tsx | 4 +- .../components}/back-button.scss | 0 .../components}/back-button.tsx | 0 .../components}/placeholder.scss | 0 .../components}/placeholder.tsx | 0 .../default-progress-header.tsx | 2 +- .../{ => components}/progress-header/index.ts | 0 .../progress-header/progress-header.scss | 0 .../progress-header/progress-header.tsx | 0 .../progress-header/utils.tsx | 0 .../components}/task-list-item.tsx | 0 .../components}/task-list-menu.tsx | 0 .../components}/task-list.scss | 0 .../components}/task-list.tsx | 3 +- .../{tasks => task-lists/components}/task.tsx | 0 .../components}/test/task-list-item.test.tsx | 0 .../components}/test/task-list.test.tsx | 0 .../components}/test/task.test.tsx | 0 .../fills/Marketing/Marketing.scss | 0 .../fills/Marketing/Plugin.scss | 0 .../fills/Marketing/Plugin.tsx | 0 .../fills/Marketing/PluginList.scss | 0 .../fills/Marketing/PluginList.tsx | 0 .../fills/Marketing/index.tsx | 0 .../fills/Marketing/test/index.tsx | 2 +- .../components/Action.js | 0 .../components/List/Item.js | 0 .../components/List/List.js | 0 .../components/List/List.scss | 0 .../components/List/Placeholder.js | 0 .../components/List/fallback.png | Bin .../components/List/index.js | 0 .../components/List/test/list.js | 0 .../components/Setup/Configure.js | 0 .../components/Setup/Placeholder.js | 0 .../components/Setup/Setup.js | 0 .../components/Setup/Setup.scss | 0 .../components/Setup/index.js | 0 .../components/Setup/test/configure.js | 0 .../components/Setup/test/setup.js | 2 +- .../components/Toggle/Toggle.js | 0 .../components/Toggle/Toggle.scss | 0 .../components/Toggle/index.js | 0 .../components/WCPay/Suggestion.js | 0 .../components/WCPay/UsageModal.js | 0 .../components/WCPay/index.js | 0 .../components/WCPay/suggestion.scss | 0 .../components/WCPay/utils.js | 0 .../fills/PaymentGatewaySuggestions/index.js | 0 .../payment-gateway-suggestions.scss | 0 .../PaymentGatewaySuggestions/plugins/Bacs.js | 0 .../PaymentGatewaySuggestions/test/index.js | 0 .../PaymentGatewaySuggestions/test/utils.js | 0 .../fills/PaymentGatewaySuggestions/utils.js | 0 .../{tasks => task-lists}/fills/appearance.js | 0 .../load-sample-product-confirm-modal.scss | 0 .../load-sample-product-confirm-modal.tsx | 0 .../components/load-sample-product-modal.scss | 0 .../components/load-sample-product-modal.tsx | 0 .../test/load-sample-product-modal.tsx | 0 .../components/use-load-sample-products.ts | 0 .../fills}/deprecated-tasks.tsx | 0 .../components/connect.tsx | 0 .../components/plugin-banner.scss | 0 .../components/plugin-banner.tsx | 0 .../components/plugins.tsx | 0 .../components/store-location.tsx | 2 +- .../components/wcs-banner.tsx | 0 .../images/discount.svg | 0 .../images/paper.svg | 0 .../images/printer.svg | 0 .../images/shipstation.svg | 0 .../images/star.svg | 0 .../images/timer.svg | 0 .../images/wcs.svg | 0 .../index.tsx | 0 .../shipping-recommendation.tsx | 0 .../test/shipping-recommendation.tsx | 0 .../types.ts | 0 .../utils.ts | 0 .../fills/import-products/CardList.tsx | 0 .../fills/import-products/cards.scss | 0 .../fills/import-products/importTypes.tsx | 0 .../fills/import-products/index.tsx | 0 .../fills/import-products/style.scss | 0 .../fills/import-products/test/index.tsx | 0 .../{tasks => task-lists}/fills/index.ts | 1 + .../fills/products/constants.tsx | 0 .../fills/products/footer.tsx | 0 .../fills/products/icon/lightbulb_24px.js | 0 .../fills/products/icon/link_24px.js | 0 .../fills/products/icon/widgets_24px.js | 0 .../fills/products/index.scss | 0 .../fills/products/index.tsx | 0 .../fills/products/stack.scss | 0 .../fills/products/stack.tsx | 0 .../fills/products/test/footer.tsx | 0 .../fills/products/test/index.tsx | 0 .../fills/products/test/stack.tsx | 0 .../fills/products/test/utils.ts | 0 .../products/use-create-product-by-type.ts | 0 .../products/use-product-types-list-items.tsx | 0 .../fills/products/utils.tsx | 0 .../{tasks => task-lists}/fills/purchase.tsx | 0 .../fills/shipping/index.js | 0 .../fills/shipping/rates.js | 0 .../shipping-providers/assets/check.svg | 0 .../shipping-providers/assets/discount.svg | 0 .../assets/envia-banner-side.svg | 0 .../assets/packlink-banner-side.svg | 0 .../assets/packlink-column-logo.svg | 0 .../shipping-providers/assets/paper.svg | 0 .../shipping-providers/assets/printer.svg | 0 .../assets/sendcloud-banner-side.svg | 0 .../assets/sendcloud-column-logo.svg | 0 .../assets/shipstation-banner-side.svg | 0 .../assets/shipstation-column-logo.svg | 0 .../shipping-providers/assets/shipstation.svg | 0 .../assets/skydropx-banner-side.svg | 0 .../shipping-providers/assets/star.svg | 0 .../shipping-providers/assets/timer.svg | 0 .../assets/wcs-banner-side.svg | 0 .../shipping-providers/assets/wcs.svg | 0 .../shipping/shipping-providers/partners.tsx | 0 .../shipping-providers/shipping-providers.ts | 0 .../fills/shipping/shipping.scss | 0 .../fills/shipping/single-partner-features.ts | 0 .../fills/steps/location.tsx | 0 .../fills/tax/avalara/card.tsx | 0 .../fills/tax/avalara/logo.png | Bin .../fills/tax/components/bullet.tsx | 0 .../fills/tax/components/partner-card.scss | 0 .../fills/tax/components/partner-card.tsx | 0 .../fills/tax/components/partners.scss | 0 .../fills/tax/components/partners.tsx | 0 .../fills/tax/components/store-location.tsx | 2 +- .../{tasks => task-lists}/fills/tax/index.tsx | 0 .../tax/manual-configuration/configure.tsx | 0 .../fills/tax/manual-configuration/index.tsx | 0 .../{tasks => task-lists}/fills/tax/utils.ts | 0 .../tax/woocommerce-tax/automated-taxes.tsx | 0 .../fills/tax/woocommerce-tax/card.tsx | 0 .../fills/tax/woocommerce-tax/connect.tsx | 0 .../fills/tax/woocommerce-tax/index.tsx | 0 .../fills/tax/woocommerce-tax/logo.png | Bin .../fills/tax/woocommerce-tax/plugins.tsx | 0 .../fills/tax/woocommerce-tax/setup.scss | 0 .../fills/tax/woocommerce-tax/setup.tsx | 0 .../fills/use-record-completion-time.ts | 0 .../{tasks => task-lists}/fills/utils.js | 0 .../fills/woocommerce-payments.tsx | 0 .../hooks/useActiveSetupList.ts | 0 .../client/task-lists/index.ts | 10 +- .../reminder-bar/index.tsx | 0 .../reminder-bar/reminder-bar.scss | 0 .../reminder-bar/reminder-bar.tsx | 0 .../assets}/completed-celebration-header.svg | 0 .../assets/task-list-completed.svg} | 0 .../components/dismiss-modal.tsx} | 4 + .../components/task-headers}/appearance.js | 2 +- .../components/task-headers/index.ts | 24 +++ .../components/task-headers}/marketing.js | 2 +- .../components/task-headers}/payments.js | 2 +- .../components/task-headers}/products.js | 2 +- .../components/task-headers}/purchase.js | 2 +- .../components/task-headers}/shipping.js | 2 +- .../components/task-headers}/store-details.js | 2 +- .../components/task-headers}/tax.js | 2 +- .../components/task-headers}/timer.svg | 0 .../task-headers}/woocommerce-payments.js | 2 +- .../task-list-completed-header.scss} | 0 .../task-list-completed-header.tsx} | 6 +- .../components/task-list-completed.tsx} | 14 +- .../components/task-list-item.tsx} | 2 +- .../components/task-list-placeholder.tsx} | 14 +- .../footer-slot/footer-slot.tsx | 0 .../setup-task-list}/footer-slot/index.ts | 0 .../setup-task-list}/footer-slot/utils.tsx | 0 .../task-lists/setup-task-list/index.ts | 2 + .../setup-task-list/setup-task-list.tsx} | 25 ++- .../setup-task-list}/style.scss | 22 +-- .../task-list-completion-slot/index.ts | 0 .../task-list-completion-slot.tsx | 0 .../task-list-completion-slot/utils.tsx | 0 .../test/setup-task-list.test.tsx} | 24 +-- .../tasks.scss => task-lists/task-lists.scss} | 0 .../tasks.tsx => task-lists/task-lists.tsx} | 28 ++-- .../{tasks => task-lists}/test/tasks.test.tsx | 38 ++--- .../woocommerce-admin/client/tasks/index.ts | 10 -- .../client/two-column-tasks/extended-task.tsx | 145 ------------------ .../client/two-column-tasks/index.js | 101 ------------ .../client/two-column-tasks/task-headers.ts | 26 ---- .../changelog/dev-clean-up-task-list | 4 + .../src/Admin/API/OnboardingTasks.php | 12 ++ .../Features/OnboardingTasks/TaskLists.php | 47 ------ .../Tasks/AdditionalPayments.php | 3 - .../Tasks/WooCommercePayments.php | 2 +- 202 files changed, 170 insertions(+), 458 deletions(-) rename plugins/woocommerce-admin/client/{tasks => task-lists/components}/back-button.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists/components}/back-button.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists/components}/placeholder.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists/components}/placeholder.tsx (100%) rename plugins/woocommerce-admin/client/task-lists/{ => components}/progress-header/default-progress-header.tsx (96%) rename plugins/woocommerce-admin/client/task-lists/{ => components}/progress-header/index.ts (100%) rename plugins/woocommerce-admin/client/task-lists/{ => components}/progress-header/progress-header.scss (100%) rename plugins/woocommerce-admin/client/task-lists/{ => components}/progress-header/progress-header.tsx (100%) rename plugins/woocommerce-admin/client/task-lists/{ => components}/progress-header/utils.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists/components}/task-list-item.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists/components}/task-list-menu.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists/components}/task-list.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists/components}/task-list.tsx (97%) rename plugins/woocommerce-admin/client/{tasks => task-lists/components}/task.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists/components}/test/task-list-item.test.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists/components}/test/task-list.test.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists/components}/test/task.test.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/Marketing/Marketing.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/Marketing/Plugin.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/Marketing/Plugin.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/Marketing/PluginList.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/Marketing/PluginList.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/Marketing/index.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/Marketing/test/index.tsx (99%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/Action.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/List/Item.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/List/List.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/List/List.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/List/Placeholder.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/List/fallback.png (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/List/index.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/List/test/list.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/Setup/Configure.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/Setup/Placeholder.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/Setup/Setup.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/Setup/Setup.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/Setup/index.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/Setup/test/configure.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/Setup/test/setup.js (98%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/Toggle/Toggle.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/Toggle/Toggle.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/Toggle/index.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/WCPay/Suggestion.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/WCPay/UsageModal.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/WCPay/index.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/WCPay/suggestion.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/components/WCPay/utils.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/index.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/payment-gateway-suggestions.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/plugins/Bacs.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/test/index.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/test/utils.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/PaymentGatewaySuggestions/utils.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/appearance.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/components/load-sample-product-confirm-modal.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/components/load-sample-product-confirm-modal.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/components/load-sample-product-modal.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/components/load-sample-product-modal.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/components/test/load-sample-product-modal.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/components/use-load-sample-products.ts (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists/fills}/deprecated-tasks.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/components/connect.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/components/plugin-banner.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/components/plugin-banner.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/components/plugins.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/components/store-location.tsx (95%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/components/wcs-banner.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/images/discount.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/images/paper.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/images/printer.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/images/shipstation.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/images/star.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/images/timer.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/images/wcs.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/index.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/shipping-recommendation.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/test/shipping-recommendation.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/types.ts (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/experimental-shipping-recommendation/utils.ts (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/import-products/CardList.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/import-products/cards.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/import-products/importTypes.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/import-products/index.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/import-products/style.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/import-products/test/index.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/index.ts (95%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/products/constants.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/products/footer.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/products/icon/lightbulb_24px.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/products/icon/link_24px.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/products/icon/widgets_24px.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/products/index.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/products/index.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/products/stack.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/products/stack.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/products/test/footer.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/products/test/index.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/products/test/stack.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/products/test/utils.ts (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/products/use-create-product-by-type.ts (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/products/use-product-types-list-items.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/products/utils.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/purchase.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/index.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/rates.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/check.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/discount.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/envia-banner-side.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/packlink-banner-side.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/packlink-column-logo.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/paper.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/printer.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/sendcloud-banner-side.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/sendcloud-column-logo.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/shipstation-banner-side.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/shipstation-column-logo.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/shipstation.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/skydropx-banner-side.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/star.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/timer.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/wcs-banner-side.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/assets/wcs.svg (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/partners.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping-providers/shipping-providers.ts (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/shipping.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/shipping/single-partner-features.ts (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/steps/location.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/avalara/card.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/avalara/logo.png (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/components/bullet.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/components/partner-card.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/components/partner-card.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/components/partners.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/components/partners.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/components/store-location.tsx (98%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/index.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/manual-configuration/configure.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/manual-configuration/index.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/utils.ts (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/woocommerce-tax/automated-taxes.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/woocommerce-tax/card.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/woocommerce-tax/connect.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/woocommerce-tax/index.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/woocommerce-tax/logo.png (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/woocommerce-tax/plugins.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/woocommerce-tax/setup.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/tax/woocommerce-tax/setup.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/use-record-completion-time.ts (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/utils.js (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/fills/woocommerce-payments.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/hooks/useActiveSetupList.ts (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/reminder-bar/index.tsx (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/reminder-bar/reminder-bar.scss (100%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/reminder-bar/reminder-bar.tsx (100%) rename plugins/woocommerce-admin/client/{two-column-tasks => task-lists/setup-task-list/assets}/completed-celebration-header.svg (100%) rename plugins/woocommerce-admin/client/{two-column-tasks/completed.svg => task-lists/setup-task-list/assets/task-list-completed.svg} (100%) rename plugins/woocommerce-admin/client/{two-column-tasks/dismiss-modal.js => task-lists/setup-task-list/components/dismiss-modal.tsx} (91%) rename plugins/woocommerce-admin/client/{two-column-tasks/headers => task-lists/setup-task-list/components/task-headers}/appearance.js (94%) create mode 100644 plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/index.ts rename plugins/woocommerce-admin/client/{two-column-tasks/headers => task-lists/setup-task-list/components/task-headers}/marketing.js (94%) rename plugins/woocommerce-admin/client/{two-column-tasks/headers => task-lists/setup-task-list/components/task-headers}/payments.js (94%) rename plugins/woocommerce-admin/client/{two-column-tasks/headers => task-lists/setup-task-list/components/task-headers}/products.js (94%) rename plugins/woocommerce-admin/client/{two-column-tasks/headers => task-lists/setup-task-list/components/task-headers}/purchase.js (96%) rename plugins/woocommerce-admin/client/{two-column-tasks/headers => task-lists/setup-task-list/components/task-headers}/shipping.js (94%) rename plugins/woocommerce-admin/client/{two-column-tasks/headers => task-lists/setup-task-list/components/task-headers}/store-details.js (95%) rename plugins/woocommerce-admin/client/{two-column-tasks/headers => task-lists/setup-task-list/components/task-headers}/tax.js (94%) rename plugins/woocommerce-admin/client/{two-column-tasks/headers => task-lists/setup-task-list/components/task-headers}/timer.svg (100%) rename plugins/woocommerce-admin/client/{two-column-tasks/headers => task-lists/setup-task-list/components/task-headers}/woocommerce-payments.js (97%) rename plugins/woocommerce-admin/client/{two-column-tasks/completed-header.scss => task-lists/setup-task-list/components/task-list-completed-header.scss} (100%) rename plugins/woocommerce-admin/client/{two-column-tasks/completed-header.tsx => task-lists/setup-task-list/components/task-list-completed-header.tsx} (97%) rename plugins/woocommerce-admin/client/{two-column-tasks/completed.js => task-lists/setup-task-list/components/task-list-completed.tsx} (78%) rename plugins/woocommerce-admin/client/{two-column-tasks/task-list-item-two-column.tsx => task-lists/setup-task-list/components/task-list-item.tsx} (97%) rename plugins/woocommerce-admin/client/{two-column-tasks/placeholder.tsx => task-lists/setup-task-list/components/task-list-placeholder.tsx} (79%) rename plugins/woocommerce-admin/client/{two-column-tasks => task-lists/setup-task-list}/footer-slot/footer-slot.tsx (100%) rename plugins/woocommerce-admin/client/{two-column-tasks => task-lists/setup-task-list}/footer-slot/index.ts (100%) rename plugins/woocommerce-admin/client/{two-column-tasks => task-lists/setup-task-list}/footer-slot/utils.tsx (100%) create mode 100644 plugins/woocommerce-admin/client/task-lists/setup-task-list/index.ts rename plugins/woocommerce-admin/client/{two-column-tasks/task-list.tsx => task-lists/setup-task-list/setup-task-list.tsx} (92%) rename plugins/woocommerce-admin/client/{two-column-tasks => task-lists/setup-task-list}/style.scss (94%) rename plugins/woocommerce-admin/client/{two-column-tasks => task-lists/setup-task-list}/task-list-completion-slot/index.ts (100%) rename plugins/woocommerce-admin/client/{two-column-tasks => task-lists/setup-task-list}/task-list-completion-slot/task-list-completion-slot.tsx (100%) rename plugins/woocommerce-admin/client/{two-column-tasks => task-lists/setup-task-list}/task-list-completion-slot/utils.tsx (100%) rename plugins/woocommerce-admin/client/{two-column-tasks/test/task-list.test.tsx => task-lists/setup-task-list/test/setup-task-list.test.tsx} (94%) rename plugins/woocommerce-admin/client/{tasks/tasks.scss => task-lists/task-lists.scss} (100%) rename plugins/woocommerce-admin/client/{tasks/tasks.tsx => task-lists/task-lists.tsx} (85%) rename plugins/woocommerce-admin/client/{tasks => task-lists}/test/tasks.test.tsx (85%) delete mode 100644 plugins/woocommerce-admin/client/tasks/index.ts delete mode 100644 plugins/woocommerce-admin/client/two-column-tasks/extended-task.tsx delete mode 100644 plugins/woocommerce-admin/client/two-column-tasks/index.js delete mode 100644 plugins/woocommerce-admin/client/two-column-tasks/task-headers.ts create mode 100644 plugins/woocommerce/changelog/dev-clean-up-task-list diff --git a/plugins/woocommerce-admin/client/activity-panel/activity-panel.js b/plugins/woocommerce-admin/client/activity-panel/activity-panel.js index 3560e0499d8..ccc4bc0d1d5 100644 --- a/plugins/woocommerce-admin/client/activity-panel/activity-panel.js +++ b/plugins/woocommerce-admin/client/activity-panel/activity-panel.js @@ -43,7 +43,7 @@ import { getUnapprovedReviews } from '../homescreen/activity-panel/reviews/utils import { ABBREVIATED_NOTIFICATION_SLOT_NAME } from './panels/inbox/abbreviated-notifications-panel'; import { getAdminSetting } from '~/utils/admin-settings'; import { getUrlParams } from '~/utils'; -import { useActiveSetupTasklist } from '~/tasks'; +import { useActiveSetupTasklist } from '~/task-lists'; import { getSegmentsFromPath } from '~/utils/url-helpers'; import { FeedbackIcon } from '~/products/images/feedback-icon'; import { ProductFeedbackTour } from '~/guided-tours/add-product-feedback-tour'; diff --git a/plugins/woocommerce-admin/client/activity-panel/panels/setup-tasks/setup-tasks-panel.tsx b/plugins/woocommerce-admin/client/activity-panel/panels/setup-tasks/setup-tasks-panel.tsx index 492e8759ee4..66451648c87 100644 --- a/plugins/woocommerce-admin/client/activity-panel/panels/setup-tasks/setup-tasks-panel.tsx +++ b/plugins/woocommerce-admin/client/activity-panel/panels/setup-tasks/setup-tasks-panel.tsx @@ -1,7 +1,7 @@ /** * Internal dependencies */ -import { Tasks } from '~/tasks'; +import { TaskLists } from '~/task-lists'; type QueryTypeProps = { query: { @@ -12,7 +12,7 @@ type QueryTypeProps = { export const SetupTasksPanel = ( { query }: QueryTypeProps ) => { return (
- +
); }; diff --git a/plugins/woocommerce-admin/client/header/index.js b/plugins/woocommerce-admin/client/header/index.js index 5bd466f6492..026c4c28675 100644 --- a/plugins/woocommerce-admin/client/header/index.js +++ b/plugins/woocommerce-admin/client/header/index.js @@ -20,7 +20,7 @@ import { Text, useSlot } from '@woocommerce/experimental'; */ import './style.scss'; import useIsScrolled from '../hooks/useIsScrolled'; -import { TasksReminderBar, useActiveSetupTasklist } from '../tasks'; +import { TasksReminderBar, useActiveSetupTasklist } from '../task-lists'; export const PAGE_TITLE_FILTER = 'woocommerce_admin_header_page_title'; diff --git a/plugins/woocommerce-admin/client/homescreen/layout.js b/plugins/woocommerce-admin/client/homescreen/layout.js index 7901abc089a..6a0a25b0896 100644 --- a/plugins/woocommerce-admin/client/homescreen/layout.js +++ b/plugins/woocommerce-admin/client/homescreen/layout.js @@ -30,7 +30,11 @@ import InboxPanel from '../inbox-panel'; import { IntroModal as NavigationIntroModal } from '../navigation/components/intro-modal'; import StatsOverview from './stats-overview'; import { StoreManagementLinks } from '../store-management-links'; -import { TasksPlaceholder, useActiveSetupTasklist } from '../tasks'; +import { + TasksPlaceholder, + useActiveSetupTasklist, + ProgressTitle, +} from '../task-lists'; import { WELCOME_MODAL_DISMISSED_OPTION_NAME, WELCOME_FROM_CALYPSO_MODAL_DISMISSED_OPTION_NAME, @@ -41,14 +45,15 @@ import { MobileAppModal } from './mobile-app-modal'; import './style.scss'; import '../dashboard/style.scss'; import { getAdminSetting } from '~/utils/admin-settings'; -import { ProgressTitle } from '../task-lists'; import { WooHomescreenHeaderBanner } from './header-banner-slot'; import { WooHomescreenWCPayFeature } from './wcpay-feature-slot'; -const Tasks = lazy( () => - import( /* webpackChunkName: "tasks" */ '../tasks' ).then( ( module ) => ( { - default: module.Tasks, - } ) ) +const TaskLists = lazy( () => + import( /* webpackChunkName: "tasks" */ '../task-lists' ).then( + ( module ) => ( { + default: module.TaskLists, + } ) + ) ); export const Layout = ( { @@ -127,7 +132,7 @@ export const Layout = ( { ) } - + ); }; diff --git a/plugins/woocommerce-admin/client/layout/index.js b/plugins/woocommerce-admin/client/layout/index.js index 798d300d0ef..32517462a08 100644 --- a/plugins/woocommerce-admin/client/layout/index.js +++ b/plugins/woocommerce-admin/client/layout/index.js @@ -55,7 +55,7 @@ const StoreAlerts = lazy( () => const WCPayUsageModal = lazy( () => import( - /* webpackChunkName: "wcpay-usage-modal" */ '../tasks/fills/PaymentGatewaySuggestions/components/WCPay/UsageModal' + /* webpackChunkName: "wcpay-usage-modal" */ '../task-lists/fills/PaymentGatewaySuggestions/components/WCPay/UsageModal' ) ); diff --git a/plugins/woocommerce-admin/client/payments/test/payment-recommendations.test.tsx b/plugins/woocommerce-admin/client/payments/test/payment-recommendations.test.tsx index aa911412981..58e6acb1767 100644 --- a/plugins/woocommerce-admin/client/payments/test/payment-recommendations.test.tsx +++ b/plugins/woocommerce-admin/client/payments/test/payment-recommendations.test.tsx @@ -9,7 +9,7 @@ import { recordEvent } from '@woocommerce/tracks'; * Internal dependencies */ import PaymentRecommendations from '../payment-recommendations'; -import { isWCPaySupported } from '../../tasks/fills/PaymentGatewaySuggestions/components/WCPay'; +import { isWCPaySupported } from '../../task-lists/fills/PaymentGatewaySuggestions/components/WCPay'; import { createNoticesFromResponse } from '~/lib/notices'; jest.mock( '@woocommerce/tracks', () => ( { recordEvent: jest.fn() } ) ); @@ -44,7 +44,7 @@ jest.mock( '@woocommerce/components', () => ( { ), } ) ); jest.mock( - '../../tasks/fills/PaymentGatewaySuggestions/components/WCPay', + '../../task-lists/fills/PaymentGatewaySuggestions/components/WCPay', () => ( { isWCPaySupported: jest.fn(), } ) diff --git a/plugins/woocommerce-admin/client/tasks/back-button.scss b/plugins/woocommerce-admin/client/task-lists/components/back-button.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/back-button.scss rename to plugins/woocommerce-admin/client/task-lists/components/back-button.scss diff --git a/plugins/woocommerce-admin/client/tasks/back-button.tsx b/plugins/woocommerce-admin/client/task-lists/components/back-button.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/back-button.tsx rename to plugins/woocommerce-admin/client/task-lists/components/back-button.tsx diff --git a/plugins/woocommerce-admin/client/tasks/placeholder.scss b/plugins/woocommerce-admin/client/task-lists/components/placeholder.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/placeholder.scss rename to plugins/woocommerce-admin/client/task-lists/components/placeholder.scss diff --git a/plugins/woocommerce-admin/client/tasks/placeholder.tsx b/plugins/woocommerce-admin/client/task-lists/components/placeholder.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/placeholder.tsx rename to plugins/woocommerce-admin/client/task-lists/components/placeholder.tsx diff --git a/plugins/woocommerce-admin/client/task-lists/progress-header/default-progress-header.tsx b/plugins/woocommerce-admin/client/task-lists/components/progress-header/default-progress-header.tsx similarity index 96% rename from plugins/woocommerce-admin/client/task-lists/progress-header/default-progress-header.tsx rename to plugins/woocommerce-admin/client/task-lists/components/progress-header/default-progress-header.tsx index 1980bdc4d55..ef63ab57b0f 100644 --- a/plugins/woocommerce-admin/client/task-lists/progress-header/default-progress-header.tsx +++ b/plugins/woocommerce-admin/client/task-lists/components/progress-header/default-progress-header.tsx @@ -9,7 +9,7 @@ import { getVisibleTasks, ONBOARDING_STORE_NAME } from '@woocommerce/data'; * Internal dependencies */ import './progress-header.scss'; -import { TaskListMenu } from '~/tasks/task-list-menu'; +import { TaskListMenu } from '~/task-lists/components/task-list-menu'; export type DefaultProgressHeaderProps = { taskListId: string; diff --git a/plugins/woocommerce-admin/client/task-lists/progress-header/index.ts b/plugins/woocommerce-admin/client/task-lists/components/progress-header/index.ts similarity index 100% rename from plugins/woocommerce-admin/client/task-lists/progress-header/index.ts rename to plugins/woocommerce-admin/client/task-lists/components/progress-header/index.ts diff --git a/plugins/woocommerce-admin/client/task-lists/progress-header/progress-header.scss b/plugins/woocommerce-admin/client/task-lists/components/progress-header/progress-header.scss similarity index 100% rename from plugins/woocommerce-admin/client/task-lists/progress-header/progress-header.scss rename to plugins/woocommerce-admin/client/task-lists/components/progress-header/progress-header.scss diff --git a/plugins/woocommerce-admin/client/task-lists/progress-header/progress-header.tsx b/plugins/woocommerce-admin/client/task-lists/components/progress-header/progress-header.tsx similarity index 100% rename from plugins/woocommerce-admin/client/task-lists/progress-header/progress-header.tsx rename to plugins/woocommerce-admin/client/task-lists/components/progress-header/progress-header.tsx diff --git a/plugins/woocommerce-admin/client/task-lists/progress-header/utils.tsx b/plugins/woocommerce-admin/client/task-lists/components/progress-header/utils.tsx similarity index 100% rename from plugins/woocommerce-admin/client/task-lists/progress-header/utils.tsx rename to plugins/woocommerce-admin/client/task-lists/components/progress-header/utils.tsx diff --git a/plugins/woocommerce-admin/client/tasks/task-list-item.tsx b/plugins/woocommerce-admin/client/task-lists/components/task-list-item.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/task-list-item.tsx rename to plugins/woocommerce-admin/client/task-lists/components/task-list-item.tsx diff --git a/plugins/woocommerce-admin/client/tasks/task-list-menu.tsx b/plugins/woocommerce-admin/client/task-lists/components/task-list-menu.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/task-list-menu.tsx rename to plugins/woocommerce-admin/client/task-lists/components/task-list-menu.tsx diff --git a/plugins/woocommerce-admin/client/tasks/task-list.scss b/plugins/woocommerce-admin/client/task-lists/components/task-list.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/task-list.scss rename to plugins/woocommerce-admin/client/task-lists/components/task-list.scss diff --git a/plugins/woocommerce-admin/client/tasks/task-list.tsx b/plugins/woocommerce-admin/client/task-lists/components/task-list.tsx similarity index 97% rename from plugins/woocommerce-admin/client/tasks/task-list.tsx rename to plugins/woocommerce-admin/client/task-lists/components/task-list.tsx index 6fd4ebf8dbf..35e0ee52e14 100644 --- a/plugins/woocommerce-admin/client/tasks/task-list.tsx +++ b/plugins/woocommerce-admin/client/task-lists/components/task-list.tsx @@ -21,14 +21,13 @@ import { useLayoutContext } from '@woocommerce/admin-layout'; import { TaskListItem } from './task-list-item'; import { TaskListMenu } from './task-list-menu'; import './task-list.scss'; -import { ProgressHeader } from '~/task-lists/progress-header'; +import { ProgressHeader } from '~/task-lists/components/progress-header'; export type TaskListProps = TaskListType & { query: { task?: string; }; eventName?: string; - twoColumns?: boolean; keepCompletedTaskList?: 'yes' | 'no'; cesHeader?: boolean; }; diff --git a/plugins/woocommerce-admin/client/tasks/task.tsx b/plugins/woocommerce-admin/client/task-lists/components/task.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/task.tsx rename to plugins/woocommerce-admin/client/task-lists/components/task.tsx diff --git a/plugins/woocommerce-admin/client/tasks/test/task-list-item.test.tsx b/plugins/woocommerce-admin/client/task-lists/components/test/task-list-item.test.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/test/task-list-item.test.tsx rename to plugins/woocommerce-admin/client/task-lists/components/test/task-list-item.test.tsx diff --git a/plugins/woocommerce-admin/client/tasks/test/task-list.test.tsx b/plugins/woocommerce-admin/client/task-lists/components/test/task-list.test.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/test/task-list.test.tsx rename to plugins/woocommerce-admin/client/task-lists/components/test/task-list.test.tsx diff --git a/plugins/woocommerce-admin/client/tasks/test/task.test.tsx b/plugins/woocommerce-admin/client/task-lists/components/test/task.test.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/test/task.test.tsx rename to plugins/woocommerce-admin/client/task-lists/components/test/task.test.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/Marketing/Marketing.scss b/plugins/woocommerce-admin/client/task-lists/fills/Marketing/Marketing.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/Marketing/Marketing.scss rename to plugins/woocommerce-admin/client/task-lists/fills/Marketing/Marketing.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/Marketing/Plugin.scss b/plugins/woocommerce-admin/client/task-lists/fills/Marketing/Plugin.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/Marketing/Plugin.scss rename to plugins/woocommerce-admin/client/task-lists/fills/Marketing/Plugin.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/Marketing/Plugin.tsx b/plugins/woocommerce-admin/client/task-lists/fills/Marketing/Plugin.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/Marketing/Plugin.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/Marketing/Plugin.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/Marketing/PluginList.scss b/plugins/woocommerce-admin/client/task-lists/fills/Marketing/PluginList.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/Marketing/PluginList.scss rename to plugins/woocommerce-admin/client/task-lists/fills/Marketing/PluginList.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/Marketing/PluginList.tsx b/plugins/woocommerce-admin/client/task-lists/fills/Marketing/PluginList.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/Marketing/PluginList.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/Marketing/PluginList.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/Marketing/index.tsx b/plugins/woocommerce-admin/client/task-lists/fills/Marketing/index.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/Marketing/index.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/Marketing/index.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/Marketing/test/index.tsx b/plugins/woocommerce-admin/client/task-lists/fills/Marketing/test/index.tsx similarity index 99% rename from plugins/woocommerce-admin/client/tasks/fills/Marketing/test/index.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/Marketing/test/index.tsx index 6caa7b753d4..fab753179f4 100644 --- a/plugins/woocommerce-admin/client/tasks/fills/Marketing/test/index.tsx +++ b/plugins/woocommerce-admin/client/task-lists/fills/Marketing/test/index.tsx @@ -6,7 +6,7 @@ import { Extension } from '@woocommerce/data'; /** * Internal dependencies */ -import { transformExtensionToPlugin, getMarketingExtensionLists } from '../'; +import { transformExtensionToPlugin, getMarketingExtensionLists } from '..'; const basicPlugins: Extension[] = [ { diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Action.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Action.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Action.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Action.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/List/Item.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/List/Item.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/List/Item.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/List/Item.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/List/List.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/List/List.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/List/List.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/List/List.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/List/List.scss b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/List/List.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/List/List.scss rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/List/List.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/List/Placeholder.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/List/Placeholder.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/List/Placeholder.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/List/Placeholder.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/List/fallback.png b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/List/fallback.png similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/List/fallback.png rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/List/fallback.png diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/List/index.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/List/index.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/List/index.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/List/index.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/List/test/list.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/List/test/list.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/List/test/list.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/List/test/list.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Setup/Configure.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/Configure.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Setup/Configure.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/Configure.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Setup/Placeholder.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/Placeholder.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Setup/Placeholder.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/Placeholder.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Setup/Setup.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/Setup.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Setup/Setup.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/Setup.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Setup/Setup.scss b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/Setup.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Setup/Setup.scss rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/Setup.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Setup/index.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/index.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Setup/index.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/index.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Setup/test/configure.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/test/configure.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Setup/test/configure.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/test/configure.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Setup/test/setup.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/test/setup.js similarity index 98% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Setup/test/setup.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/test/setup.js index f5643ec761e..15564b970b3 100644 --- a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Setup/test/setup.js +++ b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/test/setup.js @@ -6,7 +6,7 @@ import { render } from '@testing-library/react'; /** * Internal dependencies */ -import { Setup } from '../'; +import { Setup } from '..'; import { enqueueScript } from '~/utils/enqueue-script'; jest.mock( '@woocommerce/components', () => { diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Toggle/Toggle.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Toggle/Toggle.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Toggle/Toggle.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Toggle/Toggle.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Toggle/Toggle.scss b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Toggle/Toggle.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Toggle/Toggle.scss rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Toggle/Toggle.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Toggle/index.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Toggle/index.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/Toggle/index.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Toggle/index.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/WCPay/Suggestion.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/WCPay/Suggestion.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/WCPay/Suggestion.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/WCPay/Suggestion.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/WCPay/UsageModal.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/WCPay/UsageModal.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/WCPay/UsageModal.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/WCPay/UsageModal.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/WCPay/index.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/WCPay/index.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/WCPay/index.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/WCPay/index.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/WCPay/suggestion.scss b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/WCPay/suggestion.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/WCPay/suggestion.scss rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/WCPay/suggestion.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/WCPay/utils.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/WCPay/utils.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/components/WCPay/utils.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/components/WCPay/utils.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/index.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/index.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/index.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/index.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/payment-gateway-suggestions.scss b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/payment-gateway-suggestions.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/payment-gateway-suggestions.scss rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/payment-gateway-suggestions.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/plugins/Bacs.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/plugins/Bacs.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/plugins/Bacs.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/plugins/Bacs.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/test/index.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/test/index.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/test/index.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/test/index.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/test/utils.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/test/utils.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/test/utils.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/test/utils.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/utils.js b/plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/utils.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/PaymentGatewaySuggestions/utils.js rename to plugins/woocommerce-admin/client/task-lists/fills/PaymentGatewaySuggestions/utils.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/appearance.js b/plugins/woocommerce-admin/client/task-lists/fills/appearance.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/appearance.js rename to plugins/woocommerce-admin/client/task-lists/fills/appearance.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/components/load-sample-product-confirm-modal.scss b/plugins/woocommerce-admin/client/task-lists/fills/components/load-sample-product-confirm-modal.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/components/load-sample-product-confirm-modal.scss rename to plugins/woocommerce-admin/client/task-lists/fills/components/load-sample-product-confirm-modal.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/components/load-sample-product-confirm-modal.tsx b/plugins/woocommerce-admin/client/task-lists/fills/components/load-sample-product-confirm-modal.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/components/load-sample-product-confirm-modal.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/components/load-sample-product-confirm-modal.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/components/load-sample-product-modal.scss b/plugins/woocommerce-admin/client/task-lists/fills/components/load-sample-product-modal.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/components/load-sample-product-modal.scss rename to plugins/woocommerce-admin/client/task-lists/fills/components/load-sample-product-modal.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/components/load-sample-product-modal.tsx b/plugins/woocommerce-admin/client/task-lists/fills/components/load-sample-product-modal.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/components/load-sample-product-modal.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/components/load-sample-product-modal.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/components/test/load-sample-product-modal.tsx b/plugins/woocommerce-admin/client/task-lists/fills/components/test/load-sample-product-modal.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/components/test/load-sample-product-modal.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/components/test/load-sample-product-modal.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/components/use-load-sample-products.ts b/plugins/woocommerce-admin/client/task-lists/fills/components/use-load-sample-products.ts similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/components/use-load-sample-products.ts rename to plugins/woocommerce-admin/client/task-lists/fills/components/use-load-sample-products.ts diff --git a/plugins/woocommerce-admin/client/tasks/deprecated-tasks.tsx b/plugins/woocommerce-admin/client/task-lists/fills/deprecated-tasks.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/deprecated-tasks.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/deprecated-tasks.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/components/connect.tsx b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/components/connect.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/components/connect.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/components/connect.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/components/plugin-banner.scss b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/components/plugin-banner.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/components/plugin-banner.scss rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/components/plugin-banner.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/components/plugin-banner.tsx b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/components/plugin-banner.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/components/plugin-banner.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/components/plugin-banner.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/components/plugins.tsx b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/components/plugins.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/components/plugins.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/components/plugins.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/components/store-location.tsx b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/components/store-location.tsx similarity index 95% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/components/store-location.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/components/store-location.tsx index 9479c0d7635..00b8670e3c1 100644 --- a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/components/store-location.tsx +++ b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/components/store-location.tsx @@ -11,7 +11,7 @@ import { useSelect, useDispatch } from '@wordpress/data'; */ import { getCountryCode } from '~/dashboard/utils'; import { hasCompleteAddress } from '../../tax/utils'; -import { default as StoreLocationForm } from '~/tasks/fills/steps/location'; +import { default as StoreLocationForm } from '~/task-lists/fills/steps/location'; export const StoreLocation: React.FC< { nextStep: () => void; diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/components/wcs-banner.tsx b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/components/wcs-banner.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/components/wcs-banner.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/components/wcs-banner.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/images/discount.svg b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/images/discount.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/images/discount.svg rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/images/discount.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/images/paper.svg b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/images/paper.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/images/paper.svg rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/images/paper.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/images/printer.svg b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/images/printer.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/images/printer.svg rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/images/printer.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/images/shipstation.svg b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/images/shipstation.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/images/shipstation.svg rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/images/shipstation.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/images/star.svg b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/images/star.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/images/star.svg rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/images/star.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/images/timer.svg b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/images/timer.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/images/timer.svg rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/images/timer.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/images/wcs.svg b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/images/wcs.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/images/wcs.svg rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/images/wcs.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/index.tsx b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/index.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/index.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/index.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/shipping-recommendation.tsx b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/shipping-recommendation.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/shipping-recommendation.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/shipping-recommendation.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/test/shipping-recommendation.tsx b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/test/shipping-recommendation.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/test/shipping-recommendation.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/test/shipping-recommendation.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/types.ts b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/types.ts similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/types.ts rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/types.ts diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/utils.ts b/plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/utils.ts similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/experimental-shipping-recommendation/utils.ts rename to plugins/woocommerce-admin/client/task-lists/fills/experimental-shipping-recommendation/utils.ts diff --git a/plugins/woocommerce-admin/client/tasks/fills/import-products/CardList.tsx b/plugins/woocommerce-admin/client/task-lists/fills/import-products/CardList.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/import-products/CardList.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/import-products/CardList.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/import-products/cards.scss b/plugins/woocommerce-admin/client/task-lists/fills/import-products/cards.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/import-products/cards.scss rename to plugins/woocommerce-admin/client/task-lists/fills/import-products/cards.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/import-products/importTypes.tsx b/plugins/woocommerce-admin/client/task-lists/fills/import-products/importTypes.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/import-products/importTypes.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/import-products/importTypes.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/import-products/index.tsx b/plugins/woocommerce-admin/client/task-lists/fills/import-products/index.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/import-products/index.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/import-products/index.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/import-products/style.scss b/plugins/woocommerce-admin/client/task-lists/fills/import-products/style.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/import-products/style.scss rename to plugins/woocommerce-admin/client/task-lists/fills/import-products/style.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/import-products/test/index.tsx b/plugins/woocommerce-admin/client/task-lists/fills/import-products/test/index.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/import-products/test/index.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/import-products/test/index.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/index.ts b/plugins/woocommerce-admin/client/task-lists/fills/index.ts similarity index 95% rename from plugins/woocommerce-admin/client/tasks/fills/index.ts rename to plugins/woocommerce-admin/client/task-lists/fills/index.ts index 767469bd3d7..d2805bb7b1e 100644 --- a/plugins/woocommerce-admin/client/tasks/fills/index.ts +++ b/plugins/woocommerce-admin/client/task-lists/fills/index.ts @@ -9,6 +9,7 @@ import './appearance'; import './tax'; import './woocommerce-payments'; import './purchase'; +import './deprecated-tasks'; const possiblyImportProductTask = async () => { if ( isImportProduct() ) { diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/constants.tsx b/plugins/woocommerce-admin/client/task-lists/fills/products/constants.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/products/constants.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/products/constants.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/footer.tsx b/plugins/woocommerce-admin/client/task-lists/fills/products/footer.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/products/footer.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/products/footer.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/icon/lightbulb_24px.js b/plugins/woocommerce-admin/client/task-lists/fills/products/icon/lightbulb_24px.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/products/icon/lightbulb_24px.js rename to plugins/woocommerce-admin/client/task-lists/fills/products/icon/lightbulb_24px.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/icon/link_24px.js b/plugins/woocommerce-admin/client/task-lists/fills/products/icon/link_24px.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/products/icon/link_24px.js rename to plugins/woocommerce-admin/client/task-lists/fills/products/icon/link_24px.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/icon/widgets_24px.js b/plugins/woocommerce-admin/client/task-lists/fills/products/icon/widgets_24px.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/products/icon/widgets_24px.js rename to plugins/woocommerce-admin/client/task-lists/fills/products/icon/widgets_24px.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/index.scss b/plugins/woocommerce-admin/client/task-lists/fills/products/index.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/products/index.scss rename to plugins/woocommerce-admin/client/task-lists/fills/products/index.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/index.tsx b/plugins/woocommerce-admin/client/task-lists/fills/products/index.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/products/index.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/products/index.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/stack.scss b/plugins/woocommerce-admin/client/task-lists/fills/products/stack.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/products/stack.scss rename to plugins/woocommerce-admin/client/task-lists/fills/products/stack.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/stack.tsx b/plugins/woocommerce-admin/client/task-lists/fills/products/stack.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/products/stack.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/products/stack.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/test/footer.tsx b/plugins/woocommerce-admin/client/task-lists/fills/products/test/footer.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/products/test/footer.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/products/test/footer.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/test/index.tsx b/plugins/woocommerce-admin/client/task-lists/fills/products/test/index.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/products/test/index.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/products/test/index.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/test/stack.tsx b/plugins/woocommerce-admin/client/task-lists/fills/products/test/stack.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/products/test/stack.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/products/test/stack.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/test/utils.ts b/plugins/woocommerce-admin/client/task-lists/fills/products/test/utils.ts similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/products/test/utils.ts rename to plugins/woocommerce-admin/client/task-lists/fills/products/test/utils.ts diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/use-create-product-by-type.ts b/plugins/woocommerce-admin/client/task-lists/fills/products/use-create-product-by-type.ts similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/products/use-create-product-by-type.ts rename to plugins/woocommerce-admin/client/task-lists/fills/products/use-create-product-by-type.ts diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/use-product-types-list-items.tsx b/plugins/woocommerce-admin/client/task-lists/fills/products/use-product-types-list-items.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/products/use-product-types-list-items.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/products/use-product-types-list-items.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/utils.tsx b/plugins/woocommerce-admin/client/task-lists/fills/products/utils.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/products/utils.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/products/utils.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/purchase.tsx b/plugins/woocommerce-admin/client/task-lists/fills/purchase.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/purchase.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/purchase.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/index.js b/plugins/woocommerce-admin/client/task-lists/fills/shipping/index.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/index.js rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/index.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/rates.js b/plugins/woocommerce-admin/client/task-lists/fills/shipping/rates.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/rates.js rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/rates.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/check.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/check.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/check.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/check.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/discount.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/discount.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/discount.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/discount.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/envia-banner-side.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/envia-banner-side.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/envia-banner-side.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/envia-banner-side.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/packlink-banner-side.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/packlink-banner-side.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/packlink-banner-side.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/packlink-banner-side.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/packlink-column-logo.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/packlink-column-logo.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/packlink-column-logo.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/packlink-column-logo.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/paper.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/paper.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/paper.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/paper.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/printer.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/printer.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/printer.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/printer.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/sendcloud-banner-side.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/sendcloud-banner-side.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/sendcloud-banner-side.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/sendcloud-banner-side.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/sendcloud-column-logo.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/sendcloud-column-logo.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/sendcloud-column-logo.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/sendcloud-column-logo.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/shipstation-banner-side.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/shipstation-banner-side.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/shipstation-banner-side.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/shipstation-banner-side.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/shipstation-column-logo.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/shipstation-column-logo.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/shipstation-column-logo.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/shipstation-column-logo.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/shipstation.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/shipstation.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/shipstation.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/shipstation.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/skydropx-banner-side.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/skydropx-banner-side.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/skydropx-banner-side.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/skydropx-banner-side.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/star.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/star.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/star.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/star.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/timer.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/timer.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/timer.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/timer.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/wcs-banner-side.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/wcs-banner-side.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/wcs-banner-side.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/wcs-banner-side.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/wcs.svg b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/wcs.svg similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/assets/wcs.svg rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/assets/wcs.svg diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/partners.tsx b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/partners.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/partners.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/partners.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/shipping-providers.ts b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/shipping-providers.ts similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping-providers/shipping-providers.ts rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping-providers/shipping-providers.ts diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/shipping.scss b/plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/shipping.scss rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/shipping.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/shipping/single-partner-features.ts b/plugins/woocommerce-admin/client/task-lists/fills/shipping/single-partner-features.ts similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/shipping/single-partner-features.ts rename to plugins/woocommerce-admin/client/task-lists/fills/shipping/single-partner-features.ts diff --git a/plugins/woocommerce-admin/client/tasks/fills/steps/location.tsx b/plugins/woocommerce-admin/client/task-lists/fills/steps/location.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/steps/location.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/steps/location.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/avalara/card.tsx b/plugins/woocommerce-admin/client/task-lists/fills/tax/avalara/card.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/avalara/card.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/tax/avalara/card.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/avalara/logo.png b/plugins/woocommerce-admin/client/task-lists/fills/tax/avalara/logo.png similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/avalara/logo.png rename to plugins/woocommerce-admin/client/task-lists/fills/tax/avalara/logo.png diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/components/bullet.tsx b/plugins/woocommerce-admin/client/task-lists/fills/tax/components/bullet.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/components/bullet.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/tax/components/bullet.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/components/partner-card.scss b/plugins/woocommerce-admin/client/task-lists/fills/tax/components/partner-card.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/components/partner-card.scss rename to plugins/woocommerce-admin/client/task-lists/fills/tax/components/partner-card.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/components/partner-card.tsx b/plugins/woocommerce-admin/client/task-lists/fills/tax/components/partner-card.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/components/partner-card.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/tax/components/partner-card.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/components/partners.scss b/plugins/woocommerce-admin/client/task-lists/fills/tax/components/partners.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/components/partners.scss rename to plugins/woocommerce-admin/client/task-lists/fills/tax/components/partners.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/components/partners.tsx b/plugins/woocommerce-admin/client/task-lists/fills/tax/components/partners.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/components/partners.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/tax/components/partners.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/components/store-location.tsx b/plugins/woocommerce-admin/client/task-lists/fills/tax/components/store-location.tsx similarity index 98% rename from plugins/woocommerce-admin/client/tasks/fills/tax/components/store-location.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/tax/components/store-location.tsx index 7c06822a3b2..52272acb945 100644 --- a/plugins/woocommerce-admin/client/tasks/fills/tax/components/store-location.tsx +++ b/plugins/woocommerce-admin/client/task-lists/fills/tax/components/store-location.tsx @@ -16,7 +16,7 @@ import { default as StoreLocationForm, FormValues, defaultValidate, -} from '~/tasks/fills/steps/location'; +} from '~/task-lists/fills/steps/location'; const validateLocationForm = ( values: FormValues ) => { const errors = defaultValidate( values ); diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/index.tsx b/plugins/woocommerce-admin/client/task-lists/fills/tax/index.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/index.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/tax/index.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/manual-configuration/configure.tsx b/plugins/woocommerce-admin/client/task-lists/fills/tax/manual-configuration/configure.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/manual-configuration/configure.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/tax/manual-configuration/configure.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/manual-configuration/index.tsx b/plugins/woocommerce-admin/client/task-lists/fills/tax/manual-configuration/index.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/manual-configuration/index.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/tax/manual-configuration/index.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/utils.ts b/plugins/woocommerce-admin/client/task-lists/fills/tax/utils.ts similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/utils.ts rename to plugins/woocommerce-admin/client/task-lists/fills/tax/utils.ts diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/woocommerce-tax/automated-taxes.tsx b/plugins/woocommerce-admin/client/task-lists/fills/tax/woocommerce-tax/automated-taxes.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/woocommerce-tax/automated-taxes.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/tax/woocommerce-tax/automated-taxes.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/woocommerce-tax/card.tsx b/plugins/woocommerce-admin/client/task-lists/fills/tax/woocommerce-tax/card.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/woocommerce-tax/card.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/tax/woocommerce-tax/card.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/woocommerce-tax/connect.tsx b/plugins/woocommerce-admin/client/task-lists/fills/tax/woocommerce-tax/connect.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/woocommerce-tax/connect.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/tax/woocommerce-tax/connect.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/woocommerce-tax/index.tsx b/plugins/woocommerce-admin/client/task-lists/fills/tax/woocommerce-tax/index.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/woocommerce-tax/index.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/tax/woocommerce-tax/index.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/woocommerce-tax/logo.png b/plugins/woocommerce-admin/client/task-lists/fills/tax/woocommerce-tax/logo.png similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/woocommerce-tax/logo.png rename to plugins/woocommerce-admin/client/task-lists/fills/tax/woocommerce-tax/logo.png diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/woocommerce-tax/plugins.tsx b/plugins/woocommerce-admin/client/task-lists/fills/tax/woocommerce-tax/plugins.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/woocommerce-tax/plugins.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/tax/woocommerce-tax/plugins.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/woocommerce-tax/setup.scss b/plugins/woocommerce-admin/client/task-lists/fills/tax/woocommerce-tax/setup.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/woocommerce-tax/setup.scss rename to plugins/woocommerce-admin/client/task-lists/fills/tax/woocommerce-tax/setup.scss diff --git a/plugins/woocommerce-admin/client/tasks/fills/tax/woocommerce-tax/setup.tsx b/plugins/woocommerce-admin/client/task-lists/fills/tax/woocommerce-tax/setup.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/tax/woocommerce-tax/setup.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/tax/woocommerce-tax/setup.tsx diff --git a/plugins/woocommerce-admin/client/tasks/fills/use-record-completion-time.ts b/plugins/woocommerce-admin/client/task-lists/fills/use-record-completion-time.ts similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/use-record-completion-time.ts rename to plugins/woocommerce-admin/client/task-lists/fills/use-record-completion-time.ts diff --git a/plugins/woocommerce-admin/client/tasks/fills/utils.js b/plugins/woocommerce-admin/client/task-lists/fills/utils.js similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/utils.js rename to plugins/woocommerce-admin/client/task-lists/fills/utils.js diff --git a/plugins/woocommerce-admin/client/tasks/fills/woocommerce-payments.tsx b/plugins/woocommerce-admin/client/task-lists/fills/woocommerce-payments.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/fills/woocommerce-payments.tsx rename to plugins/woocommerce-admin/client/task-lists/fills/woocommerce-payments.tsx diff --git a/plugins/woocommerce-admin/client/tasks/hooks/useActiveSetupList.ts b/plugins/woocommerce-admin/client/task-lists/hooks/useActiveSetupList.ts similarity index 100% rename from plugins/woocommerce-admin/client/tasks/hooks/useActiveSetupList.ts rename to plugins/woocommerce-admin/client/task-lists/hooks/useActiveSetupList.ts diff --git a/plugins/woocommerce-admin/client/task-lists/index.ts b/plugins/woocommerce-admin/client/task-lists/index.ts index d09ba9f14e0..79af883a1a3 100644 --- a/plugins/woocommerce-admin/client/task-lists/index.ts +++ b/plugins/woocommerce-admin/client/task-lists/index.ts @@ -1,2 +1,10 @@ -export * from './progress-header'; +/** + * Internal dependencies + */ +import './fills'; + +export * from './task-lists'; +export * from './reminder-bar'; export * from './progress-title'; +export * from './components/placeholder'; +export * from './hooks/useActiveSetupList'; diff --git a/plugins/woocommerce-admin/client/tasks/reminder-bar/index.tsx b/plugins/woocommerce-admin/client/task-lists/reminder-bar/index.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/reminder-bar/index.tsx rename to plugins/woocommerce-admin/client/task-lists/reminder-bar/index.tsx diff --git a/plugins/woocommerce-admin/client/tasks/reminder-bar/reminder-bar.scss b/plugins/woocommerce-admin/client/task-lists/reminder-bar/reminder-bar.scss similarity index 100% rename from plugins/woocommerce-admin/client/tasks/reminder-bar/reminder-bar.scss rename to plugins/woocommerce-admin/client/task-lists/reminder-bar/reminder-bar.scss diff --git a/plugins/woocommerce-admin/client/tasks/reminder-bar/reminder-bar.tsx b/plugins/woocommerce-admin/client/task-lists/reminder-bar/reminder-bar.tsx similarity index 100% rename from plugins/woocommerce-admin/client/tasks/reminder-bar/reminder-bar.tsx rename to plugins/woocommerce-admin/client/task-lists/reminder-bar/reminder-bar.tsx diff --git a/plugins/woocommerce-admin/client/two-column-tasks/completed-celebration-header.svg b/plugins/woocommerce-admin/client/task-lists/setup-task-list/assets/completed-celebration-header.svg similarity index 100% rename from plugins/woocommerce-admin/client/two-column-tasks/completed-celebration-header.svg rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/assets/completed-celebration-header.svg diff --git a/plugins/woocommerce-admin/client/two-column-tasks/completed.svg b/plugins/woocommerce-admin/client/task-lists/setup-task-list/assets/task-list-completed.svg similarity index 100% rename from plugins/woocommerce-admin/client/two-column-tasks/completed.svg rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/assets/task-list-completed.svg diff --git a/plugins/woocommerce-admin/client/two-column-tasks/dismiss-modal.js b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/dismiss-modal.tsx similarity index 91% rename from plugins/woocommerce-admin/client/two-column-tasks/dismiss-modal.js rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/components/dismiss-modal.tsx index c0efa717603..cec59c4ffd7 100644 --- a/plugins/woocommerce-admin/client/two-column-tasks/dismiss-modal.js +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/dismiss-modal.tsx @@ -8,6 +8,10 @@ const DismissModal = ( { showDismissModal, setShowDismissModal, hideTasks, +}: { + showDismissModal: boolean; + setShowDismissModal: ( show: boolean ) => void; + hideTasks: ( task: string ) => void; } ) => { const closeModal = () => setShowDismissModal( false ); const title = __( 'Hide store setup tasks', 'woocommerce' ); diff --git a/plugins/woocommerce-admin/client/two-column-tasks/headers/appearance.js b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/appearance.js similarity index 94% rename from plugins/woocommerce-admin/client/two-column-tasks/headers/appearance.js rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/appearance.js index a247eb3b75a..836d264fd9d 100644 --- a/plugins/woocommerce-admin/client/two-column-tasks/headers/appearance.js +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/appearance.js @@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n'; * Internal dependencies */ import TimerImage from './timer.svg'; -import { WC_ASSET_URL } from '../../utils/admin-settings'; +import { WC_ASSET_URL } from '../../../../utils/admin-settings'; const AppearanceHeader = ( { task, goToTask } ) => { return ( diff --git a/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/index.ts b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/index.ts new file mode 100644 index 00000000000..c8f3d548b65 --- /dev/null +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/index.ts @@ -0,0 +1,24 @@ +/** + * Internal dependencies + */ +import StoreDetailsHeader from './store-details'; +import TaxHeader from './tax'; +import MarketingHeader from './marketing'; +import AppearanceHeader from './appearance'; +import ShippingHeader from './shipping'; +import ProductsHeader from './products'; +import PurchaseHeader from './purchase'; +import PaymentsHeader from './payments'; +import WoocommercePaymentsHeader from './woocommerce-payments'; + +export const taskHeaders: Record< string, React.ElementType > = { + store_details: StoreDetailsHeader, + tax: TaxHeader, + shipping: ShippingHeader, + marketing: MarketingHeader, + appearance: AppearanceHeader, + payments: PaymentsHeader, + products: ProductsHeader, + purchase: PurchaseHeader, + 'woocommerce-payments': WoocommercePaymentsHeader, +}; diff --git a/plugins/woocommerce-admin/client/two-column-tasks/headers/marketing.js b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/marketing.js similarity index 94% rename from plugins/woocommerce-admin/client/two-column-tasks/headers/marketing.js rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/marketing.js index a918573935f..120c95a150d 100644 --- a/plugins/woocommerce-admin/client/two-column-tasks/headers/marketing.js +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/marketing.js @@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n'; * Internal dependencies */ import TimerImage from './timer.svg'; -import { WC_ASSET_URL } from '../../utils/admin-settings'; +import { WC_ASSET_URL } from '../../../../utils/admin-settings'; const MarketingHeader = ( { task, goToTask } ) => { return ( diff --git a/plugins/woocommerce-admin/client/two-column-tasks/headers/payments.js b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/payments.js similarity index 94% rename from plugins/woocommerce-admin/client/two-column-tasks/headers/payments.js rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/payments.js index 21cabcd4559..5bd6edeaedd 100644 --- a/plugins/woocommerce-admin/client/two-column-tasks/headers/payments.js +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/payments.js @@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n'; * Internal dependencies */ import TimerImage from './timer.svg'; -import { WC_ASSET_URL } from '../../utils/admin-settings'; +import { WC_ASSET_URL } from '../../../../utils/admin-settings'; const PaymentsHeader = ( { task, goToTask } ) => { return ( diff --git a/plugins/woocommerce-admin/client/two-column-tasks/headers/products.js b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/products.js similarity index 94% rename from plugins/woocommerce-admin/client/two-column-tasks/headers/products.js rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/products.js index 3af8e77e3e9..11b42c4a94b 100644 --- a/plugins/woocommerce-admin/client/two-column-tasks/headers/products.js +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/products.js @@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n'; * Internal dependencies */ import TimerImage from './timer.svg'; -import { WC_ASSET_URL } from '../../utils/admin-settings'; +import { WC_ASSET_URL } from '../../../../utils/admin-settings'; const ProductsHeader = ( { task, goToTask } ) => { return ( diff --git a/plugins/woocommerce-admin/client/two-column-tasks/headers/purchase.js b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/purchase.js similarity index 96% rename from plugins/woocommerce-admin/client/two-column-tasks/headers/purchase.js rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/purchase.js index a84c1e46c2a..2cc7eb2726d 100644 --- a/plugins/woocommerce-admin/client/two-column-tasks/headers/purchase.js +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/purchase.js @@ -11,7 +11,7 @@ import { recordEvent } from '@woocommerce/tracks'; */ import CartModal from '~/dashboard/components/cart-modal'; import TimerImage from './timer.svg'; -import { WC_ASSET_URL } from '../../utils/admin-settings'; +import { WC_ASSET_URL } from '../../../../utils/admin-settings'; const PurchaseHeader = ( { task } ) => { const [ cartModalOpen, setCartModalOpen ] = useState( false ); diff --git a/plugins/woocommerce-admin/client/two-column-tasks/headers/shipping.js b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/shipping.js similarity index 94% rename from plugins/woocommerce-admin/client/two-column-tasks/headers/shipping.js rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/shipping.js index eaeb4238d39..42cf8d7552c 100644 --- a/plugins/woocommerce-admin/client/two-column-tasks/headers/shipping.js +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/shipping.js @@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n'; * Internal dependencies */ import TimerImage from './timer.svg'; -import { WC_ASSET_URL } from '../../utils/admin-settings'; +import { WC_ASSET_URL } from '../../../../utils/admin-settings'; const ShippingHeader = ( { task, goToTask } ) => { return ( diff --git a/plugins/woocommerce-admin/client/two-column-tasks/headers/store-details.js b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/store-details.js similarity index 95% rename from plugins/woocommerce-admin/client/two-column-tasks/headers/store-details.js rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/store-details.js index 3b6f25504eb..6ae25d25710 100644 --- a/plugins/woocommerce-admin/client/two-column-tasks/headers/store-details.js +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/store-details.js @@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n'; * Internal dependencies */ import TimerImage from './timer.svg'; -import { WC_ASSET_URL } from '../../utils/admin-settings'; +import { WC_ASSET_URL } from '../../../../utils/admin-settings'; const StoreDetailsHeader = ( { task, goToTask } ) => { return ( diff --git a/plugins/woocommerce-admin/client/two-column-tasks/headers/tax.js b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/tax.js similarity index 94% rename from plugins/woocommerce-admin/client/two-column-tasks/headers/tax.js rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/tax.js index 72cc65e8db1..6bab840e9fe 100644 --- a/plugins/woocommerce-admin/client/two-column-tasks/headers/tax.js +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/tax.js @@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n'; * Internal dependencies */ import TimerImage from './timer.svg'; -import { WC_ASSET_URL } from '../../utils/admin-settings'; +import { WC_ASSET_URL } from '../../../../utils/admin-settings'; const TaxHeader = ( { task, goToTask } ) => { return ( diff --git a/plugins/woocommerce-admin/client/two-column-tasks/headers/timer.svg b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/timer.svg similarity index 100% rename from plugins/woocommerce-admin/client/two-column-tasks/headers/timer.svg rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/timer.svg diff --git a/plugins/woocommerce-admin/client/two-column-tasks/headers/woocommerce-payments.js b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/woocommerce-payments.js similarity index 97% rename from plugins/woocommerce-admin/client/two-column-tasks/headers/woocommerce-payments.js rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/woocommerce-payments.js index b47ae6f423f..abf8bbdf2d0 100644 --- a/plugins/woocommerce-admin/client/two-column-tasks/headers/woocommerce-payments.js +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-headers/woocommerce-payments.js @@ -14,7 +14,7 @@ import interpolateComponents from '@automattic/interpolate-components'; * Internal dependencies */ import TimerImage from './timer.svg'; -import { WC_ASSET_URL } from '../../utils/admin-settings'; +import { WC_ASSET_URL } from '~/utils/admin-settings'; const connect = ( createNotice, setIsBusy ) => { const errorMessage = __( diff --git a/plugins/woocommerce-admin/client/two-column-tasks/completed-header.scss b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-list-completed-header.scss similarity index 100% rename from plugins/woocommerce-admin/client/two-column-tasks/completed-header.scss rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-list-completed-header.scss diff --git a/plugins/woocommerce-admin/client/two-column-tasks/completed-header.tsx b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-list-completed-header.tsx similarity index 97% rename from plugins/woocommerce-admin/client/two-column-tasks/completed-header.tsx rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-list-completed-header.tsx index a3e94b33d2c..93db998f16e 100644 --- a/plugins/woocommerce-admin/client/two-column-tasks/completed-header.tsx +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-list-completed-header.tsx @@ -21,8 +21,8 @@ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import './completed-header.scss'; -import HeaderImage from './completed-celebration-header.svg'; +import './task-list-completed-header.scss'; +import HeaderImage from '../assets/completed-celebration-header.svg'; type TaskListCompletedHeaderProps = { hideTasks: () => void; @@ -149,7 +149,7 @@ export const TaskListCompletedHeader: React.FC< <>
{ +export const TaskListCompleted = ( { + hideTasks, + keepTasks, +}: { + hideTasks: () => void; + keepTasks: () => void; +} ) => { return ( <>
void; }; -export const TaskListItemTwoColumn: React.FC< TaskListItemProps > = ( { +export const TaskListItem: React.FC< TaskListItemProps > = ( { task, activeTaskId, taskIndex, diff --git a/plugins/woocommerce-admin/client/two-column-tasks/placeholder.tsx b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-list-placeholder.tsx similarity index 79% rename from plugins/woocommerce-admin/client/two-column-tasks/placeholder.tsx rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-list-placeholder.tsx index 2cbea8720db..3cc44fc55c9 100644 --- a/plugins/woocommerce-admin/client/two-column-tasks/placeholder.tsx +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/components/task-list-placeholder.tsx @@ -6,7 +6,6 @@ import classnames from 'classnames'; /** * Internal dependencies */ -import './style.scss'; type TasksPlaceholderProps = { numTasks?: number; @@ -16,15 +15,16 @@ type TasksPlaceholderProps = { }; }; -const TaskListPlaceholder: React.FC< TasksPlaceholderProps > = ( props ) => { - const { numTasks = 5, twoColumns = false } = props; +export const TaskListPlaceholder: React.FC< TasksPlaceholderProps > = ( + props +) => { + const { numTasks = 5 } = props; return (
diff --git a/plugins/woocommerce-admin/client/two-column-tasks/footer-slot/footer-slot.tsx b/plugins/woocommerce-admin/client/task-lists/setup-task-list/footer-slot/footer-slot.tsx similarity index 100% rename from plugins/woocommerce-admin/client/two-column-tasks/footer-slot/footer-slot.tsx rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/footer-slot/footer-slot.tsx diff --git a/plugins/woocommerce-admin/client/two-column-tasks/footer-slot/index.ts b/plugins/woocommerce-admin/client/task-lists/setup-task-list/footer-slot/index.ts similarity index 100% rename from plugins/woocommerce-admin/client/two-column-tasks/footer-slot/index.ts rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/footer-slot/index.ts diff --git a/plugins/woocommerce-admin/client/two-column-tasks/footer-slot/utils.tsx b/plugins/woocommerce-admin/client/task-lists/setup-task-list/footer-slot/utils.tsx similarity index 100% rename from plugins/woocommerce-admin/client/two-column-tasks/footer-slot/utils.tsx rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/footer-slot/utils.tsx diff --git a/plugins/woocommerce-admin/client/task-lists/setup-task-list/index.ts b/plugins/woocommerce-admin/client/task-lists/setup-task-list/index.ts new file mode 100644 index 00000000000..ea833dd9351 --- /dev/null +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/index.ts @@ -0,0 +1,2 @@ +export * from './setup-task-list'; +export * from './components/task-list-placeholder'; diff --git a/plugins/woocommerce-admin/client/two-column-tasks/task-list.tsx b/plugins/woocommerce-admin/client/task-lists/setup-task-list/setup-task-list.tsx similarity index 92% rename from plugins/woocommerce-admin/client/two-column-tasks/task-list.tsx rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/setup-task-list.tsx index e11fc9bd392..d6da84ecd61 100644 --- a/plugins/woocommerce-admin/client/two-column-tasks/task-list.tsx +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/setup-task-list.tsx @@ -24,13 +24,12 @@ import { useLayoutContext } from '@woocommerce/admin-layout'; /** * Internal dependencies */ -import '../tasks/task-list.scss'; -import taskHeaders from './task-headers'; -import DismissModal from './dismiss-modal'; -import TaskListCompleted from './completed'; -import { ProgressHeader } from '~/task-lists/progress-header'; -import { TaskListItemTwoColumn } from './task-list-item-two-column'; -import { TaskListCompletedHeader } from './completed-header'; +import { taskHeaders } from './components/task-headers'; +import DismissModal from './components/dismiss-modal'; +import TaskListCompleted from './components/task-list-completed'; +import { ProgressHeader } from '~/task-lists/components/progress-header'; +import { TaskListItem } from './components/task-list-item'; +import { TaskListCompletedHeader } from './components/task-list-completed-header'; import { ExperimentalWooTaskListFooter } from './footer-slot'; import { @@ -40,20 +39,18 @@ import { export type TaskListProps = TaskListType & { eventName?: string; - twoColumns?: boolean; query: { task?: string; }; cesHeader?: boolean; }; -export const TaskList: React.FC< TaskListProps > = ( { +export const SetupTaskList: React.FC< TaskListProps > = ( { query, id, eventName, eventPrefix, tasks, - twoColumns, keepCompletedTaskList, isComplete, displayProgressHeader, @@ -271,7 +268,6 @@ export const TaskList: React.FC< TaskListProps > = ( { ) } @@ -292,8 +288,7 @@ export const TaskList: React.FC< TaskListProps > = ( { ) : null }
= ( { { visibleTasks.map( ( task, index ) => { return ( - = ( { ); }; -export default TaskList; +export default SetupTaskList; diff --git a/plugins/woocommerce-admin/client/two-column-tasks/style.scss b/plugins/woocommerce-admin/client/task-lists/setup-task-list/style.scss similarity index 94% rename from plugins/woocommerce-admin/client/two-column-tasks/style.scss rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/style.scss index ed430c7d43e..b92bd129595 100644 --- a/plugins/woocommerce-admin/client/two-column-tasks/style.scss +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/style.scss @@ -95,13 +95,7 @@ } } -.two-columns .woocommerce-task-dashboard__container.two-column-experiment { - .svg-background { - top: 15%; - } -} - -.woocommerce-task-dashboard__container.two-column-experiment { +.woocommerce-task-dashboard__container.setup-task-list { max-width: 1032px; display: flex; flex-direction: row; @@ -150,19 +144,8 @@ } } - &:not(.two-columns) { - @include single-column; - } - - &.two-columns .svg-background { - top: 50%; - bottom: 50%; - margin-top: auto; - margin-bottom: auto; - } ul { - display: flex; li { display: block; width: 100%; @@ -217,6 +200,9 @@ width: 100%; } + @include single-column; + + @for $i from 1 through 10 { .woocommerce-task-list__item:not(.complete).index-#{$i} .woocommerce-task__icon::after { content: '#{$i}'; diff --git a/plugins/woocommerce-admin/client/two-column-tasks/task-list-completion-slot/index.ts b/plugins/woocommerce-admin/client/task-lists/setup-task-list/task-list-completion-slot/index.ts similarity index 100% rename from plugins/woocommerce-admin/client/two-column-tasks/task-list-completion-slot/index.ts rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/task-list-completion-slot/index.ts diff --git a/plugins/woocommerce-admin/client/two-column-tasks/task-list-completion-slot/task-list-completion-slot.tsx b/plugins/woocommerce-admin/client/task-lists/setup-task-list/task-list-completion-slot/task-list-completion-slot.tsx similarity index 100% rename from plugins/woocommerce-admin/client/two-column-tasks/task-list-completion-slot/task-list-completion-slot.tsx rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/task-list-completion-slot/task-list-completion-slot.tsx diff --git a/plugins/woocommerce-admin/client/two-column-tasks/task-list-completion-slot/utils.tsx b/plugins/woocommerce-admin/client/task-lists/setup-task-list/task-list-completion-slot/utils.tsx similarity index 100% rename from plugins/woocommerce-admin/client/two-column-tasks/task-list-completion-slot/utils.tsx rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/task-list-completion-slot/utils.tsx diff --git a/plugins/woocommerce-admin/client/two-column-tasks/test/task-list.test.tsx b/plugins/woocommerce-admin/client/task-lists/setup-task-list/test/setup-task-list.test.tsx similarity index 94% rename from plugins/woocommerce-admin/client/two-column-tasks/test/task-list.test.tsx rename to plugins/woocommerce-admin/client/task-lists/setup-task-list/test/setup-task-list.test.tsx index a55570387e5..2624c30ccfc 100644 --- a/plugins/woocommerce-admin/client/two-column-tasks/test/task-list.test.tsx +++ b/plugins/woocommerce-admin/client/task-lists/setup-task-list/test/setup-task-list.test.tsx @@ -8,7 +8,7 @@ import { TaskType } from '@woocommerce/data'; /** * Internal dependencies */ -import { TaskList } from '../task-list'; +import { SetupTaskList } from '../setup-task-list'; jest.mock( '@woocommerce/tracks', () => ( { recordEvent: jest.fn(), @@ -27,10 +27,12 @@ jest.mock( '@woocommerce/components', () => ( { .fn() .mockImplementation( () =>
task_list_menu
), } ) ); -jest.mock( '../task-headers', () => ( { - optional: () =>
optional_header
, - required: () =>
required_header
, - completed: () =>
completed_header
, +jest.mock( '../components/task-headers', () => ( { + taskHeaders: { + optional: () =>
optional_header
, + required: () =>
required_header
, + completed: () =>
completed_header
, + }, } ) ); jest.mock( '@woocommerce/data', () => ( { ...jest.requireActual( '@woocommerce/data' ), @@ -155,7 +157,7 @@ describe( 'TaskList', () => { it( 'should trigger tasklist_view event on initial render for setup task list', () => { render( - { it( 'should trigger tasklist_view event on initial render for setup task list with eventPrefix if eventName is undefined', () => { render( - { it( 'should trigger {id}_tasklist_view event on initial render for setup task list if id is not setup', () => { render( - { it( 'should render the task header of the first uncompleted task', () => { const { queryByText } = render( - { it( 'should render all tasks', () => { const { queryByText } = render( - { it( 'should not display isDismissed tasks', () => { const dismissedTask = [ { ...tasks.setup[ 0 ], isDismissed: true } ]; const { queryByText } = render( - = ( { query } ) => { +export const TaskLists: React.FC< TaskListsProps > = ( { query } ) => { const { task } = query; const { hideTaskList } = useDispatch( ONBOARDING_STORE_NAME ); const { updateOptions } = useDispatch( OPTIONS_STORE_NAME ); @@ -108,7 +110,7 @@ export const Tasks: React.FC< TasksProps > = ( { query } ) => { const taskListIds = getAdminSetting( 'visibleTaskListIds', [] ); const TaskListPlaceholderComponent = taskListIds[ 0 ] === 'setup' - ? TwoColumnTaskListPlaceholder + ? SetupTaskListPlaceholder : TasksPlaceholder; if ( isResolving ) { @@ -118,21 +120,17 @@ export const Tasks: React.FC< TasksProps > = ( { query } ) => { return ( <> { taskLists - .filter( - ( { id }: TaskListType ) => ! id.endsWith( 'two_column' ) - ) .filter( ( { isVisible }: TaskListType ) => isVisible ) .map( ( taskList: TaskListType ) => { const { id, isHidden, isToggleable } = taskList; const TaskListComponent = - id === 'setup' ? TwoColumnTaskList : TaskList; + id === 'setup' ? SetupTaskList : TaskList; return ( { isToggleable && ( diff --git a/plugins/woocommerce-admin/client/tasks/test/tasks.test.tsx b/plugins/woocommerce-admin/client/task-lists/test/tasks.test.tsx similarity index 85% rename from plugins/woocommerce-admin/client/tasks/test/tasks.test.tsx rename to plugins/woocommerce-admin/client/task-lists/test/tasks.test.tsx index 583c04e1688..666146ddfb5 100644 --- a/plugins/woocommerce-admin/client/tasks/test/tasks.test.tsx +++ b/plugins/woocommerce-admin/client/task-lists/test/tasks.test.tsx @@ -9,10 +9,10 @@ import userEvent from '@testing-library/user-event'; /** * Internal dependencies */ -import { Tasks } from '../tasks'; -import { TaskProps } from '../task'; -import { TaskListProps } from '../task-list'; -import { TaskListProps as TwoColumnTaskListProps } from '../../two-column-tasks/task-list'; +import { TaskLists } from '../task-lists'; +import { TaskProps } from '../components/task'; +import { TaskListProps } from '../components/task-list'; +import { TaskListProps as SetupTaskListProps } from '../setup-task-list/setup-task-list'; jest.mock( '@wordpress/data', () => { // Require the original module to not be mocked... @@ -29,21 +29,21 @@ jest.mock( '@wordpress/data', () => { jest.mock( '@woocommerce/explat' ); jest.mock( '@woocommerce/tracks' ); -jest.mock( '../task-list', () => ( { +jest.mock( '../components/task-list', () => ( { TaskList: ( { id }: TaskListProps ) =>
task-list:{ id }
, } ) ); -jest.mock( '../../two-column-tasks/task-list', () => ( { - TaskList: ( { id }: TwoColumnTaskListProps ) => ( -
two-column-list:{ id }
+jest.mock( '../setup-task-list', () => ( { + SetupTaskList: ( { id }: SetupTaskListProps ) => ( +
setup-task-list:{ id }
), } ) ); -jest.mock( '../task', () => ( { +jest.mock( '../components/task', () => ( { Task: ( { query }: TaskProps ) =>
task:{ query.task }
, } ) ); -jest.mock( '../placeholder', () => ( { +jest.mock( '../components/placeholder', () => ( { TasksPlaceholder: () =>
task-placeholder
, } ) ); @@ -83,14 +83,14 @@ describe( 'Task', () => { it( 'should render if no current task and finished resolving', () => { const { queryByText } = render(
- +
); waitFor( () => { expect( queryByText( 'task-list:main' ) ).toBeInTheDocument(); expect( queryByText( 'task-list:extended' ) ).toBeInTheDocument(); expect( - queryByText( 'two-column-list:setup' ) + queryByText( 'setup-task-list:setup' ) ).not.toBeInTheDocument(); } ); } ); @@ -98,7 +98,7 @@ describe( 'Task', () => { it( 'should render the task component if query has an existing task', () => { const { queryByText } = render(
- +
); expect( queryByText( 'task:main-task-1' ) ).toBeInTheDocument(); @@ -107,7 +107,7 @@ describe( 'Task', () => { it( 'should not render anything if query has task, but task does not exist', () => { const { queryByText } = render(
- +
); expect( @@ -122,7 +122,7 @@ describe( 'Task', () => { } ) ); const { queryByText } = render(
- +
); expect( queryByText( 'task-placeholder' ) ).toBeInTheDocument(); @@ -144,7 +144,7 @@ describe( 'Task', () => { } ) ); const { queryByText } = render(
- +
); expect( queryByText( 'Show things to do next' ) ).toBeInTheDocument(); @@ -153,7 +153,7 @@ describe( 'Task', () => { it( 'should class updateOptions with default data on render', () => { render(
- +
); waitFor( () => { @@ -180,7 +180,7 @@ describe( 'Task', () => { } ) ); const { getByText } = render(
- +
); act( () => { @@ -209,7 +209,7 @@ describe( 'Task', () => { } ) ); const { getByText } = render(
- +
); act( () => { diff --git a/plugins/woocommerce-admin/client/tasks/index.ts b/plugins/woocommerce-admin/client/tasks/index.ts deleted file mode 100644 index 965ee2d89d9..00000000000 --- a/plugins/woocommerce-admin/client/tasks/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Internal dependencies - */ -import './fills'; -import './deprecated-tasks'; - -export * from './tasks'; -export * from './placeholder'; -export * from './reminder-bar'; -export * from './hooks/useActiveSetupList'; diff --git a/plugins/woocommerce-admin/client/two-column-tasks/extended-task.tsx b/plugins/woocommerce-admin/client/two-column-tasks/extended-task.tsx deleted file mode 100644 index dd0bc2df026..00000000000 --- a/plugins/woocommerce-admin/client/two-column-tasks/extended-task.tsx +++ /dev/null @@ -1,145 +0,0 @@ -/** - * External dependencies - */ -import { __ } from '@wordpress/i18n'; -import { MenuGroup, MenuItem } from '@wordpress/components'; -import { check } from '@wordpress/icons'; -import { Fragment, useEffect } from '@wordpress/element'; -import { useDispatch, useSelect } from '@wordpress/data'; -import { - ONBOARDING_STORE_NAME, - OPTIONS_STORE_NAME, - TaskListType, - TaskType, -} from '@woocommerce/data'; -import { recordEvent } from '@woocommerce/tracks'; - -/** - * Internal dependencies - */ -import { DisplayOption } from '~/activity-panel/display-options'; -import { TaskList } from '../tasks/task-list'; -import { TasksPlaceholder } from '../tasks/placeholder'; -import '../tasks/tasks.scss'; - -export type TasksProps = { - query: { task?: string }; -}; - -const ExtendedTask: React.FC< TasksProps > = ( { query } ) => { - const { hideTaskList } = useDispatch( ONBOARDING_STORE_NAME ); - const { updateOptions } = useDispatch( OPTIONS_STORE_NAME ); - const { task } = query; - - const { - isResolving, - taskLists, - }: { - isResolving: boolean; - taskLists: TaskListType[]; - } = useSelect( ( select ) => { - return { - isResolving: select( ONBOARDING_STORE_NAME ).isResolving( - 'getTaskListsByIds' - ), - taskLists: select( ONBOARDING_STORE_NAME ).getTaskListsByIds( [ - 'extended_two_column', - ] ), - }; - } ); - const toggleTaskList = ( taskList: TaskListType ) => { - const { id, isHidden } = taskList; - const newValue = ! isHidden; - - recordEvent( - newValue ? `${ id }_tasklist_hide` : `${ id }_tasklist_show`, - {} - ); - - hideTaskList( id ); - }; - - useEffect( () => { - updateOptions( { - woocommerce_task_list_prompt_shown: true, - } ); - }, [ taskLists, isResolving ] ); - - // If a task detail is being shown, we shouldn't show the extended tasklist. - if ( task ) { - return null; - } - - if ( isResolving ) { - return ; - } - - const extendedTaskList = taskLists[ 0 ]; - - if ( ! extendedTaskList || extendedTaskList.tasks.length === 0 ) { - return null; - } - - const completedTasks = extendedTaskList.tasks.filter( - ( extendedTaskListTask: TaskType ) => { - return extendedTaskListTask.isComplete; - } - ); - - // Use custom isComplete since we're manually adding tasks - // to the extended task list. - const isComplete = completedTasks.length === extendedTaskList.tasks.length; - - const { - id, - eventPrefix, - isHidden, - isVisible, - isToggleable, - title, - tasks, - displayProgressHeader, - keepCompletedTaskList, - } = extendedTaskList; - - if ( ! isVisible ) { - return null; - } - - return ( - - - { isToggleable && ( - - - toggleTaskList( extendedTaskList ) } - > - { __( 'Show things to do next', 'woocommerce' ) } - - - - ) } - - ); -}; - -export default ExtendedTask; diff --git a/plugins/woocommerce-admin/client/two-column-tasks/index.js b/plugins/woocommerce-admin/client/two-column-tasks/index.js deleted file mode 100644 index 81c8ca7203a..00000000000 --- a/plugins/woocommerce-admin/client/two-column-tasks/index.js +++ /dev/null @@ -1,101 +0,0 @@ -/** - * External dependencies - */ -import { __ } from '@wordpress/i18n'; -import { useSelect } from '@wordpress/data'; -import { ONBOARDING_STORE_NAME } from '@woocommerce/data'; - -/** - * Internal dependencies - */ -import '../tasks/tasks.scss'; -import './style.scss'; -import TaskList from './task-list'; -import TaskListPlaceholder from './placeholder'; -import { Task } from '../tasks/task'; - -const TaskDashboard = ( { query, twoColumns } ) => { - const { task } = query; - - const { isResolving, taskLists } = useSelect( ( select ) => { - return { - taskLists: select( ONBOARDING_STORE_NAME ).getTaskListsByIds( [ - 'setup_two_column', - 'extended_two_column', - ] ), - isResolving: select( ONBOARDING_STORE_NAME ).isResolving( - 'getTaskListsByIds' - ), - }; - } ); - const getCurrentTask = () => { - if ( ! task ) { - return null; - } - - const tasks = taskLists.reduce( - ( acc, taskList ) => [ ...acc, ...taskList.tasks ], - [] - ); - - const currentTask = tasks.find( ( t ) => t.id === task ); - - if ( ! currentTask ) { - return null; - } - - return currentTask; - }; - - const currentTask = getCurrentTask(); - - if ( task && ! currentTask ) { - return null; - } - - if ( isResolving || ! taskLists[ 0 ] ) { - return ; - } - - if ( currentTask ) { - return ( -
- -
- ); - } - // List of task items to be shown on the main task list. - // Any other remaining tasks will be moved to the extended task list. - const taskList = taskLists[ 0 ]; - const setupTasks = taskList.tasks; - - const completedTasks = setupTasks.filter( - ( setupTask ) => setupTask.isComplete - ); - const isTaskListComplete = setupTasks.length === completedTasks.length; - - const dismissedTasks = setupTasks.filter( - ( setupTask ) => setupTask.isDismissed - ); - - return ( - <> - { setupTasks && ( taskList.isVisible || task ) && ( - - ) } - - ); -}; - -export default TaskDashboard; diff --git a/plugins/woocommerce-admin/client/two-column-tasks/task-headers.ts b/plugins/woocommerce-admin/client/two-column-tasks/task-headers.ts deleted file mode 100644 index 6e4ee244eb7..00000000000 --- a/plugins/woocommerce-admin/client/two-column-tasks/task-headers.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Internal dependencies - */ -import StoreDetailsHeader from './headers/store-details'; -import TaxHeader from './headers/tax'; -import MarketingHeader from './headers/marketing'; -import AppearanceHeader from './headers/appearance'; -import ShippingHeader from './headers/shipping'; -import ProductsHeader from './headers/products'; -import PurchaseHeader from './headers/purchase'; -import PaymentsHeader from './headers/payments'; -import WoocommercePaymentsHeader from './headers/woocommerce-payments'; - -const taskHeaders: Record< string, React.ElementType > = { - store_details: StoreDetailsHeader, - tax: TaxHeader, - shipping: ShippingHeader, - marketing: MarketingHeader, - appearance: AppearanceHeader, - payments: PaymentsHeader, - products: ProductsHeader, - purchase: PurchaseHeader, - 'woocommerce-payments': WoocommercePaymentsHeader, -}; - -export default taskHeaders; diff --git a/plugins/woocommerce/changelog/dev-clean-up-task-list b/plugins/woocommerce/changelog/dev-clean-up-task-list new file mode 100644 index 00000000000..7e60d34da07 --- /dev/null +++ b/plugins/woocommerce/changelog/dev-clean-up-task-list @@ -0,0 +1,4 @@ +Significance: minor +Type: dev + +Cleanup task list and organize tasks file structure diff --git a/plugins/woocommerce/src/Admin/API/OnboardingTasks.php b/plugins/woocommerce/src/Admin/API/OnboardingTasks.php index a7e80da382d..9f637873ed7 100644 --- a/plugins/woocommerce/src/Admin/API/OnboardingTasks.php +++ b/plugins/woocommerce/src/Admin/API/OnboardingTasks.php @@ -295,10 +295,14 @@ class OnboardingTasks extends \WC_REST_Data_Controller { /** * Check if a given request has access to manage woocommerce. * + * @deprecated 7.8.0 snooze task is deprecated. + * * @param WP_REST_Request $request Full details about the request. * @return WP_Error|boolean */ public function snooze_task_permissions_check( $request ) { + wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '7.8.0' ); + if ( ! current_user_can( 'manage_woocommerce' ) ) { return new \WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to snooze onboarding tasks.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); } @@ -816,11 +820,15 @@ class OnboardingTasks extends \WC_REST_Data_Controller { /** * Snooze an onboarding task. * + * @deprecated 7.8.0 snooze task is deprecated. + * * @param WP_REST_Request $request Request data. * * @return WP_REST_Response|WP_Error */ public function snooze_task( $request ) { + wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '7.8.0' ); + $task_id = $request->get_param( 'id' ); $task_list_id = $request->get_param( 'task_list_id' ); $duration = $request->get_param( 'duration' ); @@ -853,10 +861,14 @@ class OnboardingTasks extends \WC_REST_Data_Controller { /** * Undo snooze of a single task. * + * @deprecated 7.8.0 undo snooze task is deprecated. + * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Request|WP_Error */ public function undo_snooze_task( $request ) { + wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '7.8.0' ); + $id = $request->get_param( 'id' ); $task = TaskLists::get_task( $id ); diff --git a/plugins/woocommerce/src/Admin/Features/OnboardingTasks/TaskLists.php b/plugins/woocommerce/src/Admin/Features/OnboardingTasks/TaskLists.php index e3e2f91a72a..8385ee9865a 100644 --- a/plugins/woocommerce/src/Admin/Features/OnboardingTasks/TaskLists.php +++ b/plugins/woocommerce/src/Admin/Features/OnboardingTasks/TaskLists.php @@ -152,45 +152,6 @@ class TaskLists { ), ) ); - self::add_list( - array( - 'id' => 'setup_two_column', - 'hidden_id' => 'setup', - 'title' => __( 'Get ready to start selling', 'woocommerce' ), - 'tasks' => array( - 'Products', - 'WooCommercePayments', - 'Payments', - 'Tax', - 'Shipping', - 'Marketing', - 'Appearance', - ), - 'event_prefix' => 'tasklist_', - ) - ); - self::add_list( - array( - 'id' => 'extended_two_column', - 'hidden_id' => 'extended', - 'title' => __( 'Things to do next', 'woocommerce' ), - 'sort_by' => array( - array( - 'key' => 'is_complete', - 'order' => 'asc', - ), - array( - 'key' => 'level', - 'order' => 'asc', - ), - ), - 'tasks' => array( - 'AdditionalPayments', - 'GetMobileApp', - ), - 'event_prefix' => 'extended_tasklist_', - ) - ); if ( Features::is_enabled( 'shipping-smart-defaults' ) ) { self::add_task( @@ -200,13 +161,6 @@ class TaskLists { ) ); - self::add_task( - 'extended_two_column', - new ReviewShippingOptions( - self::get_list( 'extended_two_column' ) - ) - ); - // Tasklist that will never be shown in homescreen, // used for having tasks that are accessed by other means. self::add_list( @@ -225,7 +179,6 @@ class TaskLists { if ( ! wp_is_mobile() ) { // Permit In-App Marketplace Tour on desktops only. $tour_task = new TourInAppMarketplace(); self::add_task( 'extended', $tour_task ); - self::add_task( 'extended_two_column', $tour_task ); } if ( has_filter( 'woocommerce_admin_experimental_onboarding_tasklists' ) ) { diff --git a/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/AdditionalPayments.php b/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/AdditionalPayments.php index 9465bb3e94a..ab1aa4dd002 100644 --- a/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/AdditionalPayments.php +++ b/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/AdditionalPayments.php @@ -91,9 +91,6 @@ class AdditionalPayments extends Payments { // Hide task if WC Pay is not installed via OBW, or is not connected, or the store is located in a country that is not supported by WC Pay. return false; } - if ( $this->get_parent_id() === 'extended_two_column' && WooCommercePayments::is_connected() ) { - return false; - } return true; } diff --git a/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/WooCommercePayments.php b/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/WooCommercePayments.php index 9c7fc60ae38..409a69fefd7 100644 --- a/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/WooCommercePayments.php +++ b/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/WooCommercePayments.php @@ -92,7 +92,7 @@ class WooCommercePayments extends Task { return ! $payments->is_complete() && // Do not re-display the task if the "add payments" task has already been completed. self::is_installed() && self::is_supported() && - ( $this->get_parent_id() !== 'setup_two_column' || ! self::is_connected() ); + ! self::is_connected(); } /** From 3db18516e60cd2e65d00ad2678de137a2230a658 Mon Sep 17 00:00:00 2001 From: Moon Date: Tue, 16 May 2023 19:13:56 -0700 Subject: [PATCH 4/4] Update RIN Transformers doc with examples. (#38176) * Update transformers doc with examples * Add changelog --- .../update-update-rin-transformers-doc | 4 + .../Transformers/README.md | 256 +++++++++++++++--- 2 files changed, 223 insertions(+), 37 deletions(-) create mode 100644 plugins/woocommerce/changelog/update-update-rin-transformers-doc diff --git a/plugins/woocommerce/changelog/update-update-rin-transformers-doc b/plugins/woocommerce/changelog/update-update-rin-transformers-doc new file mode 100644 index 00000000000..8e03ffd0ae7 --- /dev/null +++ b/plugins/woocommerce/changelog/update-update-rin-transformers-doc @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +Update transformers doc with examples diff --git a/plugins/woocommerce/src/Admin/RemoteInboxNotifications/Transformers/README.md b/plugins/woocommerce/src/Admin/RemoteInboxNotifications/Transformers/README.md index 96c8a5017d5..ca447a299c1 100644 --- a/plugins/woocommerce/src/Admin/RemoteInboxNotifications/Transformers/README.md +++ b/plugins/woocommerce/src/Admin/RemoteInboxNotifications/Transformers/README.md @@ -2,9 +2,9 @@ An option transformer is a class that transforms the given option value into a different value for the comparison operation. -Transformers run in the order they are defined. Each transformer passes down the value it transformed to the next transformer to consume. +Transformers run in the order in which they are defined, and each transformer passes down the value it transformed to the next transformer for consumption. -Definition example: +**Definition example**: transformers are always used with `option` rule. ``` { @@ -37,17 +37,17 @@ Definition example: } ``` -### ArrayColumn (array_column) +## array_column -This uses PHP's built-in `array_column` to select values by a given array key. +PHP's built-in `array_column` to select values from a single column. For more information about how array_column works, please see PHP's [official documentation](https://www.php.net/manual/en/function.array-column.php). -Arguments: +#### Arguments: | name | description | | ---- | -------------- | | key | array key name | -Definition: +#### Definition: ```php "transformers": [ @@ -60,13 +60,49 @@ Definition: ], ``` -### ArrayFlatten (array_flatten) +#### Example: -This flattens a nested array. +Given the following data -Arguments: N/A +```php +array( + array("industry" => "media" ), + array("industry" => "software" ) +); +``` -Definition: +Use `array_column` to extract `array("media", "software")` then choose the first element with `dot_notation`. + +```php +"transformers": [ + { + "use": "array_column", + "arguments": { + "key": "industry" + } + }, + { + "use": "dot_noation", + "arguments": { + "key": "0" + } + } +], +``` + +**Output**: "media" + + + + + +## array_flatten + +Flattens a nested array. + +#### Arguments: N/A + +#### Definition: ```php "transformers": [ @@ -76,13 +112,50 @@ Definition: ], ``` -### ArrayKeys (array_keys) +#### Example: -This uses PHP's built-in `array_keys` to return keys from an array. +Given the follwoing data -Arguments: N/A +```php +array( + array( + 'member1', + ), + array( + 'member2', + ), + array( + 'member3', + ), +); +``` -Definition: +Use `array_flatten` to extract `array("member1", "member2", "member3")` then use `array_search` to make sure it has `member2` + + +```php +"transformers": [ + { + "use": "array_flatten", + }, + { + "use": "array_search", + "arguments": { + "key": "member2" + } + } +], +``` + +**Output**: true + +## array_keys + +PHP's built-in `array_keys` to return keys from an array. For more information about how `array_keys` works, please see PHP’s [official documentation](https://www.php.net/manual/en/function.array-column.php). + +#### Arguments: N/A + +####Definition: ```php "transformers": [ @@ -92,16 +165,47 @@ Definition: ], ``` -### ArraySearch (array_search) +#### Example: -This uses PHP's built-in `array_search` to search a value in an array. +Given the follwing data + +```php +array( + "name" => "tester", + "address" => "test", + "supports_version_2" => true +) +``` + +Use `array_keys` to extract `array("name", "address", "supports_version_2")` and then use `array_search` to make sure it has `supports_version_2` + +```php +"transformers": [ + { + "use": "array_keys", + }, + { + "use": "array_search", + "arguments": { + "key": "member2" + } + } +], +``` + +**Output**: true + +## array_search + +PHP's built-in `array_search` to search a value in an array. For more information about how `array_search` works, please see PHP’s [official documentation](https://www.php.net/manual/en/function.array-search.php). + +#### Arguments: -Arguments: |name|description| |----|---------| | value | a value to search in the given array | -Definition: +#### Definition: ```php "transformers": [ @@ -114,13 +218,18 @@ Definition: ], ``` -### ArrayValues (array_values) +#### Examples -This uses PHP's built-in array_values to return values from an array. +See examples from [array_flatten](#array_flatten) and [array_keys](#array_keys) -Arguments: N/A +## array_values -Definition: +PHP's built-in array_values to return values from an array. For more information about how `array_values` works, please see PHP’s [official documentation](https://www.php.net/manual/en/function.array-values). + + +#### Arguments: N/A + +#### Definition: ```php "transformers": [ @@ -130,20 +239,37 @@ Definition: ], ``` -### DotNotation (dot_notation) +#### Example: -This uses dot notation to select a value in an array. Dot notation lets you access an array as if it is an object. - -Let's say we have the following array. +Given the follwoing data ```php -$items = [ - 'name' => 'name', - 'members' => ['member1', 'member2'] -]; +array ( + "size" => "x-large" +) ``` -Example definition to select `$items['name']`: +Use `array_values` to extract `array("x-large")` + +```php +"transformers": [ + { + "use": "array_values", + } +], +``` + +**Output:** "x-large" + + +## dot_notation + +Uses dot notation to select a value in an array. Dot notation lets you access an array as if it is an object. + +#### Arguments: N/A + +#### Definition: + ```php "transformers": [ @@ -156,26 +282,56 @@ Example definition to select `$items['name']`: ], ``` -Example definition to select `$items['members'][0]`: +#### Example: + + + +Given the follwoing data + +```php +array( + 'name' => 'john', + 'members' => ['member1', 'member2'] +); +``` + +Select `name` field. ```php "transformers": [ { "use": "dot_notation", "arguments": { - "path": "members.0" + "path": "name" } } ], ``` -### Count (count) +**Output:** "john" -This uses PHP's built-in count to return the number of values from a countable, such as an array. +Select `member2`. You can access array items with an index. -Arguments: N/A +```php +"transformers": [ + { + "use": "dot_notation", + "arguments": { + "path": "members.1" + } + } +], +``` -Definition: +**Output:**: "member2" + +## count + +PHP's built-in count to return the number of values from a countable, such as an array. + +#### Arguments: N/A + +#### Definition: ```php "transformers": [ @@ -184,3 +340,29 @@ Definition: } ], ``` + +#### Example: + +Given the follwing list of usernames + +```php +array( + "username1", + "username2", + "username3" +) +``` + +Let's count # of users with `count` + +```php +"transformers": [ + { + "use": "count", + } +], +``` + +**Output:** 3 + +