This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into update/singleproducttemplatecompatibility-8…
….1-compatibility
- Loading branch information
Showing
10 changed files
with
204 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
assets/js/blocks/product-collection/inspector-controls/created-control.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { __, _x } from '@wordpress/i18n'; | ||
import { | ||
Flex, | ||
FlexItem, | ||
RadioControl, | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore - Ignoring because `__experimentalToggleGroupControl` is not yet in the type definitions. | ||
// eslint-disable-next-line @wordpress/no-unsafe-wp-apis | ||
__experimentalToggleGroupControl as ToggleGroupControl, | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore - Ignoring because `__experimentalToggleGroupControlOption` is not yet in the type definitions. | ||
// eslint-disable-next-line @wordpress/no-unsafe-wp-apis | ||
__experimentalToggleGroupControlOption as ToggleGroupControlOption, | ||
// @ts-expect-error Using experimental features | ||
// eslint-disable-next-line @wordpress/no-unsafe-wp-apis | ||
__experimentalToolsPanelItem as ToolsPanelItem, | ||
} from '@wordpress/components'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { ETimeFrameOperator, QueryControlProps } from '../types'; | ||
|
||
const CreatedControl = ( props: QueryControlProps ) => { | ||
const { query, setQueryAttribute } = props; | ||
const { timeFrame } = query; | ||
|
||
return ( | ||
<ToolsPanelItem | ||
label={ __( 'Created', 'woo-gutenberg-products-block' ) } | ||
hasValue={ () => timeFrame?.operator && timeFrame?.value } | ||
onDeselect={ () => { | ||
setQueryAttribute( { | ||
timeFrame: undefined, | ||
} ); | ||
} } | ||
> | ||
<Flex direction="column" gap={ 3 }> | ||
<FlexItem> | ||
<ToggleGroupControl | ||
label={ __( | ||
'Created', | ||
'woo-gutenberg-products-block' | ||
) } | ||
isBlock | ||
onChange={ ( value: ETimeFrameOperator ) => { | ||
setQueryAttribute( { | ||
timeFrame: { | ||
...timeFrame, | ||
operator: value, | ||
}, | ||
} ); | ||
} } | ||
value={ timeFrame?.operator || ETimeFrameOperator.IN } | ||
> | ||
<ToggleGroupControlOption | ||
value={ ETimeFrameOperator.IN } | ||
label={ _x( | ||
'Within', | ||
'Product Collection query operator', | ||
'woo-gutenberg-products-block' | ||
) } | ||
/> | ||
<ToggleGroupControlOption | ||
value={ ETimeFrameOperator.NOT_IN } | ||
label={ _x( | ||
'Before', | ||
'Product Collection query operator', | ||
'woo-gutenberg-products-block' | ||
) } | ||
/> | ||
</ToggleGroupControl> | ||
</FlexItem> | ||
<FlexItem> | ||
<RadioControl | ||
onChange={ ( value: string ) => { | ||
setQueryAttribute( { | ||
timeFrame: { | ||
operator: ETimeFrameOperator.IN, | ||
...timeFrame, | ||
value, | ||
}, | ||
} ); | ||
} } | ||
options={ [ | ||
{ | ||
label: 'last 24 hours', | ||
value: '-1 day', | ||
}, | ||
{ | ||
label: 'last 7 days', | ||
value: '-7 days', | ||
}, | ||
{ | ||
label: 'last 30 days', | ||
value: '-30 days', | ||
}, | ||
{ | ||
label: 'last 3 months', | ||
value: '-3 months', | ||
}, | ||
] } | ||
selected={ timeFrame?.value } | ||
/> | ||
</FlexItem> | ||
</Flex> | ||
</ToolsPanelItem> | ||
); | ||
}; | ||
|
||
export default CreatedControl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Testing notes and ZIP for release 11.4.5 | ||
|
||
Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/13294232/woocommerce-gutenberg-products-block.zip) | ||
|
||
## WooCommerce Core | ||
|
||
### Bug Fixes | ||
|
||
#### Fix Single Product Classic Template block not showing on the front-end. [11455](https://github.com/woocommerce/woocommerce-blocks/pull/11455) | ||
|
||
1. Enable WordPress 6.4. | ||
2. Enable a block theme. | ||
3. Go to Site Editor → Single Product template. | ||
4. Remove the blockified template and add the “Classic Template” block. | ||
5. Save and check the front-end. | ||
6. Check that the template is correctly rendered on the front-end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters