diff --git a/.github/automate-team-review-assignment-config.yml b/.github/automate-team-review-assignment-config.yml index aa51f321346..f1acbd2affe 100644 --- a/.github/automate-team-review-assignment-config.yml +++ b/.github/automate-team-review-assignment-config.yml @@ -17,9 +17,9 @@ when: - woo-fse - author: teamIs: - - vortex + - flux ignore: nameIs: assign: teams: - - vortex + - flux diff --git a/.github/workflows/storybook-pages.yml b/.github/workflows/storybook-pages.yml new file mode 100644 index 00000000000..0e84b6df80f --- /dev/null +++ b/.github/workflows/storybook-pages.yml @@ -0,0 +1,34 @@ +name: Storybook GitHub Pages + +on: + workflow_dispatch: + +permissions: + contents: write + +jobs: + deploy: + runs-on: ubuntu-latest + if: ${{ github.repository == 'woocommerce/woocommerce' }} + + steps: + - name: Checkout + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + ref: trunk + fetch-depth: 0 + + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo + with: + install: true + + - name: Build Storybook + run: pnpm --filter='@woocommerce/storybook' build-storybook --quiet + + - name: Deploy + uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./tools/storybook/storybook-static + force_orphan: true diff --git a/changelog.txt b/changelog.txt index e34b03260d4..19f15145abc 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,244 @@ == Changelog == += 9.3.1 2024-09-12 = + +* Tweak - Disable remote logging feature by default [#51312](https://github.com/woocommerce/woocommerce/pull/51312) + += 9.3.0 2024-09-10 = + +**WooCommerce** + +* Enhancement - Add query params masking to remote logger [#51108](https://github.com/woocommerce/woocommerce/pull/51108) +* Update - Added more paths to remote logger query param whitelist [#51108](https://github.com/woocommerce/woocommerce/pull/51108) +* Fix - Revert update to React 18 in Checkout block. [#51289](https://github.com/woocommerce/woocommerce/pull/51289) +* Fix - Add check to ensure themes API is safe [#51081](https://github.com/woocommerce/woocommerce/pull/51081) +* Fix - CYS - Remove usage of `prepare_item_for_response` function in `Images` endpoint. [#50923](https://github.com/woocommerce/woocommerce/pull/50923) +* Fix - Add ability for a screen reader to announce the current tab on a single product page. [#50373](https://github.com/woocommerce/woocommerce/pull/50373) +* Fix - Add a label to the product pagination for the woocommerce pagination [#49924](https://github.com/woocommerce/woocommerce/pull/49924) +* Fix - Add aria-current to the current link in My Account side nav [#49800](https://github.com/woocommerce/woocommerce/pull/49800) +* Fix - Add aria-label on View order button to aid in accessibility for screen readers [#49424](https://github.com/woocommerce/woocommerce/pull/49424) +* Fix - Add CSS outline for site visibility badge keyboard accessibility [#50794](https://github.com/woocommerce/woocommerce/pull/50794) +* Fix - Add scope attribute and aria-label to the product attributes table [#49768](https://github.com/woocommerce/woocommerce/pull/49768) +* Fix - Add to Cart with Options - Fix translation when used inside the Single Product block. [#50628](https://github.com/woocommerce/woocommerce/pull/50628) +* Fix - Allow verified parameter to be set by REST API request [#50525](https://github.com/woocommerce/woocommerce/pull/50525) +* Fix - Avoid PHP warnings if `add-to-cart.php` template does not pass `aria-describedby_text` [#48969](https://github.com/woocommerce/woocommerce/pull/48969) +* Fix - Cart block: Strip HTML tags and decode HTML entities in quantity change notifications. [#50541](https://github.com/woocommerce/woocommerce/pull/50541) +* Fix - Changed from using React.render to React.createRoot for marketing coupons as it has been deprecated since React 18 [#48832](https://github.com/woocommerce/woocommerce/pull/48832) +* Fix - Changed from using React.render to React.createRoot for payment methods promotion, shipping settings region zone as it has been deprecated since React 18 [#48835](https://github.com/woocommerce/woocommerce/pull/48835) +* Fix - Changed from using React.render to React.createRoot for print shipping banner as it has been deprecated since React 18 [#48831](https://github.com/woocommerce/woocommerce/pull/48831) +* Fix - Changed from using React.render to React.createRoot for product-usage-notice-modal as it has been deprecated since React 18 [#50765](https://github.com/woocommerce/woocommerce/pull/50765) +* Fix - Changed from using React.render to React.createRoot for wc addon tour as it has been deprecated since React 18 [#48833](https://github.com/woocommerce/woocommerce/pull/48833) +* Fix - Changed from using React.render to React.createRoot for WCAdmin uses as it has been deprecated since React 18 [#48785](https://github.com/woocommerce/woocommerce/pull/48785) +* Fix - Changed instances of prime marks inappropriately used when apostrophes are supposed to be used for some parts of WC Admin JS/TS/TSX files [#50776](https://github.com/woocommerce/woocommerce/pull/50776) +* Fix - Clear product unique ID (`global_unique_id`) when duplicating products. [#50629](https://github.com/woocommerce/woocommerce/pull/50629) +* Fix - Compatibility Layer: fix 'woocommerce_before_single_product_summary' hook position. [#50392](https://github.com/woocommerce/woocommerce/pull/50392) +* Fix - CYS - Improve the error when a request fails due to permissions [#50211](https://github.com/woocommerce/woocommerce/pull/50211) +* Fix - CYS - Update the "show_on_front" setting to "posts" to avoid overriding the "page" template. [#50083](https://github.com/woocommerce/woocommerce/pull/50083) +* Fix - CYS: disable zoom out on fonts/color pairs iframe [#50498](https://github.com/woocommerce/woocommerce/pull/50498) +* Fix - CYS: Fix auto scroll when a new block is added. [#50431](https://github.com/woocommerce/woocommerce/pull/50431) +* Fix - CYS: Improve opt in flow [#50529](https://github.com/woocommerce/woocommerce/pull/50529) +* Fix - Display address card for virtual products if shopper's address is known [#50127](https://github.com/woocommerce/woocommerce/pull/50127) +* Fix - Enable skipped E2E tests for attributes #50143 [#50143](https://github.com/woocommerce/woocommerce/pull/50143) +* Fix - Ensure coupon errors are visible on block checkout when invalid coupons are removed. [#50412](https://github.com/woocommerce/woocommerce/pull/50412) +* Fix - Ensure low and no stock email notification routine is triggered whenever product stock changes [#49583](https://github.com/woocommerce/woocommerce/pull/49583) +* Fix - Ensure session object is initialized before attempting to get chosen shipping methods [#50774](https://github.com/woocommerce/woocommerce/pull/50774) +* Fix - Ensure that the orders REST endpoint behaves the same as the UI when updating an order to remove a line item. [#50606](https://github.com/woocommerce/woocommerce/pull/50606) +* Fix - Featured Product: Fix variable product Selection dropdown #50633 [#50633](https://github.com/woocommerce/woocommerce/pull/50633) +* Fix - Fix "Product Meta" translations - Register the block server side. [#50625](https://github.com/woocommerce/woocommerce/pull/50625) +* Fix - Fix: ensure the global product object is always ready for compatibility layer by disabling default render routine of Product Templates inner blocks. [#49971](https://github.com/woocommerce/woocommerce/pull/49971) +* Fix - Fix activating the installed subscription when the user has multiple active licenses for the same product. [#49803](https://github.com/woocommerce/woocommerce/pull/49803) +* Fix - Fix address heading level on My Account page. [#49764](https://github.com/woocommerce/woocommerce/pull/49764) +* Fix - Fix an admin bar CSS positioning bug in WordPress.com on mobile [#50709](https://github.com/woocommerce/woocommerce/pull/50709) +* Fix - Fix cart shortcode updates when not used on the main cart page. [#50524](https://github.com/woocommerce/woocommerce/pull/50524) +* Fix - Fix core profiler checkbox vertical alignment and border color [#50151](https://github.com/woocommerce/woocommerce/pull/50151) +* Fix - Fix core profiler set up my store button and TOS are too close to each other [#50579](https://github.com/woocommerce/woocommerce/pull/50579) +* Fix - Fix e2e Google for WooCommerce strict mode violation error [#50189](https://github.com/woocommerce/woocommerce/pull/50189) +* Fix - Fixed Core Profiler's sticky footer button problem [#50727](https://github.com/woocommerce/woocommerce/pull/50727) +* Fix - Fixed placeholders in the classic cart shipping calculator to update with country selection. [#49684](https://github.com/woocommerce/woocommerce/pull/49684) +* Fix - Fixes a bug where some express payment buttons weren't being rendered correctly [#49304](https://github.com/woocommerce/woocommerce/pull/49304) +* Fix - Fix extensionCartUpdates to surface generic error messages, and include documentation for the error handling. [#49762](https://github.com/woocommerce/woocommerce/pull/49762) +* Fix - Fix focus order on checkout block page. [#49649](https://github.com/woocommerce/woocommerce/pull/49649) +* Fix - Fix navigation badge decreases when installing extension in "Grow your business task" [#50584](https://github.com/woocommerce/woocommerce/pull/50584) +* Fix - Fix page titles of the cart and checkout page when using blocks and FSE themes. [#49986](https://github.com/woocommerce/woocommerce/pull/49986) +* Fix - Fix rescheduling of actions that are blocked by other delayed actions [#50082](https://github.com/woocommerce/woocommerce/pull/50082) +* Fix - Fix the "Add payment methods" link in LYS congrat screen redirects to a blank page [#50609](https://github.com/woocommerce/woocommerce/pull/50609) +* Fix - Fix translation - Avoid registering blocks in the wrong context. [#50615](https://github.com/woocommerce/woocommerce/pull/50615) +* Fix - Fix `Product meta` console error. [#50680](https://github.com/woocommerce/woocommerce/pull/50680) +* Fix - Fix `store-title` endpoint - Pass default value to `get_option`. [#50673](https://github.com/woocommerce/woocommerce/pull/50673) +* Fix - Hide save changes button in main payments screen [#50064](https://github.com/woocommerce/woocommerce/pull/50064) +* Fix - In Remote Specs, treat empty arrays as valid cached values so individual engines can return default values. [#50521](https://github.com/woocommerce/woocommerce/pull/50521) +* Fix - Keep focus on shipping option input once selected [#49360](https://github.com/woocommerce/woocommerce/pull/49360) +* Fix - Make the matching variations alert a live region [#50132](https://github.com/woocommerce/woocommerce/pull/50132) +* Fix - Only count published products in productCount [#50503](https://github.com/woocommerce/woocommerce/pull/50503) +* Fix - Prevent fatal error if NULL is provided in array_search under Jetpack Stats [#50696](https://github.com/woocommerce/woocommerce/pull/50696) +* Fix - Prevent Store API orders being placed with empty state [#50028](https://github.com/woocommerce/woocommerce/pull/50028) +* Fix - Prevent sync-on-read from affecting results of HPOS diff CLI tool. [#49726](https://github.com/woocommerce/woocommerce/pull/49726) +* Fix - Product Collection: Fix max price query to include prices less or equal to the given max value. [#49917](https://github.com/woocommerce/woocommerce/pull/49917) +* Fix - Product Collection: fix the preview if used in Products by specific Category or Tag [#49889](https://github.com/woocommerce/woocommerce/pull/49889) +* Fix - Product Price block: prevent price amounts from breaking into multiple lines [#50660](https://github.com/woocommerce/woocommerce/pull/50660) +* Fix - Properly detect active plugins in multisite WP installations. [#50417](https://github.com/woocommerce/woocommerce/pull/50417) +* Fix - Reduce error noise in the user profile screen, by removing the requirement for custom fields to have a class attribute. [#48079](https://github.com/woocommerce/woocommerce/pull/48079) +* Fix - Remove Active Shipping Zones check for displaying shipping calculator on the Cart Page. [#49214](https://github.com/woocommerce/woocommerce/pull/49214) +* Fix - Single product block - Fix translation for title and description in edit mode. [#50599](https://github.com/woocommerce/woocommerce/pull/50599) +* Fix - Store API: Do not resume pending orders--create a new order instead [#50531](https://github.com/woocommerce/woocommerce/pull/50531) +* Fix - Transform labels in shipping zone region selector to decode html entities [#50694](https://github.com/woocommerce/woocommerce/pull/50694) +* Fix - Treat post_type=product as a shop page. [#50567](https://github.com/woocommerce/woocommerce/pull/50567) +* Fix - Update product order status colors to ensure accessible color contrasts [#49934](https://github.com/woocommerce/woocommerce/pull/49934) +* Add - Add an additional field for the email settings that sets the footer text color [#49648](https://github.com/woocommerce/woocommerce/pull/49648) +* Add - Add blueprint behind a feature flag for testing purposes. [#49763](https://github.com/woocommerce/woocommerce/pull/49763) +* Add - Add field for the email footer text color [#49648](https://github.com/woocommerce/woocommerce/pull/49648) +* Add - Add function to clear system status theme info cache [#50803](https://github.com/woocommerce/woocommerce/pull/50803) +* Add - Add methods required by extensions to control product feature usage based on subscription status. [#50218](https://github.com/woocommerce/woocommerce/pull/50218) +* Add - Add parameter to avoid attempting to create the logs directory if it doesn't exist [#49766](https://github.com/woocommerce/woocommerce/pull/49766) +* Add - Add Pattern button to no blocks view on the CYS assembler [#49981](https://github.com/woocommerce/woocommerce/pull/49981) +* Add - Add reactified main payments screen [#49972](https://github.com/woocommerce/woocommerce/pull/49972) +* Add - Add reactify-classic-payments-settings feature flag [#49966](https://github.com/woocommerce/woocommerce/pull/49966) +* Add - Add tracks for WordPress Importer/Export pages. [#50769](https://github.com/woocommerce/woocommerce/pull/50769) +* Add - Add `FilteredGetDataTrait`, `OrderAwareControllerTrait`, and `StatsDataStoreTrait` for extension developers to reuse while creating custom Analytics [#49425](https://github.com/woocommerce/woocommerce/pull/49425) +* Add - Implement server-side remote error logging [#49599](https://github.com/woocommerce/woocommerce/pull/49599) +* Add - Inform screen reader users when mini cart updates [#48295](https://github.com/woocommerce/woocommerce/pull/48295) +* Add - Integrate JS remote logging package in WooCommerce Admin [#50134](https://github.com/woocommerce/woocommerce/pull/50134) +* Add - Product Collection: emit the JS event when PC block is rendered [#50166](https://github.com/woocommerce/woocommerce/pull/50166) +* Add - Product Collection: Enable Context-Aware Previews by Adding `usesReference` to `registerProductCollection` [#49796](https://github.com/woocommerce/woocommerce/pull/49796) +* Add - Track frequency of unhandled JS errors with MC Stats [#50155](https://github.com/woocommerce/woocommerce/pull/50155) +* Add - Use MC Stats for PHP fatal error counting [#49658](https://github.com/woocommerce/woocommerce/pull/49658) +* Add - [E2E tests]: Add product description using the block editor #50232 [#50232](https://github.com/woocommerce/woocommerce/pull/50232) +* Update - Update WooCommerce Shipping Promo Banner to install the latest version of WooCommerce Shipping instead of WCS&T. [#50970](https://github.com/woocommerce/woocommerce/pull/50970) +* Update - Add abbreviations for fields GTIN, UPC, EAN, OR ISBN [#50042](https://github.com/woocommerce/woocommerce/pull/50042) +* Update - Add additional fields to new product editor e2e tests. [#50241](https://github.com/woocommerce/woocommerce/pull/50241) +* Update - Add confirmation prompt for site visibility settings when changing from live to coming soon mode [#50759](https://github.com/woocommerce/woocommerce/pull/50759) +* Update - Add pattern validation for global_unique_id [#50501](https://github.com/woocommerce/woocommerce/pull/50501) +* Update - Add remote logger as a log handler to wc logger [#50430](https://github.com/woocommerce/woocommerce/pull/50430) +* Update - Add request_uri prop to remote logging data [#50671](https://github.com/woocommerce/woocommerce/pull/50671) +* Update - Add woocommerce_coming_soon option for all sites [#50581](https://github.com/woocommerce/woocommerce/pull/50581) +* Update - Comment: Fix typos in documentation. [#50282](https://github.com/woocommerce/woocommerce/pull/50282) +* Update - CYS - Add tests for the Full Composability feature. [#49748](https://github.com/woocommerce/woocommerce/pull/49748) +* Update - CYS - Run appropriate tests depending on the WordPress version. [#50016](https://github.com/woocommerce/woocommerce/pull/50016) +* Update - CYS - Update icon and text colors in the assembler. [#50478](https://github.com/woocommerce/woocommerce/pull/50478) +* Update - CYS: Improve opt-in flow fonts. [#50086](https://github.com/woocommerce/woocommerce/pull/50086) +* Update - CYS: Improve opt-in flow patterns. [#50080](https://github.com/woocommerce/woocommerce/pull/50080) +* Update - CYS: Improve tracking survey [#50196](https://github.com/woocommerce/woocommerce/pull/50196) +* Update - CYS: Improve tracking survey [#50354](https://github.com/woocommerce/woocommerce/pull/50354) +* Update - CYS: Update the tracking URL to the external Fiverr link in sidebar of the **Add your logo** screen. [#50753](https://github.com/woocommerce/woocommerce/pull/50753) +* Update - Enable remote logging feature flag [#50351](https://github.com/woocommerce/woocommerce/pull/50351) +* Update - feat: add `aria-required` attributes to WC form fields [#48371](https://github.com/woocommerce/woocommerce/pull/48371) +* Update - Fixed log-out link behavior so that redirects work, and so that security nonces are automatically added to link in navigation menus. [#49605](https://github.com/woocommerce/woocommerce/pull/49605) +* Update - Migrate LYS user meta [#50664](https://github.com/woocommerce/woocommerce/pull/50664) +* Update - Move marketing task to things to do next task list [#50487](https://github.com/woocommerce/woocommerce/pull/50487) +* Update - Move site visibility badge to admin bar. [#50775](https://github.com/woocommerce/woocommerce/pull/50775) +* Update - Remove "Need help?" modal from onboarding [#47812](https://github.com/woocommerce/woocommerce/pull/47812) +* Update - Remove all links from the CYS sidebars [#50414](https://github.com/woocommerce/woocommerce/pull/50414) +* Update - Remove remote API call from marketing task [#50479](https://github.com/woocommerce/woocommerce/pull/50479) +* Update - Remove WooCommerce Navigation client side feature and deprecate PHP classes. [#50190](https://github.com/woocommerce/woocommerce/pull/50190) +* Update - Renamed columns inside In-App Marketplace > My subscriptions and added action to turn auto-renewal on for a subscription [#49985](https://github.com/woocommerce/woocommerce/pull/49985) +* Update - Rename woocommerce_is_store_page to woocommerce_is_extension_store_page [#50771](https://github.com/woocommerce/woocommerce/pull/50771) +* Update - Reverting the new `buttonAttributes` API. This will be included in a later release [#50763](https://github.com/woocommerce/woocommerce/pull/50763) +* Update - Revert the Zoom Out feature for the CYS experience [#50535](https://github.com/woocommerce/woocommerce/pull/50535) +* Update - Show expiring and expired notices to active and unconnected subscriptions [#50383](https://github.com/woocommerce/woocommerce/pull/50383) +* Update - Store API: Remove the need for nonces when using cart tokens. Remove deprecated X-WC-Store-API-Nonce header. [#50025](https://github.com/woocommerce/woocommerce/pull/50025) +* Update - Strip HTML tags from aria-label in wc_help_tip function [#50103](https://github.com/woocommerce/woocommerce/pull/50103) +* Update - Text adjustments on shipping zones settings page [#50136](https://github.com/woocommerce/woocommerce/pull/50136) +* Update - Update AdditionalPayments task to use default payment gateways [#50674](https://github.com/woocommerce/woocommerce/pull/50674) +* Update - Update add product task button section UI [#50580](https://github.com/woocommerce/woocommerce/pull/50580) +* Update - Update all blocks to use API Version 3. [#48720](https://github.com/woocommerce/woocommerce/pull/48720) +* Update - Update Blueprint settings layout. [#50724](https://github.com/woocommerce/woocommerce/pull/50724) +* Update - Update core profiler continue button container on extension screen [#50582](https://github.com/woocommerce/woocommerce/pull/50582) +* Update - Update Store Alert actions to have unique keys. [#50424](https://github.com/woocommerce/woocommerce/pull/50424) +* Update - Update WooCommercePayments task is_supported to use default suggestions [#50585](https://github.com/woocommerce/woocommerce/pull/50585) +* Dev - Execute test env setup on host instead of wp-env container [#51021](https://github.com/woocommerce/woocommerce/pull/51021) +* Dev - Added code docs with examples to the Analytics classes [#49425](https://github.com/woocommerce/woocommerce/pull/49425) +* Dev - Add lost password e2e tests [#50611](https://github.com/woocommerce/woocommerce/pull/50611) +* Dev - Add unit tests for the product_add_publish track. [#49916](https://github.com/woocommerce/woocommerce/pull/49916) +* Dev - CI: introduce PHPUnit tests sharding. [#50084](https://github.com/woocommerce/woocommerce/pull/50084) +* Dev - CI: minor speed boost of wp-env startup. [#50445](https://github.com/woocommerce/woocommerce/pull/50445) +* Dev - CI: speedup assets size verification job execution time. [#50178](https://github.com/woocommerce/woocommerce/pull/50178) +* Dev - CI: Use a single shard when re-running failed tests in CI [#50492](https://github.com/woocommerce/woocommerce/pull/50492) +* Dev - CI config: update changes list to include more paths [#50399](https://github.com/woocommerce/woocommerce/pull/50399) +* Dev - Clean up unused images [#50516](https://github.com/woocommerce/woocommerce/pull/50516) +* Dev - CYS - Document possible Intro pages [#50171](https://github.com/woocommerce/woocommerce/pull/50171) +* Dev - CYS - Move the "ai/patterns" endpoint to woocommerce admin API. [#50372](https://github.com/woocommerce/woocommerce/pull/50372) +* Dev - CYS - Move the "ai/store-info" endpoint to woocommerce admin API [#50363](https://github.com/woocommerce/woocommerce/pull/50363) +* Dev - CYS - Move the ai/business-description endpoint to woocommerce admin API [#50359](https://github.com/woocommerce/woocommerce/pull/50359) +* Dev - CYS - Move the ai/store-title endpoint to woocommerce admin API [#50352](https://github.com/woocommerce/woocommerce/pull/50352) +* Dev - CYS - Move the `ai/images` endpoint to woocommerce admin API [#50365](https://github.com/woocommerce/woocommerce/pull/50365) +* Dev - CYS - Move the `ai/product` endpoint to woocommerce admin API. [#50393](https://github.com/woocommerce/woocommerce/pull/50393) +* Dev - CYS: add E2E tests for fonts installation. [#50210](https://github.com/woocommerce/woocommerce/pull/50210) +* Dev - E2E tests: add a flaky test reporter for Core e2e tests [#50259](https://github.com/woocommerce/woocommerce/pull/50259) +* Dev - E2E tests: add an option to skip the env setup script running before test execution [#50620](https://github.com/woocommerce/woocommerce/pull/50620) +* Dev - E2E tests: add buildkite-test-collector for blocks e2e tests [#50642](https://github.com/woocommerce/woocommerce/pull/50642) +* Dev - E2E tests: add environment reporter [#49988](https://github.com/woocommerce/woocommerce/pull/49988) +* Dev - E2E tests: add hpos-disabled env and tagged tests with hpos tag [#50448](https://github.com/woocommerce/woocommerce/pull/50448) +* Dev - E2E tests: fixed broken logo picker tests [#50473](https://github.com/woocommerce/woocommerce/pull/50473) +* Dev - E2E tests: fix flakiness in page-loads customer page test [#50559](https://github.com/woocommerce/woocommerce/pull/50559) +* Dev - E2E tests: fix flakiness in product attributes test [#50485](https://github.com/woocommerce/woocommerce/pull/50485) +* Dev - E2E tests: removed Github reporter [#50256](https://github.com/woocommerce/woocommerce/pull/50256) +* Dev - E2E tests: Removed unnecessary pause in the test [#50043](https://github.com/woocommerce/woocommerce/pull/50043) +* Dev - E2E tests for verifying approve, spam and reply to product reviews. [#50060](https://github.com/woocommerce/woocommerce/pull/50060) +* Dev - Fix E2E tests SKU field id #49729 [#49729](https://github.com/woocommerce/woocommerce/pull/49729) +* Dev - Fixes a flaky product variations e2e test [#50807](https://github.com/woocommerce/woocommerce/pull/50807) +* Dev - Fix Metrics CI job [#50214](https://github.com/woocommerce/woocommerce/pull/50214) +* Dev - Fix optional param in PHPdoc for `WC_Admin_Marketplace_Promotions` to generate code-reference w/o warnings [#50732](https://github.com/woocommerce/woocommerce/pull/50732) +* Dev - Fix the Metrics job by adding a missing NVM install step [#50482](https://github.com/woocommerce/woocommerce/pull/50482) +* Dev - Make the Metrics tests use utilities provided by the updated @wordpress/e2e-test-utils-playwright package. [#50626](https://github.com/woocommerce/woocommerce/pull/50626) +* Dev - Mark ReportTable tableData prop as not required [#50816](https://github.com/woocommerce/woocommerce/pull/50816) +* Dev - Monorepo: enable new linting rules for PHP (PSR-4 naming, Strict types declaration). [#49438](https://github.com/woocommerce/woocommerce/pull/49438) +* Dev - Monorepo: tweak Webpack loaders paths filtering for better build perfromance. [#49714](https://github.com/woocommerce/woocommerce/pull/49714) +* Dev - move block theme docs to docs site folder [#50638](https://github.com/woocommerce/woocommerce/pull/50638) +* Dev - move part of checkout docs to main docs folder [#49984](https://github.com/woocommerce/woocommerce/pull/49984) +* Dev - Move `ReportError` to `@woocommerce/components` as `AnalyticsError` [#50108](https://github.com/woocommerce/woocommerce/pull/50108) +* Dev - moving product collection docs to main docs folder [#50368](https://github.com/woocommerce/woocommerce/pull/50368) +* Dev - Reduce duplicated code in Analytics controllers, unify their behavior and API. [#49425](https://github.com/woocommerce/woocommerce/pull/49425) +* Dev - Reduce the amount of duplicated code in Analytics `DataStore`s. [#49425](https://github.com/woocommerce/woocommerce/pull/49425) +* Dev - Removed defaultProps from React functional components since they will be deprecated for React 19 [#50266](https://github.com/woocommerce/woocommerce/pull/50266) +* Dev - Removed directive to disable woocommerce_coming_soon in e2e tests so that we get better test coverage [#50344](https://github.com/woocommerce/woocommerce/pull/50344) +* Dev - Render a React placeholder for offline and WooCommerce Payments settings sections [#50008](https://github.com/woocommerce/woocommerce/pull/50008) +* Dev - Replace `Automattic\WooCommerce\Admin\API\Reports\*\Query` classes with a single `GenericQuery` class. [#49425](https://github.com/woocommerce/woocommerce/pull/49425) +* Dev - Switch `render()` to `createRoot().render()` to use React 18 features. [#48843](https://github.com/woocommerce/woocommerce/pull/48843) +* Dev - Tests: moved api core tests as a suite in e2e-pw [#50024](https://github.com/woocommerce/woocommerce/pull/50024) +* Dev - Tweak the lost password e2e logic [#50666](https://github.com/woocommerce/woocommerce/pull/50666) +* Dev - Update @wordpress/e2e-test-utils-playwright core dependency to wp-6.6 [#50274](https://github.com/woocommerce/woocommerce/pull/50274) +* Dev - Updated e2e tests docs to clarify the use of environments [#50530](https://github.com/woocommerce/woocommerce/pull/50530) +* Dev - Updated the workflow prompting for testing instructions to only run once (preventing double comments) [#50034](https://github.com/woocommerce/woocommerce/pull/50034) +* Dev - Update E2E tests for linked list and variation creation with new component changes. [#50128](https://github.com/woocommerce/woocommerce/pull/50128) +* Dev - Update lys e2e tests to test with both classic and block themes [#50657](https://github.com/woocommerce/woocommerce/pull/50657) +* Dev - Update Playwright to 1.46.1 from 1.45.1 [#50772](https://github.com/woocommerce/woocommerce/pull/50772) +* Dev - Update WP version to 6.6 in Blocks wp-env config. [#49704](https://github.com/woocommerce/woocommerce/pull/49704) +* Dev - Use stricter text selector on test [#50848](https://github.com/woocommerce/woocommerce/pull/50848) +* Dev - [Filter Products by Price]: Update view when changing the min/max value #50651 [#50651](https://github.com/woocommerce/woocommerce/pull/50651) +* Tweak - Disable remote logging feature by default [#51312](https://github.com/woocommerce/woocommerce/pull/51312) +* Tweak - Add GTIN in structured data [#50087](https://github.com/woocommerce/woocommerce/pull/50087) +* Tweak - Add link to title, remove link from a description, minor copy changes to site visibility settings page [#50781](https://github.com/woocommerce/woocommerce/pull/50781) +* Tweak - Add the `woocommerce_should_clear_cart_after_payment` filter to influence whether the cart should be cleared after payment. [#44515](https://github.com/woocommerce/woocommerce/pull/44515) +* Tweak - allows the quantity selector on block cart page to render as readonly when editable is false [#49450](https://github.com/woocommerce/woocommerce/pull/49450) +* Tweak - Bump Jetpack COnnection, Jetpack Constants and a8c MC Stats [#50471](https://github.com/woocommerce/woocommerce/pull/50471) +* Tweak - Extract the checkbox list option logic into its own component [#50566](https://github.com/woocommerce/woocommerce/pull/50566) +* Tweak - Make `geolocation_ajax_get_location_hash` case-insensitive, to reduce the number of cache misses. [#45439](https://github.com/woocommerce/woocommerce/pull/45439) +* Tweak - Optimize large image files [#50517](https://github.com/woocommerce/woocommerce/pull/50517) +* Tweak - Product Collection: fix the PHP deprecated warning [#50661](https://github.com/woocommerce/woocommerce/pull/50661) +* Tweak - Reduce core profiler sticky footer height [#50788](https://github.com/woocommerce/woocommerce/pull/50788) +* Tweak - Remove colon from product data meta box checkboxes [#50619](https://github.com/woocommerce/woocommerce/pull/50619) +* Tweak - Remove the code related to the automatic Products (Beta) -> Product Collection upgrade. [#50440](https://github.com/woocommerce/woocommerce/pull/50440) +* Tweak - Set timeout to 2 seconds for helper product-usage-notice-rules endpoint request [#50821](https://github.com/woocommerce/woocommerce/pull/50821) +* Tweak - Update size of site visibility badge. [#50792](https://github.com/woocommerce/woocommerce/pull/50792) +* Tweak - Vertically center product meta elements [#50826](https://github.com/woocommerce/woocommerce/pull/50826) +* Performance - Cache order dates in options for performance. [#50066](https://github.com/woocommerce/woocommerce/pull/50066) +* Performance - Compress pattern placeholder image assets [#50405](https://github.com/woocommerce/woocommerce/pull/50405) +* Performance - Improve performance of maybe_assign_default_product_cat by only dropping cache and term recounting if changes were made in the database [#50006](https://github.com/woocommerce/woocommerce/pull/50006) +* Performance - Improve setup_tasks_remaining performance [#50655](https://github.com/woocommerce/woocommerce/pull/50655) +* Enhancement - Add a filter to override the SKU database lock. [#49755](https://github.com/woocommerce/woocommerce/pull/49755) +* Enhancement - Add email type to Checkout block email field. [#48611](https://github.com/woocommerce/woocommerce/pull/48611) +* Enhancement - Add filter `woocommerce_is_store_page` to modify whether Coming Soon mode considers a URL a store page or not. [#50174](https://github.com/woocommerce/woocommerce/pull/50174) +* Enhancement - Add username in email reset-password link [#49737](https://github.com/woocommerce/woocommerce/pull/49737) +* Enhancement - CYS: improve CTA [#50278](https://github.com/woocommerce/woocommerce/pull/50278) +* Enhancement - Ensure `wccomHelper` data is only loaded on the Extensions page where it's needed. [#49758](https://github.com/woocommerce/woocommerce/pull/49758) +* Enhancement - Fixed minor issues in the developer documentation recently added by public resources team [#50845](https://github.com/woocommerce/woocommerce/pull/50845) +* Enhancement - Hide zoomed product images for screen readers. [#50003](https://github.com/woocommerce/woocommerce/pull/50003) +* Enhancement - Improve hover style on product tabs when using the Minimal style in the Product Details block [#50605](https://github.com/woocommerce/woocommerce/pull/50605) +* Enhancement - Make screen readers announce notice messages once page loads. [#50061](https://github.com/woocommerce/woocommerce/pull/50061) +* Enhancement - Refactor: Migrate the All Products block to API version 3 [#50203](https://github.com/woocommerce/woocommerce/pull/50203) +* Enhancement - Remove opacity from the hover style of the mini cart button [#50240](https://github.com/woocommerce/woocommerce/pull/50240) +* Enhancement - Use standard link color in legal disclaimers on core profiler [#50830](https://github.com/woocommerce/woocommerce/pull/50830) + = 9.2.3 2024-08-26 = **WooCommerce** diff --git a/docs/building-a-woo-store/block-references.md b/docs/building-a-woo-store/block-references.md index 5ae993bb975..5ec221ebed1 100644 --- a/docs/building-a-woo-store/block-references.md +++ b/docs/building-a-woo-store/block-references.md @@ -1109,16 +1109,16 @@ The contents of this block will display when there are no products found. - **Supports:** align, color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** -## Product Filter (Experimental) - woocommerce/product-filter +## Product Filters (Experimental) - woocommerce/product-filters -A block that adds product filters to the product collection. +Let shoppers filter products displayed on the page. -- **Name:** woocommerce/product-filter +- **Name:** woocommerce/product-filters - **Category:** woocommerce -- **Ancestor:** woocommerce/product-filters +- **Ancestor:** - **Parent:** -- **Supports:** ~~html~~, ~~inserter~~, ~~reusable~~ -- **Attributes:** attributeId, filterType, heading, isPreview +- **Supports:** align, color (background, text), interactivity, layout (allowJustification, allowOrientation, allowVerticalAlignment, default, ~~allowInheriting~~), spacing (blockGap), typography (fontSize, textAlign), ~~inserter~~, ~~multiple~~ +- **Attributes:** overlay, overlayButtonStyle, overlayIcon, overlayIconSize ## Filter Options - woocommerce/product-filter-active @@ -1153,50 +1153,6 @@ Allows shoppers to reset this filter. - **Supports:** interactivity, ~~inserter~~ - **Attributes:** -## Filter Options - woocommerce/product-filter-price - -Enable customers to filter the product collection by choosing a price range. - -- **Name:** woocommerce/product-filter-price -- **Category:** woocommerce -- **Ancestor:** woocommerce/product-filter -- **Parent:** -- **Supports:** interactivity, ~~inserter~~ -- **Attributes:** inlineInput, showInputFields - -## Filter Options - woocommerce/product-filter-rating - -Enable customers to filter the product collection by rating. - -- **Name:** woocommerce/product-filter-rating -- **Category:** woocommerce -- **Ancestor:** woocommerce/product-filter -- **Parent:** -- **Supports:** color (text, ~~background~~), interactivity, ~~inserter~~ -- **Attributes:** className, displayStyle, isPreview, selectType, showCounts - -## Filter Options - woocommerce/product-filter-stock-status - -Enable customers to filter the product collection by stock status. - -- **Name:** woocommerce/product-filter-stock-status -- **Category:** woocommerce -- **Ancestor:** woocommerce/product-filter -- **Parent:** -- **Supports:** color (text, ~~background~~), interactivity, ~~html~~, ~~inserter~~, ~~multiple~~ -- **Attributes:** className, displayStyle, isPreview, selectType, showCounts - -## Product Filters (Experimental) - woocommerce/product-filters - -Let shoppers filter products displayed on the page. - -- **Name:** woocommerce/product-filters -- **Category:** woocommerce -- **Ancestor:** -- **Parent:** -- **Supports:** align, color (background, text), interactivity, layout (allowJustification, allowOrientation, allowVerticalAlignment, default, ~~allowInheriting~~), spacing (blockGap), typography (fontSize, textAlign), ~~inserter~~, ~~multiple~~ -- **Attributes:** overlay, overlayButtonStyle, overlayIcon, overlayIconSize - ## Product Filters Overlay (Experimental) - woocommerce/product-filters-overlay Display product filters in an overlay on top of a page. @@ -1219,6 +1175,50 @@ Display overlay navigation controls. - **Supports:** align (center, left, right), color (background, text), layout (default, ~~allowEditing~~), position (sticky), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~inserter~~ - **Attributes:** align, buttonStyle, iconSize, navigationStyle, overlayMode, style, triggerType +## Filter Options - woocommerce/product-filter-price + +Enable customers to filter the product collection by choosing a price range. + +- **Name:** woocommerce/product-filter-price +- **Category:** woocommerce +- **Ancestor:** woocommerce/product-filter +- **Parent:** +- **Supports:** interactivity, ~~inserter~~ +- **Attributes:** inlineInput, showInputFields + +## Product Filter (Experimental) - woocommerce/product-filter + +A block that adds product filters to the product collection. + +- **Name:** woocommerce/product-filter +- **Category:** woocommerce +- **Ancestor:** woocommerce/product-filters +- **Parent:** +- **Supports:** inserter, ~~html~~, ~~reusable~~ +- **Attributes:** attributeId, filterType, heading, isPreview + +## Filter Options - woocommerce/product-filter-rating + +Enable customers to filter the product collection by rating. + +- **Name:** woocommerce/product-filter-rating +- **Category:** woocommerce +- **Ancestor:** woocommerce/product-filter +- **Parent:** +- **Supports:** color (text, ~~background~~), interactivity, ~~inserter~~ +- **Attributes:** className, displayStyle, isPreview, selectType, showCounts + +## Filter Options - woocommerce/product-filter-stock-status + +Enable customers to filter the product collection by stock status. + +- **Name:** woocommerce/product-filter-stock-status +- **Category:** woocommerce +- **Ancestor:** woocommerce/product-filter +- **Parent:** +- **Supports:** color (text, ~~background~~), interactivity, ~~html~~, ~~inserter~~ +- **Attributes:** className, displayStyle, isPreview, selectType, showCounts + ## Product Gallery (Beta) - woocommerce/product-gallery Showcase your products relevant images and media. diff --git a/docs/cart-and-checkout-blocks/additional-checkout-fields.md b/docs/cart-and-checkout-blocks/additional-checkout-fields.md index 29981df9bdc..89af92968c2 100644 --- a/docs/cart-and-checkout-blocks/additional-checkout-fields.md +++ b/docs/cart-and-checkout-blocks/additional-checkout-fields.md @@ -339,11 +339,11 @@ This results in the following address form (the billing form will be the same): The rendered markup looks like this: ```html - + data-custom="custom data" value="" > ``` ### Rendering a checkbox field diff --git a/docs/cart-and-checkout-blocks/available-filters/README.md b/docs/cart-and-checkout-blocks/available-filters/README.md index 6185107f41b..80eeab35f71 100644 --- a/docs/cart-and-checkout-blocks/available-filters/README.md +++ b/docs/cart-and-checkout-blocks/available-filters/README.md @@ -81,7 +81,7 @@ const modifyCartItemClass = ( defaultValue, extensions, args ) => { const modifyCartItemPrice = ( defaultValue, extensions, args ) => { if ( isOrderSummaryContext( args ) ) { - return ' for all items'; + return '<price/> for all items'; } return defaultValue; }; @@ -95,7 +95,7 @@ const modifyItemName = ( defaultValue, extensions, args ) => { const modifySubtotalPriceFormat = ( defaultValue, extensions, args ) => { if ( isOrderSummaryContext( args ) ) { - return ' per item'; + return '<price/> per item'; } return defaultValue; }; diff --git a/docs/cart-and-checkout-blocks/available-filters/order-summary-items.md b/docs/cart-and-checkout-blocks/available-filters/order-summary-items.md index ce4134df03c..c210fa39fcf 100644 --- a/docs/cart-and-checkout-blocks/available-filters/order-summary-items.md +++ b/docs/cart-and-checkout-blocks/available-filters/order-summary-items.md @@ -106,17 +106,17 @@ The `cartItemPrice` filter allows to format the order summary item price. ### Parameters -- _defaultValue_ `string` (default: ``) - The default order summary item price. +- _defaultValue_ `string` (default: `<price/>`) - The default order summary item price. - _extensions_ `object` (default: `{}`) - The extensions object. - _args_ `object` - The arguments object with the following keys: - _cart_ `object` - The cart object from `wc/store/cart`, see [Cart object](#cart-object). - _cartItem_ `object` - The order summary item object from `wc/store/cart`, see [order summary item object](#cart-item-object). - _context_ `string` (allowed values: `cart` or `summary`) - The context of the item. -- _validation_ `boolean` - Checks if the return value contains the substring ``. +- _validation_ `boolean` - Checks if the return value contains the substring `<price/>`. ### Returns -- `string` - The modified format of the order summary item price, which must contain the substring ``, or the original price format. +- `string` - The modified format of the order summary item price, which must contain the substring `<price/>`, or the original price format. ### Code examples @@ -132,7 +132,7 @@ const modifyCartItemPrice = ( defaultValue, extensions, args, validation ) => { return defaultValue; } - return ' for all items'; + return '<price/> for all items'; }; registerCheckoutFilters( 'example-extension', { @@ -153,14 +153,14 @@ const modifyCartItemPrice = ( defaultValue, extensions, args, validation ) => { } if ( args?.cartItem?.name === 'Beanie with Logo' ) { - return ' to keep you ☀️'; + return '<price/> to keep you ☀️'; } if ( args?.cartItem?.name === 'Sunglasses' ) { - return ' to keep you ❄️'; + return '<price/> to keep you ❄️'; } - return ' for all items'; + return '<price/> for all items'; }; registerCheckoutFilters( 'example-extension', { @@ -261,17 +261,17 @@ The `subtotalPriceFormat` filter allows to format the order summary item subtota ### Parameters -- _defaultValue_ `string` (default: ``) - The default order summary item subtotal price. +- _defaultValue_ `string` (default: `<price/>`) - The default order summary item subtotal price. - _extensions_ `object` (default: `{}`) - The extensions object. - _args_ `object` - The arguments object with the following keys: - _cart_ `object` - The cart object from `wc/store/cart`, see [Cart object](#cart-object). - _cartItem_ `object` - The order summary item object from `wc/store/cart`, see [order summary item object](#cart-item-object). - _context_ `string` (allowed values: `cart` or `summary`) - The context of the item. -- _validation_ `boolean` - Checks if the return value contains the substring ``. +- _validation_ `boolean` - Checks if the return value contains the substring `<price/>`. ### Returns -- `string` - The modified format of the order summary item subtotal price, which must contain the substring ``, or the original price format. +- `string` - The modified format of the order summary item subtotal price, which must contain the substring `<price/>`, or the original price format. ### Code examples @@ -292,7 +292,7 @@ const modifySubtotalPriceFormat = ( return defaultValue; } - return ' per item'; + return '<price/> per item'; }; registerCheckoutFilters( 'example-extension', { @@ -318,14 +318,14 @@ const modifySubtotalPriceFormat = ( } if ( args?.cartItem?.name === 'Beanie with Logo' ) { - return ' per warm beanie'; + return '<price/> per warm beanie'; } if ( args?.cartItem?.name === 'Sunglasses' ) { - return ' per cool sunglasses'; + return '<price/> per cool sunglasses'; } - return ' per item'; + return '<price/> per item'; }; registerCheckoutFilters( 'example-extension', { diff --git a/docs/cart-and-checkout-blocks/available-filters/totals-footer-item.md b/docs/cart-and-checkout-blocks/available-filters/totals-footer-item.md index 360c7627b80..c3a72631330 100644 --- a/docs/cart-and-checkout-blocks/available-filters/totals-footer-item.md +++ b/docs/cart-and-checkout-blocks/available-filters/totals-footer-item.md @@ -71,11 +71,11 @@ The `totalValue` filter allows to format the total price in the footer of the Ca - _extensions_ `object` (default: `{}`) - The extensions object. - _args_ `object` - The arguments object with the following keys: - _cart_ `object` - The cart object from `wc/store/cart`, see [Cart object](#cart-object). -- _validation_ `boolean` - Checks if the return value contains the substring ``. +- _validation_ `boolean` - Checks if the return value contains the substring `<price/>`. ### Returns -- `string` - The modified format of the total price, which must contain the substring ``, or the original price format. +- `string` - The modified format of the total price, which must contain the substring `<price/>`, or the original price format. ### Code example @@ -83,7 +83,7 @@ The `totalValue` filter allows to format the total price in the footer of the Ca const { registerCheckoutFilters } = window.wc.blocksCheckout; const modifyTotalsPrice = ( defaultValue, extensions, args, validation ) => { - return 'Pay now'; + return 'Pay <price/> now'; }; registerCheckoutFilters( 'my-extension', { diff --git a/docs/cart-and-checkout-blocks/available-slot-fills.md b/docs/cart-and-checkout-blocks/available-slot-fills.md index 80effcba522..efc47abcfa2 100644 --- a/docs/cart-and-checkout-blocks/available-slot-fills.md +++ b/docs/cart-and-checkout-blocks/available-slot-fills.md @@ -22,11 +22,11 @@ const { ExperimentalOrderMeta } = window.wc.blocksCheckout; const render = () => { return ( - -
+ <ExperimentalOrderMeta> + <div class="wc-block-components-totals-wrapper"> { __( 'Yearly recurring total ...', 'YOUR-TEXTDOMAIN' ) } -
-
+ </div> + </ExperimentalOrderMeta> ); }; @@ -61,9 +61,9 @@ const { ExperimentalOrderShippingPackages } = window.wc.blocksCheckout; const render = () => { return ( - -
{ __( 'Express Shipping', 'YOUR-TEXTDOMAIN' ) }
-
+ <ExperimentalOrderShippingPackages> + <div>{ __( 'Express Shipping', 'YOUR-TEXTDOMAIN' ) }</div> + </ExperimentalOrderShippingPackages> ); }; @@ -104,14 +104,14 @@ const { ExperimentalOrderLocalPickupPackages } = window.wc.blocksCheckout; const render = () => { return ( - -
+ <ExperimentalOrderLocalPickupPackages> + <div> { __( 'By using our convenient local pickup option, you can come to our store and pick up your order. We will send you and email when your order is ready for pickup.', 'YOUR-TEXTDOMAIN' ) } -
-
+ </div> + </ExperimentalOrderLocalPickupPackages> ); }; @@ -143,11 +143,11 @@ const { ExperimentalDiscountsMeta } = window.wc.blocksCheckout; const render = () => { return ( - -
+ <ExperimentalDiscountsMeta> + <div class="wc-block-components-totals-wrapper"> { __( 'You have 98683 coins to spend ...', 'YOUR-TEXTDOMAIN' ) } -
-
+ </div> + </ExperimentalDiscountsMeta> ); }; diff --git a/docs/cart-and-checkout-blocks/checkout-payment-methods/payment-method-integration.md b/docs/cart-and-checkout-blocks/checkout-payment-methods/payment-method-integration.md index 602bcb7deaa..d3457214654 100644 --- a/docs/cart-and-checkout-blocks/checkout-payment-methods/payment-method-integration.md +++ b/docs/cart-and-checkout-blocks/checkout-payment-methods/payment-method-integration.md @@ -43,8 +43,8 @@ The options you feed the configuration instance should be an object in this shap ```js const options = { name: 'my_payment_method', - content:
A React node
, - edit:
A React node
, + content: <div>A React node</div>, + edit: <div>A React node</div>, canMakePayment: () => true, paymentMethodId: 'new_payment_method', supports: { diff --git a/docs/cart-and-checkout-blocks/slot-fills.md b/docs/cart-and-checkout-blocks/slot-fills.md index d694d03bb1e..38003d4921f 100644 --- a/docs/cart-and-checkout-blocks/slot-fills.md +++ b/docs/cart-and-checkout-blocks/slot-fills.md @@ -32,14 +32,14 @@ const { registerPlugin } = wp.plugins; const { ExperimentalOrderMeta } = wc.blocksCheckout; const MyCustomComponent = ( { cart, extensions } ) => { - return
Hello WooCommerce
; + return <div className="my-component">Hello WooCommerce</div>; }; const render = () => { return ( - - - + <ExperimentalOrderMeta> + <MyCustomComponent /> + </ExperimentalOrderMeta> ); }; diff --git a/docs/code-snippets/customising-checkout-fields.md b/docs/code-snippets/customising-checkout-fields.md index 4b8aa96aee8..ab90d600be1 100644 --- a/docs/code-snippets/customising-checkout-fields.md +++ b/docs/code-snippets/customising-checkout-fields.md @@ -295,7 +295,7 @@ function custom_override_checkout_fields( $fields ) { add_action( 'woocommerce_admin_order_data_after_shipping_address', 'my_custom_checkout_field_display_admin_order_meta', 10, 1 ); function my_custom_checkout_field_display_admin_order_meta($order){ - echo '

'. esc_html__( 'Phone From Checkout Form' ) . ': ' . esc_html( $order->get_meta( '_shipping_phone', true ) ) . '

'; + echo '<p><strong>'. esc_html__( 'Phone From Checkout Form' ) . ':</strong> ' . esc_html( $order->get_meta( '_shipping_phone', true ) ) . '</p>'; } ``` @@ -317,7 +317,7 @@ add_action( 'woocommerce_after_order_notes', 'my_custom_checkout_field' ); function my_custom_checkout_field( $checkout ) { - echo '

' . esc_html__( 'My Field' ) . '

'; + echo '<div id="my_custom_checkout_field"><h2>' . esc_html__( 'My Field' ) . '</h2>'; woocommerce_form_field( 'my_field_name', @@ -330,7 +330,7 @@ function my_custom_checkout_field( $checkout ) { $checkout->get_value( 'my_field_name' ) ); - echo '
'; + echo '</div>'; } ``` @@ -387,7 +387,7 @@ If you wish to display the custom field value on the admin order edition page, y add_action( 'woocommerce_admin_order_data_after_billing_address', 'my_custom_checkout_field_display_admin_order_meta', 10, 1 ); function my_custom_checkout_field_display_admin_order_meta( $order ){ - echo '

' . esc_html__( 'My Field' ) . ': ' . esc_html( $order->get_meta( 'My Field', true ) ) . '

'; + echo '<p><strong>' . esc_html__( 'My Field' ) . ':</strong> ' . esc_html( $order->get_meta( 'My Field', true ) ) . '</p>'; } ``` diff --git a/docs/code-snippets/displaying_custom_fields_in_your_theme_or_site.md b/docs/code-snippets/displaying_custom_fields_in_your_theme_or_site.md index 0549ead8a57..6d3caeedb2a 100644 --- a/docs/code-snippets/displaying_custom_fields_in_your_theme_or_site.md +++ b/docs/code-snippets/displaying_custom_fields_in_your_theme_or_site.md @@ -33,7 +33,7 @@ function woocommerce_custom_field_example() { $custom_field_value = get_post_meta( $product->get_id(), 'woo_custom_field', true ); if ( ! empty( $custom_field_value ) ) { - echo '
' . esc_html( $custom_field_value ) . '
'; + echo '<div class="custom-field">' . esc_html( $custom_field_value ) . '</div>'; } } diff --git a/docs/code-snippets/link-to-logged-data.md b/docs/code-snippets/link-to-logged-data.md index a4d31dd362b..d2fdf8da947 100644 --- a/docs/code-snippets/link-to-logged-data.md +++ b/docs/code-snippets/link-to-logged-data.md @@ -19,7 +19,7 @@ if ( defined( 'WC_LOG_DIR' ) ) { $log_url = add_query_arg( 'log_file', $log_key, $log_url ); // Add a link to the logs to the label - $label .= ' | ' . sprintf( \_\_( '%1$sView Log%2$s', 'your-textdomain-here' ), '', '' ); + $label .= ' | ' . sprintf( \_\_( '%1$sView Log%2$s', 'your-textdomain-here' ), '<a href\="' . esc_url( $log_url ) . '">', '</a\>' ); } // Add the logging option to the form fields diff --git a/docs/docs-manifest.json b/docs/docs-manifest.json index 5de8f35e6aa..f7579ca4cef 100644 --- a/docs/docs-manifest.json +++ b/docs/docs-manifest.json @@ -74,7 +74,7 @@ "post_title": "Blocks reference", "menu_title": "Blocks Reference", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/building-a-woo-store/block-references.md", - "hash": "329f17097ce67074a915d7814b2363e8b9e908910c1f7b196c8f4fd8594cc55c", + "hash": "9bbd3555641a70a0d7c24c818323a9270e437a6446998de9a6506e0c2ed6ddf5", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/building-a-woo-store/block-references.md", "id": "1fbe91d7fa4fafaf35f0297e4cee1e7958756aed" }, @@ -100,7 +100,7 @@ "menu_title": "Slot and Fill", "tags": "reference", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/cart-and-checkout-blocks/slot-fills.md", - "hash": "f83a5fbef86e5ef6b0ec1d63fdbcbf4742f54de1125e535fa0f32f5f80ec794a", + "hash": "a232ca3d53f10857170113f6dc5b37ac7ae629e852629bac015a8d3c2cd1bbc4", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/cart-and-checkout-blocks/slot-fills.md", "id": "e388101586765dd9aca752d66d667d74951a1504" }, @@ -136,7 +136,7 @@ "menu_title": "Available Slots", "tags": "reference", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/cart-and-checkout-blocks/available-slot-fills.md", - "hash": "770da9156eea1fdc24db0736ce4ccd44ebde4f3b0373cd875b1ae88d4d9c8a49", + "hash": "444d9892cb6552c8394ecdf81816952987b59bc79fa53f3083c3d14a89d1e961", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/cart-and-checkout-blocks/available-slot-fills.md", "id": "c7ac16eee5540b06b6db928f5d03282ff177e84e" }, @@ -145,14 +145,14 @@ "menu_title": "Additional Checkout Fields", "tags": "reference", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/cart-and-checkout-blocks/additional-checkout-fields.md", - "hash": "1b034ede098b933b6b00a9a27ba33e418b1c88c4883e2b9b191092e32866f7b9", + "hash": "641615864f627be4bb42574df378cea91f4a7fda9edab099558bad06b92ce62d", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/cart-and-checkout-blocks/additional-checkout-fields.md", "id": "cb5dd8d59043a4e53929121b45da7b33b1661ab8" } ], "categories": [ { - "content": "\nThis document lists the filters that are currently available to extensions and offers usage information for each one of them. Information on registering filters can be found on the [Checkout - Filter Registry](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce-blocks/packages/checkout/filter-registry/README.md) page.\n\n## Cart Line Items filters\n\nThe following [Cart Line Items filters](./cart-line-items.md) are available:\n\n- `cartItemClass`\n- `cartItemPrice`\n- `itemName`\n- `saleBadgePriceFormat`\n- `showRemoveItemLink`\n- `subtotalPriceFormat`\n\nThe following screenshot shows which parts the individual filters affect:\n\n![Cart Line Items](https://woocommerce.com/wp-content/uploads/2023/10/Screenshot-2023-10-26-at-13.12.33.png)\n\n## Order Summary Items filters\n\nThe following [Order Summary Items filters](./order-summary-items.md) are available:\n\n- `cartItemClass`\n- `cartItemPrice`\n- `itemName`\n- `subtotalPriceFormat`\n\nThe following screenshot shows which parts the individual filters affect:\n\n![Order Summary Items](https://woocommerce.com/wp-content/uploads/2023/10/Screenshot-2023-10-26-at-16.29.45.png)\n\n## Totals Footer Item filter\n\nThe following [Totals Footer Item filter](./totals-footer-item.md) is available:\n\n- `totalLabel`\n- `totalValue`\n\n## Checkout and place order button filters\n\nThe following [Checkout and place order button filters](./checkout-and-place-order-button.md) are available:\n\n- `proceedToCheckoutButtonLabel`\n- `proceedToCheckoutButtonLink`\n- `placeOrderButtonLabel`\n\n## Coupon filters\n\nThe following [Coupon filters](./coupons.md) are available:\n\n- `coupons`\n- `showApplyCouponNotice`\n- `showRemoveCouponNotice`\n\n## Additional Cart and Checkout inner block types filter\n\nThe following [Additional Cart and Checkout inner block types filter](./additional-cart-checkout-inner-block-types.md) is available:\n\n- `additionalCartCheckoutInnerBlockTypes`\n\n## Combined filters\n\nFilters can also be combined. The following example shows how to combine some of the available filters.\n\n```tsx\nconst { registerCheckoutFilters } = window.wc.blocksCheckout;\n\nconst isOrderSummaryContext = ( args ) => args?.context === 'summary';\n\nconst modifyCartItemClass = ( defaultValue, extensions, args ) => {\n\tif ( isOrderSummaryContext( args ) ) {\n\t\treturn 'my-custom-class';\n\t}\n\treturn defaultValue;\n};\n\nconst modifyCartItemPrice = ( defaultValue, extensions, args ) => {\n\tif ( isOrderSummaryContext( args ) ) {\n\t\treturn ' for all items';\n\t}\n\treturn defaultValue;\n};\n\nconst modifyItemName = ( defaultValue, extensions, args ) => {\n\tif ( isOrderSummaryContext( args ) ) {\n\t\treturn `${ defaultValue }`;\n\t}\n\treturn defaultValue;\n};\n\nconst modifySubtotalPriceFormat = ( defaultValue, extensions, args ) => {\n\tif ( isOrderSummaryContext( args ) ) {\n\t\treturn ' per item';\n\t}\n\treturn defaultValue;\n};\n\nregisterCheckoutFilters( 'example-extension', {\n\tcartItemClass: modifyCartItemClass,\n\tcartItemPrice: modifyCartItemPrice,\n\titemName: modifyItemName,\n\tsubtotalPriceFormat: modifySubtotalPriceFormat,\n} );\n```\n\n## Troubleshooting\n\nIf you are logged in to the store as an administrator, you should be shown an error like this if your filter is not\nworking correctly. The error will also be shown in your console.\n\n![Troubleshooting](https://woocommerce.com/wp-content/uploads/2023/10/Screenshot-2023-10-30-at-10.52.53.png)\n\n\n", + "content": "\nThis document lists the filters that are currently available to extensions and offers usage information for each one of them. Information on registering filters can be found on the [Checkout - Filter Registry](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce-blocks/packages/checkout/filter-registry/README.md) page.\n\n## Cart Line Items filters\n\nThe following [Cart Line Items filters](./cart-line-items.md) are available:\n\n- `cartItemClass`\n- `cartItemPrice`\n- `itemName`\n- `saleBadgePriceFormat`\n- `showRemoveItemLink`\n- `subtotalPriceFormat`\n\nThe following screenshot shows which parts the individual filters affect:\n\n![Cart Line Items](https://woocommerce.com/wp-content/uploads/2023/10/Screenshot-2023-10-26-at-13.12.33.png)\n\n## Order Summary Items filters\n\nThe following [Order Summary Items filters](./order-summary-items.md) are available:\n\n- `cartItemClass`\n- `cartItemPrice`\n- `itemName`\n- `subtotalPriceFormat`\n\nThe following screenshot shows which parts the individual filters affect:\n\n![Order Summary Items](https://woocommerce.com/wp-content/uploads/2023/10/Screenshot-2023-10-26-at-16.29.45.png)\n\n## Totals Footer Item filter\n\nThe following [Totals Footer Item filter](./totals-footer-item.md) is available:\n\n- `totalLabel`\n- `totalValue`\n\n## Checkout and place order button filters\n\nThe following [Checkout and place order button filters](./checkout-and-place-order-button.md) are available:\n\n- `proceedToCheckoutButtonLabel`\n- `proceedToCheckoutButtonLink`\n- `placeOrderButtonLabel`\n\n## Coupon filters\n\nThe following [Coupon filters](./coupons.md) are available:\n\n- `coupons`\n- `showApplyCouponNotice`\n- `showRemoveCouponNotice`\n\n## Additional Cart and Checkout inner block types filter\n\nThe following [Additional Cart and Checkout inner block types filter](./additional-cart-checkout-inner-block-types.md) is available:\n\n- `additionalCartCheckoutInnerBlockTypes`\n\n## Combined filters\n\nFilters can also be combined. The following example shows how to combine some of the available filters.\n\n```tsx\nconst { registerCheckoutFilters } = window.wc.blocksCheckout;\n\nconst isOrderSummaryContext = ( args ) => args?.context === 'summary';\n\nconst modifyCartItemClass = ( defaultValue, extensions, args ) => {\n\tif ( isOrderSummaryContext( args ) ) {\n\t\treturn 'my-custom-class';\n\t}\n\treturn defaultValue;\n};\n\nconst modifyCartItemPrice = ( defaultValue, extensions, args ) => {\n\tif ( isOrderSummaryContext( args ) ) {\n\t\treturn '<price/> for all items';\n\t}\n\treturn defaultValue;\n};\n\nconst modifyItemName = ( defaultValue, extensions, args ) => {\n\tif ( isOrderSummaryContext( args ) ) {\n\t\treturn `${ defaultValue }`;\n\t}\n\treturn defaultValue;\n};\n\nconst modifySubtotalPriceFormat = ( defaultValue, extensions, args ) => {\n\tif ( isOrderSummaryContext( args ) ) {\n\t\treturn '<price/> per item';\n\t}\n\treturn defaultValue;\n};\n\nregisterCheckoutFilters( 'example-extension', {\n\tcartItemClass: modifyCartItemClass,\n\tcartItemPrice: modifyCartItemPrice,\n\titemName: modifyItemName,\n\tsubtotalPriceFormat: modifySubtotalPriceFormat,\n} );\n```\n\n## Troubleshooting\n\nIf you are logged in to the store as an administrator, you should be shown an error like this if your filter is not\nworking correctly. The error will also be shown in your console.\n\n![Troubleshooting](https://woocommerce.com/wp-content/uploads/2023/10/Screenshot-2023-10-30-at-10.52.53.png)\n\n\n", "category_slug": "cart-and-checkout-available-filters", "category_title": "Available Filters", "posts": [ @@ -161,7 +161,7 @@ "menu_title": "Totals Footer Item", "tags": "reference", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/cart-and-checkout-blocks/available-filters/totals-footer-item.md", - "hash": "3a9869d7d7beadb8117c100c3b58675e416e16386ee753f78e1a9087e768053f", + "hash": "6cf668422809b036dca7c1996ae907497a38631dd5bfb7e67d6bf3620425e411", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/cart-and-checkout-blocks/available-filters/totals-footer-item.md", "id": "90a9b8df374082f1713866a58b810303adb4d3da" }, @@ -170,7 +170,7 @@ "menu_title": "Order Summary Items", "tags": "reference", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/cart-and-checkout-blocks/available-filters/order-summary-items.md", - "hash": "36f1bfa8d192b106d28d71334b42413d4c289a0a8d1f5b76b2f905d6fa453883", + "hash": "1796f53f3d67dd6b47fe8d7f67cbd69bddcaa6416bb5a0cc1a0fc99f42ea9d10", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/cart-and-checkout-blocks/available-filters/order-summary-items.md", "id": "78eb3b135f82a3624a49979e3e93334295abd060" }, @@ -223,7 +223,7 @@ "menu_title": "Payment Method Integration", "tags": "reference", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/cart-and-checkout-blocks/checkout-payment-methods/payment-method-integration.md", - "hash": "f60acaaea4a6ac4adf637bc7069c966e01db089f9dfaa937def91165a71a4255", + "hash": "138ffbf27e79ec8b35d2c46e87e3663c203d91fc9ba3f76c43f3cbe76258e5bf", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/cart-and-checkout-blocks/checkout-payment-methods/payment-method-integration.md", "id": "c9a763b6976ecf03aeb961577c17c31f1ac7c420", "links": { @@ -363,7 +363,7 @@ "menu_title": "Add link to logged data", "tags": "code-snippets", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/code-snippets/link-to-logged-data.md", - "hash": "fd1c3a58da8b7eed11da841d901b4d3cc117c6753c3b3834f3de41ea266490b9", + "hash": "4e51c120a6ea7b14c0e43f11e8eb1b785e4447fbe2b997f5789f10b57c485137", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/code-snippets/link-to-logged-data.md", "id": "34da337f79be5ce857024f541a99d302174ca37d" }, @@ -389,7 +389,7 @@ "menu_title": "Displaying custom fields in theme", "tags": "code-snippet", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/code-snippets/displaying_custom_fields_in_your_theme_or_site.md", - "hash": "8048c2e9e5d25268d17d4f4ca7929e265eddbd4653318dd8f544856ddecd39dd", + "hash": "013acf9daaef92daf49e49315b2c0eba730b96adb8078eaab1146db4afc5270b", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/code-snippets/displaying_custom_fields_in_your_theme_or_site.md", "id": "3e3fd004afda355cf9dbb05f0967523d6d0da1ce" }, @@ -405,7 +405,7 @@ "post_title": "Customizing checkout fields using actions and filters", "tags": "code-snippet", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/code-snippets/customising-checkout-fields.md", - "hash": "8bbfe162402e484ae89427e1aedaed4faa57555b64b5a77ca800f701524314cb", + "hash": "ce63f640d5b91d85c3bbb80128d8a19e9c00d1c0e252abd4f958e29dcc1e60ce", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/code-snippets/customising-checkout-fields.md", "id": "83097d3b7414557fc80dcf9f8f1a708bbdcdd884" }, @@ -676,7 +676,7 @@ { "post_title": "Settings API", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/settings-api.md", - "hash": "ca80728c56d60bb7416bb2865678b9e04807d0e208a4df56b8efaf32e9ac465d", + "hash": "9015453d8be72871bb26a450b86e542aa698c67b93284a04cd2b18008113bf43", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/settings-api.md", "id": "ed56b97b9de350074a302373ebaaa5dcce727e8b" }, @@ -691,7 +691,7 @@ "post_title": "Integrating with coming soon mode", "tags": "how-to, coming-soon", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/integrating-coming-soon-mode.md", - "hash": "910dbbab77c6fb4735e7704796242c38d86f3bf3b897de1075338eb47194f8f5", + "hash": "791cd6d3928b3aafc72a24d0283a404a90a0f021c7c36edaa445eb44978114a3", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/integrating-coming-soon-mode.md", "id": "787743efb6ef0ad509b17735eaf58b2a9a08afbc" }, @@ -700,7 +700,7 @@ "menu_title": "Creating custom settings", "tags": "how-to", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/implementing-settings.md", - "hash": "604d455f9e413c23a208c174ba25611c333e02eef0bafb0d38253f8dd8e3a04c", + "hash": "5cab83a84bb7eb11090bac244754fdae1f8aef1030850d12c29c09054c50bc61", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/implementing-settings.md", "id": "58bcbd3a0cd3b3e5fe738c3bb625cf9b7747c99a" }, @@ -727,7 +727,7 @@ "menu_title": "Implement merchant onboarding", "tags": "how-to", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/handling-merchant-onboarding.md", - "hash": "c73e3c5015e6cda3be9ebd2d5fbda590ac9fa599e5fb02163c971c01060970ad", + "hash": "85fc7d70f47fdb195ad2c690d3b95565169221f9e4d7afa98e88f3824ad0e267", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/handling-merchant-onboarding.md", "id": "89fe15dc232379f546852822230c334d3d940b93" }, @@ -814,7 +814,7 @@ "menu_title": "Add custom product types to Add Products onboarding list", "tags": "how-to", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/adding-custom-products-to-add-products-onboarding-list.md", - "hash": "60e50ef5d7e2ac6d0745c31031140df1dbb3c1b8724230cab1eaedebe3814688", + "hash": "92a8e17f2cd8dc32a78f03970ded1beec2fd60cadbf14c8cefcabbf7abae59c5", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/adding-custom-products-to-add-products-onboarding-list.md", "id": "747321d7fd2eb5c9c3351ea38374dfc80d3ec968" }, @@ -861,7 +861,7 @@ "menu_title": "Troubleshooting Endpoints", "tags": "how-to", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/getting-started/troubleshooting-endpoints.md", - "hash": "1a015d82f4d82cc2d9f13f188f03c4e6e03b98ea9d22c5a7710547e7d3c8c78f", + "hash": "448bcd827ff44e9eb10d039bfd933cd63a37df05bd694bf80f9d9f978a3afdf5", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/getting-started/troubleshooting-endpoints.md", "id": "dff57bd736ae83850bfc7e4ac994bd22141d96ee", "links": { @@ -874,7 +874,7 @@ "menu_title": "Development environment setup", "tags": "tutorial, setup", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/getting-started/development-environment.md", - "hash": "b9f56987247aee67eaa2c74d1059e1cadfd335fa81c77b76c0717648d5631c0f", + "hash": "9e471d3f44a882fe61dcad9e5207d51b280a7220aae1bf6e4ae1fbdd68b7e3d4", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/getting-started/development-environment.md", "id": "9080572a3904349c44c565ca7e1bef1212c58757" }, @@ -903,7 +903,7 @@ "menu_title": "Customizing Endpoint URLs", "tags": "how-to", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/getting-started/customizing-endpoint-urls.md", - "hash": "7feda75b07a1c11d533afabc7781abb80438ce2fa2c3fb37c173e1275098e720", + "hash": "364ed14d70c49498ba5017104b9c83743322d5095c215262d4311866a76181e5", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/getting-started/customizing-endpoint-urls.md", "id": "c19e1b1da6543f8a95ee04ba120f4f171f8e6e40", "links": { @@ -956,7 +956,7 @@ "post_title": "HPOS CLI Tools", "tags": "reference", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/high-performance-order-storage/cli-tools.md", - "hash": "8cd823759ce20551d582c39f57ae79f9e0227a8cb0131146e6b7dac5e7312708", + "hash": "63e5edd55720c963de6700854515ea51946ff734b716ab61793955308b72af91", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/high-performance-order-storage/cli-tools.md", "id": "cdd9d9ad5777d978ba953e3478fbb61cab8fdf59" } @@ -1050,7 +1050,7 @@ "menu_title": "Registering custom collections", "tags": "how-to", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/product-collection-block/register-product-collection.md", - "hash": "27c321bed35524d74019e015f5eed6cdca7e6c2efe0bc89ffdd2b9b5d43c47e8", + "hash": "6d32bc27924226b032e03624dbeedde3c899c2e8eb777a1fece93bed99544f03", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/product-collection-block/register-product-collection.md", "id": "3bf26fc7c56ae6e6a56e1171f750f5204fcfcece" }, @@ -1059,7 +1059,7 @@ "menu_title": "DOM Events", "tags": "how-to", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/product-collection-block/dom-events.md", - "hash": "fbad20bc55cc569161e80478c0789db3c34cf35513e669554af36db1de967a26", + "hash": "59a4b49eb146774d33229bc60ab7d8f74381493f6e7089ca8f0e2d0eb433a7a4", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/product-collection-block/dom-events.md", "id": "c8d247b91472740075871e6b57a9583d893ac650" } @@ -1117,7 +1117,7 @@ { "post_title": "Extending the product form with custom fields", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/product-editor-development/how-to-guides/custom-field-tutorial.md", - "hash": "f0d0273c0d65739d605448492bfbe684f0ed33f9e6e274df06f26e83cb6ba341", + "hash": "dfa00ed71af6eda1f539684657d5c880850ececea4c07bd11e89a605fab77ec7", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/product-editor-development/how-to-guides/custom-field-tutorial.md", "id": "fed80efbb225df9054fadd6e1fc45c2cd03e7f99" } @@ -1329,7 +1329,7 @@ "menu_title": "Extend analytics reports", "tags": "how-to", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/reporting/extending-woocommerce-admin-reports.md", - "hash": "b694b0e857d3ca60acdef2ffaae329a93f0a0243eacc4b192562c7f507f169b3", + "hash": "56712b3583d0b0a4d96eb19153e5abcb8a386fcd083fa56481acf1be530afa25", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/reporting/extending-woocommerce-admin-reports.md", "id": "3ef20148084c97d7f62b565b92df844392ac27f7" }, @@ -1411,7 +1411,7 @@ "categories": [] }, { - "content": "\nProperly setting up your test environment and writing tests when contributing to WooCommrece core are essential parts of our development pipeline. The links below are also included in our [Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) on GitHub.\n\nIf you have any questions about testing please reach out to the developer community in our public channels([Developer Blog](https://developer.woocommerce.com/blog/), [GitHub Discussions](https://github.com/woocommerce/woocommerce/discussions), or [Community Slack](https://woocommerce.com/community-slack/)).\n\n## Unit Testing\n\n[End-to-end tests](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/tests/e2e-pw) are powered by `Playwright`. The test site is spun up using `wp-env` ([recommended](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/)), but we will continue to support `e2e-environment` in the meantime, and slowly [deprecate](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/tests/e2e/README.md) `Puppeteer` testing. \n\n## API Testing\n\n`api-core-tests` is a [package](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/tests/api-core-tests#guide-for-writing-api-tests) that contains automated API tests for WooCommerce, based on `Playwright` and `wp-env`. It supersedes the SuperTest based `api-core-tests` package and `e2e-environment` setup, which we will gradually deprecate.\n\n## Calls for Testing\n\nKeep tabs on calls for testing on our developer blog, and make sure to read our beta testing instructions to help us build new features and enhancements.\n", + "content": "\nProperly setting up your test environment and writing tests when contributing to WooCommerce core are essential parts of our development pipeline. The links below are also included in our [Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) on GitHub.\n\nIf you have any questions about testing please reach out to the developer community in our public channels([Developer Blog](https://developer.woocommerce.com/blog/), [GitHub Discussions](https://github.com/woocommerce/woocommerce/discussions), or [Community Slack](https://woocommerce.com/community-slack/)).\n\n## Unit Testing\n\n[End-to-end tests](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/tests/e2e-pw) are powered by `Playwright`. The test site is spun up using `wp-env` ([recommended](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/)), but we will continue to support `e2e-environment` in the meantime, and slowly [deprecate](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/tests/e2e/README.md) `Puppeteer` testing. \n\n## API Testing\n\n`api-core-tests` is a [package](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/tests/api-core-tests#guide-for-writing-api-tests) that contains automated API tests for WooCommerce, based on `Playwright` and `wp-env`. It supersedes the SuperTest based `api-core-tests` package and `e2e-environment` setup, which we will gradually deprecate.\n\n## Calls for Testing\n\nKeep tabs on calls for testing on our developer blog, and make sure to read our beta testing instructions to help us build new features and enhancements.\n", "category_slug": "testing", "category_title": "Testing", "posts": [ @@ -1498,7 +1498,7 @@ "post_title": "Classic theme development handbook", "menu_title": "Classic theme development", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/theme-development/classic-theme-developer-handbook.md", - "hash": "1194437fbc2ec82d60c8b73a9742ec650bd90fe734758c3a2b27ed852d4d14f7", + "hash": "95ce7250479a5133bba6c68939d86e4e79708c65044d70727c73f6a88f716da7", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/theme-development/classic-theme-developer-handbook.md", "id": "c2fde53e1dc3efbded3cfe1fb4df27136a3799a4" } @@ -1775,7 +1775,7 @@ "menu_title": "Commands", "tags": "reference", "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/wc-cli/wc-cli-commands.md", - "hash": "a926ff45642539e0edc6b4e3dfeba4b31c2d01082700af132a2e8d56cfa25ec5", + "hash": "17bbb18fd0ad0523a5b864f74acbec64c853ae7b42ecd7e6d9dbce1fbe2669aa", "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/wc-cli/wc-cli-commands.md", "id": "73d6bc6468d23a9e93d16d574399105b143e43af" }, @@ -1804,5 +1804,5 @@ "categories": [] } ], - "hash": "212688b70a2dd0e70819746e6ffc033bc2279cb5b7b6350f377bbc3bc28c080f" + "hash": "77c102c35a45b0681e7b70def9d639d764e4e5068121c2ef4dd23477c0f8784c" } \ No newline at end of file diff --git a/docs/extension-development/adding-custom-products-to-add-products-onboarding-list.md b/docs/extension-development/adding-custom-products-to-add-products-onboarding-list.md index 4d50b8e4d31..f85464aa86f 100644 --- a/docs/extension-development/adding-custom-products-to-add-products-onboarding-list.md +++ b/docs/extension-development/adding-custom-products-to-add-products-onboarding-list.md @@ -45,8 +45,8 @@ addFilter( key: 'custom-product', title: __('Custom product', 'custom-product'), content: __('Create an awesome custom product.', 'custom-product'), - before: , - after: , + before: <FolderMultipleIcon />, + after: <Icon icon={chevronRight} />, onClick: () => { } }, diff --git a/docs/extension-development/handling-merchant-onboarding.md b/docs/extension-development/handling-merchant-onboarding.md index 3dec70d6f89..5b3adaed57d 100644 --- a/docs/extension-development/handling-merchant-onboarding.md +++ b/docs/extension-development/handling-merchant-onboarding.md @@ -448,7 +448,7 @@ class ExampleNote { $note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL ); // Set the type of layout the note uses. Supported layout types are: - // 'banner', 'plain', 'thumbnail' + // 'plain', 'thumbnail' $note->set_layout( 'plain' ); // Set the image for the note. This property renders as the src diff --git a/docs/extension-development/implementing-settings.md b/docs/extension-development/implementing-settings.md index 4b86c41b714..360fb1e09a6 100644 --- a/docs/extension-development/implementing-settings.md +++ b/docs/extension-development/implementing-settings.md @@ -227,19 +227,19 @@ public function generate_button_html( $key, $data ) { ob_start(); ?> - - - + <tr valign="top"> + <th scope="row" class="titledesc"> + <label for=""></label> get_tooltip_html( $data ); ?> - - -
- - + </th> + <td class="forminp"> + <fieldset< + <legend class="screen-reader-text"><span>" type="button" name="" id="" style="" get_custom_attribute_html( $data ); ?>></button> get_description_html( $data ); ?> -
- - + </fieldset> + </td> + </tr> ) { + if ( get_the_ID() === <page-id> ) { return true; } return $is_excluded; }, 10 ); ``` + +#### Custom share links + +The following example shows how to integrate with a custom share code. We recommend using cookies or other storage to persist the access when users navigate across the site: + +```php +add_filter( 'woocommerce_coming_soon_exclude', function( $exclude ) { + // Implement your logic to get and validate share code. + if ( function_exists( 'your_plugin_get_share_code' ) && function_exists( 'your_plugin_is_valid_share_code' ) ) { + $share_code = your_plugin_get_share_code(); + if ( your_plugin_is_valid_share_code( $share_code ) ) { + return true; + } + } + + return $exclude; +} ); +``` + +### Extend "Apply to store pages only" setting + +When using the `Apply to store pages only` setting, you may want to add a custom page to the list of store pages which will be restricted by coming soon mode. You can use the following example to add a custom page: + +```php +add_filter( 'woocommerce_store_pages', function( $pages ) { + $page = get_page_by_path( 'your-page-slug' ); + if ( $page ) { + $pages[] = $page->ID; + } + return $pages; +} ); +``` diff --git a/docs/extension-development/settings-api.md b/docs/extension-development/settings-api.md index 6078ceca42a..60ed624a3fe 100644 --- a/docs/extension-development/settings-api.md +++ b/docs/extension-development/settings-api.md @@ -70,10 +70,10 @@ Create a method called `admin_options` containing the following: ```php function admin_options() { ?> -

- + <h2></h2> + <table class="form-table"> generate_settings_html(); ?> -
+ </table> - - - - - - - - - - - - - - - - - +<<>?xml version="1.0" encoding="UTF-8"?> +<configuration> + <system.webServer> + <handlers accessPolicy="Read, Execute, Script" /> + <rewrite> + <rules> + <rule name="wordpress" patternSyntax="Wildcard"> + <match url="*" /> + <conditions> + <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> + <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> + </conditions> + <action type="Rewrite" url="index.php" /> + </rule> + </rules> + </rewrite> + </system.webServer> +</configuration> ``` ### Pages direct to wrong place @@ -74,6 +74,6 @@ Landing on the wrong page when clicking an endpoint URL is typically caused by i ### How to Remove "Downloads" from My Account -Sometimes the "Downloads" endpoint on the "My account" page does not need to be displayed. This can be removed by going to **WooCommerce → Settings → Advanced → Account endpoints** and clearing the Downloads endpoint field. +Sometimes the "Downloads" endpoint on the "My account" page does not need to be displayed. This can be removed by going to **WooCommerce > Settings > Advanced > Account endpoints** and clearing the Downloads endpoint field. ![Account endpoints](https://developer.woocommerce.com/wp-content/uploads/2023/12/Screenshot-2023-04-09-at-11.45.58-PM.png) diff --git a/docs/getting-started/development-environment.md b/docs/getting-started/development-environment.md index 3cde937ffdb..0701be60fc1 100644 --- a/docs/getting-started/development-environment.md +++ b/docs/getting-started/development-environment.md @@ -14,7 +14,7 @@ If you would like to contribute to the WooCommerce core platform; please read ou ## Prerequisites -WooCommerce does adhere to WordPress code standards and guidelines, so it’s best to familiarize yourself with [WordPress Development](https://learn.wordpress.org/tutorial/introduction-to-wordpress/) as well as [PHP](https://www.php.net/). +WooCommerce does adhere to WordPress code standards and guidelines, so it's best to familiarize yourself with [WordPress Development](https://learn.wordpress.org/tutorial/introduction-to-wordpress/) as well as [PHP](https://www.php.net/). Knowledge and understanding of [WooCommerce Hooks and Filters](https://woocommerce.com/document/introduction-to-hooks-actions-and-filters/) will allow you to add and change code without editing core files. You can learn more about WordPress hooks and filters in the [WordPress Plugin Development Handbook](https://developer.wordpress.org/plugins/hooks/). diff --git a/docs/getting-started/troubleshooting-endpoints.md b/docs/getting-started/troubleshooting-endpoints.md index 467d9dba1cb..11de5172810 100644 --- a/docs/getting-started/troubleshooting-endpoints.md +++ b/docs/getting-started/troubleshooting-endpoints.md @@ -18,24 +18,24 @@ For more information, learn how to [Customize Endpoints](./customizing-endpoint- On Windows servers, the **web.config** file may not be set correctly to allow for the endpoints to work correctly. In this case, clicking on endpoint links (e.g. /edit-account/ or /customer-logout/) may appear to do nothing except refresh the page. In order to resolve this, try simplifying the **web.config** file on your Windows server. Here's a sample file configuration: ```xml - - - - - - - - - - - - - - - - - - +<?xml version="1.0" encoding="UTF-8"?> +<configuration> + <system.webServer> + <handlers accessPolicy="Read, Execute, Script" /> + <rewrite> + <rules> + <rule name="wordpress" patternSyntax="Wildcard"> + <match url="*" /> + <conditions> + <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> + <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> + </conditions> + <action type="Rewrite" url="index.php" /> + </rule> + </rules> + </rewrite> + </system.webServer> +</configuration> ``` ## Pages direct to wrong place @@ -44,6 +44,6 @@ Landing on the wrong page when clicking an endpoint URL is typically caused by i ## How to Remove "Downloads" from My Account -Sometimes the "Downloads" endpoint on the "My account" page does not need to be displayed. This can be removed by going to **WooCommerce → Settings → Advanced → Account endpoints** and clearing the Downloads endpoint field. +Sometimes the "Downloads" endpoint on the "My account" page does not need to be displayed. This can be removed by going to **WooCommerce > Settings > Advanced > Account endpoints** and clearing the Downloads endpoint field. ![Account endpoints](https://developer.woocommerce.com/wp-content/uploads/2023/12/Screenshot-2023-04-09-at-11.45.58-PM.png) diff --git a/docs/high-performance-order-storage/cli-tools.md b/docs/high-performance-order-storage/cli-tools.md index e61035d60cd..c4b1877b9e5 100644 --- a/docs/high-performance-order-storage/cli-tools.md +++ b/docs/high-performance-order-storage/cli-tools.md @@ -229,7 +229,7 @@ The backfill command can be used to selectively migrate order data (or whole ord The exact syntax for this command is as follows: ```plaintext -wp wc hpos backfill --from= --to= [--meta_keys=] [--props=] +wp wc hpos backfill <order_id> --from=<datastore> --to=<datastore> [--meta_keys=<meta_keys>] [--props=<props>] ``` You have to specify which datastore to use as source (either `posts` or `hpos`) and which one to use as destination. The `--meta_keys` and `--props` arguments receive a comma separated list of meta keys and order properties, which can be used to move only certain data from one datastore to the other, instead of the whole order. diff --git a/docs/product-collection-block/dom-events.md b/docs/product-collection-block/dom-events.md index cc49b4bb8b9..940e49a929d 100644 --- a/docs/product-collection-block/dom-events.md +++ b/docs/product-collection-block/dom-events.md @@ -10,13 +10,13 @@ tags: how-to This event is triggered when Product Collection block was rendered or re-rendered (e.g. due to page change). -### `detail` parameters +### `wc-blocks_product_list_rendered` - `detail` parameters | Parameter | Type | Default value | Description | | ------------------ | ------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `collection` | string | `undefined` | Collection type. It's `undefined` for "create your own" collections as the type is not specified. For other Core collections it can be one of type: `woocommerce/product-collection/best-sellers`, `woocommerce/product-collection/featured`, `woocommerce/product-collection/new-arrivals`, `woocommerce/product-collection/on-sale`, `woocommerce/product-collection/top-rated`. For custom collections it will hold their name. | -### Example usage +### `wc-blocks_product_list_rendered` - Example usage ```javascript window.document.addEventListener( @@ -27,3 +27,27 @@ window.document.addEventListener( } ); ``` + +## Event: `wc-blocks_viewed_product` + +This event is triggered when some blocks are clicked in order to view product (redirect to product page). + +### `wc-blocks_viewed_product` - `detail` parameters + +| Parameter | Type | Default value | Description | +| ------------------ | ------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `collection` | string | `undefined` | Collection type. It's `undefined` for "create your own" collections as the type is not specified. For other Core collections it can be one of type: `woocommerce/product-collection/best-sellers`, `woocommerce/product-collection/featured`, `woocommerce/product-collection/new-arrivals`, `woocommerce/product-collection/on-sale`, `woocommerce/product-collection/top-rated`. For custom collections it will hold their name. | +| `productId` | number | | Product ID | + +### `wc-blocks_viewed_product` Example usage + +```javascript +window.document.addEventListener( + 'wc-blocks_viewed_product', + ( e ) => { + const { collection, productId } = e.detail; + console.log( collection ) // -> collection name, e.g. "woocommerce/product-collection/featured" or undefined for default one + console.log( productId ) // -> product ID, e.g. 34 + } +); +``` diff --git a/docs/product-collection-block/register-product-collection.md b/docs/product-collection-block/register-product-collection.md index 677668ba71e..b754746a679 100644 --- a/docs/product-collection-block/register-product-collection.md +++ b/docs/product-collection-block/register-product-collection.md @@ -36,7 +36,7 @@ We will explain important arguments that can be passed to `__experimentalRegiste A Collection is defined by an object that can contain the following fields: -- `name` (type `string`): A unique and machine-readable collection name. We recommend using the format `/product-collection/`. Both `` and `` should consist only of alphanumeric characters and hyphens (e.g., `my-plugin/product-collection/my-collection`). +- `name` (type `string`): A unique and machine-readable collection name. We recommend using the format `<plugin-name>/product-collection/<collection-name>`. Both `<plugin-name>` and `<collection-name>` should consist only of alphanumeric characters and hyphens (e.g., `my-plugin/product-collection/my-collection`). - `title` (type `string`): The title of the collection, which will be displayed in various places including the block inserter and collection chooser. - `description` (optional, type `string`): A human-readable description of the collection. - `innerBlocks` (optional, type `Array[]`): An array of inner blocks that will be added to the collection. If not provided, the default inner blocks will be used. diff --git a/docs/product-editor-development/how-to-guides/custom-field-tutorial.md b/docs/product-editor-development/how-to-guides/custom-field-tutorial.md index 64fb3203025..ae243d3c9dc 100644 --- a/docs/product-editor-development/how-to-guides/custom-field-tutorial.md +++ b/docs/product-editor-development/how-to-guides/custom-field-tutorial.md @@ -62,7 +62,7 @@ In React: import { registerBlockType } from '@wordpress/blocks'; function Edit() { - return

Hello World (from the editor).

; + return <p>Hello World (from the editor).</p>; } registerBlockType( 'tutorial/new-product-form-field', { @@ -217,8 +217,8 @@ function Edit( { attributes } ) { const blockProps = useWooBlockProps( attributes ); return ( -
- -
+ /> + </div> ); } ``` diff --git a/docs/reporting/extending-woocommerce-admin-reports.md b/docs/reporting/extending-woocommerce-admin-reports.md index 2abe7862fe3..fe328313aee 100644 --- a/docs/reporting/extending-woocommerce-admin-reports.md +++ b/docs/reporting/extending-woocommerce-admin-reports.md @@ -32,7 +32,7 @@ npm run create-wc-extension After choosing a name, move into that folder and start webpack to watch and build files. ```sh -cd ../ +cd ../<my-plugin-name> npm install npm start ``` diff --git a/docs/testing/README.md b/docs/testing/README.md index 1ad733872aa..df176bd42cc 100644 --- a/docs/testing/README.md +++ b/docs/testing/README.md @@ -4,7 +4,7 @@ category_slug: testing post_title: Testing --- -Properly setting up your test environment and writing tests when contributing to WooCommrece core are essential parts of our development pipeline. The links below are also included in our [Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) on GitHub. +Properly setting up your test environment and writing tests when contributing to WooCommerce core are essential parts of our development pipeline. The links below are also included in our [Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) on GitHub. If you have any questions about testing please reach out to the developer community in our public channels([Developer Blog](https://developer.woocommerce.com/blog/), [GitHub Discussions](https://github.com/woocommerce/woocommerce/discussions), or [Community Slack](https://woocommerce.com/community-slack/)). diff --git a/docs/theme-development/classic-theme-developer-handbook.md b/docs/theme-development/classic-theme-developer-handbook.md index dcdd64c0b6f..3f34881afe9 100644 --- a/docs/theme-development/classic-theme-developer-handbook.md +++ b/docs/theme-development/classic-theme-developer-handbook.md @@ -73,11 +73,11 @@ add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10); add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10); function my_theme_wrapper_start() { - echo '
'; + echo '<section id="main">'; } function my_theme_wrapper_end() { - echo '
'; + echo '</section>'; } ``` diff --git a/docs/wc-cli/wc-cli-commands.md b/docs/wc-cli/wc-cli-commands.md index 06606bdb500..aa7d3e3a646 100644 --- a/docs/wc-cli/wc-cli-commands.md +++ b/docs/wc-cli/wc-cli-commands.md @@ -117,7 +117,7 @@ Options: table, json, csv, ids, yaml, count, headers, body, envelope ### wc customer_download -#### wc customer_download list +#### wc customer_download list <customer_id> - `--customer_id` - Unique identifier for the resource. - `--context` - Scope under which the request is made; determines fields present in response. @@ -198,7 +198,7 @@ Options: table, json, csv, ids, yaml, count, headers, body, envelope ### wc order_note -#### wc order_note list +#### wc order_note list <order_id> - `--order_id` - The order ID. - `--context` - Scope under which the request is made; determines fields present in response. @@ -211,14 +211,14 @@ Default: table Options: table, json, csv, ids, yaml, count, headers, body, envelope -#### wc order_note create +#### wc order_note create <order_id> - `--order_id` - The order ID. - `--note` - Order note content. (*Required*) - `--customer_note` - If true, the note will be shown to customers and they will be notified. If false, the note will be for admin reference only. - `--porcelain` - Output just the id when the operation is successful. -#### wc order_note get [id] +#### wc order_note get <order_id> [id] - `--id` - Unique identifier for the resource. - `--order_id` - The order ID. @@ -231,7 +231,7 @@ Default: table Options: table, json, csv, ids, yaml, count, headers, body, envelope -#### wc order_note delete [id] +#### wc order_note delete <order_id> [id] - `--id` - Unique identifier for the resource. - `--order_id` - The order ID. @@ -240,7 +240,7 @@ Options: table, json, csv, ids, yaml, count, headers, body, envelope ### wc shop_order_refund -#### wc shop_order_refund list +#### wc shop_order_refund list <order_id> - `--order_id` - The order ID. - `--context` - Scope under which the request is made; determines fields present in response. @@ -265,7 +265,7 @@ Default: table Options: table, json, csv, ids, yaml, count, headers, body, envelope -#### wc shop_order_refund create +#### wc shop_order_refund create <order_id> - `--order_id` - The order ID. - `--amount` - Refund amount. @@ -276,7 +276,7 @@ Options: table, json, csv, ids, yaml, count, headers, body, envelope - `--api_refund` - When true, the payment gateway API is used to generate the refund. - `--porcelain` - Output just the id when the operation is successful. -#### wc shop_order_refund get [id] +#### wc shop_order_refund get <order_id> [id] - `--order_id` - The order ID. - `--id` - Unique identifier for the resource. @@ -289,7 +289,7 @@ Default: table Options: table, json, csv, ids, yaml, count, headers, body, envelope -#### wc shop_order_refund delete [id] +#### wc shop_order_refund delete <order_id> [id] - `--order_id` - The order ID. - `--id` - Unique identifier for the resource. @@ -386,7 +386,7 @@ Options: table, json, csv, ids, yaml, count, headers, body, envelope ### wc product_attribute_term -#### wc product_attribute_term list +#### wc product_attribute_term list <attribute_id> - `--attribute_id` - Unique identifier for the attribute of the terms. - `--context` - Scope under which the request is made; determines fields present in response. @@ -409,7 +409,7 @@ Default: table Options: table, json, csv, ids, yaml, count, headers, body, envelope -#### wc product_attribute_term create +#### wc product_attribute_term create <attribute_id> - `--attribute_id` - Unique identifier for the attribute of the terms. - `--name` - Name for the resource. (*Required*) @@ -418,7 +418,7 @@ Options: table, json, csv, ids, yaml, count, headers, body, envelope - `--menu_order` - Menu order, used to custom sort the resource. - `--porcelain` - Output just the id when the operation is successful. -#### wc product_attribute_term get [id] +#### wc product_attribute_term get <attribute_id> [id] - `--id` - Unique identifier for the resource. - `--attribute_id` - Unique identifier for the attribute of the terms. @@ -431,7 +431,7 @@ Default: table Options: table, json, csv, ids, yaml, count, headers, body, envelope -#### wc product_attribute_term update [id] +#### wc product_attribute_term update <attribute_id> [id] - `--id` - Unique identifier for the resource. - `--attribute_id` - Unique identifier for the attribute of the terms. @@ -441,7 +441,7 @@ Options: table, json, csv, ids, yaml, count, headers, body, envelope - `--menu_order` - Menu order, used to custom sort the resource. - `--porcelain` - Output just the id when the operation is successful. -#### wc product_attribute_term delete [id] +#### wc product_attribute_term delete <attribute_id> [id] - `--id` - Unique identifier for the resource. - `--attribute_id` - Unique identifier for the attribute of the terms. @@ -565,7 +565,7 @@ Options: table, json, csv, ids, yaml, count, headers, body, envelope ### wc product_review -#### wc product_review list +#### wc product_review list <product_id> - `--product_id` - Unique identifier for the variable product. - `--id` - Unique identifier for the variation. @@ -578,7 +578,7 @@ Default: table Options: table, json, csv, ids, yaml, count, headers, body, envelope -#### wc product_review create +#### wc product_review create <product_id> - `--product_id` - Unique identifier for the variable product. - `--id` - Unique identifier for the variation. @@ -590,7 +590,7 @@ Options: table, json, csv, ids, yaml, count, headers, body, envelope - `--email` - Email of the reviewer. (*Required*) - `--porcelain` - Output just the id when the operation is successful. -#### wc product_review get [id] +#### wc product_review get <product_id> [id] - `--product_id` - Unique identifier for the variable product. - `--id` - Unique identifier for the resource. @@ -603,7 +603,7 @@ Default: table Options: table, json, csv, ids, yaml, count, headers, body, envelope -#### wc product_review update [id] +#### wc product_review update <product_id> [id] - `--product_id` - Unique identifier for the variable product. - `--id` - Unique identifier for the resource. @@ -615,7 +615,7 @@ Options: table, json, csv, ids, yaml, count, headers, body, envelope - `--email` - Reviewer email. - `--porcelain` - Output just the id when the operation is successful. -#### wc product_review delete [id] +#### wc product_review delete <product_id> [id] - `--product_id` - Unique identifier for the variable product. - `--id` - Unique identifier for the resource. @@ -893,7 +893,7 @@ Options: table, json, csv, ids, yaml, count, headers, body, envelope ### wc product_variation -#### wc product_variation list +#### wc product_variation list <product_id> - `--product_id` - Unique identifier for the variable product. - `--context` - Scope under which the request is made; determines fields present in response. @@ -932,7 +932,7 @@ Default: table Options: table, json, csv, ids, yaml, count, headers, body, envelope -#### wc product_variation create +#### wc product_variation create <product_id> - `--product_id` - Unique identifier for the variable product. - `--description` - Variation description. @@ -964,7 +964,7 @@ Options: table, json, csv, ids, yaml, count, headers, body, envelope - `--meta_data` - Meta data. - `--porcelain` - Output just the id when the operation is successful. -#### wc product_variation get [id] +#### wc product_variation get <product_id> [id] - `--product_id` - Unique identifier for the variable product. - `--id` - Unique identifier for the variation. @@ -977,7 +977,7 @@ Default: table Options: table, json, csv, ids, yaml, count, headers, body, envelope -#### wc product_variation update [id] +#### wc product_variation update <product_id> [id] - `--product_id` - Unique identifier for the variable product. - `--id` - Unique identifier for the variation. @@ -1010,7 +1010,7 @@ Options: table, json, csv, ids, yaml, count, headers, body, envelope - `--meta_data` - Meta data. - `--porcelain` - Output just the id when the operation is successful. -#### wc product_variation delete [id] +#### wc product_variation delete <product_id> [id] - `--product_id` - Unique identifier for the variable product. - `--id` - Unique identifier for the variation. diff --git a/packages/js/components/changelog/upgrade-storybook_and_add_pages_workflow b/packages/js/components/changelog/upgrade-storybook_and_add_pages_workflow new file mode 100644 index 00000000000..579b91e0c80 --- /dev/null +++ b/packages/js/components/changelog/upgrade-storybook_and_add_pages_workflow @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +Update storybook file format in support with Storybook 7 story indexer. diff --git a/packages/js/components/package.json b/packages/js/components/package.json index 49781d18732..b57050f50c4 100644 --- a/packages/js/components/package.json +++ b/packages/js/components/package.json @@ -132,18 +132,10 @@ "devDependencies": { "@babel/core": "^7.23.5", "@babel/runtime": "^7.23.5", - "@storybook/addon-actions": "6.5.17-alpha.0", "@storybook/addon-console": "^1.2.3", - "@storybook/addon-controls": "6.5.17-alpha.0", - "@storybook/addon-docs": "6.5.17-alpha.0", - "@storybook/addon-knobs": "^6.4.0", - "@storybook/addon-links": "6.5.17-alpha.0", - "@storybook/addons": "6.5.17-alpha.0", - "@storybook/api": "6.5.17-alpha.0", - "@storybook/components": "6.5.17-alpha.0", - "@storybook/core-events": "6.5.17-alpha.0", + "@storybook/addon-docs": "7.6.19", + "@storybook/addon-links": "7.6.19", "@storybook/react": "6.5.17-alpha.0", - "@storybook/theming": "6.5.17-alpha.0", "@testing-library/dom": "8.11.3", "@testing-library/jest-dom": "5.16.2", "@testing-library/react": "12.1.3", diff --git a/packages/js/components/src/abbreviated-card/stories/index.js b/packages/js/components/src/abbreviated-card/stories/abbreviated-card.story.js similarity index 100% rename from packages/js/components/src/abbreviated-card/stories/index.js rename to packages/js/components/src/abbreviated-card/stories/abbreviated-card.story.js diff --git a/packages/js/components/src/advanced-filters/stories/index.js b/packages/js/components/src/advanced-filters/stories/advanced-filters.story.js similarity index 100% rename from packages/js/components/src/advanced-filters/stories/index.js rename to packages/js/components/src/advanced-filters/stories/advanced-filters.story.js diff --git a/packages/js/components/src/analytics/error/stories/index.tsx b/packages/js/components/src/analytics/error/stories/analytics-error.story.tsx similarity index 100% rename from packages/js/components/src/analytics/error/stories/index.tsx rename to packages/js/components/src/analytics/error/stories/analytics-error.story.tsx diff --git a/packages/js/components/src/animation-slider/stories/index.js b/packages/js/components/src/animation-slider/stories/animation-slider.story.js similarity index 100% rename from packages/js/components/src/animation-slider/stories/index.js rename to packages/js/components/src/animation-slider/stories/animation-slider.story.js diff --git a/packages/js/components/src/badge/stories/index.tsx b/packages/js/components/src/badge/stories/badge.story.tsx similarity index 100% rename from packages/js/components/src/badge/stories/index.tsx rename to packages/js/components/src/badge/stories/badge.story.tsx diff --git a/packages/js/components/src/calendar/stories/date-picker.js b/packages/js/components/src/calendar/stories/date-picker.story.js similarity index 100% rename from packages/js/components/src/calendar/stories/date-picker.js rename to packages/js/components/src/calendar/stories/date-picker.story.js diff --git a/packages/js/components/src/calendar/stories/date-range.js b/packages/js/components/src/calendar/stories/date-range.story.js similarity index 100% rename from packages/js/components/src/calendar/stories/date-range.js rename to packages/js/components/src/calendar/stories/date-range.story.js diff --git a/packages/js/components/src/chart/stories/index.js b/packages/js/components/src/chart/stories/chart.story.js similarity index 100% rename from packages/js/components/src/chart/stories/index.js rename to packages/js/components/src/chart/stories/chart.story.js diff --git a/packages/js/components/src/collapsible-content/stories/index.tsx b/packages/js/components/src/collapsible-content/stories/collapsible-content.story.tsx similarity index 100% rename from packages/js/components/src/collapsible-content/stories/index.tsx rename to packages/js/components/src/collapsible-content/stories/collapsible-content.story.tsx diff --git a/packages/js/components/src/compare-filter/stories/index.js b/packages/js/components/src/compare-filter/stories/compare-filter.story.js similarity index 100% rename from packages/js/components/src/compare-filter/stories/index.js rename to packages/js/components/src/compare-filter/stories/compare-filter.story.js diff --git a/packages/js/components/src/compare-filter/test/compare-filter.js b/packages/js/components/src/compare-filter/test/compare-filter.js index 2980de4f4cd..18ab9b36057 100644 --- a/packages/js/components/src/compare-filter/test/compare-filter.js +++ b/packages/js/components/src/compare-filter/test/compare-filter.js @@ -7,7 +7,7 @@ import { createElement } from '@wordpress/element'; /** * Internal dependencies */ -import { Basic } from '../stories/index'; +import { Basic } from '../stories/compare-filter.story'; import { CompareFilter } from '../index'; import Search from '../../search'; import productAutocompleter from '../../search/autocompleters/product'; diff --git a/packages/js/components/src/date-range-filter-picker/stories/index.js b/packages/js/components/src/date-range-filter-picker/stories/date-range-filter-picker.story.js similarity index 100% rename from packages/js/components/src/date-range-filter-picker/stories/index.js rename to packages/js/components/src/date-range-filter-picker/stories/date-range-filter-picker.story.js diff --git a/packages/js/components/src/date-time-picker-control/stories/index.tsx b/packages/js/components/src/date-time-picker-control/stories/date-time-picker-control.story.tsx similarity index 100% rename from packages/js/components/src/date-time-picker-control/stories/index.tsx rename to packages/js/components/src/date-time-picker-control/stories/date-time-picker-control.story.tsx diff --git a/packages/js/components/src/date/stories/index.js b/packages/js/components/src/date/stories/date.story.js similarity index 100% rename from packages/js/components/src/date/stories/index.js rename to packages/js/components/src/date/stories/date.story.js diff --git a/packages/js/components/src/dropdown-button/stories/index.js b/packages/js/components/src/dropdown-button/stories/index.story.js similarity index 100% rename from packages/js/components/src/dropdown-button/stories/index.js rename to packages/js/components/src/dropdown-button/stories/index.story.js diff --git a/packages/js/components/src/dynamic-form/stories/index.js b/packages/js/components/src/dynamic-form/stories/index.story.js similarity index 100% rename from packages/js/components/src/dynamic-form/stories/index.js rename to packages/js/components/src/dynamic-form/stories/index.story.js diff --git a/packages/js/components/src/ellipsis-menu/stories/index.js b/packages/js/components/src/ellipsis-menu/stories/ellipsis-menu.story.js similarity index 100% rename from packages/js/components/src/ellipsis-menu/stories/index.js rename to packages/js/components/src/ellipsis-menu/stories/ellipsis-menu.story.js diff --git a/packages/js/components/src/empty-content/stories/index.js b/packages/js/components/src/empty-content/stories/empty-content.story.js similarity index 100% rename from packages/js/components/src/empty-content/stories/index.js rename to packages/js/components/src/empty-content/stories/empty-content.story.js diff --git a/packages/js/components/src/error-boundary/stories/index.tsx b/packages/js/components/src/error-boundary/stories/error-boundary.story.tsx similarity index 100% rename from packages/js/components/src/error-boundary/stories/index.tsx rename to packages/js/components/src/error-boundary/stories/error-boundary.story.tsx diff --git a/packages/js/components/src/experimental-select-control/stories/index.tsx b/packages/js/components/src/experimental-select-control/stories/select-control.story.tsx similarity index 100% rename from packages/js/components/src/experimental-select-control/stories/index.tsx rename to packages/js/components/src/experimental-select-control/stories/select-control.story.tsx diff --git a/packages/js/components/src/experimental-select-tree-control/stories/index.tsx b/packages/js/components/src/experimental-select-tree-control/stories/select-tree-control.story.tsx similarity index 100% rename from packages/js/components/src/experimental-select-tree-control/stories/index.tsx rename to packages/js/components/src/experimental-select-tree-control/stories/select-tree-control.story.tsx diff --git a/packages/js/components/src/experimental-tree-control/stories/index.tsx b/packages/js/components/src/experimental-tree-control/stories/tree-control.story.tsx similarity index 100% rename from packages/js/components/src/experimental-tree-control/stories/index.tsx rename to packages/js/components/src/experimental-tree-control/stories/tree-control.story.tsx diff --git a/packages/js/components/src/filter-picker/stories/index.js b/packages/js/components/src/filter-picker/stories/filter-picker.story.js similarity index 100% rename from packages/js/components/src/filter-picker/stories/index.js rename to packages/js/components/src/filter-picker/stories/filter-picker.story.js diff --git a/packages/js/components/src/filter-picker/test/index.js b/packages/js/components/src/filter-picker/test/index.js index 62d024f199f..a6ac33837ee 100644 --- a/packages/js/components/src/filter-picker/test/index.js +++ b/packages/js/components/src/filter-picker/test/index.js @@ -8,7 +8,7 @@ import { createElement } from '@wordpress/element'; /** * Internal dependencies */ -import { Basic } from '../stories/index'; +import { Basic } from '../stories/filter-picker.story'; import FilterPicker from '../index'; import Search from '../../search'; import productAutocompleter from '../../search/autocompleters/product'; diff --git a/packages/js/components/src/filters/stories/index.js b/packages/js/components/src/filters/stories/filters.story.js similarity index 100% rename from packages/js/components/src/filters/stories/index.js rename to packages/js/components/src/filters/stories/filters.story.js diff --git a/packages/js/components/src/flag/stories/index.js b/packages/js/components/src/flag/stories/flag.story.js similarity index 100% rename from packages/js/components/src/flag/stories/index.js rename to packages/js/components/src/flag/stories/flag.story.js diff --git a/packages/js/components/src/form-section/stories/index.tsx b/packages/js/components/src/form-section/stories/form-section.story.tsx similarity index 100% rename from packages/js/components/src/form-section/stories/index.tsx rename to packages/js/components/src/form-section/stories/form-section.story.tsx diff --git a/packages/js/components/src/form/stories/index.js b/packages/js/components/src/form/stories/form.story.js similarity index 100% rename from packages/js/components/src/form/stories/index.js rename to packages/js/components/src/form/stories/form.story.js diff --git a/packages/js/components/src/image-gallery/stories/index.tsx b/packages/js/components/src/image-gallery/stories/image-gallery.story.tsx similarity index 96% rename from packages/js/components/src/image-gallery/stories/index.tsx rename to packages/js/components/src/image-gallery/stories/image-gallery.story.tsx index 82cd856c0ee..6481ef732d6 100644 --- a/packages/js/components/src/image-gallery/stories/index.tsx +++ b/packages/js/components/src/image-gallery/stories/image-gallery.story.tsx @@ -8,7 +8,7 @@ import React from 'react'; * Internal dependencies */ import { ImageGallery, ImageGalleryItem } from '../'; -import { MockMediaUpload } from '../../media-uploader/stories/index.tsx'; +import { MockMediaUpload } from '../../media-uploader/stories/mock-media-uploader'; export const Basic: React.FC = () => { return ( diff --git a/packages/js/components/src/image-upload/stories/index.js b/packages/js/components/src/image-upload/stories/image-upload.story.js similarity index 100% rename from packages/js/components/src/image-upload/stories/index.js rename to packages/js/components/src/image-upload/stories/image-upload.story.js diff --git a/packages/js/components/src/link/stories/index.tsx b/packages/js/components/src/link/stories/link.story.tsx similarity index 100% rename from packages/js/components/src/link/stories/index.tsx rename to packages/js/components/src/link/stories/link.story.tsx diff --git a/packages/js/components/src/list-item/stories/index.tsx b/packages/js/components/src/list-item/stories/list-item.story.tsx similarity index 100% rename from packages/js/components/src/list-item/stories/index.tsx rename to packages/js/components/src/list-item/stories/list-item.story.tsx diff --git a/packages/js/components/src/list/stories/index.js b/packages/js/components/src/list/stories/list.story.js similarity index 100% rename from packages/js/components/src/list/stories/index.js rename to packages/js/components/src/list/stories/list.story.js diff --git a/packages/js/components/src/media-uploader/stories/index.tsx b/packages/js/components/src/media-uploader/stories/media-uploader.story.tsx similarity index 76% rename from packages/js/components/src/media-uploader/stories/index.tsx rename to packages/js/components/src/media-uploader/stories/media-uploader.story.tsx index 9f83de937f9..b0ddb24e79f 100644 --- a/packages/js/components/src/media-uploader/stories/index.tsx +++ b/packages/js/components/src/media-uploader/stories/media-uploader.story.tsx @@ -2,7 +2,7 @@ * External dependencies */ import React, { createElement } from 'react'; -import { Modal, Notice } from '@wordpress/components'; +import { Notice } from '@wordpress/components'; import { MediaItem } from '@wordpress/media-utils'; import { useState } from '@wordpress/element'; import { cloudUpload } from '@wordpress/icons'; @@ -12,59 +12,7 @@ import { cloudUpload } from '@wordpress/icons'; */ import { MediaUploader } from '../'; import { File } from '../types'; - -const MockMediaUpload = ( { onSelect, render } ) => { - const [ isOpen, setOpen ] = useState( false ); - - return ( - <> - { render( { - open: () => setOpen( true ), - } ) } - { isOpen && ( - { - setOpen( false ); - event.stopPropagation(); - } } - > -

- Use the default built-in{ ' ' } - MediaUploadComponent prop to render the WP - Media Modal. -

- { Array( ...Array( 3 ) ).map( ( n, i ) => { - return ( - - ); - } ) } -
- ) } - - ); -}; +import { MockMediaUpload } from './mock-media-uploader'; const ImageGallery = ( { images }: { images: File[] } ) => { return ( diff --git a/packages/js/components/src/media-uploader/stories/mock-media-uploader.tsx b/packages/js/components/src/media-uploader/stories/mock-media-uploader.tsx new file mode 100644 index 00000000000..a31460877f5 --- /dev/null +++ b/packages/js/components/src/media-uploader/stories/mock-media-uploader.tsx @@ -0,0 +1,59 @@ +/** + * External dependencies + */ +import React, { createElement } from 'react'; +import { Modal } from '@wordpress/components'; +import { useState } from '@wordpress/element'; + +export const MockMediaUpload = ( { onSelect, render } ) => { + const [ isOpen, setOpen ] = useState( false ); + + return ( + <> + { render( { + open: () => setOpen( true ), + } ) } + { isOpen && ( + { + setOpen( false ); + event.stopPropagation(); + } } + > +

+ Use the default built-in{ ' ' } + MediaUploadComponent prop to render the WP + Media Modal. +

+ { Array( ...Array( 3 ) ).map( ( n, i ) => { + return ( + + ); + } ) } +
+ ) } + + ); +}; diff --git a/packages/js/components/src/order-status/stories/index.js b/packages/js/components/src/order-status/stories/order-status.story.js similarity index 100% rename from packages/js/components/src/order-status/stories/index.js rename to packages/js/components/src/order-status/stories/order-status.story.js diff --git a/packages/js/components/src/pagination/stories/index.js b/packages/js/components/src/pagination/stories/pagination.story.js similarity index 100% rename from packages/js/components/src/pagination/stories/index.js rename to packages/js/components/src/pagination/stories/pagination.story.js diff --git a/packages/js/components/src/phone-number-input/stories/index.tsx b/packages/js/components/src/phone-number-input/stories/phone-number-input.story.tsx similarity index 100% rename from packages/js/components/src/phone-number-input/stories/index.tsx rename to packages/js/components/src/phone-number-input/stories/phone-number-input.story.tsx diff --git a/packages/js/components/src/pill/stories/index.js b/packages/js/components/src/pill/stories/pill.story.js similarity index 100% rename from packages/js/components/src/pill/stories/index.js rename to packages/js/components/src/pill/stories/pill.story.js diff --git a/packages/js/components/src/plugins/index.tsx b/packages/js/components/src/plugins/index.tsx index df2561ea28f..a330bc8cbd2 100644 --- a/packages/js/components/src/plugins/index.tsx +++ b/packages/js/components/src/plugins/index.tsx @@ -11,7 +11,12 @@ import { } from '@wordpress/element'; import { SyntheticEvent, useCallback } from 'react'; import { useDispatch, useSelect } from '@wordpress/data'; -import { PLUGINS_STORE_NAME, InstallPluginsResponse } from '@woocommerce/data'; +import { PLUGINS_STORE_NAME } from '@woocommerce/data'; +import type { + InstallPluginsResponse, + PluginSelectors, + PluginActions, +} from '@woocommerce/data'; type PluginsProps = { onComplete: ( @@ -52,10 +57,14 @@ export const Plugins = ( { const [ hasErrors, setHasErrors ] = useState( false ); // Tracks action so that multiple instances of this button don't all light up when one is clicked const [ hasBeenClicked, setHasBeenClicked ] = useState( false ); - const { installAndActivatePlugins } = useDispatch( PLUGINS_STORE_NAME ); + const { installAndActivatePlugins }: PluginActions = + useDispatch( PLUGINS_STORE_NAME ); const { isRequesting } = useSelect( ( select ) => { - const { getActivePlugins, getInstalledPlugins, isPluginsRequesting } = - select( PLUGINS_STORE_NAME ); + const { + getActivePlugins, + getInstalledPlugins, + isPluginsRequesting, + }: PluginSelectors = select( PLUGINS_STORE_NAME ); return { isRequesting: @@ -64,7 +73,7 @@ export const Plugins = ( { activePlugins: getActivePlugins(), installedPlugins: getInstalledPlugins(), }; - } ); + }, [] ); const handleErrors = useCallback( ( errors: unknown, response: InstallPluginsResponse ) => { diff --git a/packages/js/components/src/plugins/test/index.js b/packages/js/components/src/plugins/test/index.js index 1aad94cd6d6..30c3f4f41cd 100644 --- a/packages/js/components/src/plugins/test/index.js +++ b/packages/js/components/src/plugins/test/index.js @@ -13,7 +13,7 @@ import { useDispatch } from '@wordpress/data'; import { Plugins } from '../index'; jest.mock( '@wordpress/data', () => ( { - ...jest.requireActual( '@wordpress/data' ), + __esModule: true, useDispatch: jest .fn() .mockReturnValue( { installAndActivatePlugins: jest.fn() } ), diff --git a/packages/js/components/src/product-fields/store/index.ts b/packages/js/components/src/product-fields/store/index.ts index 9c53ed96870..95fb84fbccf 100644 --- a/packages/js/components/src/product-fields/store/index.ts +++ b/packages/js/components/src/product-fields/store/index.ts @@ -12,7 +12,6 @@ import * as actions from './actions'; import { STORE_NAME } from './constants'; export const store = createReduxStore( STORE_NAME, { - // @ts-expect-error reducer has correct format. reducer, selectors, actions, diff --git a/packages/js/components/src/product-fields/store/types.ts b/packages/js/components/src/product-fields/store/types.ts index ebab49c0509..1b48e9ca1f5 100644 --- a/packages/js/components/src/product-fields/store/types.ts +++ b/packages/js/components/src/product-fields/store/types.ts @@ -8,6 +8,7 @@ export type ProductFieldDefinition = { type?: HTMLInputTypeAttribute; // eslint-disable-next-line @typescript-eslint/no-explicit-any render?: ComponentType; + attributes?: Record< string, string >; }; export type ProductFieldState = { diff --git a/packages/js/components/src/product-fields/stories/index.tsx b/packages/js/components/src/product-fields/stories/product-fields.story.tsx similarity index 100% rename from packages/js/components/src/product-fields/stories/index.tsx rename to packages/js/components/src/product-fields/stories/product-fields.story.tsx diff --git a/packages/js/components/src/product-image/stories/index.tsx b/packages/js/components/src/product-image/stories/product-image.story.tsx similarity index 100% rename from packages/js/components/src/product-image/stories/index.tsx rename to packages/js/components/src/product-image/stories/product-image.story.tsx diff --git a/packages/js/components/src/progress-bar/stories/index.tsx b/packages/js/components/src/progress-bar/stories/progress-bar.story.tsx similarity index 100% rename from packages/js/components/src/progress-bar/stories/index.tsx rename to packages/js/components/src/progress-bar/stories/progress-bar.story.tsx diff --git a/packages/js/components/src/rating/stories/index.tsx b/packages/js/components/src/rating/stories/rating.story.tsx similarity index 100% rename from packages/js/components/src/rating/stories/index.tsx rename to packages/js/components/src/rating/stories/rating.story.tsx diff --git a/packages/js/components/src/rich-text-editor/editor-writing-flow.tsx b/packages/js/components/src/rich-text-editor/editor-writing-flow.tsx index 2726dc0cee8..1333a7f3c3c 100644 --- a/packages/js/components/src/rich-text-editor/editor-writing-flow.tsx +++ b/packages/js/components/src/rich-text-editor/editor-writing-flow.tsx @@ -43,7 +43,7 @@ export const EditorWritingFlow = ( { editorMode: __unstableGetEditorMode(), selectedBlockClientIds: getSelectedBlockClientIds(), }; - } ); + }, [] ); // This is a workaround to prevent focusing the block on initialization. // Changing to a mode other than "edit" ensures that no initial position diff --git a/packages/js/components/src/rich-text-editor/stories/index.tsx b/packages/js/components/src/rich-text-editor/stories/rich-text-editor.story.tsx similarity index 100% rename from packages/js/components/src/rich-text-editor/stories/index.tsx rename to packages/js/components/src/rich-text-editor/stories/rich-text-editor.story.tsx diff --git a/packages/js/components/src/scroll-to/stories/index.js b/packages/js/components/src/scroll-to/stories/scroll-to.story.js similarity index 100% rename from packages/js/components/src/scroll-to/stories/index.js rename to packages/js/components/src/scroll-to/stories/scroll-to.story.js diff --git a/packages/js/components/src/search-list-control/stories/index.js b/packages/js/components/src/search-list-control/stories/search-list-control.story.js similarity index 100% rename from packages/js/components/src/search-list-control/stories/index.js rename to packages/js/components/src/search-list-control/stories/search-list-control.story.js diff --git a/packages/js/components/src/search/stories/index.js b/packages/js/components/src/search/stories/search.story.js similarity index 100% rename from packages/js/components/src/search/stories/index.js rename to packages/js/components/src/search/stories/search.story.js diff --git a/packages/js/components/src/section-header/stories/index.js b/packages/js/components/src/section-header/stories/section-header.story.js similarity index 100% rename from packages/js/components/src/section-header/stories/index.js rename to packages/js/components/src/section-header/stories/section-header.story.js diff --git a/packages/js/components/src/section/stories/index.tsx b/packages/js/components/src/section/stories/section.story.tsx similarity index 100% rename from packages/js/components/src/section/stories/index.tsx rename to packages/js/components/src/section/stories/section.story.tsx diff --git a/packages/js/components/src/segmented-selection/stories/index.js b/packages/js/components/src/segmented-selection/stories/segmented-selection.story.js similarity index 100% rename from packages/js/components/src/segmented-selection/stories/index.js rename to packages/js/components/src/segmented-selection/stories/segmented-selection.story.js diff --git a/packages/js/components/src/select-control/stories/index.tsx b/packages/js/components/src/select-control/stories/select-control.story.tsx similarity index 100% rename from packages/js/components/src/select-control/stories/index.tsx rename to packages/js/components/src/select-control/stories/select-control.story.tsx diff --git a/packages/js/components/src/sortable/stories/index.tsx b/packages/js/components/src/sortable/stories/sortable.story.tsx similarity index 100% rename from packages/js/components/src/sortable/stories/index.tsx rename to packages/js/components/src/sortable/stories/sortable.story.tsx diff --git a/packages/js/components/src/spinner/stories/index.js b/packages/js/components/src/spinner/stories/spinner.story.js similarity index 100% rename from packages/js/components/src/spinner/stories/index.js rename to packages/js/components/src/spinner/stories/spinner.story.js diff --git a/packages/js/components/src/stepper/stories/index.js b/packages/js/components/src/stepper/stories/stepper.story.js similarity index 100% rename from packages/js/components/src/stepper/stories/index.js rename to packages/js/components/src/stepper/stories/stepper.story.js diff --git a/packages/js/components/src/summary/stories/index.js b/packages/js/components/src/summary/stories/summary.story.js similarity index 100% rename from packages/js/components/src/summary/stories/index.js rename to packages/js/components/src/summary/stories/summary.story.js diff --git a/packages/js/components/src/table/stories/empty-table.tsx b/packages/js/components/src/table/stories/empty-table.story.tsx similarity index 100% rename from packages/js/components/src/table/stories/empty-table.tsx rename to packages/js/components/src/table/stories/empty-table.story.tsx diff --git a/packages/js/components/src/table/stories/table-card.tsx b/packages/js/components/src/table/stories/table-card.story.tsx similarity index 100% rename from packages/js/components/src/table/stories/table-card.tsx rename to packages/js/components/src/table/stories/table-card.story.tsx diff --git a/packages/js/components/src/table/stories/table-placeholder.tsx b/packages/js/components/src/table/stories/table-placeholder.story.tsx similarity index 100% rename from packages/js/components/src/table/stories/table-placeholder.tsx rename to packages/js/components/src/table/stories/table-placeholder.story.tsx diff --git a/packages/js/components/src/table/stories/table-summary-placeholder.tsx b/packages/js/components/src/table/stories/table-summary-placeholder.story.tsx similarity index 100% rename from packages/js/components/src/table/stories/table-summary-placeholder.tsx rename to packages/js/components/src/table/stories/table-summary-placeholder.story.tsx diff --git a/packages/js/components/src/table/stories/table-summary.jsx b/packages/js/components/src/table/stories/table-summary.story.jsx similarity index 100% rename from packages/js/components/src/table/stories/table-summary.jsx rename to packages/js/components/src/table/stories/table-summary.story.jsx diff --git a/packages/js/components/src/table/stories/table.tsx b/packages/js/components/src/table/stories/table.story.tsx similarity index 100% rename from packages/js/components/src/table/stories/table.tsx rename to packages/js/components/src/table/stories/table.story.tsx diff --git a/packages/js/components/src/tag/stories/index.tsx b/packages/js/components/src/tag/stories/tag.story.tsx similarity index 100% rename from packages/js/components/src/tag/stories/index.tsx rename to packages/js/components/src/tag/stories/tag.story.tsx diff --git a/packages/js/components/src/text-control-with-affixes/stories/index.js b/packages/js/components/src/text-control-with-affixes/stories/text-control-with-affixes.story.js similarity index 100% rename from packages/js/components/src/text-control-with-affixes/stories/index.js rename to packages/js/components/src/text-control-with-affixes/stories/text-control-with-affixes.story.js diff --git a/packages/js/components/src/text-control/stories/index.js b/packages/js/components/src/text-control/stories/text-control.story.js similarity index 100% rename from packages/js/components/src/text-control/stories/index.js rename to packages/js/components/src/text-control/stories/text-control.story.js diff --git a/packages/js/components/src/timeline/stories/index.js b/packages/js/components/src/timeline/stories/index.js deleted file mode 100644 index a995ea3fd18..00000000000 --- a/packages/js/components/src/timeline/stories/index.js +++ /dev/null @@ -1,107 +0,0 @@ -/** - * External dependencies - */ -import { date, text } from '@storybook/addon-knobs'; -import GridIcon from 'gridicons'; - -/** - * Internal dependencies - */ -import Timeline, { orderByOptions } from '../'; - -export default { - title: 'WooCommerce Admin/components/Timeline', - component: Timeline, -}; - -export const Empty = () => ; - -const itemDate = ( label, value ) => { - const d = date( label, value ); - return new Date( d ); -}; - -export const Filled = () => ( - - { text( 'event 1, first event', 'p element in body' ) } -

, - text( 'event 1, second event', 'string in body' ), - ], - headline: ( -

{ text( 'event 1, headline', 'p tag in headline' ) }

- ), - icon: ( - - ), - hideTimestamp: true, - }, - { - date: itemDate( - 'event 2 date', - new Date( 2020, 0, 20, 23, 45 ) - ), - body: [], - headline: ( - - { text( 'event 2, headline', 'span in headline' ) } - - ), - icon: ( - - ), - }, - { - date: itemDate( - 'event 3 date', - new Date( 2020, 0, 22, 15, 13 ) - ), - body: [ - - { text( 'event 3, second event', 'span in body' ) } - , - ], - headline: text( 'event 3, headline', 'string in headline' ), - icon: ( - - ), - }, - { - date: itemDate( - 'event 4 date', - new Date( 2020, 0, 17, 1, 45 ) - ), - headline: text( - 'event 4, headline', - 'undefined body and string headline' - ), - icon: ( - - ), - }, - ] } - /> -); diff --git a/packages/js/components/src/timeline/stories/timeline.story.js b/packages/js/components/src/timeline/stories/timeline.story.js new file mode 100644 index 00000000000..3efe17fd676 --- /dev/null +++ b/packages/js/components/src/timeline/stories/timeline.story.js @@ -0,0 +1,71 @@ +/** + * External dependencies + */ +import GridIcon from 'gridicons'; + +/** + * Internal dependencies + */ +import Timeline, { orderByOptions } from '../'; + +export const Filled = () => { + return ( + p element in body

, + 'string in body', + ], + headline:

p tag in headline

, + icon: ( + + ), + hideTimestamp: true, + }, + { + date: new Date( 2020, 0, 20, 23, 45 ), + body: [], + headline: span in headline, + icon: ( + + ), + }, + { + date: new Date( 2020, 0, 22, 15, 13 ), + body: [ span in body ], + headline: 'string in headline', + icon: ( + + ), + }, + { + date: new Date( 2020, 0, 17, 1, 45 ), + headline: 'undefined body and string headline', + icon: , + }, + ] } + /> + ); +}; + +export default { + title: 'WooCommerce Admin/components/Timeline', + component: Filled, +}; + +export const Empty = () => ; diff --git a/packages/js/components/src/tooltip/stories/index.tsx b/packages/js/components/src/tooltip/stories/tooltip.story.tsx similarity index 100% rename from packages/js/components/src/tooltip/stories/index.tsx rename to packages/js/components/src/tooltip/stories/tooltip.story.tsx diff --git a/packages/js/components/src/tour-kit/stories/index.tsx b/packages/js/components/src/tour-kit/stories/tour-kit.story.tsx similarity index 100% rename from packages/js/components/src/tour-kit/stories/index.tsx rename to packages/js/components/src/tour-kit/stories/tour-kit.story.tsx diff --git a/packages/js/components/src/tree-select-control/stories/index.js b/packages/js/components/src/tree-select-control/stories/tree-select-control.story.js similarity index 100% rename from packages/js/components/src/tree-select-control/stories/index.js rename to packages/js/components/src/tree-select-control/stories/tree-select-control.story.js diff --git a/packages/js/components/src/view-more-list/stories/index.js b/packages/js/components/src/view-more-list/stories/view-more-list.story.js similarity index 100% rename from packages/js/components/src/view-more-list/stories/index.js rename to packages/js/components/src/view-more-list/stories/view-more-list.story.js diff --git a/packages/js/components/src/web-preview/stories/index.js b/packages/js/components/src/web-preview/stories/web-preview.story.js similarity index 100% rename from packages/js/components/src/web-preview/stories/index.js rename to packages/js/components/src/web-preview/stories/web-preview.story.js diff --git a/packages/js/data/changelog/fix-remove-help-panel-user-meta b/packages/js/data/changelog/fix-remove-help-panel-user-meta new file mode 100644 index 00000000000..9b1882ac793 --- /dev/null +++ b/packages/js/data/changelog/fix-remove-help-panel-user-meta @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +Removed the leftover user meta from the help panel spotlight diff --git a/packages/js/data/changelog/update-51103-woopayments-incentive-to-tracks-props b/packages/js/data/changelog/update-51103-woopayments-incentive-to-tracks-props new file mode 100644 index 00000000000..c0d87293d0e --- /dev/null +++ b/packages/js/data/changelog/update-51103-woopayments-incentive-to-tracks-props @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +Add wooPaymentsIncentiveId to the TaskType additionalData. diff --git a/packages/js/data/changelog/upgrade-storybook_and_add_pages_workflow b/packages/js/data/changelog/upgrade-storybook_and_add_pages_workflow new file mode 100644 index 00000000000..f6bdc7a7044 --- /dev/null +++ b/packages/js/data/changelog/upgrade-storybook_and_add_pages_workflow @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +Export plugin related data store types for selectors and actions. diff --git a/packages/js/data/src/index.ts b/packages/js/data/src/index.ts index 266c103813a..9b75260376a 100644 --- a/packages/js/data/src/index.ts +++ b/packages/js/data/src/index.ts @@ -85,6 +85,8 @@ export { } from './product-form/types'; export * from './onboarding/types'; export * from './plugins/types'; +export { PluginSelectors } from './plugins/selectors'; +export { ActionDispatchers as PluginActions } from './plugins/actions'; export * from './products/types'; export type { PartialProductVariation, diff --git a/packages/js/data/src/onboarding/types.ts b/packages/js/data/src/onboarding/types.ts index a39fa627e63..7e3e3058c73 100644 --- a/packages/js/data/src/onboarding/types.ts +++ b/packages/js/data/src/onboarding/types.ts @@ -35,6 +35,7 @@ export type TaskType = { stripeTaxActivated?: boolean; woocommerceTaxActivated?: boolean; woocommerceShippingActivated?: boolean; + wooPaymentsIncentiveId?: string; }; // Possibly added in DeprecatedTasks.mergeDeprecatedCallbackFunctions isDeprecated?: boolean; diff --git a/packages/js/data/src/user/types.ts b/packages/js/data/src/user/types.ts index 34328a41f18..428b8e1a5e1 100644 --- a/packages/js/data/src/user/types.ts +++ b/packages/js/data/src/user/types.ts @@ -15,7 +15,6 @@ export type UserPreferences = { dashboard_chart_type?: string; dashboard_leaderboard_rows?: string; dashboard_sections?: string; - help_panel_highlight_shown?: string; homepage_layout?: string; homepage_stats?: string; orders_report_columns?: string; diff --git a/packages/js/e2e-utils/README.md b/packages/js/e2e-utils/README.md index 12c9abe07ec..93f898daf37 100644 --- a/packages/js/e2e-utils/README.md +++ b/packages/js/e2e-utils/README.md @@ -12,7 +12,8 @@ npm install @woocommerce/e2e-utils --save ## Usage Example: -~~~js + +```js import { shopper, merchant, @@ -29,7 +30,7 @@ describe( 'Cart page', () => { await expect( page ).toMatchElement( '.cart-empty', { text: 'Your cart is currently empty.' } ); } ); } ); -~~~ +``` ### Retries @@ -86,7 +87,6 @@ This package provides support for enabling retries in tests: |----------|-------------|------------| | `addDownloadableProductPermission` | `productName` | Add a downloadable permission for product in order | | `collapseAdminMenu` | `collapse` | Collapse or expand the WP admin menu | -| `dismissOnboardingWizard` | | Dismiss the onboarding wizard if present | | `goToOrder` | `orderId` | Go to view a single order | | `goToProduct` | `productId` | Go to view a single product | | `login` | | Log in as merchant | @@ -100,7 +100,6 @@ This package provides support for enabling retries in tests: | `openPermalinkSettings` | | Go to Settings -> Permalinks | | `openPlugins` | | Go to the Plugins screen | | `openSettings` | | Go to WooCommerce -> Settings | -| `runSetupWizard` | | Open the onboarding profiler | | `updateOrderStatus` | `orderId, status` | Update the status of an order | | `openEmailLog` | | Open the WP Mail Log page | | `openAnalyticsPage` | | Open any Analytics page | @@ -210,7 +209,6 @@ There is a general utilities object `utils` with the following functions: | `clickFilter` | `selector` | helper method that clicks on a list page filter | | `clickTab` | `tabName` | Click on a WooCommerce -> Settings tab | | `clickUpdateOrder` | `noticeText`, `waitForSave` | Helper method to click the Update button on the order details page | -| `completeOnboardingWizard` | | completes the onboarding wizard with some default settings | | `createCoupon` | `couponAmount`, `couponType` | creates a basic coupon. Default amount is 5. Default coupon type is fixed discount. Returns the generated coupon code. | | `createGroupedProduct` | | creates a grouped product for the grouped product tests. Returns the product id. | | `createSimpleDownloadableProduct` | `name, downloadLimit, downloadName, price` | Create a simple downloadable product | diff --git a/packages/js/e2e-utils/changelog/cleanup-profiler-wizard b/packages/js/e2e-utils/changelog/cleanup-profiler-wizard new file mode 100644 index 00000000000..8a55c777336 --- /dev/null +++ b/packages/js/e2e-utils/changelog/cleanup-profiler-wizard @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Remove Profile Wizard releated utils diff --git a/packages/js/e2e-utils/src/components.js b/packages/js/e2e-utils/src/components.js index 911d8d51a54..b641c674869 100644 --- a/packages/js/e2e-utils/src/components.js +++ b/packages/js/e2e-utils/src/components.js @@ -60,151 +60,6 @@ const waitAndClickPrimary = async ( waitForNetworkIdle = true ) => { await page.waitForNavigation( { waitUntil: 'networkidle0' } ); } }; -/** - * Complete onboarding wizard. - */ -const completeOnboardingWizard = async () => { - // Store Details section - await merchant.runSetupWizard(); - - // Fill store's address - first line - await expect( page ).toFill( - '#inspector-text-control-0', - config.get( 'addresses.admin.store.addressfirstline' ) - ); - - // Fill store's address - second line - await expect( page ).toFill( - '#inspector-text-control-1', - config.get( 'addresses.admin.store.addresssecondline' ) - ); - - // Fill country and state where the store is located - await expect( page ).toFill( - '.woocommerce-select-control__control-input', - config.get( 'addresses.admin.store.countryandstate' ) - ); - - // Fill the city where the store is located - await expect( page ).toFill( - '#inspector-text-control-2', - config.get( 'addresses.admin.store.city' ) - ); - - // Fill postcode of the store - await expect( page ).toFill( - '#inspector-text-control-3', - config.get( 'addresses.admin.store.postcode' ) - ); - - // Verify that checkbox next to "I'm setting up a store for a client" is not selected - await verifyCheckboxIsUnset( '.components-checkbox-control__input' ); - - // Wait for "Continue" button to become active - await page.waitForSelector( 'button.is-primary:not(:disabled)' ); - - // Click on "Continue" button to move to the next step - await page.click( 'button.is-primary', { text: 'Continue' } ); - - // Wait for usage tracking pop-up window to appear on a new site - const usageTrackingHeader = await page.$( - '.components-modal__header-heading' - ); - if ( usageTrackingHeader ) { - await expect( page ).toMatchElement( - '.components-modal__header-heading', - { - text: 'Build a better WooCommerce', - } - ); - - // Query for "No Thanks" buttons - const continueButtons = await page.$$( - '.woocommerce-usage-modal__actions button.is-secondary' - ); - expect( continueButtons ).toHaveLength( 1 ); - - await continueButtons[ 0 ].click(); - await expect( page ).toMatchElement( - '.woocommerce-usage-modal__actions button.is-secondary.is-busy' - ); - await expect( page ).not.toMatchElement( - '.woocommerce-usage-modal__actions button.is-primary:disabled' - ); - } - await page.waitForNavigation( { waitUntil: 'networkidle0' } ); - - // Industry section - - // Query for the industries checkboxes - const industryCheckboxes = await page.$$( - '.components-checkbox-control__input' - ); - expect( industryCheckboxes ).toHaveLength( 8 ); - - // Select all industries including "Other" - for ( let i = 0; i < 8; i++ ) { - await industryCheckboxes[ i ].click(); - } - - // Fill "Other" industry - await expect( page ).toFill( - '.components-text-control__input', - config.get( 'onboardingwizard.industry' ) - ); - - // Wait for "Continue" button to become active - await waitAndClickPrimary(); - - // Product types section - - // Query for the product types checkboxes - const productTypesCheckboxes = await page.$$( - '.components-checkbox-control__input' - ); - expect( productTypesCheckboxes ).toHaveLength( 7 ); - - // Select Physical and Downloadable products - for ( let i = 1; i < 2; i++ ) { - await productTypesCheckboxes[ i ].click(); - } - - // Wait for "Continue" button to become active - await waitAndClickPrimary(); - - // Business Details section - - // Temporarily add delay to reduce test flakiness - await page.waitFor( 2000 ); - - // Query for the s - const selectControls = await page.$$( '.woocommerce-select-control' ); - expect( selectControls ).toHaveLength( 2 ); - - // Fill the number of products you plan to sell - await selectControls[ 0 ].click(); - await page.waitForSelector( '.woocommerce-select-control__control' ); - await expect( page ).toClick( '.woocommerce-select-control__option', { - text: config.get( 'onboardingwizard.numberofproducts' ), - } ); - - // Fill currently selling elsewhere - await selectControls[ 1 ].click(); - await page.waitForSelector( '.woocommerce-select-control__control' ); - await expect( page ).toClick( '.woocommerce-select-control__option', { - text: config.get( 'onboardingwizard.sellingelsewhere' ), - } ); - - // Wait for "Continue" button to become active - await waitAndClickPrimary( false ); - - // Skip installing extensions - await unsetCheckbox( '.components-checkbox-control__input' ); - await verifyCheckboxIsUnset( '.components-checkbox-control__input' ); - await waitAndClickPrimary(); - - // End of onboarding wizard -}; /** * Create simple product. @@ -668,7 +523,6 @@ const deleteAllShippingZones = async () => { }; export { - completeOnboardingWizard, createSimpleProduct, createVariableProduct, createGroupedProduct, diff --git a/packages/js/e2e-utils/src/flows/merchant.js b/packages/js/e2e-utils/src/flows/merchant.js index d312ad64686..0bde1222503 100644 --- a/packages/js/e2e-utils/src/flows/merchant.js +++ b/packages/js/e2e-utils/src/flows/merchant.js @@ -31,8 +31,6 @@ const { WP_ADMIN_NEW_PRODUCT, WP_ADMIN_PERMALINK_SETTINGS, WP_ADMIN_PLUGINS, - WP_ADMIN_SETUP_WIZARD, - WP_ADMIN_WC_HOME, WP_ADMIN_WC_SETTINGS, WP_ADMIN_WC_EXTENSIONS, WP_ADMIN_WC_HELPER, @@ -42,7 +40,6 @@ const { WP_ADMIN_IMPORT_PRODUCTS, WP_ADMIN_PLUGIN_INSTALL, WP_ADMIN_WP_UPDATES, - IS_RETEST_MODE, } = require( './constants' ); const { getSlug, waitForTimeout } = require( './utils' ); @@ -83,7 +80,6 @@ const merchant = { await Promise.all( [ page.click( 'input[type=submit]' ), page.waitForNavigation( { waitUntil: 'networkidle0' } ), - merchant.dismissOnboardingWizard(), ] ); }, @@ -173,15 +169,6 @@ const merchant = { } ); }, - runSetupWizard: async () => { - const setupWizard = IS_RETEST_MODE - ? WP_ADMIN_SETUP_WIZARD - : WP_ADMIN_WC_HOME; - await page.goto( setupWizard, { - waitUntil: 'networkidle0', - } ); - }, - goToOrder: async ( orderId ) => { await page.goto( WP_ADMIN_SINGLE_CPT_VIEW( orderId ), { waitUntil: 'networkidle0', @@ -290,9 +277,10 @@ const merchant = { revokeDownloadableProductPermission: async ( productName ) => { // Revoke downloadable product permission - const permission = await expect( - page - ).toMatchElement( 'div.wc-metabox > h3', { text: productName } ); + const permission = await expect( page ).toMatchElement( + 'div.wc-metabox > h3', + { text: productName } + ); await expect( permission ).toClick( 'button.revoke_access' ); // Wait for auto save @@ -625,10 +613,10 @@ const merchant = { }, /* Uploads and activates a plugin located at the provided file path. This will also deactivate and delete the plugin if it exists. - * - * @param {string} pluginFilePath The location of the plugin zip file to upload. - * @param {string} pluginName The name of the plugin. For example, `WooCommerce`. - */ + * + * @param {string} pluginFilePath The location of the plugin zip file to upload. + * @param {string} pluginName The name of the plugin. For example, `WooCommerce`. + */ uploadAndActivatePlugin: async ( pluginFilePath, pluginName ) => { await merchant.openPlugins(); @@ -647,8 +635,7 @@ const merchant = { await page.click( 'a.upload-view-toggle' ); await expect( page ).toMatchElement( 'p.install-help', { - text: - 'If you have a plugin in a .zip format, you may install or update it by uploading it here.', + text: 'If you have a plugin in a .zip format, you may install or update it by uploading it here.', } ); const uploader = await page.$( 'input[type=file]' ); @@ -753,33 +740,6 @@ const merchant = { } }, - /** - * Dismiss the onboarding wizard if it is open. - */ - dismissOnboardingWizard: async () => { - let waitForNav = false; - const skipButton = await page.$( - '.woocommerce-profile-wizard__footer-link' - ); - if ( skipButton ) { - await skipButton.click(); - waitForNav = true; - } - - // Dismiss usage tracking pop-up window if it appears on a new site - const usageTrackingHeader = await page.$( - '.woocommerce-usage-modal button.is-secondary' - ); - if ( usageTrackingHeader ) { - await usageTrackingHeader.click(); - waitForNav = true; - } - - if ( waitForNav ) { - await page.waitForNavigation( { waitUntil: 'networkidle0' } ); - } - }, - /** * Expand or collapse the WP admin menu. * diff --git a/packages/js/e2e-utils/src/old-flows.js b/packages/js/e2e-utils/src/old-flows.js index 4afde090920..c59a7d6e74a 100644 --- a/packages/js/e2e-utils/src/old-flows.js +++ b/packages/js/e2e-utils/src/old-flows.js @@ -172,11 +172,6 @@ const StoreOwnerFlow = { StoreOwnerFlowDeprecated(); await merchant.openSettings( tab, section ); }, - - runSetupWizard: async () => { - StoreOwnerFlowDeprecated(); - await merchant.runSetupWizard(); - }, }; export { CustomerFlow, StoreOwnerFlow }; diff --git a/packages/js/experimental/changelog/upgrade-storybook_and_add_pages_workflow b/packages/js/experimental/changelog/upgrade-storybook_and_add_pages_workflow new file mode 100644 index 00000000000..579b91e0c80 --- /dev/null +++ b/packages/js/experimental/changelog/upgrade-storybook_and_add_pages_workflow @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +Update storybook file format in support with Storybook 7 story indexer. diff --git a/packages/js/experimental/src/experimental-list/stories/index.tsx b/packages/js/experimental/src/experimental-list/stories/experimental-list.story.tsx similarity index 100% rename from packages/js/experimental/src/experimental-list/stories/index.tsx rename to packages/js/experimental/src/experimental-list/stories/experimental-list.story.tsx diff --git a/packages/js/experimental/src/vertical-css-transition/stories/index.tsx b/packages/js/experimental/src/vertical-css-transition/stories/vertical-css-transition.story.tsx similarity index 100% rename from packages/js/experimental/src/vertical-css-transition/stories/index.tsx rename to packages/js/experimental/src/vertical-css-transition/stories/vertical-css-transition.story.tsx diff --git a/packages/js/onboarding/changelog/upgrade-storybook_and_add_pages_workflow b/packages/js/onboarding/changelog/upgrade-storybook_and_add_pages_workflow new file mode 100644 index 00000000000..579b91e0c80 --- /dev/null +++ b/packages/js/onboarding/changelog/upgrade-storybook_and_add_pages_workflow @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +Update storybook file format in support with Storybook 7 story indexer. diff --git a/packages/js/onboarding/package.json b/packages/js/onboarding/package.json index 0521b2f2163..98fd24eef18 100644 --- a/packages/js/onboarding/package.json +++ b/packages/js/onboarding/package.json @@ -71,7 +71,6 @@ }, "devDependencies": { "@babel/core": "^7.23.5", - "@storybook/addon-knobs": "^7.0.2", "@testing-library/react": "12.1.3", "@types/jest": "^27.5.2", "@types/react": "^17.0.71", diff --git a/packages/js/onboarding/src/components/Loader/stories/index.tsx b/packages/js/onboarding/src/components/Loader/stories/loader.story.tsx similarity index 100% rename from packages/js/onboarding/src/components/Loader/stories/index.tsx rename to packages/js/onboarding/src/components/Loader/stories/loader.story.tsx diff --git a/packages/js/product-editor/changelog/fix-style_conflicts b/packages/js/product-editor/changelog/fix-style_conflicts new file mode 100644 index 00000000000..bd5d3c6d81c --- /dev/null +++ b/packages/js/product-editor/changelog/fix-style_conflicts @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +Increase specificity of product data views styles to avoid conflicts. diff --git a/packages/js/product-editor/changelog/upgrade-storybook_and_add_pages_workflow b/packages/js/product-editor/changelog/upgrade-storybook_and_add_pages_workflow new file mode 100644 index 00000000000..579b91e0c80 --- /dev/null +++ b/packages/js/product-editor/changelog/upgrade-storybook_and_add_pages_workflow @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +Update storybook file format in support with Storybook 7 story indexer. diff --git a/packages/js/product-editor/src/components/advice-card/stories/index.tsx b/packages/js/product-editor/src/components/advice-card/stories/advice-card.story.tsx similarity index 100% rename from packages/js/product-editor/src/components/advice-card/stories/index.tsx rename to packages/js/product-editor/src/components/advice-card/stories/advice-card.story.tsx diff --git a/packages/js/product-editor/src/components/attribute-combobox-field/stories/index.tsx b/packages/js/product-editor/src/components/attribute-combobox-field/stories/attribute-combobox-field.story.tsx similarity index 100% rename from packages/js/product-editor/src/components/attribute-combobox-field/stories/index.tsx rename to packages/js/product-editor/src/components/attribute-combobox-field/stories/attribute-combobox-field.story.tsx diff --git a/packages/js/product-editor/src/components/button-with-dropdown-menu/stories/index.tsx b/packages/js/product-editor/src/components/button-with-dropdown-menu/stories/button-with-dropdown-menu.story.tsx similarity index 100% rename from packages/js/product-editor/src/components/button-with-dropdown-menu/stories/index.tsx rename to packages/js/product-editor/src/components/button-with-dropdown-menu/stories/button-with-dropdown-menu.story.tsx diff --git a/packages/js/product-editor/src/components/label/stories/index.tsx b/packages/js/product-editor/src/components/label/stories/label.story.tsx similarity index 100% rename from packages/js/product-editor/src/components/label/stories/index.tsx rename to packages/js/product-editor/src/components/label/stories/label.story.tsx diff --git a/packages/js/product-editor/src/images/cash-register/stories/index.tsx b/packages/js/product-editor/src/images/cash-register/stories/cash-register.story.tsx similarity index 100% rename from packages/js/product-editor/src/images/cash-register/stories/index.tsx rename to packages/js/product-editor/src/images/cash-register/stories/cash-register.story.tsx diff --git a/packages/js/product-editor/src/images/glasses/stories/index.tsx b/packages/js/product-editor/src/images/glasses/stories/glasses.story.tsx similarity index 100% rename from packages/js/product-editor/src/images/glasses/stories/index.tsx rename to packages/js/product-editor/src/images/glasses/stories/glasses.story.tsx diff --git a/packages/js/product-editor/src/images/pants/stories/index.tsx b/packages/js/product-editor/src/images/pants/stories/pants.story.tsx similarity index 100% rename from packages/js/product-editor/src/images/pants/stories/index.tsx rename to packages/js/product-editor/src/images/pants/stories/pants.story.tsx diff --git a/packages/js/product-editor/src/images/shirt/stories/index.tsx b/packages/js/product-editor/src/images/shirt/stories/shirt.story.tsx similarity index 100% rename from packages/js/product-editor/src/images/shirt/stories/index.tsx rename to packages/js/product-editor/src/images/shirt/stories/shirt.story.tsx diff --git a/packages/js/product-editor/src/images/shopping-bags/stories/index.tsx b/packages/js/product-editor/src/images/shopping-bags/stories/shopping-bags.story.tsx similarity index 100% rename from packages/js/product-editor/src/images/shopping-bags/stories/index.tsx rename to packages/js/product-editor/src/images/shopping-bags/stories/shopping-bags.story.tsx diff --git a/packages/js/product-editor/src/products.scss b/packages/js/product-editor/src/products.scss index 33f49a1ae7b..463564ff88e 100644 --- a/packages/js/product-editor/src/products.scss +++ b/packages/js/product-editor/src/products.scss @@ -40,5 +40,7 @@ body.js.is-fullscreen-mode { } } -@import "products-app/sidebar-dataviews/style.scss"; -@import "products-app/product-edit/style.scss"; +.woocommerce_page_woocommerce-products-dashboard { + @import "products-app/sidebar-dataviews/style.scss"; + @import "products-app/product-edit/style.scss"; +} diff --git a/packages/js/remote-logging/CHANGELOG.md b/packages/js/remote-logging/CHANGELOG.md index f7aac6be3b3..31e41a6ad37 100644 --- a/packages/js/remote-logging/CHANGELOG.md +++ b/packages/js/remote-logging/CHANGELOG.md @@ -1,3 +1,18 @@ # Changelog This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.0.0](https://www.npmjs.com/package/@woocommerce/remote-logging/v/1.0.0) - 2024-09-09 + +- Patch - Fix wc asset url check [#50701] +- Minor - Add JS remote logging package [#49702] +- Patch - Track frequency of unhandled JS errors with MC Stats [#50155] +- Minor - Add query params sanitisation [#51046] +- Patch - Add request_uri prop to remote logging data [#50671] +- Patch - Comment: Fix some comment typos. [#50993] +- Patch - Update README.md to document the filters specs & usage [#51010] +- Patch - Update remote logger to check dev env and whether logging is enabled [#50134] +- Patch - Fix pnpm version to 9.1.3 to avoid dependency installation issues. [#50828] +- Patch - Tweak logic for adding remote logging tool in beta tester [#50425] + +[See legacy changelogs for previous versions](https://github.com/woocommerce/woocommerce/blob/68581955106947918d2b17607a01bdfdf22288a9/packages/js/remote-logging/CHANGELOG.md). diff --git a/packages/js/remote-logging/changelog/49702-add-js-remote-error-logging b/packages/js/remote-logging/changelog/49702-add-js-remote-error-logging deleted file mode 100644 index 9b540da3c02..00000000000 --- a/packages/js/remote-logging/changelog/49702-add-js-remote-error-logging +++ /dev/null @@ -1,4 +0,0 @@ -Significance: minor -Type: add - -Add JS remote logging package \ No newline at end of file diff --git a/packages/js/remote-logging/changelog/50828-dev-constrain-pnpm-version b/packages/js/remote-logging/changelog/50828-dev-constrain-pnpm-version deleted file mode 100644 index fdead95ceb5..00000000000 --- a/packages/js/remote-logging/changelog/50828-dev-constrain-pnpm-version +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: dev - -Fix pnpm version to 9.1.3 to avoid dependency installation issues. \ No newline at end of file diff --git a/packages/js/remote-logging/changelog/50993-fix-some-comment-typos b/packages/js/remote-logging/changelog/50993-fix-some-comment-typos deleted file mode 100644 index 3dce9f8d32b..00000000000 --- a/packages/js/remote-logging/changelog/50993-fix-some-comment-typos +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: update - -Comment: Fix some comment typos. diff --git a/packages/js/remote-logging/changelog/add-bump-stats-error b/packages/js/remote-logging/changelog/add-bump-stats-error deleted file mode 100644 index 2a41a632378..00000000000 --- a/packages/js/remote-logging/changelog/add-bump-stats-error +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: add - -Track frequency of unhandled JS errors with MC Stats diff --git a/packages/js/remote-logging/changelog/add-remote-logging-beta-tester-tool b/packages/js/remote-logging/changelog/add-remote-logging-beta-tester-tool deleted file mode 100644 index 1e7f8794894..00000000000 --- a/packages/js/remote-logging/changelog/add-remote-logging-beta-tester-tool +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: tweak - -Tweak logic for adding remote logging tool in beta tester diff --git a/packages/js/remote-logging/changelog/add-wcadmin-remote-logging b/packages/js/remote-logging/changelog/add-wcadmin-remote-logging deleted file mode 100644 index 230dd1e821f..00000000000 --- a/packages/js/remote-logging/changelog/add-wcadmin-remote-logging +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: update - -Update remote logger to check dev env and whether logging is enabled diff --git a/packages/js/remote-logging/changelog/fix-remote-logging-asset-path b/packages/js/remote-logging/changelog/fix-remote-logging-asset-path deleted file mode 100644 index fc166a1888b..00000000000 --- a/packages/js/remote-logging/changelog/fix-remote-logging-asset-path +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: fix - -Fix wc asset url check diff --git a/packages/js/remote-logging/changelog/update-remote-logging-data b/packages/js/remote-logging/changelog/update-remote-logging-data deleted file mode 100644 index 69c8edf57c4..00000000000 --- a/packages/js/remote-logging/changelog/update-remote-logging-data +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: update - -Add request_uri prop to remote logging data diff --git a/packages/js/remote-logging/changelog/update-remote-logging-readme b/packages/js/remote-logging/changelog/update-remote-logging-readme deleted file mode 100644 index db2068ed42a..00000000000 --- a/packages/js/remote-logging/changelog/update-remote-logging-readme +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: update - -Update README.md to document the filters specs & usage diff --git a/packages/js/remote-logging/package.json b/packages/js/remote-logging/package.json index c96e6ca3f18..d56739c09a6 100644 --- a/packages/js/remote-logging/package.json +++ b/packages/js/remote-logging/package.json @@ -1,6 +1,6 @@ { "name": "@woocommerce/remote-logging", - "version": "0.0.1", + "version": "1.0.0", "description": "WooCommerce remote logging for Automattic based projects", "author": "Automattic", "license": "GPL-2.0-or-later", diff --git a/packages/php/remote-specs-validation/bundles/obw-free-extensions.json b/packages/php/remote-specs-validation/bundles/obw-free-extensions.json index 4f6eab2bf3f..76da6d4426c 100644 --- a/packages/php/remote-specs-validation/bundles/obw-free-extensions.json +++ b/packages/php/remote-specs-validation/bundles/obw-free-extensions.json @@ -195,7 +195,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } }, @@ -217,7 +220,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } }, diff --git a/packages/php/remote-specs-validation/bundles/payment-gateway-suggestions.json b/packages/php/remote-specs-validation/bundles/payment-gateway-suggestions.json index 78a72622f7b..37928228c99 100644 --- a/packages/php/remote-specs-validation/bundles/payment-gateway-suggestions.json +++ b/packages/php/remote-specs-validation/bundles/payment-gateway-suggestions.json @@ -179,7 +179,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } }, @@ -201,7 +204,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } }, @@ -864,7 +870,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } }, @@ -886,7 +895,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } }, diff --git a/packages/php/remote-specs-validation/bundles/remote-inbox-notification.json b/packages/php/remote-specs-validation/bundles/remote-inbox-notification.json index c64ac57f605..f9b0de6f6b2 100644 --- a/packages/php/remote-specs-validation/bundles/remote-inbox-notification.json +++ b/packages/php/remote-specs-validation/bundles/remote-inbox-notification.json @@ -283,7 +283,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } }, @@ -305,7 +308,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } }, diff --git a/packages/php/remote-specs-validation/bundles/shipping-partner-suggestions.json b/packages/php/remote-specs-validation/bundles/shipping-partner-suggestions.json index 0e886b8aca7..d86a98dd5df 100644 --- a/packages/php/remote-specs-validation/bundles/shipping-partner-suggestions.json +++ b/packages/php/remote-specs-validation/bundles/shipping-partner-suggestions.json @@ -173,7 +173,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } }, @@ -195,7 +198,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } }, @@ -847,7 +853,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } }, @@ -869,7 +878,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } }, diff --git a/packages/php/remote-specs-validation/bundles/wc-pay-promotions.json b/packages/php/remote-specs-validation/bundles/wc-pay-promotions.json index 75f8d2fd7d1..c90eac95ab4 100644 --- a/packages/php/remote-specs-validation/bundles/wc-pay-promotions.json +++ b/packages/php/remote-specs-validation/bundles/wc-pay-promotions.json @@ -176,7 +176,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } }, @@ -198,7 +201,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } }, @@ -844,7 +850,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } }, @@ -866,7 +875,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } }, diff --git a/packages/php/remote-specs-validation/changelog.md b/packages/php/remote-specs-validation/changelog.md index 3783eb0da3d..d645580a6a9 100644 --- a/packages/php/remote-specs-validation/changelog.md +++ b/packages/php/remote-specs-validation/changelog.md @@ -1,3 +1,26 @@ # Changelog This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.0.2](https://packagist.org/packages/woocommerce/remote-specs-validation#1.0.2) - 2024-04-12 + +* Fix - Fix base_location_state and base_location_country value type [#51169] +* Update - Bump all remote spec endpoints to version `2.0`. [#45298] +* Update - Remove ToS acceptance where unnecessary [#46003] +* Update - Update Woo.com references to WooCommerce.com. [#46259] +* Dev - Fix whitespace in package.json [#44902] +* Tweak - Fix typos. [#49207] +* Tweak - Rename Google Listings and Ads with Google for WooCommerce #### Comment [#47614] +* Tweak - Rename Google Listings and Ads with Google for WooCommerce [#47614] + + +## [1.0.1](https://packagist.org/packages/woocommerce/remote-specs-validation#1.0.1) - 2024-02-28 + +* Update - Accept JSON schema string as constructor argument instead of file path -- this is more fleixble. [#45151] + +## [1.0.0](https://packagist.org/packages/woocommerce/remote-specs-validation#1.0.0) - 2024-02-21 + +* Add - Add JSON Schema files [#44484] +* Add - Add project scaffolding [#44419] +* Add - Support range operator in Remote Inbox Notification [#45201] +* Add - Updated shipstation copy [#48549] diff --git a/packages/php/remote-specs-validation/changelog/45201-add-44787-add-range-rule b/packages/php/remote-specs-validation/changelog/45201-add-44787-add-range-rule deleted file mode 100644 index 332381bbbbe..00000000000 --- a/packages/php/remote-specs-validation/changelog/45201-add-44787-add-range-rule +++ /dev/null @@ -1,4 +0,0 @@ -Significance: minor -Type: add - -Support range operator in Remote Inbox Notification \ No newline at end of file diff --git a/packages/php/remote-specs-validation/changelog/45298-update-remote-endpoints-2.0 b/packages/php/remote-specs-validation/changelog/45298-update-remote-endpoints-2.0 deleted file mode 100644 index f1639f5b326..00000000000 --- a/packages/php/remote-specs-validation/changelog/45298-update-remote-endpoints-2.0 +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: update - -Bump all remote spec endpoints to version `2.0`. \ No newline at end of file diff --git a/packages/php/remote-specs-validation/changelog/46003-update-remove-duplicated-tos-acceptance b/packages/php/remote-specs-validation/changelog/46003-update-remove-duplicated-tos-acceptance deleted file mode 100644 index cbb0b4301b6..00000000000 --- a/packages/php/remote-specs-validation/changelog/46003-update-remove-duplicated-tos-acceptance +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: update - -Remove ToS acceptance where unnecessary \ No newline at end of file diff --git a/packages/php/remote-specs-validation/changelog/47614-tweak-google-extension-rename b/packages/php/remote-specs-validation/changelog/47614-tweak-google-extension-rename deleted file mode 100644 index 4ac5ec3e8d9..00000000000 --- a/packages/php/remote-specs-validation/changelog/47614-tweak-google-extension-rename +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: tweak - -Rename Google Listings and Ads with Google for WooCommerce #### Comment \ No newline at end of file diff --git a/packages/php/remote-specs-validation/changelog/accept-json-schema-string b/packages/php/remote-specs-validation/changelog/accept-json-schema-string deleted file mode 100644 index 1e1479613be..00000000000 --- a/packages/php/remote-specs-validation/changelog/accept-json-schema-string +++ /dev/null @@ -1,4 +0,0 @@ -Significance: major -Type: update - -Accept JSON schema string as constructor argument instead of file path -- this is more fleixble. diff --git a/packages/php/remote-specs-validation/changelog/add-json-schema-files b/packages/php/remote-specs-validation/changelog/add-json-schema-files deleted file mode 100644 index e0dda27f72d..00000000000 --- a/packages/php/remote-specs-validation/changelog/add-json-schema-files +++ /dev/null @@ -1,4 +0,0 @@ -Significance: minor -Type: add - -Add JSON Schema files \ No newline at end of file diff --git a/packages/php/remote-specs-validation/changelog/add-php-package-RIN-testing b/packages/php/remote-specs-validation/changelog/add-php-package-RIN-testing deleted file mode 100644 index ef5d8f75d92..00000000000 --- a/packages/php/remote-specs-validation/changelog/add-php-package-RIN-testing +++ /dev/null @@ -1,4 +0,0 @@ -Significance: minor -Type: add - -Add project scaffolding diff --git a/packages/php/remote-specs-validation/changelog/add-update-shipping-specs-shipstation-copy b/packages/php/remote-specs-validation/changelog/add-update-shipping-specs-shipstation-copy deleted file mode 100644 index 253ad9a432c..00000000000 --- a/packages/php/remote-specs-validation/changelog/add-update-shipping-specs-shipstation-copy +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: add - -Updated shipstation copy diff --git a/packages/php/remote-specs-validation/changelog/fix-typo-in-remote-specs-validation-readme b/packages/php/remote-specs-validation/changelog/fix-typo-in-remote-specs-validation-readme deleted file mode 100644 index a279c2fc260..00000000000 --- a/packages/php/remote-specs-validation/changelog/fix-typo-in-remote-specs-validation-readme +++ /dev/null @@ -1,4 +0,0 @@ -Significance: minor -Type: tweak - -Fix typos. diff --git a/packages/php/remote-specs-validation/changelog/tweak-google-extension-rename b/packages/php/remote-specs-validation/changelog/tweak-google-extension-rename deleted file mode 100644 index 8a85377cbb9..00000000000 --- a/packages/php/remote-specs-validation/changelog/tweak-google-extension-rename +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: tweak - -Rename Google Listings and Ads with Google for WooCommerce diff --git a/packages/php/remote-specs-validation/changelog/update-woo-com-to-woocommerce-com b/packages/php/remote-specs-validation/changelog/update-woo-com-to-woocommerce-com deleted file mode 100644 index 36ca65dd012..00000000000 --- a/packages/php/remote-specs-validation/changelog/update-woo-com-to-woocommerce-com +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: update - -Update Woo.com references to WooCommerce.com. diff --git a/packages/php/remote-specs-validation/composer.json b/packages/php/remote-specs-validation/composer.json index 95bca61eb23..6f828f244a6 100644 --- a/packages/php/remote-specs-validation/composer.json +++ b/packages/php/remote-specs-validation/composer.json @@ -1,6 +1,6 @@ { "name": "woocommerce/remote-specs-validation", - "version": "1.0.1", + "version": "1.0.2", "description": "Remote specs testing suite", "type": "library", "license": "GPL-3.0-or-later", @@ -9,9 +9,9 @@ "Automattic\\WooCommerce\\RemoteSpecsValidation\\": "src/" } }, - "autoload-dev": { - "psr-4": { - "Automattic\\WooCommerce\\RemoteSpecsValidation\\Tests\\": "tests/" + "autoload-dev": { + "psr-4": { + "Automattic\\WooCommerce\\RemoteSpecsValidation\\Tests\\": "tests/" } }, "require-dev": { diff --git a/packages/php/remote-specs-validation/schemas/shared/rules/base_location_country.json b/packages/php/remote-specs-validation/schemas/shared/rules/base_location_country.json index bcb565ef6b3..6d15e8f5ae2 100644 --- a/packages/php/remote-specs-validation/schemas/shared/rules/base_location_country.json +++ b/packages/php/remote-specs-validation/schemas/shared/rules/base_location_country.json @@ -10,7 +10,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } -} \ No newline at end of file +} diff --git a/packages/php/remote-specs-validation/schemas/shared/rules/base_location_state.json b/packages/php/remote-specs-validation/schemas/shared/rules/base_location_state.json index e2f1abb7fc9..b0f9266cbce 100644 --- a/packages/php/remote-specs-validation/schemas/shared/rules/base_location_state.json +++ b/packages/php/remote-specs-validation/schemas/shared/rules/base_location_state.json @@ -10,7 +10,10 @@ "$ref": "#/definitions/operations" }, "value": { - "type": "string" + "type": [ + "string", + "array" + ] } } -} \ No newline at end of file +} diff --git a/plugins/woocommerce-admin/bin/hook-reference/data.json b/plugins/woocommerce-admin/bin/hook-reference/data.json index 8693d4a18e4..67bdf3e86bd 100644 --- a/plugins/woocommerce-admin/bin/hook-reference/data.json +++ b/plugins/woocommerce-admin/bin/hook-reference/data.json @@ -810,19 +810,6 @@ } ] }, - { - "description": "Filter for Onboarding steps configuration.", - "sourceFile": "https://github.com/woocommerce/woocommerce-admin/blob/46c8304c425749dfc715b38e59f56198b05e7b46/client/profile-wizard/index.js#L140-L145", - "name": "woocommerce_admin_profile_wizard_steps", - "type": "filter", - "params": [ - { - "name": "steps", - "type": "Array.", - "description": "Array of steps for Onboarding Wizard." - } - ] - }, { "description": "Store Management extensions links", "sourceFile": "https://github.com/woocommerce/woocommerce-admin/blob/46c8304c425749dfc715b38e59f56198b05e7b46/client/store-management-links/index.js#L171-L176", diff --git a/plugins/woocommerce-admin/client/core-profiler/index.tsx b/plugins/woocommerce-admin/client/core-profiler/index.tsx index 428566a4578..8dbcd742f3f 100644 --- a/plugins/woocommerce-admin/client/core-profiler/index.tsx +++ b/plugins/woocommerce-admin/client/core-profiler/index.tsx @@ -300,15 +300,28 @@ const exitToWooHome = fromPromise( async () => { window.location.href = getNewPath( {}, '/', {} ); } ); +const getPluginNameParam = ( + pluginsSelected: CoreProfilerStateMachineContext[ 'pluginsSelected' ] +) => { + if ( pluginsSelected.includes( 'woocommerce-payments' ) ) { + return 'woocommerce-payments'; + } + return 'jetpack-ai'; +}; + const redirectToJetpackAuthPage = ( { event, + context, }: { context: CoreProfilerStateMachineContext; event: { output: { url: string } }; } ) => { const url = new URL( event.output.url ); url.searchParams.set( 'installed_ext_success', '1' ); - url.searchParams.set( 'plugin_name', 'jetpack-ai' ); + url.searchParams.set( + 'plugin_name', + getPluginNameParam( context.pluginsSelected ) + ); window.location.href = url.toString(); }; diff --git a/plugins/woocommerce-admin/client/core-profiler/stories/BusinessInfo.tsx b/plugins/woocommerce-admin/client/core-profiler/stories/BusinessInfo.story.tsx similarity index 100% rename from plugins/woocommerce-admin/client/core-profiler/stories/BusinessInfo.tsx rename to plugins/woocommerce-admin/client/core-profiler/stories/BusinessInfo.story.tsx diff --git a/plugins/woocommerce-admin/client/core-profiler/stories/BusinessLocation.tsx b/plugins/woocommerce-admin/client/core-profiler/stories/BusinessLocation.story.tsx similarity index 100% rename from plugins/woocommerce-admin/client/core-profiler/stories/BusinessLocation.tsx rename to plugins/woocommerce-admin/client/core-profiler/stories/BusinessLocation.story.tsx diff --git a/plugins/woocommerce-admin/client/core-profiler/stories/IntroOptIn.tsx b/plugins/woocommerce-admin/client/core-profiler/stories/IntroOptIn.story.tsx similarity index 100% rename from plugins/woocommerce-admin/client/core-profiler/stories/IntroOptIn.tsx rename to plugins/woocommerce-admin/client/core-profiler/stories/IntroOptIn.story.tsx diff --git a/plugins/woocommerce-admin/client/core-profiler/stories/Loader.tsx b/plugins/woocommerce-admin/client/core-profiler/stories/Loader.story.tsx similarity index 100% rename from plugins/woocommerce-admin/client/core-profiler/stories/Loader.tsx rename to plugins/woocommerce-admin/client/core-profiler/stories/Loader.story.tsx diff --git a/plugins/woocommerce-admin/client/core-profiler/stories/Plugins.tsx b/plugins/woocommerce-admin/client/core-profiler/stories/Plugins.story.tsx similarity index 100% rename from plugins/woocommerce-admin/client/core-profiler/stories/Plugins.tsx rename to plugins/woocommerce-admin/client/core-profiler/stories/Plugins.story.tsx diff --git a/plugins/woocommerce-admin/client/core-profiler/stories/UserProfile.tsx b/plugins/woocommerce-admin/client/core-profiler/stories/UserProfile.story.tsx similarity index 100% rename from plugins/woocommerce-admin/client/core-profiler/stories/UserProfile.tsx rename to plugins/woocommerce-admin/client/core-profiler/stories/UserProfile.story.tsx diff --git a/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/global-styles/variation-container.jsx b/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/global-styles/variation-container.jsx index ab05865014a..60313651ee7 100644 --- a/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/global-styles/variation-container.jsx +++ b/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/global-styles/variation-container.jsx @@ -14,6 +14,11 @@ import { mergeBaseAndUserConfigs } from '@wordpress/edit-site/build-module/compo import { unlock } from '@wordpress/edit-site/build-module/lock-unlock'; import { isEqual, noop } from 'lodash'; +/** + * Internal dependencies + */ +import { trackEvent } from '~/customize-store/tracking'; + const { GlobalStylesContext } = unlock( blockEditorPrivateApis ); // Removes the typography settings from the styles when the user is changing @@ -100,6 +105,24 @@ export const VariationContainer = ( { variation, children } ) => { ), }; } ); + + if ( variation.settings.color?.palette ) { + trackEvent( + 'customize_your_store_assembler_hub_color_palette_item_click', + { + item: variation.title, + } + ); + } + + if ( variation.settings.typography ) { + trackEvent( + 'customize_your_store_assembler_hub_typography_item_click', + { + item: variation.title, + } + ); + } }; const selectOnEnter = ( event ) => { diff --git a/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/sidebar-navigation-screen-color-palette.tsx b/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/sidebar-navigation-screen-color-palette.tsx index b1b10bab2e6..c851175894a 100644 --- a/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/sidebar-navigation-screen-color-palette.tsx +++ b/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/sidebar-navigation-screen-color-palette.tsx @@ -17,6 +17,7 @@ import { unlock } from '@wordpress/edit-site/build-module/lock-unlock'; import { CustomizeStoreContext } from '../'; import { SidebarNavigationScreen } from './sidebar-navigation-screen'; import { ColorPalette, ColorPanel } from './global-styles'; +import { trackEvent } from '~/customize-store/tracking'; import { FlowType } from '~/customize-store/types'; const { GlobalStylesContext } = unlock( blockEditorPrivateApis ); @@ -27,6 +28,14 @@ const SidebarNavigationScreenColorPaletteContent = () => { const hasCreatedOwnColors = !! ( user.settings.color && user.settings.color.palette.hasCreatedOwnColors ); + + function handlePanelBodyToggle( open?: boolean ) { + trackEvent( + 'customize_your_store_assembler_hub_color_palette_create_toggle', + { open } + ); + } + // Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are // loaded. This is necessary because the Iframe component waits until // the block editor store's `__internalIsInitialized` is true before @@ -45,6 +54,7 @@ const SidebarNavigationScreenColorPaletteContent = () => { className="woocommerce-customize-store__color-panel-container" title={ __( 'or create your own', 'woocommerce' ) } initialOpen={ hasCreatedOwnColors } + onToggle={ handlePanelBodyToggle } > diff --git a/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/sidebar-navigation-screen-logo.tsx b/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/sidebar-navigation-screen-logo.tsx index 0a55417170d..10f4c6a5f02 100644 --- a/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/sidebar-navigation-screen-logo.tsx +++ b/plugins/woocommerce-admin/client/customize-store/assembler-hub/sidebar/sidebar-navigation-screen-logo.tsx @@ -297,16 +297,26 @@ const LogoEdit = ( { ); } + function handleMediaUploadSelect( media: { id: string; url: string } ) { + onInitialSelectLogo( media ); + trackEvent( 'customize_your_store_assembler_hub_logo_select' ); + } + if ( ! logoUrl ) { return ( void } ) => (