Commit Graph

65352 Commits

Author SHA1 Message Date
Chi-Hsuan Huang 44f7946656 Add changelog 2024-09-19 16:27:15 +08:00
Chi-Hsuan Huang c1b7627228 Add set-woocom-base-url tool 2024-09-19 16:26:58 +08:00
Chi-Hsuan Huang 4d0beb757c Add changelog 2024-09-19 14:57:45 +08:00
Chi-Hsuan Huang 29408da9d2 Refactor data source poller classes for marketing recommendations, payment gateway suggestions, shipping partner suggestions, inbox notifications, remote free extensions, and WooPayments promotion
- Refactor the data source poller classes for marketing recommendations, payment gateway suggestions, shipping partner suggestions, inbox notifications, remote free extensions, and WooPayments promotion to use a dynamic base URL for the data sources.
- Update the deprecated DATA_SOURCES constant to an empty array in each class.
- Add a new method get_data_sources() in each class to return the updated data sources with the dynamic base URL.
- Modify the constructor of each class to use the get_data_sources() method instead of the deprecated DATA_SOURCES constant.
2024-09-19 14:55:31 +08:00
Chi-Hsuan Huang b5c43db303 Refactor WooCommerce Helper class
This commit refactors the WooCommerce Helper class in the `class-wc-helper.php` file. The changes include:
- Updating the comparison operator from `==` to `===` in the `activate_plugin` condition.
- Renaming the `get_install_base_url` method to `get_woocommerce_com_base_url`.
- Adding a new `get_install_base_url` method that returns the base URL for the plugin auto installer.

These changes improve the readability and maintainability of the code.
2024-09-19 14:55:15 +08:00
Chi-Hsuan Huang dfd7d52d6b
[beta tester] Simulate core error early in the request lifecycle before WP fully loaded. (#51330)
* Improve remote logging tool to simulate core error early in the request lifecycle before wp fully loaded

* Disable wp error handler when simulate_woocommerce_error
2024-09-19 12:22:53 +08:00
DAnn2012 2fc6528c61
Fix typo (task-list-completed.tsx) (#51484)
* Update task-list-completed.tsx

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2024-09-19 03:14:36 +00:00
github-actions[bot] 8cdefdcd01
Update changelog.txt from release 9.3.2 (#51523)
Prep trunk post release 9.3.2

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-18 14:13:18 -07:00
Barry Hughes 34aa4f07f1
Update stable tag to 9.3.2 (#51522)
Update stable tag to 9.3.2
2024-09-18 14:06:54 -07:00
Alex Florisca 9b8256cc3e
[Feature] Express Checkout Improvements (#50791)
* Add new buttonAttributes API to style express checkout buttons coherently (#47899)

* Expose buttonAttributes to the express payment methods

* Add size and label attributes to the express checkout area

* Remove defaultHeight

* default button Label

* Remove the button label attribute

* Remove px from height

* Change large button height to 55px

* Load express checkout block with attributes

* Add toggle and borderRadius controls and remove getting border radius from the theme

* Remove extra border radius text

* Only pass buttonAttributes if toggled on

* Move express payment block attribute logic into a Provider

* Tidy up editor grid and parse attributes into context on frontend

* Add px to border-radius input

* Express payment methods not selectable

* Add a test

* lint fixes

* default button height is 48 not 4

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

* Update docs

* Add tests for express payment methods

* Center images within the express payment area in the editor

* Apply the buttonAttributes to the li container in the editor regardless of showButtonStyles

* Fix style issue

* fix linting

* fix lint again

* Update manifest

* Update docs manifest

* Resize images in editor

* lint fix

---------

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

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

* Synchronise the express payment settings between the Cart & Checkout blocks (#50688)

* Add express payment methods to sidebar

* Only add extra props for express payment methods

* Update docs

* Make title, description and gatewayId types optional

* Update docs

* Fix types again and editor side

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

* handle situation when no methods are active

* Update manifest

* Add express payment methods to inspector controls for express checkout block (#50983)

* Remove forced styles on the editor

* Remove the darkMode setting from the buttonAttributes API (#51109)

* Remove darkMode from the buttonAttributes API

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

---------

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

* Accept supports declarations for express payment style controls + merchant ux improvements in the editor (#51296)

* Fix images in editor displaying weird

* Fix long express payment names breaking layout

* Default to uniform styles off

* Use heightControl for border radius and fix height for cart buttons

* Move formatting title and description to the config validation

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

* Fix linting

* Fix failing test

* Add back the 48px height for images in editor

* Fix linting again

* Update docs

* Update docs manifest

* Update docs to fix linting

* Add comment to test to better explain why we are expecting a console warning

* make strings translatable

* Sync cart & checkout directly without option

* Remove current styles

* Change the beta label

* Replace < and > with symbol references in docs

* Update docs manifest

* Increase padding of beta label

* fix linter issues

* change to using looger helper

* fix CSS

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2024-09-18 19:49:27 +00:00
Nathan Silveira 96719139be
Add global_unique_id parameter to products REST API (#51264)
* Add global_unique_id parameter to products REST API

* Remove unnecessary if statement related to commas and trim request content
2024-09-18 15:26:40 -03:00
Jonathan Lane 9d135ee2f5
Skip top flaky tests (#51510)
* Skip top flaky tests

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

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-09-18 18:43:12 +02:00
github-actions[bot] df37ccf8c5
Delete changelog files based on PR 51449 (#51477)
Delete changelog files for 51449

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-18 19:34:07 +07:00
github-actions[bot] 13f5eee40b
Delete changelog files based on PR 51441 (#51497)
Delete changelog files for 51441

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-18 19:33:24 +07:00
github-actions[bot] 8042fcdae3
Delete changelog files based on PR 51456 (#51496)
Delete changelog files for 51456

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-18 19:32:28 +07:00
DAnn2012 610af536d1
Fix typo (adding-a-custom-field-to-variable-products.md) (#50331)
Update adding-a-custom-field-to-variable-products.md

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2024-09-18 14:15:51 +02:00
Boro Sitnikovski ce66b55bc5
In app search improvements feature branch (#51413)
* Add search results count to the in-app marketplace (#51266)

* Add searchResults to context

* Use setSearchResults in Content

* Add ribbons to the tabs

* Changelog

* Use setState as the function name

* Only show ribbon counts when there's an active search

* Refactor how 'setSearchResultsCount' is used (h/t @mcliwanow)

* Don't populate initial search results

* Unify css styling

* Marketplace: bring back the loading state (#51342)

* Marketplace: bring back the loading state

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

---------

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

* Remove in-app marketplace Search results tab and unify results into existing tabs (#51297)

* Remove search results component and any references to it

* Persist current tab for searching, or default to extensions if tab is not set

* Persist term when switching across tabs

* Lint

* When a search is initiated, fetch all categories to keep the tab counts up to date.

The necessary filtering to display data to the current screen will be performed on the frontend.

* Apply correct colors to the tabs, as per design

* Beyond query.term, also rely on isLoading so that search result counts don't jump

* Address an issue when the user searches for something that returns no results in the business services tab

* Changelog

* Addressed :)

* Change key to category

* Fix category filter being broken

Whenever a category is requested, we need to do an additional request with the category param being the current category (overriding extensions/theme/business services).

Ideally the backend API would make a distinction between type (theme/extension/business service) and category, but this hack should do for now.

* Lint

* Remove unused variables h/t @KokkieH

* Lint

* Revert "Lint"

This reverts commit 0b2d2dca6d.

* Actually fix lint without introducing infinite loop

Reproducible at http://localhost:8080/wp-admin/admin.php?page=wc-admin&term=payments&tab=extensions&path=%2Fextensions&category=customer-service

* Show category selector even if there are no results displayed

* Update comment to be less misleading

* Query isn't used here

* Update Marketplace search component (#51313)

* Update Search placeholder text

* Replace search component with one from @wordpress/components

* Make mobile search field font consistent with desktop

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

* Handle import errors for SearchControl component

---------

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

* Marketplace: update category selector (#51309)

* Marketplace: update category selector

Remove the dropdown on the desktop view and show all items, even if
overflowing. Added helper buttons to scroll to the right to show more.

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

* Marketplace: remove category sroll helpers from tabindex

GitHub:
https://github.com/woocommerce/woocommerce/pull/51309/files#r1758448638

* Marketplace: Remove selectedTab reference from product.tsx

This is probably included due to the merge conflict

* Marketplace: tweak category scroll button narrower

---------

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

* Lint

* Fix 2 lint errors

* Fix another lint error (useMemo) h/t @KokkieH

* Add load more button in-app (#51434)

* Add additional fields returned by search API to marketplace types

Ensure components have access to additional fields

* Add LoadMoreButton component

* Only render Load More button if there are additional pages of results

* Fetch and display next page of results in Load More button is clicked

* Simplify renderContent function to have less repetition

- Hide load more button while fetching results

* Improve loading of new products

- Ensure keyboard focus goes to first new product after Load More is clicked

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

* Add blank line to separate sections

* Set category param based on current tab when loading more products

* Improve busy-state screen reader text

Co-authored-by: Boro Sitnikovski <buritomath@gmail.com>

* Add missing dependency

* Move getProductType() function to functions.tsx

- Do not show load more button if isLoading state is true

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Boro Sitnikovski <buritomath@gmail.com>

* Rework the values used with `setSearchResultsCount`

After https://github.com/Automattic/woocommerce.com/pull/21678/files we
get a `totalProducts` so we can re-use that.

Also remove setting the counts when paginating since we set them to the
total.

* Add search complete announcement h/t @KokkieH

* Show update count only if greater than 0 h/t @andfinally

* Switch to Extensions tab if on My subscriptions when searching

* yoda

---------

Co-authored-by: Cem Ünalan <raicem@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Herman <KokkieH@users.noreply.github.com>
2024-09-18 14:14:30 +02:00
Ivan Stojadinov 4bc4649008
[e2e] External - Expand WPCOM suite, part 3 (#51422)
* Skip "Restricted coupon management" - error 500

* Make `wooPatterns` element more specific

* Skip "Merchant can view a list of all customers" - more customers due to using existing website

* No LYS on WPCOM

* Dismiss notice if shown

* Expand WPCOM suite

* Click on `Canada`

* Click on `Canada`

* Be more specific about `Delete` button

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

* Skip two more tests - WC patterns and block

* Remove usage of `networkidle`

* Handle notice if present with `addLocatorHandler`

* Fix ESLint issue

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-18 13:24:38 +02:00
Néstor Soriano 16e072879b
Fix: "Import file path is invalid" in Windows (#51456)
* Fix WC_Product_CSV_Importer_Controller::check_file_path failing on Windows
2024-09-18 13:15:15 +02:00
Naman Malhotra 3df48f2bd7
Revert low stock notification changes (#51441)
* Revert - Change when stock notif emails are triggered

* added changelog

* restored comment

* restored more comment

* lint fixes

* Add docblock.

---------

Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
2024-09-18 18:12:23 +07:00
Ilyas Foo 6a83e8d301
Fix deprecation notice in coming soon and store-only mode (#51474)
* Wrap parse_str under a check

* Changelog
2024-09-18 18:06:38 +08:00
Vladimir Reznichenko d6f1cce424
[dev] Monorepo: update git post-checkout hook (feedback) (#51471) 2024-09-18 11:10:11 +02:00
Maikel Perez f529d927a2
CYS: Fix Looker dashboard data (Track & display average loading times) (#51461)
* Track customize_your_store_assembler_hub_editor_loaded event to measure CYS loading time

* Add changelog file
2024-09-18 09:59:14 +02:00
Vedanshu Jain 3cdf45f69c
Modify API response tests to assert that expected key values are present (#51465)
Modify API response tests to assert that expected key values are present.

This differs from earlier assertion which checks for exact equality. However the earlier assertion was brittle and would fail when a new property is added, for example in https://core.trac.wordpress.org/ticket/61739.

With this change, any addition to schema will not breaking existing API tests.
2024-09-18 12:58:38 +05:30
Tung Du 1b58098848
[Experimental] Product Filters Chips style and new interactivity API implementation (#51393) 2024-09-18 13:16:07 +07:00
RJ ec29880e3e
fix: added pre-API call permissions check on APIs being called on non-admin accessible screens (#51406)
fix: no permissions api errors
2024-09-18 12:53:52 +08:00
Sam Seay 2e3013555e
Check if button element exists when triggering added_to_cart (#51449) 2024-09-18 14:13:47 +12:00
Chi-Hsuan Huang cf7fd8303c
Improve remote logging structure and content (#51360)
* Refactor RemoteLogger to format error file paths and remove absolute paths

* Add changelog

* Change "**" -> "./"
2024-09-18 08:58:10 +08:00
Chi-Hsuan Huang cfca07eca8
Reducing Noise in Remote Logging (#51357)
* Refactor remote logging in WooCommerce

This commit refactors the remote logging functionality in WooCommerce to improve its efficiency and flexibility.

- In the `class-woocommerce.php` file, the `context` array now includes a new key `remote-logging` to indicate whether the error should be logged remotely if remote logging is enabled.

- In the `RemoteLogger.php` file, the `file` key in the `context['error']` array is now assigned to the `$log_data` array, and then unset from the `context['error']` array.

- The `should_handle` method in the `RemoteLogger` class now checks for the presence of the `remote-logging` key in the `context` array. If it is not set or set to `false`, the log is ignored.

- The `RemoteLoggerTest.php` file includes new test cases to ensure that the `should_handle` method returns `false` when the `remote-logging` key is not present in the `context` array.

These changes improve the remote logging functionality in WooCommerce and make it more robust and efficient.

* Revert log format change

* Set remote-logging context to true in log remote event method

* Add changelog

* revert change

* revert change
2024-09-18 08:57:32 +08:00
Narendra Sishodiya c2fa5eeff5
Updated Product attributes placeholder to e.g. length or weight (#51379)
* Updated Product attributes placeholder to e.g. length or weight

* Added Changelog

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

* Delete changelog/51134-product-attribute-placeholder-update

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

* Revise changelog.

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

* Satisfy linter.

* Increase exactitude to reduce ambiguity levels.

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2024-09-17 15:59:22 -07:00
Moon 5fe53a2e3f
Add locale param to jetpack redirect url (#51392)
* Add locale from php

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

* Return a full locale with language and region code

* Fix style

* Fix error

* Lint fixes

* Lint fixes

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-17 13:46:26 -07:00
Narendra Sishodiya e03c51c5ed
Fixed call to member function is_visible Fatal Error (#51286)
* Fixed call to member function is_visible Fatal Error

* Implemented the suggestions

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

* Updated the @version tag

* Promote 'comment' to actual changelog entry.

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2024-09-17 11:30:47 -07:00
Jason Kytros ea6e7295ec
Merge WooCommerce Brands into core (#50165)
* Move WooCommerce Brands into core

* Fix linting errors in brand-thumbnails.php

* More lint fixes for brand-thumbnails.php

* Fix lint issues in brand-description.php

* Fix lint errors for brand-thumbnails-description

* Lint errors: Fix taxonomy-product_brand

* Lint errors: fix taxonomy-product_brand

* Linting: Try adding a space between ignore command and docblock

* Another try to remove the lowercase file name error

* Another try removing lint error for lowercase files

* Lint errors: Fix brands-a-z.php

* More lint fixes for brands-a-z.php

* More lint fixes for brands-a-z.php

* Lint fixes: brand-description.php

* Another try fixing lint errors for brand-description.php

* Another try fixing lint errors for brand-description.php

* More fixes for brand-description.php

* Fix lint errors for Packages.php

* More fixes for Packages.php

* Linting fixes for Brands.php

* Added docblocks for WC_Widget_Brand_Thumbnails variables

* Add script to fix coding standards for files changed in branch

* Run autofix script for linting

* Lint fixes for class-wc-widget-brand-thumbnails.php

* More lint fixes for: class-wc-widget-brand-thumbnails.php

* More lint fixes for class-wc-widget-brand-thumbnails.php

* Lint fixes for class-wc-widget-brand-nav.php

* lint fixes: ignore docblocks

* Another try to fix missing docblocks

* Another try to fix missing docblocks

* Another try fixing missing docblocks

* Better messages for fix-branch.sh

* Fix lint errors in class-wc-widget-brand-description.php

* Fix linting errors in REST API and functions classes

* Fix linting issues in class-wc-brands.php

* More lint fixes for wc-brands.php

* More lint fixes for wc-brands.php

* Fix lint errors for wc-brands-coupons.php

* Fix lint errors for class-wc-brands-block-templates.php

* Fix linting errors for class-wc-brands-block-template-utils-duplicated.php

* Fix lint errors in class-wc-admin-brands.php

* More fixes in class-wc-admin-brands.php

* More class-wc-admin-brands.php

* More lint fixes for: class-wc-admin-brands.php

* More lint fixes for class-wc-admin-brands.php

* Transfer unit test

* Transfer e2e test

* Added specific versions to templates

* Added changelog

* Another try for HTML templates version

* Fix lint errors in test files

* More lint fixes

* Fix lint warnings

* Added brands to list of expected REST API fields

* More lint warning fixes

* More lint warning fixes

* Updated unit tests to include brands

* Remove whitespace

* Added declare( strict_types = 1); to all PHP files

* Added declare( strict_types = 1) to test file as well

* Fix: There must be exactly one blank line after the file comment

* Temporarily remove Brands e2e tests

* Move Brands blockified templates

* Remove script to fix lint errors in current branch

* Try removing pull-package-deps

* Bring back deps

* Commit pnpm-lock.yaml

* Add debug statements

* More debug statements

* Make regular expression more specific

* Make matches more specific

* Search only for PHP templates

* Bring back whitespace

* Remove unnecessary change

* Update pnpm-lock.yaml

* Change the way Brands files are included

* Include all files

* Prevent Brands assets from being double-enqueued

* Move Brands scripts handling into core

* Revert changes in the template-changes.ts script

* Use strict in_array

* Add scaffolding for Brands test

* Add more scaffolding for Brands tests

* Enhance e2e test by adding steps for creating a Brand

* Move Brands test to Playwright folder

* Added manifest

* Fix lint errors in tests

* Move Brands coupons test into core's coupons tests

* Fix linting error in tests

* Move all Brands initialization within the /Internal/Brands class

* Rename `$merged_packages` to `$merged_plugins`

* Add force disable method back

* Move Brands logic outside core files

* Rename admin styles

* Remove brands logic from core's admin class

* Roll back all changes in admin assets class

* Fix linting errors

* Move REST API logic to Brands main class

* Introduce an option to control whether the Brands package is enabled.
Prevent autoloader from loading classes already loaded by individual Packages.
Fix an issue with Brands admin styles.

* Bring back pnpm-lock

* Add comment

* Split long line into two

* Review default values for remote variant assignment

* Rename global functions and add polyfills for deprecated functions

* Bump versions

* Fix some lint errors

* More lint fixes

* Set woocommerce_remote_variant_assignment for Brands to be enabled for unit tests

* Replace reserved word class with class_name

* Another try to include Brands files in tests

* Remove Brands from REST API tests

* Skip Brands tests while Brands is behind a feature flag

* Lint fixes

* Remove empty line

* Added feature flag.

* Fix widgets form

* Fix lint errors for brand description widget

* Fix lint errors for brand description widget

* Fix lint errors

* Bump version

* Updated tooltips for Brands coupon restrictions to match core's

* Fix lint errors

* More lint fixes

* Add REST API v3 for Brands

---------

Co-authored-by: Walther Lalk <83255+dakota@users.noreply.github.com>
2024-09-17 18:13:46 +03:00
Albert Juhé Lluveras 514b39eea0
Fix a type mismatch in UpdateProducts.php (#51408)
* Fix a type mismatch in UpdateProducts.php

* Add changelog file

* Fix a type mismatch in UpdateProducts.php (II)
2024-09-17 16:56:55 +02:00
Chi-Hsuan Huang 6bc2244ec9
Reduce dependency of remote logging on WC_Tracks (#51365)
* Simplify WC_Tracks::get_blog_details() to reduce its dependencies

* Add changelog

* Remove store_id field

* Improve the check
2024-09-17 22:31:55 +08:00
Chi-Hsuan Huang dee8c619f0
Refine PHP Fatal Error Counting (#51363)
* Refine PHP Fatal Error Counting in MC Stat

* Add changelog

* Fix import
2024-09-17 22:31:44 +08:00
jonathansadowski bd1bbfd63c
Update upload- and download-artifact versions in workflows (#51073)
* Update build zip workflow fo upload artifact v4

* Update download- and upload-artifact to v4 in code freeze workflow
2024-09-17 09:16:29 -05:00
louwie17 ad8a25bd63
Add cron for Storybook pages - daily at 2:30 UTC (#51445)
Add cron for storybook pages - daily at 2:30 UTC
2024-09-17 11:11:54 -03:00
Mike Jolley 554434ea3d
Cart Shortcode: `wc_get_cart_url` should only return current URL if on the cart page (#51384)
* Narrow logic further by only checking if the current page is the cart, not WOOCOMMERCE_CART

* changelog
2024-09-17 13:56:01 +01:00
Vladimir Reznichenko b98236a25e
[dev] CI: experimental version of performance metrics job (#51276) 2024-09-17 14:32:01 +02:00
Mike Jolley be17f843b6
Add missing `wp-block-` classnames to order confirmation blocks, Store Notices, and Breadcrumbs (#51380)
* Add missing wp-block-x classname to order confirmation blocks

* Use get_block_wrapper_attributes for store notices block

* Breadcrumbs and notices

* Changelog
2024-09-17 13:30:22 +02:00
Seghir Nadir 66523872f3
Support controlling address card state from data store in Checkout block (#51386)
* fix line height

* Support controlling address card from data store

* expand billing address on unsync

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

* disable linter rule

* remove empty section

* remove used vars

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-17 10:56:15 +00:00
Karol Manijak e354295387
Update Markdown lint allowing the same headings if they're not siblings (#51438)
* Set markdown rule about Multiple headings to check siblings only

* Change the doc to have same headings but not siblings as example

* Add changelog

* Update docs manifest
2024-09-17 12:44:15 +02:00
Vladimir Reznichenko 8b7050f9b1
Monorepo: git post-checkout hook to verify pnpm version and update dependecies. (#51382) 2024-09-17 12:34:40 +02:00
Ivan Stojadinov acc313a9b2
[e2e] External - Expand WPCOM suite, part 2 (#51414)
* Add /merchant tests to the WPCOM suite

* Skip "can manually add a variation" on WPCOM

* Skip "Coupon management" - API returns 500 on delete

* Resolve `wp-block-woocommerce-checkout-order-summary-block` on the first element

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-17 10:43:43 +02:00
Manish Menaria 861bc091d4
Product Collection - Add Editor UI for missing product reference (#51114)
* Initial implementation of the missing product state

- Changed `getProductCollectionUIStateInEditor` to a hook `useProductCollectionUIState`.
	- As we added logic to check if selected product reference is deleted which require making an API call. Therefore, I decided to use a hook.
- While making an API call to check if product reference is deleted, I decided to show spinner in the block.
- Introduced new UI state `DELETED_PRODUCT_REFERENCE` to handle the missing product state.
- Updated existing `ProductPicker` component to handle the new UI state.
	- It's better to use existing component for the missing product state, as it already has all the required UI.

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

* Use getEntityRecord to check if product exists and other improvements

* Remove console log

* Add E2E tests for deleted product reference in Product Collection block

This commit introduces new E2E tests to verify the behavior of the Product
Collection block when dealing with deleted product references. The changes
include:

1. New test suite in register-product-collection-tester.block_theme.spec.ts
2. Modification to product-collection.page.ts to support custom product selection
3. Minor update to utils.tsx to handle trashed products

These tests ensure that the Product Collection block correctly handles
scenarios where referenced products are deleted, trashed, or restored,
improving the overall reliability of the feature.

* Simplify product creation in Product Collection block test

* Refactor E2E test for delete product reference picker

1. Removing the unnecessary `test.describe` block for "Deleted product reference"
2. Eliminating the `beforeEach` hook that was creating a test product
3. Integrating the test product creation directly into the main test

This change simplifies the test structure and improves readability while
maintaining the same test coverage for the Product Collection block's
behavior when dealing with deleted or unavailable products.

* Simplify logic for product collection UI state

This commit simplifies the handling of the `usesReference` prop in the
Product Collection block:

1. In `edit/index.tsx`, directly pass `usesReference` to
   `useProductCollectionUIState` hook without conditional spreading.

2. In `utils.tsx`, update the type definition of `usesReference` in the
   `useProductCollectionUIState` hook to explicitly include `undefined`.

* Refactor Product Collection block to improve prop passing

- Introduce ProductCollectionContentProps type for better prop management
- Refactor Edit component to use a renderComponent function
- Update component prop types to use more specific props
- Remove unnecessary props from ProductCollectionEditComponentProps
- Simplify component rendering logic in Edit component
- Adjust ProductPicker to receive only required props
- Update imports and prop types in various files to use new types

This refactoring improves code organization and reduces prop drilling by
only passing necessary props to each component. It enhances maintainability
and readability of the Product Collection block and related components.

* Refactor Product Collection block editor UI state handling

This commit simplifies the rendering logic in the Product Collection block's
Edit component. It removes a redundant case for the VALID state, as both
VALID and VALID_WITH_PREVIEW states now render the same ProductCollectionContent
component. This change improves code maintainability and reduces duplication.

* Fix: isDeletedProductReference is not set correctly

* Use "page.reload" instead of "admin.page.reload"

* Separate PRODUCT_REFERENCE_PICKER and DELETED_PRODUCT_REFERENCE cases

This improves readability and maintainability of the switch statement.

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-17 14:08:24 +05:30
Albert Juhé Lluveras 4ee2689f4f
Fix fatal when adding the Product Gallery (Beta) block into a pattern (#51189)
* Fix fatal when adding the Product Gallery (Beta) block into a pattern

* Add changelog file

* Linting
2024-09-17 09:49:53 +02:00
Moon 160b3e3ca7
Add use-wp-horizon feature flag (#51421)
* Add use-wp-horizon feature flag

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-16 21:02:21 -07:00
RJ 0036b4d293
add: tax task completion filter (#51362)
* add: tax task completion filter

* fix: add phpcs ignore for missing hook comment

* lint
2024-09-17 09:33:41 +08:00
Miguel Pérez Pellicer e4d995938f
Set customer email in reports data if available (#51367)
* Set customer email in reports data if available.

* Add changelog

* Lint
2024-09-16 22:45:47 +04:00