Commit Graph

21306 Commits

Author SHA1 Message Date
Vladimir Reznichenko 444f105eba
CI: Re-group PHPUnit jobs. (#49443)
In this PR, we reduce build time for REST API tests (lightweight build) and regroup a bit of PHPUnit jobs (fewer jobs with the same coverage).
2024-07-15 13:39:07 +02:00
Mike Jolley 13d3e11d40
Checkout: Add password field to create account form (#48985)
* Add site title to account checkbox

* Add customer_password support to Store API

* Hide password nag if defining own password

* Add woocommerce_registration_generate_password option to block assets

* Change login prompt to just "log in"

* Add default styling to password inputs

* Reset line height for checkbox inputs

* Add customer password to store

* Add password field to contact information block

* Handle customer password in checkout processor

* Styling for new elements

* Update tests so they match new create account label

* Update log in link in tests

* Add e2e tests for password field

* Add validation message and fix rendering when account is required

* Changelog

* Add missing api to tests

* Remove console log

* rerender checkout

* Update log in link in test

* Adjust validation so we can change the label in messages with custom callback

* Use queryByText in test

* Make sure password generation is on in tests

* Create password if provided password is empty

* Skip "Place order" button translation test

* Revert "Skip "Place order" button translation test"

This reverts commit 7aed6137e88cdb3577f74f6f0c05258b531ed534.

* Update plugins/woocommerce-blocks/assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/block.tsx

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Update plugins/woocommerce-blocks/assets/js/data/checkout/reducers.ts

Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>

* Comment empty condition

* Update CSS classnames

* Return null in CreateAccountUI if nothing to display

* Linting: Return return param

* Document $password param

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
2024-07-15 11:43:02 +01:00
Ian Yu-Hsun Lin c269a86efc
Fix variation name in WC Analytics Variations report (#49440)
* Show "Any [ATTRIBUTE_NAME]" for variation product if attribute is empty

Like that in the product variation edit page:
35a0ee2e8a/plugins/woocommerce/includes/admin/meta-boxes/views/html-variation-admin.php (L36)

* Add changelog
2024-07-15 16:55:06 +08:00
Miguel Pérez Pellicer e1b314229c
[WooCommerce Analytics] Fix: Show variations only for the selected product's variations (#49470)
* Allow to filter variation per its parent.

* Changelog

* Lint

* Lint

* Remove unused mapping
2024-07-15 12:43:52 +04:00
Vlad Olaru 1bc6e3e0ae
Fix specs rule evaluation logging not working (#49167)
* Better docs and minor refactoring for the EvaluationLogger

* Add support for logger args to EvaluateSuggestion methods

* Provide evaluation logger args to EvaluateSuggestion methods

* Improve docs and use short array syntax

* Log when spec rule is not an object

* Sanitize logger arguments for sanity

* Don't use short array syntax because of linter

* Lint fixes

* Add changelog

* docs: Spacing and alignment

* refact: Sanitize only the suggestion tile

* Add filter for rule evaluator logging enabled

* test: Add tests for suggestion evaluation logging

* test: Replace deprecated withConsecutive

* Simplify logic

* test: Cleanup

* test: Add rule logging tests for shipping partnerships

* Lint fixes

* Lint fixes
2024-07-15 10:24:14 +03:00
Alba Rincón 6baddf6cd1
Update the `Customer Account` block icon for the line style (#49401)
* Update the customer icon for the line style

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

* Import Circle and Path and fix attribute case

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-15 08:53:47 +02:00
Paulo Arromba f3cafa2f17
Fix Store API response for very large price amounts (#49361)
* Fixed overflow when formatting price for Store API responses

* Added explanation comment.

* Added changelog.

* Linting.

* Ensure wc_format_decimal doesn't return decimal points and trims .00

* Update comment.

* Removed unnecessary rounding modes.

* Updated comment.

* Updated comment.

* Updated comment.

* Updated Unit Tests.

* Lint.

* Fix tests.

* Re-add rounding modes.

* Prevented a fatal if an array is supplied to the method. This was the old behaviour, although it will produce erroneous prices, but before we let this throw a fatal we need to warn devs and track usage.

* Added doing_it_wrong() for unexpected types for $value arg.

* Early return, removed translation, renamed unit test method.

* Added expect notice to unit test.

* Add further tests to rounding modes.

* Renamed $mock_formatter. This is not a mock.

* Fixed tests and added provider for types.

* Linting.
2024-07-15 02:03:33 +01:00
Sam Seay 9fa32b4f2b
Migrate StateInput, CountryInput and custom fields to native `<select>` (#48180) 2024-07-12 21:17:54 +00:00
Julia Amosova c31e274616
Update stable tag to 9.1.2 (#49501)
woorelease: Update stable tag to 9.1.2

Co-authored-by: Julia Amosova <juliaamosova@ultraw-mbp.mynetworksettings.com>
2024-07-12 15:57:38 -04:00
Néstor Soriano 0f2f331b90
Check if parent product exists when creating attribute lookup data for variations (#49474)
* Check if parent product exists in LookupDataStore::create_data_for_variation

If it doesn't exist it will thrown an exception, which will be
catched by the caller an a proper log entry will be written.
Previously a fatal error would be thrown.

* Add changelog file

Fixes #33730
2024-07-12 12:04:39 -07:00
Veljko V 4b58049979
Fix logo picker e2e tests with flaky wait for response (#49451)
* Fix flaky waiting for response in logo picker e2e test

* Add changelog

* Remove wait for response header

* Wait for success message

* Relogic logo picker e2e test
2024-07-12 11:31:55 -07:00
Corey McKrill aa1eae6c17
Docs: Updates to the Logging doc (#49430)
* Docs: Updates to the Logging doc

This tweaks the wording in a few places and adds
a new suggestion under the "Customizing" header
about changing the directory where log files are
stored.

* Update docs manifest
2024-07-12 11:11:08 -07:00
Naman Malhotra 43d9f10200
Update Action Scheduler to 3.8.1 (#49483) 2024-07-12 08:44:00 -07:00
Jorge A. Torres 79172bca82
Trigger doing_it_wrong for CPT order queries with HPOS query args (#47457)
* Trigger doing_it_wrong for CPT queries using HPOS-only args

* Add changelog
2024-07-12 16:06:14 +01:00
Miguel Pérez Pellicer f8f4cbf826
[WooCommerce Analytics] Adapt Order Report CSV Export structure to the one used in the client side. (#49356)
* Equalize data in Order export with data in Client side CSV export

* Add changelog

* USe Net total without format
2024-07-12 19:01:49 +04:00
Mike Jolley e0c62dce79
Extensibility: Format currency config so it can be consumed more easily (#48727)
* Export pre-formatted SITE_CURRENCY object from settings

* Fallback to SITE_CURRENCY

* Changelog

* Fix typedef

* Update mocks

* Inject site currency into cart preview data

* Update test

* Add currency formatting to preview data

* Mock currency in tests

* More currency mocking
2024-07-12 14:24:22 +01:00
Vlad Olaru 892c44a27a
Update APMs BNPL suggestions when WooPayments can handle them (#49234)
* Update BNPLs default payment gateway suggestions

* Update default payment gateway suggestions priorities

* docs: Fix return type

* Fix Affirm default payment gateway visibility rules

* refact: Introduce WCPay rules

* Add WCPay BNPL pseudo-gateway recommendation

* Replace deprecated prop

* Add WCPay BNPL suggestion component

* Remove short array syntax

* Add svg for default WCPay BNPL suggestion

* Update Payment Gateway Suggestions with WCPay BNPL

* test: Update Payment Gateway Suggestions tests

* Add changelog

* Remove needles rule for payment gateways suggestion

* test: Fix payment gateways suggestions test

* Only hide Klarna if in a WooPayments eligible country

* MX is not a WooPayments-eligible country

* Make sure we don't inadvertently promote WCPay BNPL to non-eligible countries

* Lint fixes

* Escape default payment gateway suggestions translatable strings

* Revert translatable strings escaping as it has too many implications

* Revert char change to avoid invalidating translations

* Lint fixes
2024-07-12 12:40:24 +03:00
Alba Rincón 45486bc1c7
CYS - Update the full composability layout to match designs (#49303)
* Update the full composability layout to match designs

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

* Fix lint errors

* Remove unnecessary important

* Update colors

* Fix empty logo color

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-12 09:53:10 +02:00
Alba Rincón 0d76b21f39
CYS - Fix marking the CYS task as completed only by accessing the Intro page (#49374)
* Improve the conditions to check if the customize store task should be marked as completed

Before we were relying in a json string to check if the global styles were the default,
but that string had a hardcoded version. Since the version has changed this was failing.
We are now checking that the global style json only has two keys: version and
isGlobalStylesUserThemeJSON, regardless of their values.

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-12 09:52:23 +02:00
RJ b6ed6223bd
fix: LYS success page overflows (#49127)
* fix: LYS success page overflows

* css

* Update plugins/woocommerce-admin/client/launch-your-store/hub/styles.scss

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

---------

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
2024-07-12 14:12:45 +08:00
Vladimir Reznichenko 4ce23d5343
Monorepo: fix linting script (side-effects from enabling strict mode earlier (#49436) 2024-07-12 07:49:07 +02:00
Sam Seay e59decd222
Clean up unused files and dependencies from when WooCommerce Blocks was merged into the monorepo (#49319) 2024-07-12 16:40:07 +12:00
Julia Amosova 35a0ee2e8a
Update stable tag to 9.1.1 (#49429)
woorelease: Update stable tag to 9.1.1

Co-authored-by: Julia Amosova <juliaamosova@ultraw-mbp.mynetworksettings.com>
2024-07-11 18:31:47 -04:00
Ivan Stojadinov 9e3eb2d024
[e2e] Add support for WPCOM site (#49403)
* Add support for WPCOM site

* Add support for WPCOM site

* Change the default Pressable site

* Change the default Pressable site

* Add .env.enc for WPCOM site

* Add .env.enc for WPCOM site #2

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

* Update changelog

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

* Update changelog

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
2024-07-11 23:37:10 +03:00
Adrian Moldovan 7e86b23761
[blocks e2e] Update config for retries and trace retention (#49416)
* Update config for retries and trace retention

* Add changelog

* Update maxFailures
2024-07-11 11:14:14 -07:00
github-actions[bot] cb85e9265f
Delete changelog files based on PR 49404 (#49422)
Delete changelog files for 49404

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-07-11 13:37:54 -04:00
Corey McKrill 4d68cd486e
PluginUtil: Add method to get active valid plugins (#48709)
* PluginUtil: Add method to get active valid plugins

When getting a list of active plugins directly from the options table,
you can run into an error if you try to then access one of the plugin
files if it doesn't actually exist. WP Core has a method that verifies
that the files exist before returning the list. But it's marked as a
"private" method, which means it could change and break backcompat.
That seems very unlikely, though, so we're using the method (it was
already in use actually), but putting in some safeguards so we can
detect if a backcompat issue arises.

Fixes #48132

* Modify to accommodate multisite
2024-07-11 18:18:33 +01:00
Niels Lange 79786c5443
Revert #46362 (#49404)
* Revert #46262

* Remove pnpm-lock.yaml

* Revert "Remove pnpm-lock.yaml"

This reverts commit df4b87940d.

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

* Revert pnpm-lock.yaml

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-11 19:00:49 +02:00
Jorge A. Torres aeab61838c
Change case for CLIRunner namespace to meet autoloader expectations (#49390)
* Correct case in `CLIRunner` namespace

* Rename a few `@packages`

* Add changelog
2024-07-11 09:54:27 -07:00
Jorge A. Torres 21cc919094
Return HTTP 404 in REST API for non-existent product reviews (#48726)
* Return HTTP 404 when accessing non-existent product views via REST API

* Fix unit tests

* Add changelog

* Address feedback
2024-07-11 16:30:20 +01:00
Albert Juhé Lluveras ec95afc178
Fix sidebar attribute control in Products by Attribute block (#49351)
* Fix sidebar attribute control in Products by Attribute block

* Add changelog file

* Linting
2024-07-11 15:52:57 +02:00
Adrian Moldovan 3ff155182e
Fix Blocks e2e environment setup in release checks (#49379) 2024-07-11 15:45:30 +03:00
Vladimir Reznichenko 9fef18cd0d
CI: missing jobs on changes in components package. (#49330)
This PR addresses issues in building a CI jobs matrix (resolving dependent packages and running CI jobs for them).
2024-07-11 14:36:56 +02:00
Veljko V e049d93681
Fix flaky e2e merchant tests (#49381) 2024-07-11 15:31:57 +03:00
Mike Jolley d18a722501
Store API: Reduced number of recalculations on Store API cart routes (#48944)
* woocommerce_removed_coupon event should recalculate totals automatically

* Remove early calculation from cart routes

* get_cart_for_response ensures late calculation if needed

* Remove calculation when removing coupons

* Calc totals already does shipping

* Remove calc on checkout route

* Update cart controller to load session if needed and introduce new helper methods

* Changelog
2024-07-11 13:12:51 +01:00
Tung Du 6d6271260d
E2E: Fix flaky CYS logo picker tests (#49364)
* test: fix flaky cys logo picker e2e tests

* chore: changelog

* try: unfocus the input

* fix: use toHaveCSS to leverage auto waiting

* fix: duplicated Promise

* fix: blur is unnecessary
2024-07-11 14:04:37 +02:00
nigeljamesstevenson da4de031f0
Update stable tag to 9.1.0 (#49383)
Update readme.txt
2024-07-11 12:32:00 +01:00
Vladimir Reznichenko f8c0e6e02f
E2E: enable reporting slow blocks test. (#49367) 2024-07-11 12:21:59 +02:00
rodelgc ab21f5981f
Delete changelog file from #49370 (#49378) 2024-07-11 18:18:42 +08:00
Ivan Stojadinov 236fe48f97
Cherry-pick #303 into trunk (#49373)
* Improve mu-compatibility of `WC_Customer_Data_Store::get_last_order()`.

* Use the blog prefix as a suffix rather than a prefix (readability).

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>

* Extract site-specific user meta handlers into their own set of reusable methods.

* Make the customer data store's get_order_count and get_total_spent methods network-aware.

* Support deletion of site-specific user meta.

* Update cache invalidation (make multisite-aware) for money spent, order count, and last order.

* Further fixes for mu-aware order and spend caching.

* Add migration to remove unneeded/unused user meta data.

* Revert change to handling of `paying_customer` user meta (out-of-scope for this fix).

* Be stricter when obtaining current blog prefix.

* Add missing `@since` tag to historic filter hook.

Archaeology: https://github.com/woocommerce/woocommerce/compare/4.9.0...4.9.1#diff-8dcda80485fb4b7bc3cb9544ecf4b73aa78dc448bc574b1e56271ee8b56e7189R330

* Ensure the 'last order ID' references an order that actually belongs to the current customer.

* Fix docblock.

* Add additional test to describe safeguards around fetching a customer order.

* Unset `$last_order_id` if the order is not of type `WC_Order`

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>

* Merge 9.1.0 update functions list.

* Logging best practices (do not translate).

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>

* Logging best practices (do not translate).

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>

---------

Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
2024-07-11 12:33:26 +03:00
Ivan Stojadinov fa693249db
Cherry-pick #331 into trunk (#49370)
* Wrap order note saving with wc_sanitize_textarea

* Add changelog

* Change note output to wp_kses with no allowed HTML

* Add totalsMock for order confirmation test

* Add Totals test

* Add classic checkout test to ensure notes are cleaned

* Change wp_kses_post to wp_kses for all order note usage

* wp_kses the order note before editing too

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2024-07-11 11:49:33 +03:00
Vladimir Reznichenko ba9f0a1625
Monorepo: set strict mode for WooCommerce plugin linting script. (#49366) 2024-07-11 09:18:23 +02:00
Néstor Soriano c4ddaef3bc
Optimize the method that gets the downloads count for a given download (#49008)
The old code was retrieving all the existing download entries from
the database and then counting them locally. Now a SQL COUNT query
is used instead.

---------

Co-authored-by: Naman Malhotra <naman03malhotra@gmail.com>
2024-07-11 09:14:24 +02:00
Caleb Mazalevskis 2a90d1e06b
Fix typo (index.tsx) (#49233)
* Fix typo (index.tsx)

"Congratuations" -> "Congratulations"

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

---------

Co-authored-by: Paul Sealock <psealock@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-07-11 11:24:11 +08:00
Nathan Silveira c16b5e578b
Add new unique ID to the classic product form (#49312)
* Update wc_update_product_lookup_tables_column function

* Rename error message

* Create 'form-flex-box' class and increase icon size

* Persist global_unique_id for main product and variations

* Add global unique id field to main product

* Add global unique id field to variations

* Add changelog

* Update error message
2024-07-10 20:06:29 +00:00
Daniel W. Robert e0d6c981ea
CYS: Add `rel="noreferrer"` to External Fiverr Link (#49314)
* Add `rel="noreferrer"` to external link

This is a precautionary security measure to to prevent the new page
from accessing the original page’s `window` object.

See pb22l9-304-p2 (internal link) for additional context.

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-10 15:41:48 -04:00
Jonathan Lane a50a2a95b0
Fix failing e2e tests on daily run (#49313)
* Fix inability to activate twentytwenty theme

* Fix linting error

* Fix command palette test

* Change locator for Gutenberg tests

* Revert locator — Gutenberg adds an iframe

* Use regex for command palette

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-07-10 13:26:08 -03:00
piinthecloud cae3937ee6
Revert move docs (#49354)
* revert moving docs to main folder ahead of issues with subcategories

* add changelog

* add changelog
2024-07-10 17:33:15 +02:00
piinthecloud ec82b3f08f
move checkout docs with front matter to main folder (#49186)
* move checkout docs with front matter to main folder

* add manifest

* add core changelog

* Remove emojis, unsupported links and table of contents

* pr comments

* update folder name and remove toc

* title fix

---------

Co-authored-by: Jacklyn Biggin <hi@jacklyn.dev>
2024-07-10 16:53:52 +02:00
Miguel Pérez Pellicer 39b8b23fc8
Fix order_count inconsistency between stats and reports (#49283)
* Fix order_count consistency between stats and reports

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-10 17:19:33 +04:00
Vladimir Reznichenko 4311640de2
Monorepo: caching deps per target package in GH actions (#49020)
In this PR, we are implementing per-package build and caching, which optimizes build and fetching cached dependencies times across our workflows.
2024-07-10 14:39:49 +02:00
Néstor Soriano f1399c9d77
Fix the namespace of the RestApiControllerBase class (#49333)
* Fix the namespace of the RestApiControllerBase class

* Add changelog file
2024-07-10 13:10:03 +01:00
Sam Seay eaf57e9f15
Create a separate bundle for cart and checkout (#48010) 2024-07-10 21:23:17 +12:00
Adrian Moldovan a862dab4f7
Disable Metrics job in CI (#49328) 2024-07-10 11:12:23 +03:00
Alba Rincón fb421397be
CYS - Bring back footer and header borders on hover and selected patterns (#49299)
* Bring back footer and header borders on hover and selected patterns

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

* Fix the selected pattern color

* Fix lint errors

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-10 09:14:23 +02:00
Alba Rincón 620fd4efed
CYS - Update delete button copy to `Delete` (#49295)
* Update delete button copy to match Dotcom

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-10 09:13:55 +02:00
Alba Rincón c000a074be
CYS - Fix the intro cards size to match the designs (#49297)
* Fix the intro cards to match the designs

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-10 09:13:41 +02:00
Matt Sherman 2957458bac
Product Editor Dev Tools: Improved expression evaluation tooling (#48588)
* Refactor to extract ExpressionField

* Move styling of expression and result prefixes to CSS

* Layout expression field with grid

* Add buttons to expression field

* Enter edit mode and cancel

* Hook up editing in textarea

* Allow existing expression to be edited

* Make expression param optional

* Use ExpressionField to add new expression

* Hide cancel button if no callback and add updateLabel prop

* Only show error when dirty

* Placeholder for expression field

* Format result in expression field

* Expression field textarea styling

* Justify expressions at bottom

* Prevent jumping when editing expression

* Revert changes on cancel

* Remove unused CSS

* Extract ExpressionTextArea

* Extract ExpressionResult

* Auto height textarea

* Hover styling for expression

* Result type tag

* Tweak styling

* Update padding in expression field

* Changelog

* Enable scrolling of result when editing expression

* Use smaller close icon

* Fix enabling of add/edit button

* Focus text area when clicking edit button

* Put cursor at the end of text area when focusing it

* Enter edit mode when clicking on text area

* Remove expression in list

* Don't style expressions list as a flex box

* Show full result while editing expression
2024-07-09 14:05:39 -04:00
Mik 5948b0d822
Fix incorrectly escaped HTML (#49195)
* Fix incorrectly escaped HTML

* Add a changelog entry
2024-07-09 17:04:20 +01:00
Alex Florisca 56cc77fcef
Fix the mini cart items not being visible when zoomed in (#48384)
* Render an aria-label for the initial mini cart html

* FIx mini-cart items not visible when zoomed in

* Add changelog

* Fix linting issues

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

* Kick the GH actions

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

* delete duplicate changelog file

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

* Delete plugins/woocommerce/changelog/48384-fix-43639-zoom-mini-cart

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-09 16:47:21 +01:00
Néstor Soriano 99ae453ea3
Improve the handling of the deprecated WC()->api property (#48884)
* Improve the handling of the deprecated WC()->api property:

- When the legacy REST API plugin is not available, set the property
  to an instance of RestApiUtil. This object has the get_endpoint_data
  method that is still used by external plugins.

- Add a new legacy_rest_api_is_available method to WooCommerce class.

- Replace all instances of "is_null(WC()->api)" with (negated) calls to
  the new legacy_rest_api_is_available method.

- Make WC()->api point to an instance of LegacyRestApiStub, instead of RestApiUtil.

---------

Co-authored-by: Naman Malhotra <naman03malhotra@gmail.com>
2024-07-09 17:26:20 +02:00
Chris Lilitsas a4ff1d01b3
[Product Collection] Track block instances and feature usage (#46466)
* add block parser and filters wip

* replace strings with template slugs and do some polish

* Refactor some parts to reused in wc_tracker

* Clean up and introduce snapshot data in the WC_Tracker

* Minor improvements

* Track only fse themes

* Consolidate collection names per context in the WC_Tracker snapshot

* Add changelog

* Separate taxonomy filter usage into specific category and tag usage

* Polish event params values

* Lint

* Remove wc-tracker to simplify the pr

* More cleanup

* Unify location names

* Handle stock status default value

* Renamed order confirm context

* Track price filter fix

* consider 3pd stock statuses in tracking

* Lint

* Consider the woocommerce_hide_out_of_stock_items option when tracking stock filter

* Cleanup empty lines

* Rename single product area flag

* Add docblock

* Avoid drafts and autosaves

* introduce a new class under tracking events

* Cleanup main controller

* Cleanup

* Add docblocks

* Stop recursive process up to 2 levels and cleanup

* Cleanup

* Ensure blocks exist

* Lint

* Normalize keys and values

* Track inherit and order-by usage

* Fix lint

* Add strict types

* add strict again

* Strict types

* Move strict types

* Remove codeblock

* Clean up

* Move directive on separate line

* Cleanup spaces
2024-07-09 16:46:04 +03:00
Christopher Allford 7d71e2235a
Product Collection: Redesigned Collection Insertion Selection (#48911)
* Updated Collection Selection Buttons

Rather than using normal buttons we're going to replace these with cards
that we want to use instead.

* Reworked Product Catalog Creation

* Added Dropdown Collection Option

* Changelog

* Added Collection Dashicon Support

* Fixed Collection Change Modal

This is going to get replaced soon but it may as well look nicer than it
does right now.

* Type Fix

* Fixed `:focus` Hover Border

* Simplified Click Handler

* Style Fixes

* Gutenberg Style Fixes

* E2E Fixes

* Fixed E2E Test

* Added Dropdown Inserter E2E Support

* Logging

* Fixed Default Insertion Options

* Prevent Premature Rendering

* E2E Fix Attempt

* Lint Fix

* E2E Fix

* Fix test chaking if custom registred collections are available in the collection chooser

* Improve logic of choosing collection to cover both dropdown and placeholder

---------

Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
2024-07-09 13:53:48 +02:00
Tom Cafferkey dacee984fa
Track the newly installed version in wp_options (#49139)
* Add initial install version to database

* Change update_option to add_option

* Add changelog

* Add since annotation

* Change initial_install_version option to initial_installed_version and also set autoload to false

* Add unit test for initial_installed_version

* Add unit test for initial_installed_version
2024-07-09 10:51:24 +01:00
martynmjones ab67891874
Exclude simple products from variations reports by default (#49244)
* Make use of simple products exclusion filter regardless of included products

* Add unit test

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

* Update reports-variations.php: Remove since comment

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-09 10:48:05 +01:00
Albert Juhé Lluveras a5aef5f599
BlockTemplatesController: move all hooks into methods instead of being inline (#49182)
* BlockTemplatesController: move all hooks into methods instead of being inline

* Add changelog file
2024-07-09 11:36:43 +02:00
Vedanshu Jain 6d92aa9ccb
Load controllers only when needed for performance. (#47704)
* Load controllers only when needed for performance.

* Classify controllers based on their namespace and load selectively.

* Enable private namespace along with store api.

* Only prevent route loading when request is known for back compat.

* Lint fixes.

* Remove duplicate inclusion.

* Correctly load feature controller.

* Add since tag.

* Add unit tests.
2024-07-09 09:07:14 +00:00
Luigi Teschio fcb7f6798f
CYS: Fix pattern preview border color (#49206)
* CYS: Fix pattern preview border color when the user hovers the preview; fix pattern preview border color when the pattern is present in the site preview

* Remove the is-added class to avoid marking patterns that are already removed

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

* Fix lint errors

* Fix lint error

---------

Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-07-09 09:12:33 +02:00
Vlad Olaru 0346ca618a
Fix Payments and APMs tasks logic and links (#46017)
* Link Payments task item to Overview if WooPayments is connected

* Link APMs task item to payments task page

* Add changelog for WooCommerce

* If WCPay is connected go to Payments Overview page

It shouldn't matter if the WCPay account is fully or partially onboarded.

* Fix determining if other gateways are enabled besides WCPay ones

Since UPE, WCPay registers multiple payment gateways, all prefixed with woocommerce_payments.

* Fix WooCommercePayments task kick-in logic

The WooCommercePayments task should supersede the general Payments task
when the general Payments task is not completed already and the store is in a
WooPayments supported country. We should not factor in if WooPayments is
just installed but not connected.

* Add changelog

* test: Fix Playwright tests for payment tasks

* test: Fix Playwright tests linting

* test: Further fixes to the Playwright payment setup task
2024-07-09 09:42:50 +03:00
Barry Hughes 97656a907d
Reduce potential for plugin conflict-driven fatal errors during (REST API-based) refund creation (#47918)
Introduce a method to help ensure values that have been filtered are still of the expected type.

Fixes #47601

* Reduce potential for plugin conflict-driven fatal errors during (REST API) refund creation.

* Parcel up return-type-assurance logic into its own reusable helper.

* Generalize the type checking helper.

* Do not replace existing WP_Errors.

* Do not translate logging messages, per current best practices.

Ref: d2bde1368a/docs/extension-development/logging.md (best-practices)

* Add test describing the behaviour of `Types::ensure_instance_of()`.

Note that the exception error code originally specified in the Types class was also removed: if we want this, it needs to be an integer rather than a string. However, we don't have a methodology or centralized registry for handling numeric error codes at present.

* Use ternary shorthand, not null coalescing.

* Add `@since` tag for hook `woocommerce_rest_pre_insert_<POST_TYPE>_object`.

Selected 4.5.0, as this is the point at which the (until then separate) REST API package was merged into WooCommerce Core.

* Avoid short ternaries.

* Strict types.
2024-07-08 16:30:25 -07:00
github-actions[bot] d4017c0700
Delete changelog files based on PR 49243 (#49255)
Delete changelog files for 49243

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-07-08 23:37:24 +01:00
Jorge A. Torres 5c81b0e5cc
Do not run `BatchProcessingController`'s cleanup after a premature shutdown (#49243)
* Prevent `BatchProcessingController` from running its cleanup function during an abnormal shutdown

* Add changelog

* Use a safer check (we cannot always depend on `as_has_scheduled_action` being available).
For context, please see:

- A problem we faced recently when using modern Action Scheduler functionality, in https://github.com/woocommerce/woocommerce/pull/49243.
- Description of load order concerns https://developer.woocommerce.com/2021/10/12/best-practices-for-deconflicting-different-versions-of-action-scheduler/.

---------

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2024-07-08 14:31:39 -07:00
Gabriel Manussakis 1b9e3601a4
[Accessibility] Fix typo in woo-ai plugin doc (#49208)
* Fix "prequisites" typo

* Add changelog file
2024-07-08 15:44:37 -03:00
Jonathan Lane 07c9d2b7b1
Update Playwright to 1.45.1 (#49202)
* Update Playwright to 1.45.1

* Update lockfile

* Add changelog

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-07-08 15:22:13 -03:00
Alba Rincón a93343dd90
CYS - Fix size of the "no logo" title to match the "logo" title size (#49231)
* Fix size of the no logo title to match the logo title size

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-08 17:36:37 +02:00
Albert Juhé Lluveras 416db85d01
Add srcset to Single Product gallery thumbnail images (#49112)
* Add srcset to Single Product gallery thumbnail images

* Add changelog file
2024-07-08 17:23:07 +02:00
Alba Rincón cecfecdf1f
CYS - Fix assembler styling issues (#49232)
* Fix sidebar bg color

* Fix spacing and title size on patterns section

* Increase space between the section description and the list of patterns

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-08 16:47:30 +02:00
Maikel Perez d849155c59
Change the custom field name component to be an autocomplete (#48949)
* Moving to a Combobox

* Create CustomFieldNameControl component

* Fix combobox styles

* Change Combobox to behave as an Autocomplete

* Integrate CustomFieldNameControl within the CustomFieldCreateModal

* Fix the ref type from CustomFieldNameControl

* Integrate CustomFieldNameControl within CustomFieldEditModal

* Fix CustomFieldNameControl default/focus border style

* Fix custom field value control height to be 36px like other controls

* Add changelog file

* Fix linter errors

* Add ->esc_like to the search criteria when searching for a product custom field name

* Add changelog file

* Add comments explaining why the implamentation was made that way

* Remove non existing classname

* Fix wrong border color when the field is invalid and focused

* Fix linter errors

* Hide props from the internal input element

* Rename comboboxRef with inputElementRef

* Fix invalid empty value when the combobox has a selected value
2024-07-08 09:14:36 -04:00
Adrian Moldovan 7b0f9457cf
[e2e tests] Add Allure reporter to Blocks e2e tests (#49228) 2024-07-08 15:02:31 +03:00
Naman Malhotra 8f98a2a057
Drop Select2 in Backwards compatable manner (#48731)
* init

* added changelog

* Review - point select2 in admin assets
2024-07-08 18:47:59 +07:00
Veljko V 1a94d68d2b
Fix flaky e2e test merchant filling regular price in inventory tab (#49226) 2024-07-08 13:10:40 +03:00
Alba Rincón b83eed8869
CYS - Fix patterns spacing (#49196)
* Fix spacing in patterns

* Fix spacing

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

* Remove metadata

* Remove metadata

* Fix test

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-08 10:52:35 +02:00
Veljko V 05c47d8566
Fix flaky filling SKU and verifying CYS footer e2e tests (#49191) 2024-07-08 11:24:02 +03:00
Alba Rincón c763bdf695
CYS - Filter out patterns with external dependencies (#48618)
* Filter out patterns with external dependencies

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

* Fix test

* Remove excluding patterns by id

* Bring back url

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-08 08:53:06 +02:00
Vladimir Reznichenko 68532ce433
CI: update linting jobs to skip build step (#49193)
In this PR, we introduce changes to linting and PHPUnit jobs in order to speed them up: skip or minimize the build step.
2024-07-08 08:39:39 +02:00
Eason 6d17019827
Fix the inconsistent formatting of the numeric columns in the Leaderboards on the Analytics > Dashboard page (#49097)
* Add the `format` property to the items of the `rows` array in Analytics' Leaderboards API response to indicate how it's formatted.

* Make the `Leaderboard` component within Analytics aware of the currency context and format the numeric columns accordingly.

* Avoid a warning from the test of `Leaderboard` component when running JS tests.

File: client/analytics/components/leaderboard/test/index.js
Ref: https://github.com/woocommerce/woocommerce/blob/9.0.2/packages/js/components/src/pagination/pagination.tsx#L44

* Apply better practice to the test of `Leaderboard` component.

File: client/analytics/components/leaderboard/test/index.js

* Add changelog.

* Make the `Leaderboard` component not create a new function for every `row` rendering.

Address: https://github.com/woocommerce/woocommerce/pull/49097#discussion_r1667009910
2024-07-08 11:15:12 +08:00
Nathan Silveira e62f28b3ca
Allow selecting categories through keyboard (#49049)
* Remove portal and use inline popup

* Allow selecting existing values through , or ENTER

* Add help to taxonomy block

* Provide help attribute to taxonomy block

* Add changelogs

* Remove help text

* Add help text and a11y instructions

* Try to fix unit test

* Add changelog

* Fix E2E test

* Allow navigating up from first list item into the input

* Add scenario for single selection as well
2024-07-05 14:20:28 -03:00
Adrian Moldovan 178466aa06
[e2e tests] Tweak Playwright config - retries and test artifacts (#49148) 2024-07-05 15:38:49 +02:00
Luigi Teschio 615513144d
CYS: Fix color button (#49181)
* CYS: Fix color button

* Add colors to the just arrived full hero button

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

* fix just arrived full hero on sidebar

* improving name

* reorganize code

* Fix lint errors

---------

Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-07-05 12:41:27 +00:00
Manish Menaria 2d6448d9b4
Product Collection: Fix alignment of the first item in Grid layout for WP 6.6 (#49096)
* Remove `__experimentalLayout` from Product Template block

This commit removes `__experimentalLayout` from Product Template block. This is because we don't want to use `layout` from Gutenberg for now. This change fixes the alignment of the first item in Grid layout.

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

* Fix linting errors in SCSS file

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-05 17:24:27 +05:30
Manish Menaria fa11141726
Expose `__experimentalRegisterProductCollection` in @woocommerce/blocks-registry Package (#48141)
* Expose registerProductCollection in @woocommerce/blocks-registry Package

This commit exposes the `registerProductCollection` function as part of the `@woocommerce/blocks-registry` package. This enhancement facilitates the registration of new product collections by 3PDs, promoting better modularity and extensibility within the WooCommerce Blocks ecosystem.

Changes include:
- Migration of `register-product-collection.tsx` to `packages/checkout/blocks-registry`.
- Export `registerProductCollection` from `@woocommerce/blocks-registry/index.ts`.
- Updated related imports and references to the new path.

This update enables 3PDs to register product collections more seamlessly, enhancing the extensibility of Product Collection block.

* Replace @woocommerce/blocks-checkout with @woocommerce/blocks-registry

* Add __experimental prefix

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

* Improve registerproductcollection for 3pds

* Set isDefault value to false

* Don't export all the types

* Update changelog

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

* Add plugin to test __experimentalRegisterProductCollection

* Add E2E tests

* Fix Lint errors

* Improve E2E tests for __experimentalRegisterProductCollection

- Reduced preview timeout from 2000ms to 1000ms.
- Expanded E2E tests to cover new attributes and preview functionalities.

* Refactor code to improve readability and maintainability

- Added a warning comment to indicate that `__experimentalRegisterProductCollection` is an experimental API.
- Refactored variable names and imports in `register-product-collection.tsx` and `index.tsx` for clarity.
- Simplified and reorganized type definitions and imports in `types.ts` and `utils.tsx`.
- Renamed function in `register-product-collection-tester.php` for consistency.

* E2E: Also test the Frontend

* Use alias for import statement

* Don't pass isActive to registerProductCollection

Now it's handle by registerProductCollection itself.

* Update registerproductcollection API structure

Refactored the product collection block to enhance attribute management and ensure consistency in query defaults. This change includes:
- Importing `DEFAULT_QUERY` from constants and using it to set default query attributes.
- Removing `DEFAULT_ATTRIBUTES` from specific collections and directly defining required attributes.
- Ensuring `postType` and `isProductCollectionBlock` are set to default values in the query object.
- Setting `inherit` attribute to `false` by default in all collections.

* Hide inherit control in collections

Ensure the "inherit" control is always hidden, as collections should not be able to change this attribute. This includes:
- Adding `CoreFilterNames.INHERIT` to the `hideControls` set in `register-product-collection.tsx`.
- Adjusting the `hideControls` attribute in individual collection files to remove redundant hiding of the `INHERIT` control.

* Fix: Filters not showing in inspector controls

* Set inherit to false for all collections

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

* Product Collection: Add validation for `__experimentalRegisterProductCollection` arguments (#48513)

* Add validation for `__experimentalRegisterProductCollection` arguments

Introduced comprehensive validation for the `ProductCollectionConfig` object in `__experimentalRegisterProductCollection` to ensure correct data types and values, enhancing error handling and robustness.

- Added a new function `isValidProductCollectionConfig` to perform various checks on the `ProductCollectionConfig` object.
- Validates properties such as `name`, `title`, `description`, `category`, `keywords`, `icon`, `isDefault`, `innerBlocks`, `example`, `scope`, `isActive`, `attributes`, and `preview`.
- Ensures correct data types and provides detailed console error messages for invalid configurations.
- Updated `__experimentalRegisterProductCollection` to use the validation function before proceeding with the registration process.

**Impact**
- Improves stability and prevents invalid configurations from causing runtime errors.
- Provides clearer error messages for developers, aiding in quicker debugging and development.

* Fix typo

* Refactor: Replace console.error with console.warn

Updated the error logging in the isValidProductCollectionConfig function to use console.warn instead of console.error for invalid configuration properties. This address the feedback from the PR review.

- Replaced console.error with console.warn for various validation checks in isValidProductCollectionConfig.
- Removed redundant return statements after console.warn calls.
- Improved logging messages to better inform about invalid configuration properties without treating them as critical errors.
- Simplified the logic in __experimentalRegisterProductCollection by combining query and attribute properties and ensuring defaults are set properly.

* Refactor: Rename isValidProductCollectionConfig to isValidCollectionConfig

Updated the function name from isValidProductCollectionConfig to isValidCollectionConfig for better clarity and consistency. Also, renamed related variables for improved readability.

* Add validation for name property

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

* Title is required for new collection

* Update comments

* Fix E2E tests

* Address PR feedback

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add README file for __experimentalRegisterProductCollection

* Add screenshots in README file

* Try to fix lint issue

* Docs: add example for collection with inner blocks

Enhanced the documentation for `__experimentalRegisterProductCollection` to include an example demonstrating how to define a collection with inner blocks. This example shows how to create a custom collection with nested blocks, including a heading and product elements, providing a clear guide for developers.

New content added:
- Example 4: Collection with inner blocks
- Sample code for defining a collection with inner blocks
- Tips and links to further resources on inner blocks and core collection definitions

* Fix Lint errors

* Address PR feedback

* Reduce number of JS files on /shop page

**Problem:** There was increase in number of JS files on /shop page after exposing `registerProductCollection` function in `@woocommerce/blocks-registry` package. This package is loaded on the frontend. For example, previously 45 JS files were loaded on /shop page but now 55 JS files are loaded on /shop page.

**Solution:**
1. After a bit of debugging I found out that constant file which we are importing i.e. `plugins/woocommerce-blocks/assets/js/blocks/product-collection/constants.ts` contain some heavy dependencies & it's not pure. Therefore, I decided to split this file into two files. I moved all the constants that are used in `registerProductCollection` function to a new file i.e. `plugins/woocommerce-blocks/assets/js/blocks/product-collection/constants-register-product-collection.ts`. This way, we don't need to load all the constants on the frontend i.e. /shop page.
  - This reduced 4 JS files i.e. 51 JS files are loaded on /shop page.

2. After some more investigation, I found out that importing `registerBlockVariation` function is increasing number of JS files on Frontend. Therefore, I decided to use global `wp` object to call `registerBlockVariation` function. This way, we don't need to import it. This reduced last 6 files i.e. 45 JS files are loaded on /shop page.

This way, I was able to reduce number of JS files on /shop page from 55 to 45, which is same as before this PR.

* Refactor: product collection constants

- Moved constants from `constants-register-product-collection.ts` to `constants.ts`
- Deleted `constants-register-product-collection.ts`
- Updated import paths in relevant files to reflect the changes
- Moved utility functions to `utils.ts`

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-05 16:55:35 +05:30
Chris Lilitsas d3df046f97
[Product Collection] Parse front-end context (#44145)
* Parse global context

* Refactor the util to only parse global context, provide the location context to collection children

* cleanup

* Cleanup

* Add changelog

* Make linters happy

* provide context to each inner block recursively

* Fix linters

* Remove debug

* Update plugins/woocommerce/src/Blocks/BlockTypes/ProductCollection.php

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>

* Rename the provider method

* Fix typo on cart item products

* Use the query context instead

* Lint

* Lint again

* Minor change on docs

* Polish

* Cleanup

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2024-07-05 13:49:24 +03:00
Mike Jolley be849473e0
Checkout: Update legacy status handling (#48788)
* Allow same status as API expects

* changelog
2024-07-05 11:42:38 +01:00
Luigi Teschio 9fc207b1a6
CYS: fix: Assembler follows admin color schema (#49159)
* CYS: fix: Assembler follows admin color schema

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-05 12:20:49 +02:00
Vladimir Reznichenko 1675c63bba
Monorepo: tweak CodeSniffer rules conflicting with strict types declaration requirements (#49183) 2024-07-05 11:46:30 +02:00
Alba Rincón dae47a6a5f
CYS - Remove non-default patterns and register them from the PTK and update margins (#49101)
* Remove not default patterns

* Add margins

* Include woocommerce patterns from PTK

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

* Bring back some patterns

* Bring back footer and headers

* Update snapshots after updating margins

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-05 08:55:05 +02:00
Alba Rincón c4d160bf21
CYS - Add missing patterns to their categories for the assembler (#49154)
* Add the Featured Category Cover Image to Intro category

* Add missing patterns to their categories for the assembler

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-05 08:54:23 +02:00
Chi-Hsuan Huang e59f4e406d
Fix the Coming Soon Site Page heading color is white after completing the CYS task (#49129)
* Fix site coming soon page heading color

* Add changelog
2024-07-05 10:51:30 +08:00
Joshua T Flowers 1c8698c684
Prevent product editor styles loading on non wc-admin pages (#49170)
* Only load product editor styles on WC admin pages

* Manually load interface styles to exclude fullscreen styles

* Add changefile(s) from automation for the following project(s): @woocommerce/product-editor, woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-04 14:17:14 -07:00
Alba Rincón c0d102a93c
CYS - Replace customer account block icon in headers used in the assembler (#49133)
* Replace customer account block icon in headers used in the assembler

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

* Change icons style for injected blocks

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-04 18:59:52 +02:00
Veljko V 59a1e5394b
Fix flaky connect to Woo e2e test (#48926) 2024-07-04 18:21:15 +03:00
Mik cf7fc7b2a9
Fix deprecated get_option notice when viewing Analytics > Orders (#49092)
* Add option for orders_report_date_tour_shown to allow list

* Disable the orders report date tour in E2E test
2024-07-04 16:09:58 +01:00
Jorge A. Torres 04fa888b2f
Fix toggling of permission details in downloadable product permissions metabox (order screen) (#49022)
* Work around WP's handlediv functionality in download permissions metabox

* Add changelog
2024-07-04 08:06:45 -07:00
Alba Rincón a712e54005
CYS - Include the dotcom reviews patterns (#49140)
* Include the dotcom reviews patterns

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-04 16:51:59 +02:00
Alba Rincón c2973c3fe1
CYS - Make some titles bold on CYS patterns (#49151)
* Make some titles bold on cys patterns

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-04 16:05:09 +02:00
Luigi Teschio d95b43a6f5
CYS: Fix Shuffle feature logic (#49153)
* CYS: fix shuffle feature

* improve types and add comment

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-04 15:46:18 +02:00
Roy Ho 780f27256f
Remove IE11 specific styles (#49027)
* Remove IE11 specific styles

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

* Remove unused mixin

* Remove additional IE/edge styles

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-04 05:28:26 -07:00
piinthecloud 025b5f1a8f
add front matter and cleanup docs in V1 migration for docs site (#49010)
* add front matter and cleanup docs in V1 migration for docs site

* add changelog entry and fix remaining HTML tables to markdown

* bypass linter rules

* update rule

* rever rule change for incorrect file

* rever rule change for incorrect file

* lint filtering-payment-methods.md rule

* address comments

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/migrated-hooks.md

Co-authored-by: Niels Lange <info@nielslange.de>

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/migrated-hooks.md

Co-authored-by: Niels Lange <info@nielslange.de>

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md

Co-authored-by: Niels Lange <info@nielslange.de>

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/filtering-payment-methods.md

Co-authored-by: Niels Lange <info@nielslange.de>

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-filters/totals-footer-item.md

Co-authored-by: Niels Lange <info@nielslange.de>

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-filters/checkout-and-place-order-button.md

Co-authored-by: Niels Lange <info@nielslange.de>

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-filters/additional-cart-checkout-inner-block-types.md

Co-authored-by: Niels Lange <info@nielslange.de>

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-filters/cart-line-items.md

Co-authored-by: Niels Lange <info@nielslange.de>

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/additional-checkout-fields.md

Co-authored-by: Niels Lange <info@nielslange.de>

* Update plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/how-checkout-processes-an-order.md

Co-authored-by: Niels Lange <info@nielslange.de>

---------

Co-authored-by: Niels Lange <info@nielslange.de>
2024-07-04 13:54:43 +02:00
Veljko V c9f8480a3f
Fix flaky filling SKU field in e2e test (#49134) 2024-07-04 14:00:14 +03:00
Amit Raj e562ed4ede
Add product count visibility option to mini cart block (#48545) 2024-07-04 13:52:01 +03:00
github-actions[bot] 41314eccb7
Delete changelog files based on PR 49113 (#49138)
Delete changelog files for 49113

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-07-04 10:54:43 +01:00
Niels Lange 0089b2359c
Use `createRoot().render()` instead of `render()` (#48858)
* Use createRoot().render() instead of render()

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

* Remove “ReactDOM.render is no longer supported” checks

* Add “ReactDOM.render is no longer supported” checks again

* Adjust JS unit tests

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-04 11:36:38 +02:00
Luigi Teschio c8e4938548
CYS: fix not template set correctly (#49113)
* CYS: fix not template set correctly

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-04 09:35:16 +00:00
Adrian Moldovan 62c74d0ed4
[e2e tests] Add support for external sites in CI (#49017) 2024-07-04 12:15:43 +03:00
RJ e61313b33d
Use createRoot in classic product editor cases (#48834)
mothra

mothra

mothra
2024-07-04 05:38:19 -03:00
Vladimir Reznichenko 7959060850
Monorepo: disable autoloading optimization by default (take 2) (#48980)
This PR is the second attempt to speed up monorepo installation by removing autoloading optimization setting from the configuration and performing the optimization where it is appropriate (composer post-install hooks and when building releases).

In the installation context, the composer post-install hook will execute a background task to dump the optimized autoloading, while the installation process completes other tasks.
2024-07-04 10:12:52 +02:00
Karol Manijak ab646ace8e
Product Collection: "Sync with current query" should only apear in archive context and not other places (#48917)
* Show Sync with current query option only in archive templates

* Add changelog

* Add e2e test

* Remove unused variable
2024-07-04 09:13:36 +02:00
Vladimir Reznichenko f8c95a8db8
CI: caching tune (part one - relocate playwright caching) (#49081)
In this PR we ar relocating playwright downloads caching into the monorepo action (behind input parameter). That consolidates monorepo-related caching and also reduces the time fetching the cache action in external workflows.
2024-07-04 06:55:24 +02:00
Paul Sealock 7aa42a6d76
LYS: Fix missing CSS (#49075) 2024-07-04 11:10:12 +12:00
github-actions[bot] 0b00aec60a
Delete changelog files based on PR 49104 (#49115)
Delete changelog files for 49104

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-07-03 13:46:43 -04:00
Adrian Duffell 9af58923de
Place Printful behind a feature flag (#49104)
* Add printful feature flag

* Place printful placement behind feature flag

* Add changelog
2024-07-03 17:01:37 +00:00
Adrian Duffell b36083403d
Ensure WooPayments is the only enabled gateway when offering to delete test orders (#49032)
* Add a check for woopayments is the only gateway

* Try fix TS error

* Add changelog

* Fix lint issues
2024-07-03 23:22:27 +08:00
Thomas Roberts 20e7128775
Update WC blocks wp-env to use WP 6.6 RC1 (#49037)
Co-authored-by: github-actions <github-actions@github.com>
2024-07-03 16:09:43 +01:00
Nathan Silveira 85cedf2d2b
Add unique_id field to product (#47364)
* Add unique_id field to product

* Fix documentation

* Fix wrong comment

* Update description

* Add unique_id for variations

* Update lint

* Update tests

* Add changelog

* Update variations unit test

* Add unique_id to wc_product_meta_lookup

* Add unique_id methods to cpt interface

* Add new methods for unique_id and add it to lookup table

* Add unique_id functions to product functions

* Throw error when unique_id is duplicated

* Handle error message for unique_id on the front-end

* Add changelog

* Rename unique_id description in REST API

* Fix lint issues

* Add unique_id tracking for product publish

* Rename to 'global_unique_id'

* Fix lint

* Fix lint

* Bump documentation version

* Update controller description of fields
2024-07-03 11:45:48 -03:00
Luigi Teschio 496df1b7a2
CYS: fix default intro pattern (#49082)
* CYS: fix default intro pattern

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

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-03 16:17:25 +02:00
Manish Menaria ab826271d3
Update revert button text and description (#48717)
* Update Revert button text and description

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

* Add (Classic) as suffix instead of prefix

* Button text should be in center

* Fix: Button text isn't in center

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-03 19:31:50 +05:30
Jorge M bf6f3bbf41
Fix fatal error in order reports when parent order doesn't exist for a refund. (#49006)
* Check if parent order exists

* Add tests for order reports with orphaned refunds

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

* Update phpdocs test

* Add method is_valid_order

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-03 13:34:16 +02:00
Mike Jolley 27c08f4a5e
Remove encoding type from verify email form (#48859)
* Remove enctype from verify email form

* Changelog
2024-07-03 12:32:30 +01:00
Albert Juhé Lluveras 1687d462fb
Initialize BlockTemplatesController for block themes only (#48905)
* Move `check_should_use_blockified_product_grid_templates` to `wc-template-functions.php`

* add changelog entry

* alias Blocks/Options as BlocksOptions

* Init `BlockTemplatesController` for block themes only

* Remove the `wc_current_theme_is_fse_theme()` check from BTC

* Streamline the option update logic a tad

* Revert "Streamline the option update logic a tad"

This reverts commit 54a965d9784df253f82533991e03c1112fd386ef.

* init BTC for themes that support block template parts

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* init BTC for themes that support block template parts, p.2

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

* move the check to a new OptionsManager class

* make types consistent

* add classic theme with block template parts support

* tmp: add logs for debugging

* Initialize BlockTemplatesController on init

* Remove debugging code

* Prevent duplicate template parts appearing in the Site Editor in classic themes that support template parts

* Update e2e tests for classic themes that support template parts

* Fix Checkout header not being rendered

* Fix PHP tests

* Simplify WC_BLOCK_USE_BLOCKIFIED_PRODUCT_GRID_BLOCK_AS_TEMPLATE logic

* Rename OptionsManager class to TemplateOptions

* Change format of inline comment

* Use wc()->is_store_api_request()

* Update plugins/woocommerce/src/Blocks/TemplateOptions.php

Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>

* Update testing theme slugs

* Add strict_types to TemplateOptions file

* Refactor check_should_use_blockified_product_grid_templates()

* Don't update 'wc_blocks_use_blockified_product_grid_block_as_template' when switching between block themes

* Add extra unit test to make sure the option is not updated when switching between block themes

* Update strict_types format

* Remove unnecessary theme switch after tests finish running

* Replace .toHaveCount( 0 ) with .toBeHidden() in several tests

* Create a TestUtils to abstract logic to open Mini-Cart block

* Remove unnecessary import

* Replace .toHaveCount( 0 ) with .toBeHidden() in several tests (II)

---------

Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
2024-07-03 11:31:41 +02:00
Bart Kalisz f8011713a0
Fix e2e-guidelines.md syntax (#49018) 2024-07-03 11:01:14 +02:00
Adrian Moldovan 36c28b6ad2
Move buildkite-test-collector to devDependencies (#49051) 2024-07-03 11:31:40 +03:00
Luigi Teschio 9eaa73d20d
CYS: improve copy no blocks placeholder (#49030)
* CYS: improve copy no blocks placeholder

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-03 09:25:33 +02:00
Luigi Teschio a511ce77e9
CYS: fix toolbar position after the site preview resizes (#49028)
* CYS: fix toolbar position

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-03 09:25:23 +02:00
Luigi Teschio 7b3434c8b5
CYS: Fix pattern rendering issues (#49041)
* CYS: Fix pattern rendering issues

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

* fix import

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-03 09:25:12 +02:00
Prahesa Kusuma Setia 60c4807e4b
Update WC Tasks regarding wccom connection (#48128)
* update task manage wc marketplace

* add browse marketplace task

* remove wccom connection note inbox

* add changelog

* fix lint

* update doc comment

* update the ordering of inbox

* delete the store connect task

* rename to extend store

* update title to "Enhance your store with extensions"

* update spec
2024-07-03 13:31:47 +07:00
Adrian Moldovan 37280df9ea
Add daily checks for core e2e with PHP 8.1, WP latest-1 and HPOS disabled (#48929) 2024-07-02 15:37:19 -03:00
Thomas Roberts a032d4ff1c
Allow blocks with parents in the `woocommerce` namespace to be rendered as inner blocks (#48543) 2024-07-02 18:24:02 +01:00
Daniel W. Robert 2241a4f199
Update Fiverr CTA to Reflect the Latest Copy in Figma (#48987)
* Update Fiverr CTA to reflect latest update in Figma.

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-02 12:21:44 -04:00
Vlad Olaru b5cf9826d7
Update WCPay Tracks events props (#48901)
* Add path and source props to incentive CTA clicked Tracks event

* Minor inline docs fixes

* Fix wording mistake

* Add from param to Payments settings CTA URL

* Add from param to incentive CTA URL

* refact: Clearer logic for incentive page tracking

* Add changelog

* Fix incentives page tests
2024-07-02 18:45:27 +03:00
Luigi Teschio d4438a8833
CYS: Add default patterns (#48839)
* remove not necessary patterns

* use always template1 for AI flow

* show default patterns homepage

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

* remove not used images

* restore changes

* fix e2e test

* fix e2e test

* restore necessary patterns

* add necessary patterns

* add default patterns

* add default pattern

* update tests

* fix logic

* rename images

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

* restore deleted patterns

* exclude tt4 patterns

* update image

* update default intro pattern

* not use i18n function

* fix how patterns label are translated

* order patterns in the sidebar

* fix unit test

* simplify function

* Fetch patterns from the private dotcom patterns

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

* exclude some default patterns

* fix lint error

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
2024-07-02 14:39:49 +00:00
Gabriel Manussakis e086ba7d32
[Accessibility] Add required indicator to form login (#48743)
* Add accessibility attributes to form login

* Add accessibility attributes to lost password form

* Add accessibility attributes to reset password form

* Bump form login templates

* Add accessibility attributes to register form

* Update login forms with aria-required attribute

* Hide asterisk for screen readers in the register form

* Add changelog file
2024-07-02 16:37:33 +02:00
Bhupesh Mishra 3d37c92c7c
Fix for tags overlapping divider line issue in "Filter by product category" (#48756)
* Fix for tags overlapping divider line issue in "Filter by product category"

Issue fixed where tags are overlapping divider line in "Filter by product category".

* Fix for tags overlapping divider line issue in "Filter by product category"

Issue fixed where tags are overlapping divider line in "Filter by product category".

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-02 06:33:52 -07:00
Alba Rincón 72c1084608
CYS - Fetch patterns from the private dotcom patterns category (#49007)
* Fetch patterns from the private dotcom patterns

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-02 15:18:26 +02:00
Alba Rincón e842d4bc26
[CYS] Avoid the intro cards to get smaller on large screens (#48983)
* Avoid the intro cards to get smaller on large screens

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

* Add flex wrap

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-02 15:06:58 +02:00
Vladimir Reznichenko 12ec2b757d
CI: bug-fix for linting missing strict types directive in new php files. (#49015)
CI: buffix for linting missing strict types directive.
2024-07-02 14:48:33 +02:00
Luigi Teschio 130edc9860
CYS: open Intro panel when user clicks on Design your homepage (#49005)
* CYS: open Intro panel when user clicks on Design your homepage

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-02 13:56:34 +02:00
Mike Jolley dabc29c04e
Enhancement: Update account creation settings wording (#48556)
* Reword and reorganise existing account settings

* Disable account creation options if toggled off

* Toggle disabled state of related options

* Update settings crud tests

* changelog

* Hide based on subscriptions checkbox also
2024-07-02 12:37:15 +01:00
Damián Suárez fae23f0906
Product Editor: disable Add button when no terms or options when creating variations (#48928)
* fix doc. improve doc

* disabe `Add` button when not terms nor options

* variant="primary" > isPrimary

* move helpers to utils file. improve jsdoc

* add tests for hasTermsOrOptions helper

* add isAttributeFilledOut unit tests

* changelog

* allow any type in unit tests

* show a toolip with not possible to add attributes

* fix wrong inline code comment

* expect the Add button is initially disabled

* check the `Add attributes` button is enabled

* changelog

* remove obvios jsdoc

* check all terms are accepted

* minor changes

* update tests

* remove console.log to dev purpose

* improve E2E testing remviing attr row
2024-07-02 08:30:24 -03:00
Luigi Teschio fe4141f663
CYS: Remove iframe animation (#48941)
* CYS: Remove animation

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

* lint CSS

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-02 08:08:38 +00:00
Luigi Teschio fb1c2b9936
CYS: Revisit sidebar layout (#48803)
* WIP

* improve layout

* improve CSS

* fix import

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

* lint scss

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-02 10:03:56 +02:00