woocommerce/packages/js/data/src
Nathan Silveira 442adcc395
Determine _product_template_id from WP filter (#47762)
* Remove template matching from front-end

* Create 'woocommerce_rest_get_product' filter to allow extensions to change the product when it's fetched through the REST API

* Stop defaulting to 'standard-product-template' product template and handle defaults only in getLayoutTemplateId function

* Use created hook to determine and persist the product template ID when it's not defined.

Also introduce 'match_fn' in ProductTemplate to allow extensions to provide robust ways of matching the template

* Add changelog

* Fix tests

* Remove outdated tests

* Fix issue in filter because $product can be false and move API change to v3

* Add comments to continue statements

* Small refactor

* Only send layout template id to useLayoutTemplate after product is loaded

* Revert front-end changes

* Remove match_fn and create filter to allow extensions to determine the product template id

* Avoid loading layout template before product is loaded

* Create woocommerce_product_editor_determine_product_template filter and use it

* Update changelogs and remove unused code

* Remove _product_template_id for products that were created with the new product editor.

* Use only id to find productTemplate

* Turn hook into experimental

* Remove deprecated tests

* Rename filter

* Add more typings to useEntityRecord

* Use hasResolved boolean to check whether product has been resolved

* Add changelog

* Add 'variation' to ProductType

* Don't default to the standard-product-template for variations

* Update changelog

* Accept null in getLayoutTemplateId

* Fix edit variable product test

* Rename hook

* Revert changed logic to avoid regressions

* Increment useProductTemplate logic

* Default to standard-product-template instead of undefined when no matches

* Re-import Features class

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-06-07 19:48:20 +00:00
..
countries add: core profiler business info page (#38412) 2023-05-30 15:05:38 +08:00
crud CRUD: populates `items` and `itemsCount` when a new item is created (#47632) 2024-05-27 16:34:12 +01:00
export dev: added types for resolveSelect where applicable (#38241) 2023-05-16 08:55:50 +08:00
import dev: added types for resolveSelect where applicable (#38241) 2023-05-16 08:55:50 +08:00
items dev: added types for resolveSelect where applicable (#38241) 2023-05-16 08:55:50 +08:00
navigation dev: added types for resolveSelect where applicable (#38241) 2023-05-16 08:55:50 +08:00
notes dev: added types for resolveSelect where applicable (#38241) 2023-05-16 08:55:50 +08:00
onboarding Move LYS coming soon initialization to core profiler flow (#46708) 2024-04-22 14:49:59 +08:00
options dev: added types for resolveSelect where applicable (#38241) 2023-05-16 08:55:50 +08:00
orders Data: add selector to get related products (#43489) 2024-01-11 12:56:59 -03:00
payment-gateways dev: added types for resolveSelect where applicable (#38241) 2023-05-16 08:55:50 +08:00
plugins Change WooCommerce Payments to WooPayments across the WC Core (#39188) 2023-07-13 12:58:17 +03:00
product-attribute-terms Fix attribute terms disappearing in list (#39620) 2023-08-09 10:41:47 -03:00
product-attributes [Product Block Editor]: update the attributes list optimistically when a new attribute is created (#46717) 2024-04-26 07:53:13 -04:00
product-categories Add category field dropdown field (#34400) 2022-10-14 09:05:39 -03:00
product-form dev: added types for resolveSelect where applicable (#38241) 2023-05-16 08:55:50 +08:00
product-shipping-classes Add shipping class section and dropdown (#34684) 2022-09-23 09:54:52 -03:00
product-tags Add Tags to product editor (#39966) 2023-09-06 15:51:22 -03:00
product-variations Enable inline actions in the variations table for images (#47065) 2024-05-03 15:26:22 -03:00
products Determine _product_template_id from WP filter (#47762) 2024-06-07 19:48:20 +00:00
reports dev: added types for resolveSelect where applicable (#38241) 2023-05-16 08:55:50 +08:00
reviews dev: added types for resolveSelect where applicable (#38241) 2023-05-16 08:55:50 +08:00
settings Add preemptive set isRequesting when optimistically updating settings 2023-08-14 11:47:34 +08:00
shipping-methods Update shipping partner suggestions to use data from API (#38457) 2023-05-30 15:56:32 +08:00
shipping-zones Add/33443 shipping zones data store (#33830) 2022-07-14 09:53:26 -03:00
tax-classes Include tax options in pricing section (#36299) 2023-01-06 09:41:45 -03:00
types Data: add selector to get related products (#43489) 2024-01-11 12:56:59 -03:00
user Update to pnpm 9.1 (#47385) 2024-05-13 10:57:39 -03:00
constants.ts Moved WCA Packages 2022-03-18 14:25:26 -07:00
controls.ts Order product count api requests orders store (#33063) 2022-05-27 11:12:00 -03:00
index.ts Tidy and update product attribute TypeScript types (#46907) 2024-04-25 07:30:02 -04:00
use-select-with-refresh.ts Migrate `@woocommerce/data` user and use-select-with-refresh to TS (#33512) 2022-06-22 17:27:18 +08:00
utils.ts Add filters to Variation table (#40978) 2023-10-31 13:29:48 -04:00