Commit Graph

63100 Commits

Author SHA1 Message Date
Roy Ho 72f5db9b6d
Change checkbox label to be inline-flex to limit the width to the content (#45603)
* Change checkbox label to be inline-flex to limit the width to the content

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

* Fix changelog entry

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

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-18 13:05:49 -07:00
Maikel Perez dea68ee3e3
Handle taxes not being enabled and customized tax classes (#45531)
* Create and register the woocommerce/product-select-field block

* Replace the tax class radio group block by woocommerce/product-select-field block

* Hide tax fields when taxes are disabled

* Hide tax fields when taxes are disabled in product variations

* Add changelog files

* Fix linter errors
2024-03-18 18:09:03 +00:00
Fernando Marichal ee044a7b50
Remove the "Always show pre-publish checks" from pre-publish panel (#45672)
* Remove "always show prepublish panel"

* Add changelog
2024-03-18 14:00:21 -04:00
Gan Eng Chin 718fe762fa
Add formatting for Cost and Sales numbers in Campaigns card in Marketing page (#44917)
* Return formatted cost and sales price for MarketingCampaigns.

* Display formatted cost and sales number in Campaigns card.

* Use price formatting.

* Format decimal places based on currency.

* Add changelog.

* Fix type issue is useCampaigns.test.ts.

* Use wp_strip_all_tags to respect currency symbol positioning settings.

Without wp_strip_all_tags, the result contains <bdi> element, and it causes browser to show the currency symbol in unexpected unwanted position.

* Fix PHP linting issue.

* Fix tests in useCampaigns.test.ts.

* Use html_entity_decode to remove dangerouslySetInnerHTML usage.

* Remove unneeded code formatting in Campaigns.tsx.

* Add explanation comment for `get_formatted_price`.

* Fix PHP lint error.

* Use map instead of filter to get price format.

* Add code comment.

* Get currency info based on user locale or default locale.

* Use locales in locale-info.php instead of currency-info.php.

Co-authored-by: Bartosz Budzanowski <bartosz.budzanowski@automattic.com>

* Code formatting and fix code comment.

* Fix lint errors.

---------

Co-authored-by: Bartosz Budzanowski <bartosz.budzanowski@automattic.com>
2024-03-19 01:56:08 +08:00
Luigi Teschio f9c0d406ae
CYS - Core: install font when user clicks opt-in (#45580)
* CYS - Core: install font when user clicks opt-in

* remove debugger

* CYS - Core: fix wp-admin page visible when click on start designing

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

* use sendEvent instead of redirect

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

* not show wp-admin after the click on the dialog button

* use sendEventToIntroMachine

* fix font installation

* fix eslint error

* fix install font phase when the iframe is not loaded

* remove not necessary async

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-18 16:49:41 +01:00
Fernando Marichal d69ceaa0a1
Add e2e tests for Organization tab (#45532)
* Add e2e tests for Organization tab

* Add changelog

* Unfy test
2024-03-18 12:44:45 -03:00
Fernando Marichal 9a2006b7e9
Add tests for variable product (#44818)
* Add toggleProductVariationTour

* Add tests

* Remove commented line

* Add changelog

* Change waitFor

* Add click to field

* Remove toggleProductVariationTour

* Set SKU

* * Add function to disable the variable product block tour

* Isolate variation tests

---------

Co-authored-by: Adrian Moldovan <adim.moldovan@gmail.com>
2024-03-18 11:58:45 -03:00
Maikel Perez 979a3c7b62
Remove 'List price' and 'Sale price' fields from the General tab (#45495)
* Remove 'List price' and 'Sale price' fields from the General tab

* Add changelog file

* Fix e2e tests
2024-03-18 11:54:39 -03:00
Albert Juhé Lluveras d8c23c4e3a
Fix block templates not being rendered in extension taxonomies (#44850)
* Fix block templates not rendering in some circumstances

* Add changelog file

---------

Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
2024-03-18 13:03:18 +01:00
Paul Sealock 12c1a6d206
Launch Your Store: Add status dropdown functionality (#45606)
* Add basic wp dropdown component

* use getAdminLink

* Add styling based on state

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

* update store page only text

* Add better 'for now' comment

* translate links

* remove private repo link from comment

* lint

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-18 17:43:02 +08:00
Chi-Hsuan Huang 63a0d5e57c
Add generic function to determine if URL is a store page (#45299)
* Add is_store_page helper function

* Add changelog

* Update doc

* Update doc

* Revert unneed changes

* Fix test

* Fix lint

* Fix typo

* Add woocommerce_store_pages filter
2024-03-18 16:29:13 +08:00
Alba Rincón 5e8bf7dbd6
[CYS on Core] Align the badge component in the themes intro screen (#45626)
* Use theme color to style the theme badge component

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

* Fix linting errors

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-18 09:17:40 +01:00
Thomas Roberts dd4babfdf8
Ensure address field is in address schema before sanitizing/validating it (#45394)
* Ensure field is on schema before sanitizing/validating against it

* Sanitize the key as a text field if we don't know what it is

* Add changelog

* Revert "Sanitize the key as a text field if we don't know what it is"

This reverts commit 9f5071051c.

* Revert "Ensure field is on schema before sanitizing/validating against it"

This reverts commit 109fbe766c.

* Omit unknown items in sanization

* add test doc block

---------

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2024-03-18 15:00:10 +07:00
RJ dbd577cbd6
add/lys xstate scaffolding (#45548)
* dev: added xstate 5

* add xstate scaffolding for launch your store
2024-03-18 15:44:32 +08:00
Karol Manijak 5a54dd6527
Product Collection: Disable client side navigation if blocks incompatible with Interactivity API are detected (#45435)
* Add dummy Force Page Reload control to Inspector Advanced Control

* Add enhancedPagination attribute that decides if client side navigation is enabled

* Consume the enhancedPagination attribute

* Force client side navigation when incompatible blocks detected

* Dummy util to detect incompatible blocks

* Detect incompatible blocks in the Editor

* Switch to WordPress Interactivity package in Product Collection

* Add initial implementation of the incompatible blocks detection in frontend

* Remove leftover

* Revert to using internal version of interactivity API

* There's no Interactivity store config available in the internal Interactivity implementation so remove it

* Disable client side navigation if the incompatible block is detected

* Add default attribute value

* Switch from enmhancedPagination attribute to forcePageReload

* Fixed some misclicked line order change

* Switch from enhancedPagination to forcePageReload in PHP code

* Apply the correct filter

* Fix the incorrect condition to detect incompatible block

* Initial implementation of orange dot to bring attention

* Cleanup

* Remove the orange dot indicator

* Refactor checking for unsupported blocks

* Add changelog

* Fix PHP lint errors

* Bring back empty line at the end of pnpm-lock

* Bring pnpm-lock.yaml file to original state

* Fix incorrect function call

* Add visibility description to function

* Switch private method to public

* More linted fixes
2024-03-18 08:24:03 +01:00
Matt Sherman 52d300f2a9
Product Editor: Disable description full editor when using an incompatible version of Gutenberg (#45650)
* Check Gutenberg version and prevent full editor use if using a version that causes crash

* Changelog
2024-03-18 02:23:08 -04:00
George Stephanis 3873bac561
Add an action to link sessions to customer ids. (#45146)
Fires an action after a customer has logged in, and their guest session id has been deleted with its data migrated to a customer id. This hook gives extensions the chance to connect the old session id to the customer id, if the key is being used externally.

Fixes #44852
2024-03-15 17:33:10 -07:00
Christopher Allford f5f2bb035a
Product Collection: Added `timeFrame` PHPUnit Tests (#45365) 2024-03-15 16:30:46 -07:00
Bhupesh Mishra 7ded649fa7
Update content used to generate Refunds page (#45292)
Updates the markup used to generate the Refunds page so that it is valid, semantic HTML, which in turn fixes an alignment issue.

Fixes #45213

---------

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
2024-03-15 15:14:00 -07:00
moory-se b13f0b0dcb
Add woocommerce_widget_layered_nav_term_anchor_text filter (#40734)
Adds a new filter to the legacy Active Product Filters widget that allows the attribute names to be modified.

---------

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
2024-03-15 14:49:39 -07:00
jonathansadowski 4d62936479
Remove awaiting triage label from enhancement issues (#45631) 2024-03-15 16:46:50 -05:00
Fernando Marichal 184459b359
Rename ProductTemplate namespace (#45594)
* Rename ProductTemplate namespace

* Add changelog

* Fix loader
2024-03-15 18:05:36 -03:00
Alexandre Lara 21f2a15e97
Product Filter: Price (Beta) block - Disable block interactions within the editor (#45602)
* Disable block interactions within the editor

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-15 17:18:25 -03:00
Alexandre Lara 85ec4a8cc1
Product Filter: Attribute (Beta) block - Fix block preview (#45558)
* Pass isPreview prop to inner blocks of the Product Filter block

* Add logic to render preview block when in Preview mode

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-15 16:27:01 -03:00
Bart Kalisz 1c1dc10958
Blocks E2E: Fix guest user handling in checkout tests (#45624) 2024-03-15 17:23:19 +00:00
Luigi Teschio 25c804ae7c
CYS - Core: fix Product Rating block renders (#45600)
* CYS - Core: fix Product Rating block renders

* add comment

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-15 17:01:56 +00:00
Luigi Teschio e5d33df9ab
CYS - fix warning Tooltip (#45592)
* CYS - fix warning

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-15 16:28:47 +00:00
Seghir Nadir 6016aad6c2
Add unit tests to Checkout Additional Fields (#45499)
* try running tests

* add additional fields unit tests

* add keys back to Cart tests

* add extra checks to unit testing

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

* address feedback

* fix linting issues

* add docblock

* escape errors

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-15 15:02:43 +00:00
Seghir Nadir 0000d754c1
Add snapshot tracking for Checkout additional fields. (#44310)
* add snapshot tracking

* add changelog

* address feedback

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

* update changelog

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

* remove the extra changelog

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-15 14:43:05 +00:00
Ahmed ed3aab14cc
Redirect to WooPayments Connect page in the Payments task (#45540)
* Add get_action_url for Payments task

* Check if plugin active before redirecting to connect page

* Add changelog

* Fix linting issues

* Point payments task to welcome page when WCPay incentive active

* Point WooPayments installed task to Connect page

* Rename WooPayments to payments

* Add from query arg

* Adjust payments task URL logic to account for suggestions logic

* Fix for partially onboarded accounts

* Replace Get paid with WooPayments

* Add new test for unsupported countries

* Add missing api definition

* Add missing baseURL

* Maybe change order of tests to fix failing test

* Revert changes to package.json (error in push)

---------

Co-authored-by: Vlad Olaru <vlad@pixelgrade.com>
Co-authored-by: oaratovskyi <oleksandr.aratovskyi@automattic.com>
2024-03-15 12:08:04 +00:00
Jorge A. Torres d9013d4737
Do not trigger 'pre_update' logic for HPOS option when value remains unchanged (#45604)
* Add changelog

* Do not trigger pre_update logic for HPOS setting when not actually
changing value
2024-03-15 12:46:15 +01:00
Jorge A. Torres 72cb02ac47
Try to account for and re-create backup posts when syncing orders (#45332) 2024-03-15 12:31:14 +01:00
Patricia Hillebrandt 488bb62d82
[CYS on core] Introduce the Transitional page, i2 (#45546)
* Update the transitional page.

* Update icons

* Remove unnecessary div class

* Update the styles for the transitional page.

* remove the editor param

* conditionally display the survey button

* Additional layout changes

* Streamline the classes for the icons

* Import brush and tag from wordpress/icons

* delete the custom icons from Woo as they already exist on wordpress/icons and can be imported from there.

* Update styles for adding support to mobile view.

* Update the lesson-plan icon.

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

* Update e2e tests to account for the changes made to the transitional page.

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-15 12:27:08 +01:00
Néstor Soriano fb32ab6c5a
Exclude the Legacy REST API plugin from the feature compatibility UI (#45610) 2024-03-15 11:44:17 +01:00
Alba Rincón ad8f76b2e9
[CYS] Fix the failed to load resource error in the CYS whenever the current active theme is not TT4 (#45519)
* Install and activate the TT4 before any other step on the loader

* Show the loader while activating the theme

* Try running steps together in parallel

* Try to run install and global styles in the same function

* Handle when the active theme returns null

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

* Add retries and types to fix lint errors

* Fix lint errors

* Fix more lint errors

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-15 11:09:31 +01:00
Matt Sherman c658b1c163
Product Editor: Fix editor crash when clicking in editor margin when summary or description fields are focused (#45608)
* Revert dashboard size (changed in #44166)

* Hide toolbar on blur of text-area

* useClearSelectedBlockOnBlur hook

* Use useClearSelectedBlockOnBlur hook to hide toolbar

* Changelog

* Update packages/js/product-editor/src/hooks/use-clear-selected-block-on-blur/use-clear-selected-block-on-blur.ts

---------

Co-authored-by: Damián Suárez <rdsuarez@gmail.com>
2024-03-15 05:54:34 -04:00
Luigi Teschio 21d4fd7786
CYS - Core: fix wp-admin page visible when click on start designing (#45586)
* CYS - Core: fix wp-admin page visible when click on start designing

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

* not show wp-admin after the click on the dialog button

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-15 08:17:20 +00:00
Alejandro López Ariza 1a8ec1c0c2
Update code freeze GH Actions workflow to upload the woocommerce packages to the R2 bucket on code freeze. (#45393)
* Update code freeze GH Actions workflow to upload the woocommerce packages to the R2 bucket on code freeze.

* Make the job that uploads WooCommerce release packages to the R2 bucket independent from the Slack integration in release-code-freeze.yml workflow.
2024-03-15 08:38:47 +01:00
Seghir Nadir 4be06d8959
Add support for WooCommerce Analytics module in @woocommerce/explat (#45131)
* support running A/B tests in frontend

* add optional chaining

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

* switch to shared variable

* fix tests

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-14 21:43:52 +00:00
Matt Sherman afe0e0724b
Product Editor: Handle loading of product editor when global settings are not available on initial render (#45490)
* Do not pass settings from global down to editor; let BlockEditor handle loading settings itself

* Changelog

* Changelog
2024-03-14 13:02:40 -04:00
Christopher Allford 23a148aa18
Added Result Count Client Navigation (#45556)
Since the product collection block uses the interactivity router,
it reloads the page in the background and replaces sections
with a `data-wc-navigation-id` set. This adds the attribute
to the count block so that it can also live reload regardless
of where it is in the tree.
2024-03-14 09:48:02 -07:00
Niels Lange e91be1a458
Disable checkout menu when checkout block is default (#45538)
* Disable checkout menu when checkout block is default

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-14 15:42:59 +01:00
Nathan Silveira 7fdaf53a88
Match template based on different attributes besides product types (#45454)
* Match template based on different attributes besides product types

* Do not hard-code postType

* Refactor code

* Handle isResolving from useEntityRecord

* Refactor useProductTemplate

* Handle null value in `useProductTemplate`
2024-03-14 10:51:42 -03:00
Thomas Roberts 5cbb0ad5bf
[Experimental] Add E2E tests for Additional Checkout Fields (#43836)
* Add additional-checkout-fields-test-helper wp-env plugin

* Ensure Checkout page waits for email to be visible before filling

* Handle additional fields in checkout page utils

* Add test for filling additional checkout fields

* Add additional check for gov-id validation

* Close context used for plugin-checking

* Update types for additional fields to be key/value objects

* Check billing gov-id is different to shipping one

* Move additional fields plugin to inline with checkout tests

* Use additional fields plugin from local dir

* Await email input to check Checkout block is loaded

* Add test to verify error message shows when leaving a field blank

* Update comment

* Add test for checking/unchecking checkboxes

* Update check in additional field test plugin

* Change fields multiple times in one test

* Add server-side validation tests

* Get exact matches for checkout form fields

* Remove unnecessarily translated strings

* update hook in test plugin to compare to confirmation gov id

* Fill in gov ID confirmation field

* Register a field of each type in each location

* Don't validate field unless both are filled

* Fill additional fields and check their values

* Fill additional fields

* Check select values in order confirmation

* Change the values of all field types multiple times

* Make checkout wait until not calculating before submitting

* Update tests to use all additional field types

* Blur after editing select box

* Add customer area checks

* Check shipping isn't calculating before submitting

* Add merchant-side tests for additional checkout fields

* Ensure customer data is done updating before submitting

* use waitForFunction to check for updating shipping

* Add changelog

* Ensure fields are blurred before pressing button

* Update validation error check

* Add test for logged out shopper

* make specific function to wait for checkout to be finished updating

* Add test to ensure fields are saved across orders

* Add sanitize and validate callbacks to gov id fields

* Make purchase type select field required

* Add sanitization test

* Use experimental function in test plugin

* Add standalone sanitization filter test

* Update testing plugin to use new and renamed filters

* Fix typo

* Move empty value test to logged out shopper block and check empty val

* Update tests to include tests for new validation/sanitization filters

* Add verifyAdditionalFieldsDetails function to checkout page

* Use new verifyAdditionalFieldsDetails function to improve readability

* Update second test to use new function to improve readability

* Update third test to improve readability

* Update fourth function to improve readability

* Update fourth test to improve readability

* Update guest shopper test to be more readable

* Update helper function to only return value not assert

* Remove check causing test to fail in CI

* Make check for guest shopper same as logged in

* Move guest shopper tests to their own file

* Ensure unchecking checkbox works OK
2024-03-14 13:39:30 +01:00
Niels Lange a7383579be
Allow usage of block notice templates when using classic themes (#45164)
* Allow block notice templates in classic themes

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

* Fix e2e constants file

* Improve inline comments

* Add filter and enhance e2e tests

* Adjust test names

* Adress PHP lint errors

* Adress PHP lint errors

* Adress PHP lint errors

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-14 19:33:33 +07:00
RJ 59635fb4c8
add: update onboarding task list copies and illustrations (#44854) 2024-03-14 15:20:31 +08:00
Patrick Rauland 72f75edf58
Adding accessible markup to sale price. (#44413)
* Adding accessible markup to sale price. See #31099

This PR adds accessible markup to the sale price.

A user who only uses screen reader software can now hear and understand the original price as well as the current price.

This is important for accessibility.

Full issue: https://github.com/woocommerce/woocommerce/issues/31099

* Improving sale price string formatting & localization #31099

This PR merges in feedback from the WooCommerce team.

* Improving string translation & output. Giving RTL languages more customization with the price in the translatable string.
* Formatting regular price & sale price at the top and then inserting into the HTML below. This prevents some sloppy logic where you might print out a blank del or ins tag.

* Swapping esc_html & sprintf #31099

Reversed the esc_html() and sprintf(). This is intentional because if translations accidentally include some HTML, that could break things.

Also, stripping HTML tags in $formatted_regular_price so that the end result in the screen-reader-text span is just plain text.

* Adjusting white space #31099

Mostly removing white space for the lint checker

* Adding translator comments #31099

Adding translator comments for lint

* Add changelog

* Fix some PHPCS violations

* Fix unit tests

* Adjust E2E test

---------

Co-authored-by: Jorge Torres <jorge.torres@automattic.com>
2024-03-13 20:43:44 -03:00
Jorge A. Torres b3c328d4e4
[HPOS CLI] Add support for backfilling specific properties or metadata (#45171)
* `wc hpos diff` command enhancements

* Add support for partial backfills to LegacyDataHandler

* Add unit tests

* Add support for partial backfills to `wp wc hpos backfill` CLI tool

* Add changelog

* Augment update_order_from_object() with args parameter

* Implement update_order_from_object() for HPOS

* Simplify partial backfill logic in LegacyDataHandler

* Move prop name validation to legacy data handler

* Apply changes to order before passing to backfill functions

* Simplify update_order_from_object() in HPOS datastore

* Simplify order update from object across datastores

* Undo change

* Minor fix for CPT version (which only takes order differences into account)

* Improve readability around ‘woocommerce_orders_table_datastore_should_save_after_meta_change’ filter

* Commit docblock suggestion

* PHPCS fixes

* Enhance unit test
2024-03-13 19:29:49 -03:00
Maikel Perez 0fc75c5148
Remove Custom Fields for New Product Editor (#45493)
* Add remove custom field for the new product editor

* Add changelog file

* Show add button when the custom fields are empty

* Ensures to always convert the metas into a string array since it can be anything

* Add changelog file
2024-03-13 19:16:12 -03:00
Barry Hughes 3f1dbd5b13
Switch from "invoice" to "order details" in our emails. (#45395)
* Switch from "invoice" to "order details" in our emails.

* Revise default order details email subject text.

* Revise default order details header text.

* Bring E2E check up-to-date with latest text revision.

* Update API tests to match order detail email changes.

* Fix typo

---------

Co-authored-by: Jorge Torres <jorge.torres@automattic.com>
2024-03-13 19:34:39 +00:00