Commit Graph

65383 Commits

Author SHA1 Message Date
Maikel Perez ade1326139
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 16:22:11 -07:00
Vedanshu Jain 7557c9be6d
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 16:22:11 -07:00
Tung Du c06c0b5319
[Experimental] Product Filters Chips style and new interactivity API implementation (#51393) 2024-09-18 16:22:11 -07:00
RJ a66adfcf6c
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 16:22:11 -07:00
Sam Seay c891bd09e3
Check if button element exists when triggering added_to_cart (#51449) 2024-09-18 16:22:10 -07:00
Chi-Hsuan Huang cb5171dd34
Improve remote logging structure and content (#51360)
* Refactor RemoteLogger to format error file paths and remove absolute paths

* Add changelog

* Change "**" -> "./"
2024-09-18 16:22:10 -07:00
Chi-Hsuan Huang 70dc6340c3
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 16:22:10 -07:00
Narendra Sishodiya cc8cf2366d
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-18 16:22:10 -07:00
Moon b1fa7c2f85
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-18 16:22:10 -07:00
Narendra Sishodiya 1feb5af079
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-18 16:22:10 -07:00
Jason Kytros 04872e31f2
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-18 16:22:10 -07:00
Albert Juhé Lluveras 9a9db637d3
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-18 16:22:09 -07:00
Chi-Hsuan Huang 83be8cb544
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-18 16:22:09 -07:00
Chi-Hsuan Huang cf953cf3cf
Refine PHP Fatal Error Counting (#51363)
* Refine PHP Fatal Error Counting in MC Stat

* Add changelog

* Fix import
2024-09-18 16:22:09 -07:00
jonathansadowski bbe2c4481b
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-18 16:22:09 -07:00
louwie17 3ca2b62611
Add cron for Storybook pages - daily at 2:30 UTC (#51445)
Add cron for storybook pages - daily at 2:30 UTC
2024-09-18 16:22:09 -07:00
Mike Jolley 7c9cef1722
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-18 16:22:09 -07:00
Vladimir Reznichenko 43d101991e
[dev] CI: experimental version of performance metrics job (#51276) 2024-09-18 16:22:09 -07:00
Mike Jolley dc5a992402
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-18 16:22:09 -07:00
Seghir Nadir 8295416732
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-18 16:22:08 -07:00
Karol Manijak 721b04bc64
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-18 16:22:08 -07:00
Vladimir Reznichenko a874c37f05
Monorepo: git post-checkout hook to verify pnpm version and update dependecies. (#51382) 2024-09-18 16:22:08 -07:00
Ivan Stojadinov d5de04d8be
[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-18 16:22:08 -07:00
Manish Menaria 5668fb9ea2
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-18 16:22:06 -07:00
Albert Juhé Lluveras 877b2dca7a
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-18 16:20:51 -07:00
Moon 00dcadac4c
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-18 16:20:51 -07:00
RJ 2ce234217a
add: tax task completion filter (#51362)
* add: tax task completion filter

* fix: add phpcs ignore for missing hook comment

* lint
2024-09-18 16:20:51 -07:00
Miguel Pérez Pellicer dfb0769c47
Set customer email in reports data if available (#51367)
* Set customer email in reports data if available.

* Add changelog

* Lint
2024-09-18 16:20:51 -07:00
Karol Manijak c690dea84d
Hide more filters in scope of handpicked through hideFilters API 2024-09-18 16:20:51 -07:00
Karol Manijak c42627fa3e
Make code more defensive 2024-09-18 16:20:49 -07:00
Karol Manijak f8a18cfe83
Improve empty state in Editor by providing meaningful instruction 2024-09-18 16:20:24 -07:00
Karol Manijak 3a3927676a
Set perPage to 0 and add Pagination block for better discoverability 2024-09-18 16:20:24 -07:00
Bart Kalisz 3bd104cd4a
Small cleanup 2024-09-18 16:20:24 -07:00
Bart Kalisz ce7356292f
Handle collection context / no results state 2024-09-18 16:20:22 -07:00
Bart Kalisz 31775d6835
Improve the query merging logic 2024-09-18 16:15:43 -07:00
Bart Kalisz 2690191cbe
Enable sorting by entered order 2024-09-18 16:13:08 -07:00
Bart Kalisz 17eb0fe113
Update titles and description 2024-09-18 16:11:32 -07:00
Bart Kalisz fa83d18545
Revert "Set control label per context"
This reverts commit cd537befbe.
2024-09-18 16:11:32 -07:00
Bart Kalisz 88e04f1b3a
Hide 'order by' control for the Hand-Picked collection 2024-09-18 16:11:32 -07:00
Bart Kalisz 16bb48c5a0
Use primitives for the icon 2024-09-18 16:11:32 -07:00
Bart Kalisz 44a0ac8544
Set control label per context 2024-09-18 16:11:32 -07:00
Bart Kalisz 155705aa78
Remove timeFrame from the query 2024-09-18 16:11:31 -07:00
Bart Kalisz 50bec181e1
combine conditions for early return 2024-09-18 16:11:31 -07:00
Bart Kalisz ac60428bc9
tweak icon render 2024-09-18 16:11:31 -07:00
Bart Kalisz 423cdce744
add back 2024-09-18 16:11:31 -07:00
Bart Kalisz 6da175824b
try removing for fixing gh syntax hl 2024-09-18 16:11:31 -07:00
Bart Kalisz 7d13eb669d
Render the collection-specific control 2024-09-18 16:11:31 -07:00
Bart Kalisz 54a648e5a8
Initialize the Hand-Picked collection 2024-09-18 16:11:29 -07:00
Christopher Allford 376a1b5223
Hide Empty Related Product Collections 2024-09-18 08:11:22 -07:00
Christopher Allford f7a83ee053
Fixed PHPDoc
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2024-09-18 07:12:32 -07:00