Commit Graph

19308 Commits

Author SHA1 Message Date
Kyle Nel 58138e0036
Hide In-app marketplace feature flag UI (#42951)
* Hide Marketplace feature toggle UI
* Ensure marketplace feature is active in DB on all sites

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-20 12:44:22 +02:00
Alba Rincón 8484520231
CYS > Update copy to remove the duplicate "try to include" (#42960)
* Remove duplicated text

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-20 10:39:09 +01:00
Thomas Roberts 7768ef5b5c
Prevent "Use same address for billing" being checked by default if addresses differ (#42967)
* Don't access the keys of what is now just an array

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-20 14:47:59 +07:00
Matt Sherman 0b315380ed
Skip BlockRegistry tests for now until we can figure out why they are flaky (#42977) 2023-12-19 22:51:50 -05:00
Kathy 7cbf7a3442
Cart: Force calculate totals when ordering again (#42921)
Ensure cart totals are correctly calculated when using "Order again".

Fixes #42889
2023-12-19 16:58:41 -08:00
Barry Hughes d033a40b26
Tweak create-product-attribute spec (#42854)
* Adds missing aria-label and tabindex HTML attributes to the Help tip element for "Product data" on "Add new product" page.

* Escape HTML tags

* Added changelog

* Update comment

* Amend method for selecting "New attribute" placeholder.

* Restore use of `getByRole()` and select first instance (two are being matched, in some cases).

* Use last match (in some test runs, `getByRole()` is unexpectedly matching more than 1 heading.

---------

Co-authored-by: Sagar Tamang <mi5t4n@gmail.com>
2023-12-19 16:35:20 -08:00
Luigi Teschio 310de4cc9f
Docs: Compatibility Layer - update documentation about `woocommerce_single_product_summary` (#42862)
* docs: Compatibility Layer - update documentation about woocommerce_single_product_summary

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-19 23:18:24 +01:00
Paul Sealock b04c45ee5e
Shipping Settings: Highlight text on focus of cost input values (#42689) 2023-12-20 08:22:17 +13:00
louwie17 a72f3ee7a2
Add grouped and external products to new experiment (#42934) 2023-12-19 14:21:05 -04:00
Albert Juhé Lluveras 06e5b43d52
Reviews by Product block: fix encoded in input aria-label (#42944)
* Reviews by Product block: fix encoded in input aria-label

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-19 13:05:18 +01:00
Mike Jolley fe37bf8ddb
Remove duplicate cookie headers from the response (#42828)
Co-authored-by: github-actions <github-actions@github.com>
2023-12-19 03:10:52 -08:00
Tom Cafferkey 73e696f467
Block Hooks API: Add Zaino theme to the list of allowed themes for Mini Cart auto-insertion (#42912)
Co-authored-by: github-actions <github-actions@github.com>
2023-12-19 11:06:35 +00:00
Seghir Nadir d63dd1ed49
Allow passing partial data to Store API extensions field. (#42790)
* Make extended fields optional in Store API

* add tests

* add changelog

* update logic in validate function

---------

Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
2023-12-19 12:04:11 +01:00
Paul Sealock 23f44c0484
Shipping Settings: revert refresh styles (#42738) 2023-12-19 23:42:21 +13:00
Tung Du c651b10b3d
Add: Active Filters block powered by Interactivity API (#42008)
* add: active filters block

* update text domain

* chore: linting

* use template string instead of concat

* add experimental flag to register block type calls

* chore: update comments

* feat: register active rating filter data

* fix: unique navigation id when collection filters are added outside product collection

* fix: active filter rating id

* fix: return the href

* chore: phpcs
2023-12-19 17:29:33 +07:00
Jorge A. Torres 1965dfb63e
Add CLI tool to remove order data from legacy tables (#42848)
* Introduce `LegacyDataHandler` for handling legacy orders in the HPOS datastore

* Add methods to count and obtain orders subject to cleanup

* First pass at metadata cleanup for orders

* Add unit tests

* Implement `wc hpos cleanup` CLI tool

* Make PHPCS happy

* Add changelog

* Change error to warning

* Improve tests

* Fix unit tests

* Allow cleaning up of placeholders with meta

* Add support for `--force` flag

* Update plugins/woocommerce/changelog/enhancement-41914

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Update plugins/woocommerce/src/Database/Migrations/CustomOrderTable/CLIRunner.php

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Update plugins/woocommerce/src/Database/Migrations/CustomOrderTable/CLIRunner.php

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Exclude auto-draft

---------

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2023-12-19 09:32:55 +00:00
Tom Cafferkey bd6a8d365a
Block Hooks API: Add Tsubaki theme to the list of allowed themes for Mini Cart auto-insertion (#42911)
Co-authored-by: github-actions <github-actions@github.com>
2023-12-19 08:59:13 +00:00
Bartosz Budzanowski 1c4d373c84
Fix Order Attribution device type in tracks. (#42814)
* Fix Order Attribution device type in tracks.

* Add changelog.

* Fix indentation.

* Remove wrong comment.

* Update plugins/woocommerce/changelog/fix-order-attribution-device-type-in-tracks

Co-authored-by: Justin Palmer <228780+layoutd@users.noreply.github.com>

* Update plugins/woocommerce/src/Internal/Admin/Orders/MetaBoxes/OrderAttribution.php

Co-authored-by: Justin Palmer <228780+layoutd@users.noreply.github.com>

* Remove trailing whitespace.

---------

Co-authored-by: Justin Palmer <228780+layoutd@users.noreply.github.com>
2023-12-19 09:18:19 +01:00
Tarun Vijwani 82a6611144
Move the switch to classic shortcode block button to separate component (#42724)
* Move the switch to classic shortcode block button to separate component

- Move modal component file from incompatible-extension-notice component folder to switch-to-classic-shortcode-button folder.
- Rename modal component file to model-content component file.
- Move the switch to classic shortcode block button to separate component folder

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

* Update class names in switch-to-classic-shortcode-button component

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

* Update plugins/woocommerce-blocks/assets/js/editor-components/switch-to-classic-shortcode-button/editor.scss

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

* Refactor SwitchToClassicShortcodeButton component

* Fix css lint erros

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2023-12-19 11:44:09 +04:00
Paul Sealock 055b1429fe
Admin.scss: Provide image-mask for Chrome (#42853)
* add mask-image

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-19 16:44:57 +13:00
Corey McKrill 7ff0e47690
Navigation: Change error_log call to doing_it_wrong (#42890)
Avoids printing an error log message in the middle of phpunit output.

Co-authored-by: Leif Singer <leif@automattic.com>
2023-12-18 14:26:38 -08:00
Daniel Dudzic 11b8276a29
Product Gallery: Add Group block labels (#42868)
* Product Gallery: Add Group block labels

* Product Gallery Group Labels: Add changelog entry

* Product Gallery Group Labels: Add an additional changelog entry

* Product Gallery Group block labels: Update changelog message
2023-12-18 22:24:30 +01:00
Maikel David Pérez Gómez 1c3843e4ec
Remove list/sale price from the General tab in grouped products (#42909)
* List and sale price should not be visible in the general tab for grouped products.

* Add changelog files

* Fix lint error
2023-12-18 16:26:38 -04:00
Corey McKrill 89fe33d64f
Logging: Render line breaks in log messages in the db log list table (#42683)
Allow for line breaks within log messages so they can be easier to read when they contain a lot of content.

Based on a suggestion in #27758

Co-authored-by: Moritz Meißelbach <4208996+Biont@users.noreply.github.com>
2023-12-18 11:24:53 -08:00
Corey McKrill 61885b8013
Logging: Improve functionality in new LogHandlerFileV2 handler class (#41802)
This fleshes out the LogHandlerFileV2 class that was introduced back in #40662. It no longer extends the original file log handler, but works as a standalone. To realize the improvements in the handler class, lots of improvements are also made to the File and FileController classes.

Notable enhancements in this handler class vs the original one:

* Better algorithm for determining the "source" of a log entry when none is provided.
* Normalizes the source property of a log entry so that variations in capitalization will still result in the same value.
* Improves file rotation behavior so that it will consistently increment each rotation up by one.
* Formats log messages to remove line breaks, so that each line of a log file is an entire entry.
* To complement this, data from the $context parameter is added to the log entries, and displayed in the log file viewer as prettified JSON, hidden behind a `<details>` element. Thus, each log entry can be expanded to show the context data, but it won't dominate the screen in the log viewer by default.

Fixes #41561
2023-12-18 10:42:17 -08:00
Nathan Silveira 09bcb3fcac
Add support for appending a unique string to the filename for the wp/v2/media endpoint (#42702)
* Extract 'downloadable product' class and include it for API endpoint calls as well

* Re-add mediauploader component

* Restore UploadFilesMenuItem

* Provide additionalData type

* Restore MediaUploader component

* Lint PHP

* Add changelogs

* Update pnpm-lock

* Revert "Update pnpm-lock"

This reverts commit b61ee5813aa0b7b8b1ea8e71423bedbb6f876139.

* Revert pnpm-lock.yaml

* Fix unit tests

* Use WC_ABSPATH
2023-12-18 14:12:44 -03:00
nigeljamesstevenson bbe2a6f2d7
Cherry pick #290 into trunk - Address potential rXSS vulnerability (product-reviews-have-moved notice) (#42728)
* Revert "k6 perf tests: Fix parsing of COT/HPOS environment variable (#40930)"

This reverts commit 50c56d8427, reversing
changes made to cbc3bac88c.

* Address potential rXSS vulnerability in the product-reviews-have-moved notice.

* Changelog.

* Restore button-based approach for notice dismissal.

In the context of this edit comments screen, it looks better as a button (than as a link, which would require extra CSS to support).

* Tidy.

* Update tests: reviews-have-moved notice HTML has been updated.

* Modify form-based approach following code-review feedback.

---------

Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
2023-12-18 16:28:17 +00:00
Ron Rennick de774715bc
Add product image by SKU (#40076)
* add matching image by sku exp feature

* attach featured image in rest api

* add CSV import support

* include changelog

* update from feedback- move to products advanced settings

* address phpcs

* bump @since to 8.5.0

---------

Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
2023-12-18 10:13:11 -04:00
Albert Juhé Lluveras 140d1db2cc
Add tracking when opening or searching in the Command Palette (#41838)
* Add tracking when opening or searching in the Command Palette

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

* Add 'origin' property to all Command Palette events

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-18 14:36:53 +01:00
Kyle Nel 56d038ff5f
Add redirect to new In-App marketplace installer (#42010)
* Add redirect to new In-App marketplace installer

* Update to shared redirect method

* Add changelog

* Add feature flag check

* reuse get_helper_redirect_url

* Remove debug code

* Fix linter issues

* Add linter exception

---------

Co-authored-by: Bero <berislav.grgicak@gmail.com>
2023-12-18 13:25:13 +00:00
Cem Ünalan 23ec020ed9
Marketplace: refresh subscriptions if "install" parameter exists (#42704)
* Marketplace: refresh subscriptions in if "install" parameter exists

* Marketplace: handle loadSubscriptions or refreshSubscriptions failing

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-18 12:53:36 +00:00
Jorge A. Torres 26b7903a68
Add hooks around HPOS orders being synced from/to posts on read/write (#42866)
* Remove unnecessary code

* Add hooks for when an HPOS order is updated from post or backfilled to a post

* Add changelog

* Add docblocks
2023-12-18 12:49:48 +00:00
Seghir Nadir 8ecfcfb9a0
Add Checkbox support for Additional Fields in Checkout Block (#42780)
* Introduce Additional Fields API for Checkout Block https://github.com/woocommerce/woocommerce-blocks/pull/12073

* revert test to what it was

* Default to text, if the type supplied is not supported throw an error

* Add type for options

* Return null if somehow the select made it through without options

* Make select fields type enum and add options to schema

* Lint fixes

* Update plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/address-form/address-form.tsx

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

* Update plugins/woocommerce/src/Blocks/Domain/Services/CheckoutFields.php

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

* Update checks to log errors and fail gracefully

* Add field id to class names

* Fix lint error

* Fix short array use

* Introduce Additional Fields API for Checkout Block https://github.com/woocommerce/woocommerce-blocks/pull/12073

* Default to text, if the type supplied is not supported throw an error

* Lint fixes

* Introduce Additional Fields API for Checkout Block https://github.com/woocommerce/woocommerce-blocks/pull/12073

* add support for registering checkboxes

* remove extra error log

* add styling

* fix rebase conflit

* fix rebase conflit 2

* fix linter errors

* address review comments

* add warning for checkbox

* fix changes

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com>
Co-authored-by: Niels Lange <info@nielslange.de>
2023-12-18 13:21:36 +01:00
Alba Rincón d5a46a1cfb
Remove padding for the products query when background is added (#42817)
* Remove padding for the products query with background

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
2023-12-18 11:14:43 +01:00
Sam Seay 6d4c69850c
Experimental Collection Rating Filter (#41999)
Introduce Experimental Collection Rating Filter, CheckboxList interactivity component.
2023-12-18 22:47:24 +13:00
Christopher Allford bf29119032
Updated PNPM to ^8.12.1 (#42860) 2023-12-18 20:31:49 +13:00
Roy Ho d15bfd2398
Product Gallery: reset main image when variations are cleared (#42830)
* Product Gallery: reset main image when variations are cleared

* Add changelog for woo core

* Update event name to be more descriptive
2023-12-15 13:22:10 -08:00
Jonathan Lane 1bf35ac737
Playwright test workflow migration from Blocks repo (#42804)
* First pass at Playwright test migration

* Set working directory

* Remove exec

* Configure the environment before testing

* Remove filter

* Update paths for tests

* Try explicitly stating working-directory

* Change tests directory

* Try running all tests

* Uncommented project

* Update commands to run tests

* Comment out env config

* Uncomment

* Changelog

* Set up multiple test configurations

* Update failing test

* Update paths for artifacts

* Update path to artifacts

* Path to results

* remove unnecessary file

* Skip translation E2E tests

Skipping translation tests until we fix the missing translations issues after we changed the domain to "woocommerce"

* Update the artifacts path

* Fix lint errors

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: Saad Tarhi <saad.trh@gmail.com>
2023-12-15 09:34:29 -08:00
Keith Light 6e8678aca0
Add HTML5 theme support to NO JS handling (#42753)
* Add HTML5 theme support to NO JS handling

* Add changelog entry

* Tweak changelog.

* Add phpcs ignore comment for safe unescaped output

---------

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2023-12-15 09:15:14 -08:00
Patricia Hillebrandt 69172606f5
CYS - AI Improvements (#42800)
* Add the response_format to the params for requests to AI to ensure it will return the responses in JSON format.

* Update the prompt to define the search term for images from Pexels.

* Streamline product content update and the product image uploads within the ProductUpdater class.

* IMprove prompts for images and product content generation.

* Update the prompt for defining the search term on Pexels and drop double quotes from the response.

* Update the prompts and the position for the titles on content generation for the woocommerce-blocks/testimonials-3-columns pattern.

* Set the 'woocommerce_ai_managed_images' transient for the products endpoint callback in case execution is interrupted so images don't have to be fetched from Pexels again.

* Update the prompt for defining the search term for images.

* Remove unused methods from the PatternsHelper class.

* Update the prompt for AI content generation in patterns.

* Update the prompts for the testimonials and the Hero Product 3 Split patterns.

* Update the position for the main title in the Hero Product 3 Split pattern.

* Reduce the size of the images uploaded to the media library for products.

* Add docblock and update prompts.

* Update the default size of the images received from Pexels to be downloaded and uploaded to the media library.

* Update prompts for the Hero Product 3 Split pattern.

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

* Address lint errors.

* Update array formatting

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-12-15 11:49:16 -03:00
Thomas Roberts 0c6a943c42
Add select field type for custom checkout fields (#42758)
Co-authored-by: Niels Lange <info@nielslange.de>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
2023-12-15 06:39:22 -08:00
louwie17 90dc5bad2e
Address some deprecation warnings (#41845)
* Remove use of deprecated conditional block

* Remove use of deprecated context usage

* Remove use of deprecated positoin on Dropdown in favour of popoverProps

* Add changelogs

* Remove unused import

* Fix lint errors

* Remove popoverProps.position with popoverProps.placement

* Update missed items replacing position to placement

* Fix lint error

* Fix placement position

* Update changelogs
2023-12-15 09:45:06 -04:00
Seghir Nadir 12572ce08c
Introduce Additional Fields extensibility API (#42695)
* Introduce Additional Fields API for Checkout Block https://github.com/woocommerce/woocommerce-blocks/pull/12073

* add changelog

* Auto load the Blocks/Domain/Services/functions.php file

* add changelog

* revert test to what it was

* Update text domain for translations

* Ensure address data is added on the cart block too

* fix lint problem

---------

Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2023-12-15 13:45:38 +01:00
Ilyas Foo 3d7e6bc796
Enable WCCOM shipping partners API consumption (#42810)
* Enable shipping partners API use from frontend

* Changelog

* Add id to each shipping partner to match wccom structure
2023-12-15 20:33:36 +08:00
Damián Suárez d996008219
[Product Block Editor]: propagate content from description inner blocks to Modal editor (#42768)
* set description like the property to update

* switch between summary block and block preview

* add todo: comment

* femove duplicated doc comment block

* Use a quick check to improve performance

* expose getContentFromFreeform() helper fn

* parse freeform content to valid blocks

* changelog

* fix TS issue

* changelog
2023-12-15 09:20:02 -03:00
Thomas Roberts 865ea6ada9
Disable `DisallowShortArraySyntax` and `InternalInjectionMethod` sniffs for blocks files. (#42863)
* Disable some rules for blocks files

* Add changelog
2023-12-15 12:39:31 +01:00
Tom Cafferkey 5cdbc8c98a
Merge branch 'trunk' into update/auto-insert-mini-cart-into-tt2 2023-12-15 08:08:45 +00:00
Tom Cafferkey 9f997106ec
Block Hooks API: Add TT3 theme to the list of allowed themes for Mini Cart auto-insertion (#42760) 2023-12-15 08:07:31 +00:00
github-actions bbc0390e35 Add changefile(s) from automation for the following project(s): woocommerce 2023-12-14 20:26:58 +00:00
paul sealock 7b1f538573 Handle multiple tables in an html string 2023-12-15 09:15:01 +13:00