Commit Graph

65292 Commits

Author SHA1 Message Date
github-actions[bot] 941f85bb77
Delete changelog files based on PR 50970 (#51093)
Delete changelog files for 50970

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-04 09:41:53 -07:00
Tom Cafferkey 6bf6f32854
CYS: Replace Nokul theme with Gizmo (#51113)
* Replace Nokul theme with Gizmo in the CYS experience since it was retired
2024-09-04 14:34:00 +01:00
Tom Cafferkey c074c5580b
PTK: Check if theres a scheduled action before logging warning. (#51143)
* Check if there is a scheduled action before logging warning
2024-09-04 13:23:20 +00:00
Roy Ho b618f81c6d
[Experimental] Product filters - ensure we can add multiple instances (#51051)
* Product filters ensure we can add multiple instances

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

* Add e2e tests to ensure multiple filters can be added

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-04 05:39:07 -07:00
Gabriel Manussakis f93a05c467
[Accessibility] Add endpoint title to the document title (#50900)
* Add endpoint title to the document title

* Add changelog file

* Ignore phpcs NonceVerification
2024-09-04 10:22:21 +01:00
louwie17 907b591a42
Add product data forms to data views (#51071)
* Add DataForms for products

* Fix list view

* Revert pnpm lock changes

* Add changelog

* Reference core store versus using string

* Revert pnpm-lock
2024-09-04 05:52:51 -03:00
Gabriel Manussakis f8677c45d1
[Accessibility] Provide screen readers with product sorting status message (#50573)
* Update result-count template to display orderby message

* Update result count live region if products are sorted

* Bump result-count template version

* Remove additional full stop.

* Fix docblock spacings

* Remove jQuery code from sort by live region logic

* Validate filter result type

---------

Co-authored-by: Tom Cafferkey <tjcafferkey@gmail.com>
2024-09-04 08:31:08 +01:00
Chi-Hsuan Huang 19aac5f6fb
Delete changelog files based on PR 51013 and 51046 (#51128)
Delete change logs for 51013 and 51046
2024-09-04 10:39:24 +08:00
Ivan Stojadinov 0d65648ed7
[e2e] Skipping 11 tests for the Pressable website (#51123)
* Skipping 11 tests for the Pressable website

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Jonathan Lane <lanej0@users.noreply.github.com>
2024-09-03 21:53:23 +00:00
Adrian Moldovan 881fd73847
[e2e tests] Fix restricted coupons tests - wait for animation to finish (#51121) 2024-09-03 14:29:07 -07:00
github-actions[bot] 1e4b34cad8
Delete changelog files based on PR 51075 (#51118)
Delete changelog files for 51075

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-03 14:04:43 -07:00
Adrian Moldovan 03a69eca0b
[api tests] Isolate test context for fix flakiness in product crud api tests (#51116) 2024-09-03 13:58:17 -07:00
Christopher Allford caf9ec635e
Use PHP 7.4 for WooCommerce Blocks' `wp-env` Config (#51075)
This resolves a PHP 7.4 compatibility problem as well as updates the `wp-env` config for the Blocks tests to use 7.4 rather than the latest.
2024-09-03 09:54:22 -07:00
Adrian Moldovan c656fdc59b
[e2e tests] Clean up created test products in product edit tests (#51112) 2024-09-03 18:02:58 +02:00
Gabriel Manussakis 57ef5a884e
[Accessibility] Improve Checkout block page accessibility after removing heading level 1 (#50925)
* Add aria-label to checkout form landmark

* Remove aria-hidden from checkout form sub-titles

* Add aria-label to checkout form

* Add changelog file

* Remove aria-hidden from form-step snapshots

* Bump form-checkout template version
2024-09-03 15:42:28 +01:00
Luigi Teschio af9ca20af5
[DataView]: Add Products View and Product Edit stories (#50999)
* Product Editor: add storybook

* fix storybook

* Add products data views list

* Add navigation on the left

* Update edit site package

* Fix styling

* Add changelog

* Add wp/icons package to syncpack exception list

* Delete some unused stuff and address types

* Add changelog

* Remove un needed css

* Remove dependency on edit-site package

* WIP

* WIP

* WIP

* Fix storybook build

* Ignore storybook from version pinning

* add slug stories

* Add products data views list

* Add navigation on the left

* Update edit site package

* Fix styling

* Add changelog

* Add wp/icons package to syncpack exception list

* Delete some unused stuff and address types

* Add changelog

* Remove un needed css

* Remove dependency on edit-site package

* Fix custom status filters

* Make sure page size works with view config

* improve storybook

* rename file

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

* Remove use of canvasMode and navigation context as it is not needed

* Remove wordpress/dom from syncpack

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

* add edit-site style

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

* remove not necessary file

* address feedback

* fix webpack configuration

* fix lint errors

---------

Co-authored-by: Lourens Schep <lourensschep@gmail.com>
Co-authored-by: Sam Seay <samueljseay@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-09-03 14:09:54 +00:00
louwie17 82a00a56e5
Remove usage of team specific names within PHP unit tests (#51017)
* Change team names in tests to generic names

* Add changelog
2024-09-03 10:29:45 -03:00
louwie17 f44c0b8064
Add replace label tool for use in GitHub Monorepo (#50649)
* Add some base tools for label updates

* Add updated replace label script

* Add state option

* Rename folder

* Include build file of folder rename

* Update types and add comments

* Update build

* Remove unused option

* Add check for existing label and address case sensitivity
2024-09-03 10:27:50 -03:00
Mike Jolley a7f29ce98e
Consolidate Store API and Core account creation handling (#50913)
* Consolidate Store API and Core account creation handling

* Changelog

* Add hook doc

* Update tests to not use global settings

* Ignore lints for other hooks in file
2024-09-03 13:42:51 +01:00
Mike Jolley bdf8f2b1a4
[Flaky Test] Wait for response across all requests, including on the checkout page (#51048)
* Wait for response across all requests, including on the checkout page

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

* Update Docblock

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-03 11:22:19 +01:00
Sam Seay 115d4f16c9
Remove the wc combobox component, it is no longer used (#50975) 2024-09-03 09:20:46 +00:00
louwie17 a0cb19b550
Remove storybook WordPress files from git (#51104)
* Remove storybook WordPress related files

* Add gitkeep to wordpress folder

* Add wordpress folder to gitignore for storybook
2024-09-03 04:40:46 -03:00
Paul Sealock bf7e81de8e
[Legacy Settings] Enable Save button on pages with tables (#51102) 2024-09-03 18:39:38 +12:00
RJ 258ae0b03b
add: remote logger request uri sanitisation (JS) (#51046)
* add: remote logger request uri sanitisation

* md lint

* Update packages/js/remote-logging/README.md

Co-authored-by: Paul Sealock <psealock@gmail.com>

* pr feedback

---------

Co-authored-by: Paul Sealock <psealock@gmail.com>
2024-09-03 05:42:03 +00:00
Chi-Hsuan Huang c1f9a73af1
Fix badge number fails to match the number of unfinished tasks (#51063)
* Update core profiler layout options

* Add changelog

* Disable footer
2024-09-03 13:38:00 +08:00
Ilyas Foo 4680b3dcfb
Add a check to make themes API query safer (#51081)
* Add check to ensure themes API is safe

* Changelog

* Lint

* Add more checks for malformed data
2024-09-03 13:01:32 +08:00
Adrian Moldovan 0be7e3deb0
[e2e tests] Fix linked products flaky test (#51099) 2024-09-03 04:53:32 +00:00
Paul Sealock cfcf074886
[Settings] Update feature flag usage (#50977) 2024-09-03 12:45:48 +12:00
Sam Najian 8b35b0785c
Update woocommerce shipping promo banner [wc-shipping-188] (#50970)
* Make sure the WC Shipping slug is used for installation

* Make sure the check to show banner metabox work for HPOS as well

* Make ShippingLabelBannerDisplayRules::order_has_shippable_products work with HPOS as well

* Remove Jetpack plugin specific checks in ShippingLabelBannerDisplayRules

* Use correct variable names for dotcom connection

* Fix comments

* Remove depenency on WCS&T for showing WC Shipping promo banner

* Remove WC Tax and WC Shipping from incompatible plugins

* Vary action button label if WCS&T is already installed

* Inject config and render label purchase app after activation

* Open the purchase modal after adding it to DOM

* Render Shipment tracking metabox

* Use a different headline when WCS&T is already installed

* Fix UX when a none-compatible WCS&T is already active

* Fix CSS linting issues

* Fix Jslint issues

* Improve around usage of localized variables

* Fix and update JS tests

* Address phpcs issues

* Delete metaboxes of compatible WCS&T

* Remove redundant variable assignment

* Remove css and js of WCS&T if a compatible version is installed

* Fix failing legacy PHPUnit tests

* Only open the new label purchase modal if WCS&T is not active

* Remove redundant code around TOS acceptance for showing the banner

* Remove redundant test for Jetpack version checking

* Make sure target passed to MutationObserver.observe is available

* Add changelog file

* Add openWcsModal to component's prototype

* Add more js unit tests

* Address PHP notice

* Remove redundant variable assignments

* Rename wcsPluginSlug to more clear wcShippingPluginSlug

* Add a link to plugins page if incompatible WCS&T is already installed

* Remove unused function parameters

* Fix API resource path

* Handle a case where none compatible version of WCShipping is installed
2024-09-02 14:23:52 +02:00
Adrian Moldovan 74e96d689b
[e2e tests] Tag some e2e tests to help with test audit (#51044) 2024-09-02 12:09:56 +02:00
Albert Juhé Lluveras 0f7773dd47
Fix My Account block icon being too small when inserted via block hooks (#51047)
* Fix My Account block icon being too small when inserted via block hooks

* Add changelog file
2024-09-02 09:40:47 +02:00
Manish Menaria 2433664aa8
Product Collection - Show product picker in Editor when collection requires a product but it doesn't exist (#50164)
* Show product picker control in the editor when a product context is required but not provided

Enhanced the Product Collection block by introducing the `selectedReference` attribute and implementing a product picker control. This control appears in the editor when a product context is required but not provided in the current template/page/post.

1. **block.json**: Added `selectedReference` attribute of type `object`.
2. **constants.ts**: Included `selectedReference` in the `queryContextIncludes` array.
3. **EditorProductPicker.tsx**: Created a new component for selecting products within the editor.
4. **editor.scss**: Added styles for the new Editor Product Picker component.
5. **index.tsx**: Updated logic to determine the component to render, incorporating the new Editor Product Picker.
6. **types.ts**: Defined types for `selectedReference` and updated `ProductCollectionAttributes` interface.

This enhancement allows merchants to manually select a product for collections that require a product context, ensuring the block displays correctly even when the product context is not available in the current template/page/post.

- **Product Picker Control**: Utilizes the existing `ProductControl` component for selecting products. This component is displayed in the editor when a collection requires a product context but it doesn't exist in the current template/page/post.

* Update label on ProductControl component

* Implement dynamic UI state management for product collection block

- Introduced `ProductCollectionUIStatesInEditor` enum to define various UI states for the product collection block.
- Added `getProductCollectionUIStateInEditor` utility function to determine the appropriate UI state based on context.
- Updated `Edit` component to use `getProductCollectionUIStateInEditor` for dynamic state management.
- Refactored `ProductCollectionContent` to utilize the new Editor UI state management.

* Fix: Product picker isn't showing

* Fix: Preview label state isn't showing

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

* Refactor WooCommerceBlockLocation type

- Introduced specific interfaces for WooCommerceBlockLocation, including ProductLocation, ArchiveLocation, CartLocation, OrderLocation, and SiteLocation, to improve type safety and code clarity.
- Updated createLocationObject function to return a BaseLocation type.
- Refactored useSetPreviewState hook in product-collection utils:
  - Extracted termId from location.sourceData for cleaner and more readable code.
  - Replaced direct access of location.sourceData?.termId with termId variable.

* Remove fallback to 0 in case there may be a product with id 0

* Use optional chaining to avoid undefined errors

* Rename  to

* Change order of arguments in  function

* Pass boolean prop instead of making further recognition of the UI state in ProductCollectionContent

* Destructure  props in  component

* Rename  to

* Update names in  enum

* Rename  to  and change the structure to single number.

* Rename location to

* Add a method to choose a product in the product picker in Editor

* Add E2E tests

* Fix failing e2e tests by changing location to productCollectionLocation

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

* Don't allow selecting product variations

* Minor code refactoring

* Fix: Product control isn't showing products

**Before**
```tsx
const getRenderItemFunc = () => {
		if ( renderItem ) {
			return renderItem;
		} else if ( showVariations ) {
			return renderItemWithVariations;
		}
    return () => null;
	};
```

As you can see above, `return () => null;` is returning a function which is causing the issue. This will render nothing in the list. I changed this to `return undefined;`. This way, we will use default render item function.

* Translate text in ProductPicker component

* Improve E2E test

* Use createInterpolateElement to safely render strong HTML tag

* Fix E2E tests

* Fix E2E tests

* Product Collection: Inspector control to change selected product (#50590)

* Add Linked Product Control to Product Collection Block Inspector Controls

- Introduced a new `LinkedProductControl` component in the Product Collection block's Inspector Controls.
- This control allows users to link a specific product to the product collection via a dropdown with a search capability.
- Added corresponding styles to `editor.scss`.
- Integrated a `useGetProduct` hook in the `utils.tsx` to fetch and manage the state of the linked product data, including handling loading states and errors.
- Updated the Inspector Controls to include the new Linked Product Control component, enhancing the block's customization options for users.

* Add E2E tests

* Hide product picker when product context is available

* Improve logic to hide Linked Product Control

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

* Remove hasError state from useGetProduct hook

* Rename isShowLinkedProductControl to showLinkedProductControl

* Convert jsxProductButton to ProductButton component

* Refactor jsxPopoverContent to LinkedProductPopoverContent component

* Improve UI of Linked Product Control

* Address PR feedback

* Fix E2E tests

---------

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

* Rename isUsesReferencePreviewMode to isUsingReferencePreviewMode

* Change order of conditions in getProductCollectionUIStateInEditor

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-09-02 12:39:33 +05:30
RJ 36ede651db
add: sanitise query params in remote logging (PHP) (#51013) 2024-09-02 12:38:22 +08:00
Fernando Marichal 3def18623e
Fix variation selector display issues on the front end (#51023)
* Add woocommerce class to single-product

* Add changelog

* Fix chevron alignment
2024-08-30 17:47:20 -03:00
Seghir Nadir dec89a1311
Revert "Store API: Do not resume orders with `pending` status (#50531)" (#51067)
* Revert "Store API: Do not resume orders with `pending` status (#50531)"

This reverts commit 3170acd1b0.

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-30 18:24:53 +01:00
louwie17 2890e16c86
Add product data views list to experimental product data views page (#51008)
* Add products data views list

* Add navigation on the left

* Update edit site package

* Fix styling

* Add changelog

* Add wp/icons package to syncpack exception list

* Delete some unused stuff and address types

* Add changelog

* Remove un needed css

* Remove dependency on edit-site package

* Fix custom status filters

* Make sure page size works with view config

* Remove use of canvasMode and navigation context as it is not needed

* Remove wordpress/dom from syncpack
2024-08-30 13:27:10 -03:00
Albert Juhé Lluveras e589fa87e1
CYS: Mark several classes as internal (#51069)
* CYS: Mark several classes as internal

* Add changelog file
2024-08-30 16:59:28 +02:00
Alba Rincón 502b4abe43
Fix increasing & decreasing sale price in product bulk edit (#50842)
* Set the regular price when the `Change to:` price is left empty

* Avoid fatal error when price is empty

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

* Avoid setting the price to 0 when there wasn't a previous sale

* Move the WC_Tests_Admin_Post_Types test to the appropiate folder so it's run

* Add e2e test

* Add e2e test

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

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

* Fix lint errors

* Fix lint errors

* Fix test

* Fix lint errors

* Revert mv

* Address increasing sale from 0

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-30 14:40:05 +02:00
Chi-Hsuan Huang 7971df1d28
Enhance WooCommerce version checking for remote logging reliability (#51009)
* Enhance WooCommerce version checking using get_plugin_updates()

* Update remote logger tool to toggle remote logging feature properly

* Add changelog
2024-08-30 20:25:52 +08:00
Tom Cafferkey 44b5f54d08
Add doc blocks to Products shortcode hooks (#51061)
* Add doc blocks to products shortcode woocommerce_before_shop_loop hooks

* Improved comments

* Add changelog
2024-08-30 11:24:34 +00:00
Vedanshu Jain 5999ea6716
Add filter to overwrite response of `wc_rest_should_load_namespace` (#50902)
* Add filter to allow overwriting `wc_rest_should_load_namespace`.

* Unit tests + changelog.

* Add doc block.

* Update version number.

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

---------

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
2024-08-30 16:42:28 +05:30
Alba Rincón 40cde50879
`Product SKU` improvements (#51033)
* Add new prefix and suffix attributes

* Add editable prefix & suffix rich text fields

* Remove the uppercase style from prefix and suffix

* Render the prefix and suffix in the front end

* Fix lint errors

* Handle old sku block without prefix and suffix

* Improve the editor styles

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

* Use wp_kses_post to filter and format the suffix and perfix

* Address extra space when empty and better escaping

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-30 10:23:28 +02:00
Gabriel Manussakis 0f1634d6da
[Accessibility] Trap focus inside the product gallery modal (#50730)
* Add i18n_open_product_gallery prop to wc_single_product_params

* Trap focus inside the product gallery modal

* Ensure the product gallery controls are always visible

* Add changelog file

* Add space before parameter

* Early return if there is no elements enough to trap focus

* Revert changes on the gallery trigger link

* Remove unnecessary white sopace

* Fix trap focus when the arrow buttons are hidden

* Remove usage of the Photoswipe destroy event
2024-08-30 10:14:22 +02:00
Bart Kalisz ff197207ef
Product Collection: Don't render when empty unless the no results block is present (#50404)
* Disable PC render when content empty unless no results block is present

* Introduce empty PC classname

* Add E2E test

* Add changelog entry

* Ensure the render is preserved as expected

* Do not render empty div

* Update tests

* Try a different logic

* Add hint to the docblock

* Remove obsolete e2e test

* Update render handler name to acknowledge context

* Fix tests failing due to recent v3 update

* Restore block interactivity

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2024-08-30 08:48:54 +02:00
Karol Manijak 062c4ed76a
Migrate Product Price to `block.json` (#50905)
* Migrate Product Price to block.json

* Add changelog

* Update block references

* Update block references and doc manifest

* Add shared config properties to Product Price block.json

* Update block references and docs manifest
2024-08-30 07:47:03 +02:00
Gabriel Manussakis a40f87b9ec
[Accessibility] Fix typo in initCustomFieldsToogle variable name (#48652)
* Fix typo in initCustomFieldsToogle variable name

* Add changelog file

---------

Co-authored-by: Daniel W. Robert <danielwrobert@users.noreply.github.com>
2024-08-29 17:55:23 -04:00
Ivan Stojadinov 3a2a812e1d
[e2e tests] External sites - update /merchant tests, part 1 (#51014)
* Dismiss "Choose a pattern" if present

* Cover "New in store" for PRessable

* Handle error for `api.delete( coupons/<id> )`

* Check if `Select an option…` is available

* Expand Pressable suite

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

* Missed one spec, adding it now

* Handle "Choose a pattern" popup

* Use `closeChoosePatternModal` instead

* Remove comments

* Add missing `throw` error

* Revert to check `Browse store` link, after updating template on Pressable

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-29 21:05:30 +02:00
github-actions[bot] a5e9744ed5
Delete changelog files based on PR 51001 (#51039)
Delete changelog files for 51001

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-08-30 01:04:09 +07:00
Tung Du cd638721f9
[Experimental] Update folder structure for new product filter blocks (#51029) 2024-08-29 15:23:40 +00:00
github-actions[bot] 84e689d8a4
Delete changelog files based on PR 50923 (#51036)
Delete changelog files for 50923

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-08-29 19:10:24 +07:00