Commit Graph

62765 Commits

Author SHA1 Message Date
Alexandre Lara 0654fa1997
Product Gallery block: Announce Pop-Up Opening with Voiceovers (#44332)
* Add aria attributes to product gallery pop-up

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Fix Interactivity API store import

* Announce Dialog opening with VoiceOver

* fix php cs lint error

* Remove unnecessary data-wc-watch directive from Product Gallery block

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-06 14:28:33 -03:00
Mike Jolley 45923dc5f3
[Experiment] Handle customer session meta data (#44181)
* Update data store to bail if there is no customer ID

* Use WC_Data meta functions

* Save and load meta in session class

* Customer session handling

* CheckoutFields - only persist customer data to accounts

* Inline docs for session handling

* Handle meta data in session

* Document wc->customer inline

* Store only additional fields in session

* Prevent notice in WC_Data

* Organise keys and remove duplicates

* Correctly save fields to account

* Fix notices on checkout

* Remove unnecessary diff

* Changelog

* Go back to previous way to loading session handler to avoid 3rd party breakage

* No need to track is_session

* white space

* Remove changes to customer data store

* Update class-wc-customer-data-store.php

* Populate client from additional values from api

* Additional fields in session

* Add woocommerce_customer_allowed_session_meta_keys hook

* Put back legacy keys for tests

* Remove key fixes

* Don't save additional fields to customer object

* Remove duplicate init call

* Only persist contact fields
2024-02-06 15:16:00 +00:00
Matt Sherman 68247d13de
Product Editor: Export recent SlotFills as __experimental (#44285)
* Make header slotfills experimental

* Make variation quick update menu items experimental

* Changelog
2024-02-06 09:33:24 -05:00
Alba Rincón fa9d68eed6
[CYS] Fix - Add back parent machine to the `designWithNoAiStateMachineDefinition` child machine option (#44397)
* Add back parent machine to the designWithoutAi child machine option

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-06 14:28:22 +01:00
github-actions[bot] e373a69209
Delete changelog files based on PR 43834 (#44399)
Delete changelog files for 43834

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-02-06 20:33:57 +08:00
Albert Juhé Lluveras fa9d42be4f
Add template title and description on 'get_block_template' hook (#44254)
* Simplify add template title and description

* Add template title and description on 'get_block_template' hook. Fixes #42221

* Add tests

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Fix test in template parts

* Use BlockTemplateUtils::template_has_title when possible

* Add test also when saving the default WooCommerce template

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-06 13:33:38 +01:00
Alexandre Lara b4928ed46a
Product Gallery block: Enable keyboard navigation for thumbnails (#44236)
* Add ability to select thumbnails using keyboard

* Add ability to open the Product Gallery pop up using the keyboard

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Fix outline border not showing on Thumbnails on some browsers

* Prevent firefox browser from focusing on UL tag of the Large Image block

* Enable usage of 'Space' and 'NumpadEnter' keys to navigate between the thumbnails

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-06 08:55:03 -03:00
github-actions[bot] a0980a1178
Delete changelog files based on PR 44359 (#44396)
Delete changelog files for 44359

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-02-06 19:52:11 +08:00
Mike Jolley 35630bb52b
Update combobox validation message to be more generic (#44229)
* Update combobox validation message

* Changelog
2024-02-06 11:51:09 +00:00
Luigi Teschio 159d47434b
[CYS - Core] Before installing the fonts, ensure that the font library is available (#44358)
* Avoid duplicating the `/onboarding/themes/recommended` request

* Use `fetchActiveThemeHasMods` in the `fetchIntroData` function

* Add changefile(s) from automation for the following project(s): woocommerce

* WIP

* WIP

* WIP

* WIP

* Move the `activeThemeHasMods` to outside the `intro` key, since it's used also in other places

Refactor, add comments and cleanup

* Remove unnecessary log

* Set the `activeThemeHasMods` on the parent window to true after the design step to avoid having to fetch it again

* Add changefile(s) from automation for the following project(s): woocommerce

* Remove unused import

* Add comment and ref to the new issue

* CYS - Core: fix flow when Font Library is not installed

* Add changefile(s) from automation for the following project(s): woocommerce

* improve naming

---------

Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-02-06 11:28:26 +01:00
Sam Seay 5f00e2f87a
[Experimental] Add e2e tests for the rating filter block (#44192) 2024-02-06 23:22:21 +13:00
Christopher Allford a90b044e73
Updated PNPM Lock File (#44382)
* Updated Lock File

* Add changefile(s) from automation for the following project(s): woo-ai

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-06 09:33:58 +00:00
Paul Sealock 73f098b563
tools/create-extension: Remove old tool (#44374)
remove tools/create-extension
2024-02-06 10:47:31 +13:00
Maikel Perez 26bcbb0417
Add an empty state to the variations table when there are no options added yet (#44163)
* Create variation empty state when no variable attributes are asigned to the product

* Add changelog file

* Remove the Add new button when a custom empty state is set

* Conditionally invalidate resolution before requesting a new variations page
2024-02-05 18:00:37 -03:00
Matt Sherman 7e7b78f943
[create-product-editor-block] Fix product editor block registration (#44194)
* Use registerProductEditorBlockType

* Changelog

* Update changelog to provide more detail
2024-02-05 15:59:39 -05:00
James Kemp 113a7caa7d
Update check-if-woo-is-active.md (#44306)
* Update check-if-woo-is-active.md

Added more reliable methods to check if WooCommerce is active

* Update check-if-woo-is-active.md

Update code examples to use WooCommerce hooks.

* Update check-if-woo-is-active.md

Update wording in some sections

* Update docs/extension-development/check-if-woo-is-active.md

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

* add docs manifest

---------

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
Co-authored-by: Jacklyn Biggin <hi@jacklyn.dev>
2024-02-05 20:08:30 +00:00
Alexandre Lara 560f0e933d
Product Gallery block: Prevent block error when a user inputs a decimal number for the Number of Thumbnails setting (#44282)
* fix error on decimal input for the Number of Thumbnails setting

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-05 15:17:35 -03:00
Damián Suárez 35b5677860
[Product Block Editor]: fix the top area for the dashboard (#44370)
* fix the padding-top for the dashboard

* changelog
2024-02-05 15:11:21 -03:00
github-actions[bot] b764167f11
Delete changelog files based on PR 44283 (#44368)
Delete changelog files for 44283

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-02-06 00:44:36 +08:00
Mike Jolley fa01e1b541
[Experimental] Add option to `show_in_order_confirmation` for additional checkout fields (#44314)
* Improve readability of register_checkout_field

* show_in_order_confirmation

* changelog
2024-02-05 16:19:34 +00:00
Justin Palmer cd7f429bc1
Remove Customer Order Count from Order Attribution checkout data (#44359)
* Remove Customer Order Count from Checkout Tracks data
2024-02-05 16:06:49 +01:00
Alba Rincón a943de24fa
[CYS] Avoid duplicating requests during the CYS flow (#44179)
* Avoid duplicating the `/onboarding/themes/recommended` request

* Use `fetchActiveThemeHasMods` in the `fetchIntroData` function

* Add changefile(s) from automation for the following project(s): woocommerce

* WIP

* WIP

* WIP

* WIP

* Move the `activeThemeHasMods` to outside the `intro` key, since it's used also in other places

Refactor, add comments and cleanup

* Remove unnecessary log

* Set the `activeThemeHasMods` on the parent window to true after the design step to avoid having to fetch it again

* Add changefile(s) from automation for the following project(s): woocommerce

* Remove unused import

* Add comment and ref to the new issue

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
2024-02-05 12:36:33 +01:00
Mike Jolley d858d22930
[Experimental] Surface custom fields in My Account pages (#43823)
* Get default attributes on front end

* Remove console log

* Show notice about 0 registered fields in editor

* Do not show block in editor if no fields are registered

* Wrapper block

* Update webpack config

* Wrapper block type definition

* Separate fields from the hook block

* Hide when no custom fields exist

* Address and contact fields

* Shared form fields in settings

* Revert render_content to original

* Allow definition of unchecked value which includes a hidden field

* Move woocommerce_edit_account_form above password section, which should be last.

* My Account hooks

* Move account handling to service class

* Show fields in order details

* Remove unused prop

* remove comment

* Hook docblocks

* Add changefile(s) from automation for the following project(s): woocommerce

* Add note about nonce verification

* wp_kses_post for label

* fix nonce linting

* Add docblock to hook

* Bump template version

* Persist contact fields to customer

* Change action name

* Add changefile(s) from automation for the following project(s): woocommerce

* Changelog

* Margin fix on order confirmation for older core themes

* Bump version tags

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-02-05 10:59:17 +00:00
Thomas Roberts 877a16096c
Update notice templates display logic to show updated templates in block themes only (#44283)
* WIP

* Add e2e tests for regular and custom templates

* Allow theme *.zip files for testing purposes

* Bump template versions

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Update comments in bash script

* Remove child themes - they will be installed from the zip

* Fix lint error re spacing

* Bump template versions

* Update PHP unit tests for classic style notices

* Revert "Remove child themes - they will be installed from the zip"

This reverts commit 98b1036616.

* Remove classic cart check in test

* Revert "Add e2e tests for regular and custom templates"

This reverts commit ef531854f9.

* Revert test-related changes

* Remove report

* Prevent phpcs warning for not escaped output

It is escaped in the wc_get_notice_data_attr function

* Revert notice changes to core E2E tests

* Update shopper add to cart e2e test to use correct notice class

* Update checkout block E2E test to use correct notice class

* Fix typo

* Update test to check for correct notice classes

* Update notice comment

* Re-apply block template overrides

* Consistent notice check with other templates

---------

Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: github-actions <github-actions@github.com>
2024-02-05 11:50:15 +01:00
Albert Juhé Lluveras 097bd5c8f5
Add e2e tests for password-protected Single Product block template (#44304)
* Add e2e tests for password-protected Single Product block template

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Fix tests

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-05 10:47:18 +01:00
Sam Seay 497d4b8a25
Remove class scoping and just use text to find elements (#44289) 2024-02-05 14:27:54 +13:00
Hsing-yu Flowers 24ea7a1848
Move the guest should verify email logic to the order class (#43834)
* Move the guest should verify email logic to the order class

* Refactor for readability and remove redundant code

* Use billing email variable

* Remove white space

* Rename and move email_is_valid to users utils

* Use global WC_DateTime and WC_Session classes

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-02 18:03:07 -08:00
Damián Suárez 4492698340
[Product Block Editor]: use Label component to render Textarea field block label (#44222)
* use Label to render base control label

* changelog
2024-02-02 18:57:41 -03:00
Damián Suárez 207e8de73d
[Product Block Editor]: add plain and rich text mode to the Textarea field block (#44191)
* introduce `mode` attribute

* move block props to wrapper el

* render plain text mode

* minor const name change

* changelog

* add toolbar buttons only in rich-text mode

* set rich-text mode as default
2024-02-02 16:04:01 -04:00
Damián Suárez 951e5ecce6
[Product Block Editor]: redefine the app dashboard size (#44166)
* chnages how to define the editor dashboard size

* remove onBlur stuff from summary block

* add a @todo note about dashboard padding top

* changelog
2024-02-02 15:57:28 -04:00
Damián Suárez f1236696d9
[Product Block Editor]: use Textarea block in the variation description field (#44151)
* use text-area for variation desctiption field

* changelog

* tweak // Translators string

* use var to define textarea border color

* remove optional from description label
2024-02-02 15:50:36 -04:00
Jonathan Lane f93dcc292c
Misc e2e test fixes (#44325)
* Change local workers to 1

* Add helpers for adding shipping

* Add shipping zone before order

* Fix tax assertion

* Fix assertion

* Tightened up locators

* Dismiss tour if visible

* Back to function

* Update tax label

* Enable shipping

* Update locator

* Changelog

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-02-02 10:17:32 -08:00
Thomas Roberts 8ac959f4e7
[Experimental] Prevent string-based sanitization on non-string field types in additional checkout fields (#43999)
Co-authored-by: github-actions <github-actions@github.com>
2024-02-02 10:16:02 -08:00
Brent MacKinnon 16f2f9024a
Adjusting internal links within docs folder (#44288)
* Adjusting internal links within docs folder

* Update docs-manifest.json

* Fix linting + update manifest

---------

Co-authored-by: Jacklyn Biggin <hi@jacklyn.dev>
2024-02-02 15:57:18 +00:00
Luigi Teschio 5937b3dec1
CYS - Core: Font Library: disable the installation of the fonts (#44311)
* avoid crash when Gutenberg is not installed

* add issue link

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-02 16:34:33 +01:00
Álvaro Thomas 5fd4176ad0
[e2e tests] Check email for completed order (#44186)
* Add completed order email test

Add test structure to verify completed order email arrival and content

* Verify Email JSON Content

Parse email content in JSON format

* Record email content in JSON

Record email content in JSON

* Update emails completed order checks

Added checks to verify the content of completed order's emails

* Add changefile(s) from automation for the following project(s): woocommerce

* Update email content const & remove duplicated test

Updated with a new const to record email content const and removed duplicated assertion.

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-02 16:13:16 +01:00
nigeljamesstevenson aa349b31a7
Update test-assistant-issue-review.yml 2024-02-02 14:17:42 +00:00
nigeljamesstevenson 40921d457d
Update test-assistant-issue-review.yml 2024-02-02 14:17:18 +00:00
nigeljamesstevenson 7c466218aa
Create test-assistant-issue-review.yml 2024-02-02 14:00:25 +00:00
Maikel Perez eaa791f7da
Hide Downloads section under Toggle for product variations (#44152)
* Create DownloadableProductTrait for common downloadable blocks creation

* Use DownloadableProductTrait in SimpleProductTemplate

* Use DownloadableProductTrait in ProductVariationTemplate

* Remeber downloadable files in product variations

* Add changelog file

* Fix php linter error

* Unlink downloads and downloadable product props so they can be managed separately

* Remove invalid margin bottom from the uploader label

* Add changelog file
2024-02-02 10:04:42 -03:00
github-actions[bot] f383284ba6
Delete changelog files based on PR 44207 (#44302)
Delete changelog files for 44207

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-02-02 12:31:53 +01:00
github-actions[bot] 11daa0d5ee
Delete changelog files based on PR 44178 (#44300)
Delete changelog files for 44178

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-02-02 11:45:54 +01:00
github-actions[bot] d7a294cb32
Delete changelog files based on PR 44174 (#44293)
Delete changelog files for 44174

Co-authored-by: WooCommerce Bot <no-reply@woo.com>
2024-02-02 09:58:46 +01:00
Jorge A. Torres ececdf0c1b
Add background HPOS cleanup process (#43293)
* Make legacy data cleanup more performant

* Add legacy data cleanup processor

* Make legacy cleanup available in the UI

* Add some validation around data synchronizer / data cleanup settings

* Add some error handling

* Add changelog

* Make CI happy

* Improve option handling

* Add unit tests

* Partially revert “real time” cleanup

* Re-schedule cleanup on ‘shutdown’ if necessary

* Revert CSS changes for HPOS settings screen

* Revert JS changes for HPOS settings screen

* Allow tools to display a status text

* Move order cleanup to Tools

* PHPCS fixes

* Extend bail early protection to other batch processing functions

* Log and stop cleanup when a full batch fails

* Make PHPCS happy
2024-02-02 12:09:08 +05:30
Manish Menaria 1d8007b822
Product Collection: Return to top after page change (#43817)
* Initial working version

* Update scrolling behavior in product collection block frontend

This commit updates the scrolling behavior in the product collection block's frontend script.

Previously, the code focused on the first anchor or button within a product collection block. This approach was taken to maintain accessibility and ensure that the focused element was scrolled into view. However, this behavior has been changed to improve the user experience.

The updated code now directly scrolls to the first product in the collection. This is achieved by selecting the product using a new selector that targets the `.wc-block-product` class within the `.wc-block-product-template` of the specified `data-wc-navigation-id`. Once the product is selected, the `scrollIntoView` method is used with smooth behavior and start block alignment, offering a more visually appealing scroll effect.

This change enhances the user experience by smoothly directing attention to the beginning of the product collection, making it easier for users to browse products.

* Remove code related to animation

* Fix the issue related to pagination block rendering

- I have improved the code by breaking it into smaller functions
- Added unique `data-wc-key` to each anchor tag

* Enhance Product Collection Block with Interactive Prefetching

* Refine Prefetch Logic & other improvements

This commit further refines the prefetch logic and interactivity in the Product Collection block. It focuses on enhancing code clarity and improving the prefetch behavior based on user interactions.

Key changes include:
1. Renamed 'isPrefetchNextAndPreviousLink' to 'isPrefetchNextOrPreviousLink' in ProductCollectionStoreContext for better readability and accuracy.
2. Modified the scrollToFirstProductIfNotVisible function to accept a wcNavigationId as a parameter instead of a reference
3. Introduced checks for the existence of wcNavigationId in scrollToFirstProductIfNotVisible to prevent unnecessary executions.
4. Updated comments throughout frontend.tsx for enhanced clarity, explaining the prefetch logic and its triggers in detail.
5. Adjusted the logic in the navigate and prefetch functions to align with the new context structure and prefetch strategy.
6. In ProductCollection.php, updated data attributes to align with the revised prefetch strategy.
7. Refined the attribute setting in process_pagination_links function to correctly implement the updated interactivity and prefetch logic.

These changes aim to optimize the prefetch functionality, reduce unnecessary prefetching on initial page load, and ensure a smoother and more efficient navigation experience within the Product Collection block.

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Improve comments

* Use wp_json_encode for data-wc-interactive attribute

This commit updates the `ProductCollection` class to use `wp_json_encode` for setting the `data-wc-interactive` attribute value. Previously, the attribute value was hardcoded as a JSON string. Now, by utilizing `wp_json_encode`, we ensure the JSON encoding is handled correctly by WordPress standards, enhancing readability and maintainability of the code.

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-02 12:07:29 +05:30
Sam Seay 6da45f6bed
[Experimental] Add e2e tests for the new active filter block (#44190) 2024-02-02 15:08:01 +13:00
Brent MacKinnon 2249b7a4c5
moving webhooks doc (#44098)
* moving webhooks doc

* Move webhooks doc to building a woo store

It's not really extension development related

* Update docs manifest

---------

Co-authored-by: Jacklyn Biggin <hi@jacklyn.dev>
2024-02-01 19:56:34 +00:00
Barry Hughes ded33b7049
Update JS Cookie library to v3.0.5. (#43686) 2024-02-01 11:36:12 -08:00
Brent MacKinnon 1bd5ab738a
updating link on wccli readme (#44100)
* updating link on wccli readme

* Fix links that were incorrect

* Update docs manifest

---------

Co-authored-by: Jacklyn Biggin <hi@jacklyn.dev>
2024-02-01 19:10:39 +00:00
Luigi Teschio ae1503f588
CYS - AI flow: fix regression - no fonts visible (#44280)
* CYS - AI flow: fix regression - no fonts visible

* Add changefile(s) from automation for the following project(s): woocommerce

* Trigger Build

* fix lint error

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-01 18:44:28 +00:00