Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Make Product Collection product-centric #9469

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
25b7f1a
Make Product Collection fetch products, not posts
kmanijak May 15, 2023
7c7f88f
Make Product Element accepting product context element
kmanijak May 15, 2023
688c623
Change results to products in no products message
kmanijak May 16, 2023
d7e9168
Refactor query building
kmanijak May 16, 2023
7355bb4
Further query build refactor
kmanijak May 16, 2023
6646a67
Remove unnecessary check
kmanijak May 16, 2023
fd8c8b0
Extract buildQuery function
kmanijak May 16, 2023
47a99da
Remove unnecessary explicit prop
kmanijak May 16, 2023
3768d18
Add types to the Product Template Query
kmanijak May 16, 2023
f7baaa6
Merge branch 'trunk' into add/product-centric-product-collection
kmanijak May 16, 2023
bad0a0c
Merge branch 'trunk' into add/product-centric-product-collection
imanish003 May 17, 2023
39c06e3
Use and revert using product title from product elements
kmanijak May 17, 2023
7fc8cb0
Switch back to Product Title variation
kmanijak May 18, 2023
7ce1a7c
Merge branch 'trunk' into add/product-centric-product-collection
kmanijak Jun 6, 2023
17b7009
Replace useStoreProducts with getEntityRecords and use api-fetch midd…
kmanijak Jun 6, 2023
904b21d
Remove empty file
kmanijak Jun 6, 2023
f86fc20
Merge branch 'trunk' into add/product-centric-product-collection
kmanijak Jun 20, 2023
d4414da
Add data tarnsformation to product data middleware
kmanijak Jun 21, 2023
2ae4022
Cnhange the target products transformation
kmanijak Jun 21, 2023
2eabf7b
WIP data transformation layer
kmanijak Jun 21, 2023
c0ffc31
WIP: transform data from WC API to WC Blocks Store API
kmanijak Jun 21, 2023
ebb515f
Make mocks more generic
kmanijak Jun 23, 2023
b5a9d69
Fix the images display
kmanijak Jun 23, 2023
57f1a03
Showcase the support for Product Title and Product Summary with middl…
kmanijak Jun 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/js/atomic/blocks/product-elements/button/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "Display a call to action button which either adds the product to the cart, or links to the product page.",
"category": "woocommerce",
"keywords": [ "WooCommerce" ],
"usesContext": [ "query", "queryId", "postId" ],
"usesContext": [ "query", "queryId", "postId", "product" ],
"textdomain": "woo-gutenberg-products-block",
"attributes": {
"productId": {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/atomic/blocks/product-elements/image/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const blockConfig: BlockConfiguration = {
icon: { src: icon },
keywords: [ 'WooCommerce' ],
description,
usesContext: [ 'query', 'queryId', 'postId' ],
usesContext: [ 'query', 'queryId', 'postId', 'product' ],
ancestor: [
'woocommerce/all-products',
'woocommerce/single-product',
Expand Down
2 changes: 1 addition & 1 deletion assets/js/atomic/blocks/product-elements/price/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const blockConfig = {
apiVersion: 2,
title,
description,
usesContext: [ 'query', 'queryId', 'postId' ],
usesContext: [ 'query', 'queryId', 'postId', 'product' ],
icon: { src: icon },
attributes,
supports,
Expand Down
2 changes: 1 addition & 1 deletion assets/js/atomic/blocks/product-elements/rating/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const blockConfig: BlockConfiguration = {
apiVersion: 2,
title,
description,
usesContext: [ 'query', 'queryId', 'postId' ],
usesContext: [ 'query', 'queryId', 'postId', 'product' ],
ancestor: [
'woocommerce/all-products',
'woocommerce/single-product',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const blockConfig: BlockConfiguration = {
supports,
attributes,
edit,
usesContext: [ 'query', 'queryId', 'postId' ],
usesContext: [ 'query', 'queryId', 'postId', 'product' ],
ancestor: [
'woocommerce/all-products',
'woocommerce/single-product',
Expand Down
2 changes: 1 addition & 1 deletion assets/js/atomic/blocks/product-elements/sku/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const blockConfig: BlockConfiguration = {
title,
description,
icon: { src: icon },
usesContext: [ 'query', 'queryId', 'postId' ],
usesContext: [ 'query', 'queryId', 'postId', 'product' ],
attributes,
ancestor: [
'woocommerce/all-products',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const blockConfig: BlockConfiguration = {
attributes,
supports,
edit,
usesContext: [ 'query', 'queryId', 'postId' ],
usesContext: [ 'query', 'queryId', 'postId', 'product' ],
ancestor: [
'woocommerce/all-products',
'woocommerce/single-product',
Expand Down
16 changes: 8 additions & 8 deletions assets/js/blocks/product-collection/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ export interface ProductCollectionAttributes {
}

export interface ProductCollectionQuery {
author: string;
exclude: string[];
inherit: boolean;
author?: string;
exclude?: string[];
inherit?: boolean;
offset: number;
order: 'asc' | 'desc';
orderBy: 'date' | 'relevance' | 'title';
pages: number;
parents: number[];
parents?: number[];
perPage: number;
postType: string;
search: string;
sticky: string;
taxQuery: string;
postType?: string;
search?: string;
sticky?: string;
taxQuery?: string;
}
Loading