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

Product Collection - Add Inherit query from template control #9485

Merged
merged 74 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
e4abb25
Add columns control to product collection block editor settings
imanish003 May 15, 2023
43b2d1c
Merge branch 'trunk' into 9356-product-collection-editor-settings-col…
imanish003 May 15, 2023
65582af
Refactor: Simplify Fallback Return in ColumnsControl Component
imanish003 May 16, 2023
e03ecf6
Feature: Add 'Order By' Control to Product Collection Inspector
imanish003 May 16, 2023
91b5cb4
Merge branch 'trunk' of https://github.com/woocommerce/woocommerce-bl…
imanish003 May 16, 2023
5e5c6b1
Add more options to OrderBy type
imanish003 May 16, 2023
502295f
Add Inherit global query control to the Product Collection
kmanijak May 16, 2023
9cfa07e
Merge branch 'trunk' into 9359-product-collection-editor-settings-ord…
imanish003 May 17, 2023
7954c13
Add orderby handling on frontend & editor
imanish003 May 17, 2023
b756198
Merge branch 'trunk' into 9359-product-collection-editor-settings-ord…
imanish003 May 17, 2023
bed6be4
Merge branch 'trunk' into 9359-product-collection-editor-settings-ord…
imanish003 May 18, 2023
58c518a
Merge branch 'trunk' into add/product-collection-inherit
kmanijak May 18, 2023
6978335
Fix the condition to show query controls (they shoul appear if query …
kmanijak May 18, 2023
df9fad6
Merge branch 'trunk' into add/product-collection-inherit
imanish003 May 18, 2023
d257e8b
Make Product Collection inheirt global query in product archive templ…
kmanijak May 18, 2023
724f894
Merge branch 'trunk' of https://github.com/woocommerce/woocommerce-bl…
imanish003 May 19, 2023
e5a43cf
Add 'on sale' filter and enhance settings management in product colle…
imanish003 May 19, 2023
2e77956
Merge branch 'trunk' into 9361-product-collection-filters-on-sale
imanish003 May 22, 2023
8e9ee85
Merge branch 'trunk' into add/product-collection-inherit
imanish003 May 22, 2023
1022323
Merge branch 'trunk' into add/product-collection-inherit
imanish003 May 23, 2023
229d12b
Revert "Make Product Collection inheirt global query in product archi…
imanish003 May 23, 2023
1828047
Updated 'inherit' behavior in the Product Collection block
imanish003 May 23, 2023
c2d59c1
Merge branch 'trunk' into add/product-collection-inherit
imanish003 May 24, 2023
a832d97
Add stock status filter to WooCommerce product collection block
imanish003 May 24, 2023
c4188da
Refactor Stock Status control of Product Collection block
imanish003 May 24, 2023
2d5e3f9
Merge branch 'trunk' into 9362-product-collection-filters-stock-status
imanish003 May 24, 2023
07fc6fe
Add keyword search control to Product Collection block
imanish003 May 24, 2023
1f6a425
Resolve conflicts
imanish003 May 25, 2023
751b2b4
Add product attributes filter control to ProductCollection block
imanish003 May 25, 2023
ede31c9
Merge branch 'trunk' into 9363-product-collection-filters-attributes
imanish003 May 25, 2023
c71c4c5
Merge branch 'trunk' into 9363-product-collection-filters-attributes
thealexandrelara May 25, 2023
c000167
Merge branch 'trunk' into 9363-product-collection-filters-attributes
imanish003 May 26, 2023
acbdc06
Resolve conflicts
imanish003 May 26, 2023
3b1b6c6
remove unused import of getDefaultStockStatuses
imanish003 May 26, 2023
287b91f
Resolve conflicts
imanish003 May 26, 2023
67446de
Delete a duplicate file
imanish003 May 26, 2023
fa957fd
Resolve conflicts
imanish003 May 26, 2023
cacd280
Remove console log
imanish003 May 29, 2023
afa0e46
Merge branch 'trunk' into 9363-product-collection-filters-attributes
imanish003 May 29, 2023
aef2878
Add taxonomies control to Product collection block
imanish003 May 29, 2023
24031a6
Merge branch 'trunk' into 9364-product-collection-filters-taxonomies
imanish003 May 29, 2023
f9a6813
Address PR feedback & other improvements
imanish003 May 30, 2023
7218533
Merge branch 'trunk' into 9363-product-collection-filters-attributes
imanish003 May 30, 2023
7cbd3a8
Merge branch '9363-product-collection-filters-attributes' of https://…
imanish003 May 30, 2023
e049cf8
Address PR review comments
imanish003 May 30, 2023
3a8dc95
Add wc-block-editor prefix to className
imanish003 May 30, 2023
edf824b
Merge branch 'trunk' into 9363-product-collection-filters-attributes
imanish003 May 30, 2023
20fdaf9
Merge branch '9363-product-collection-filters-attributes' of https://…
imanish003 May 30, 2023
9e08ade
Resolve conflicts
imanish003 May 30, 2023
c10388e
Make improvements to 'inherit' functionality in Product collection bl…
imanish003 May 30, 2023
c5b92fc
Resolve conflicts
imanish003 May 30, 2023
0fecc33
Improve product collection query inheritance and fix URL typo
imanish003 May 30, 2023
5f60aa1
Resolve conflicts
imanish003 May 30, 2023
5528cf6
Minor improvemnets
imanish003 May 30, 2023
49f4fef
Merge branch 'trunk' into add/product-collection-inherit
imanish003 May 30, 2023
872b637
Resolve conflicts
imanish003 May 30, 2023
90d133a
Add wc-block-editor- prefix with classNames
imanish003 May 30, 2023
5f1a5bb
Handle duplicate taxonomy names in Taxonomy controls
imanish003 May 31, 2023
ba0ce51
Merge branch 'trunk' into 9364-product-collection-filters-taxonomies
imanish003 May 31, 2023
d1cfe70
Remove isset() in if condition as it's unnecessary
imanish003 May 31, 2023
dbe02a9
Refactor TaxonomyItem component for better readability
imanish003 May 31, 2023
1be8967
Handling for duplicate term names & other improvements
imanish003 May 31, 2023
734d251
Restructure taxonomy controls in product collection block
imanish003 Jun 1, 2023
414d379
Merge branch 'trunk' into 9364-product-collection-filters-taxonomies
imanish003 Jun 1, 2023
5e6d9d9
Merge branch '9364-product-collection-filters-taxonomies' of https://…
imanish003 Jun 1, 2023
6a10f3f
Fix case insensitive search support for FormTokenField
imanish003 Jun 2, 2023
d9d7cd7
Refactor getTermIdByTermValue function and update newSuggestions mapping
imanish003 Jun 2, 2023
7f72924
Merge branch 'trunk' into 9364-product-collection-filters-taxonomies
imanish003 Jun 2, 2023
7b56958
Optimize term fetching and initial search state in TaxonomyItem
imanish003 Jun 2, 2023
028aa9b
Merge branch '9364-product-collection-filters-taxonomies' into add/pr…
imanish003 Jun 2, 2023
af2de33
Merge branch 'trunk' of https://github.com/woocommerce/woocommerce-bl…
imanish003 Jun 2, 2023
34762c5
Address PR comments and other improvements
imanish003 Jun 2, 2023
ef6b436
Add with types import statement
imanish003 Jun 5, 2023
b13f560
Merge branch 'trunk' into add/product-collection-inherit
imanish003 Jun 5, 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
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,25 @@ import { __ } from '@wordpress/i18n';
*/
import { ProductCollectionAttributes } from '../types';
import ColumnsControl from './columns-control';
import InheritQueryControl from './inherit-query-control';
import OrderByControl from './order-by-control';

const ProductCollectionInspectorControls = (
props: BlockEditProps< ProductCollectionAttributes >
) => {
const { inherit } = props.attributes.query;
const displayQueryControls = ! inherit;

return (
<InspectorControls>
<PanelBody
title={ __( 'Settings', 'woo-gutenberg-products-block' ) }
>
<ColumnsControl { ...props } />
<InheritQueryControl { ...props } />
{ displayQueryControls ? (
<>{ /** Placeholder for controls modyfing the query. */ }</>
) : null }
<OrderByControl { ...props } />
</PanelBody>
</InspectorControls>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* External dependencies
*/
import { ToggleControl } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { BlockEditProps } from '@wordpress/blocks';

/**
* Internal dependencies
*/
import { ProductCollectionAttributes } from '../types';

const InheritQueryControl = (
props: BlockEditProps< ProductCollectionAttributes >
) => {
const { attributes, setAttributes } = props;
const { inherit } = attributes.query;
return (
<ToggleControl
label={ __(
'Inherit query from template',
'woo-gutenberg-products-block'
) }
help={ __(
'Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.',
'woo-gutenberg-products-block'
) }
checked={ !! inherit }
onChange={ ( newInherit ) =>
setAttributes( {
query: {
...props.attributes.query,
inherit: newInherit,
},
} )
}
/>
);
};

export default InheritQueryControl;