diff --git a/.github/ISSUE_TEMPLATE/2-enhancement.yml b/.github/ISSUE_TEMPLATE/2-enhancement.yml
index 3c7637cea8c..19383e15c27 100644
--- a/.github/ISSUE_TEMPLATE/2-enhancement.yml
+++ b/.github/ISSUE_TEMPLATE/2-enhancement.yml
@@ -1,5 +1,5 @@
name: ✨ Enhancement Request
-description: If you have an idea to improve an existing feature in core or need something for development (such as a new hook) please let us know or submit a Pull Request!
+description: If you have an idea to improve existing functionality in core or need something for development (such as a new hook) please let us know or submit a Pull Request!
title: "[Enhancement]: "
labels: ["type: enhancement", "status: awaiting triage"]
body:
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index dae2134fb39..f8f1bcc6e24 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -1,5 +1,8 @@
blank_issues_enabled: true
contact_links:
+ - name: Feature Requests
+ url: https://woocommerce.com/feature-requests/woocommerce/
+ about: If you have an idea for a new feature that you wished existed in WooCommerce, take a look at our Feature Requests and vote, or open a new Feature Request yourself!
- name: 🔒 Security issue
url: https://hackerone.com/automattic/
about: For security reasons, please report all security issues via HackerOne. If the issue is valid, a bug bounty will be paid out to you. Please disclose responsibly and not via GitHub (which allows for exploiting issues in the wild before the patch is released).
diff --git a/.github/workflows/scripts/post-request-shared.php b/.github/workflows/scripts/post-request-shared.php
index 67a6794feef..8d4bc442147 100644
--- a/.github/workflows/scripts/post-request-shared.php
+++ b/.github/workflows/scripts/post-request-shared.php
@@ -135,7 +135,7 @@ function get_latest_version_with_release() {
}
/**
- * Function to retreive the sha1 reference for a given branch name.
+ * Function to retrieve the sha1 reference for a given branch name.
*
* @param string $branch The name of the branch.
* @return string Returns the name of the branch, or a falsey value on error.
diff --git a/changelog.txt b/changelog.txt
index 6005a873509..c764986089e 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -54,7 +54,7 @@
* Fix - Prevent possible warning arising from use of woocommerce_wp_* family of functions. [#37026](https://github.com/woocommerce/woocommerce/pull/37026)
* Fix - Record values for toggled checkboxes/features in settings [#37242](https://github.com/woocommerce/woocommerce/pull/37242)
* Fix - Restore the sort order when orders are cached. [#36650](https://github.com/woocommerce/woocommerce/pull/36650)
-* Fix - Treat order as seperate resource when validating for webhook since it's not necessarily a CPT anymore. [#36650](https://github.com/woocommerce/woocommerce/pull/36650)
+* Fix - Treat order as separate resource when validating for webhook since it's not necessarily a CPT anymore. [#36650](https://github.com/woocommerce/woocommerce/pull/36650)
* Fix - Update Customers report with latest user data after editing user. [#37237](https://github.com/woocommerce/woocommerce/pull/37237)
* Add - Add "Create a new campaign" modal in Campaigns card in Multichannel Marketing page. [#37044](https://github.com/woocommerce/woocommerce/pull/37044)
* Add - Add a cache for orders, to use when custom order tables are enabled [#35014](https://github.com/woocommerce/woocommerce/pull/35014)
@@ -432,7 +432,7 @@
* Tweak - Resolve an error in the product tracking code by testing to see if the `post_type` query var is set before checking its value. [#34501](https://github.com/woocommerce/woocommerce/pull/34501)
* Tweak - Simplify wording within the customer emails for on-hold orders. [#31886](https://github.com/woocommerce/woocommerce/pull/31886)
* Tweak - WooCommerce has now been tested up to WordPress 6.1.x. [#35985](https://github.com/woocommerce/woocommerce/pull/35985)
-* Performance - Split CALC_FOUND_ROW query into seperate count query for better performance. [#35468](https://github.com/woocommerce/woocommerce/pull/35468)
+* Performance - Split CALC_FOUND_ROW query into separate count query for better performance. [#35468](https://github.com/woocommerce/woocommerce/pull/35468)
* Enhancement - Add a bottom padding to the whole form [#35721](https://github.com/woocommerce/woocommerce/pull/35721)
* Enhancement - Add a confirmation modal when the user tries to navigate away with unsaved changes [#35625](https://github.com/woocommerce/woocommerce/pull/35625)
* Enhancement - Add a default placeholder title for newly added attributes and always show remove button for attributes [#35904](https://github.com/woocommerce/woocommerce/pull/35904)
@@ -3371,7 +3371,7 @@
* Fix - Add protection around func_get_args_call for backwards compatibility. #28677
* Fix - Restore stock_status in REST API V3 response. #28731
* Fix - Revert some of the changes related to perf enhancements (27735) as it was breaking stock_status filter. #28745
-* Dev - Hook for intializing price slider in frontend. #28014
+* Dev - Hook for initializing price slider in frontend. #28014
* Dev - Add support for running a custom initialization script for tests. #28041
* Dev - Use the coenjacobs/mozart package to renamespace vendor packages. #28147
* Dev - Documentation for `wc_get_container`. #28269
@@ -5290,7 +5290,7 @@
* Fix - Fix edge case where `get_plugins` would not have the custom WooCommerce plugin headers if `get_plugins` was called early. #21669
* Fix - Prevent PHP warning when deprecated user meta starts with uppercase. #21943
* Fix - Fixed support for multiple query parameters translated to meta queries via REST API requests. #22108
-* Fix - Prevent PHP errors when trying to access non-existant report tabs. #22183
+* Fix - Prevent PHP errors when trying to access non-existent report tabs. #22183
* Fix - Filter by attributes dropdown placeholder text should not be wrapped in quotes. #22185
* Fix - Apply sale price until end of closing sale date. #22189
* Fix - Allow empty schema again when registering a custom field for the API. #22204
@@ -6612,7 +6612,7 @@
* Removed internal scroll from log viewer.
* Add reply-to to admin emails.
* Improved the zone setup flow.
-* Made wc_get_wildcard_postcodes return the orignal postcode plus * since wildcards should match empty strings too.
+* Made wc_get_wildcard_postcodes return the original postcode plus * since wildcards should match empty strings too.
* Use all paid statuses in $customer->get_total_spent().
* Move location of billing email field to work with password managers.
* Option to restrict selling locations by country.
@@ -8122,7 +8122,7 @@
* Tweak - Flat rate shipping support for percentage factor of additional costs.
* Tweak - local delivery _ pattern matching for postcodes. e.g. NG1___ would match NG1 1AA but not NG10 1AA.
* Tweak - Improved layered nav OR count logic
-* Tweak - Make shipping methods check if taxable, so when customer is VAT excempt taxes are not included in price.
+* Tweak - Make shipping methods check if taxable, so when customer is VAT exempt taxes are not included in price.
* Tweak - Coupon in admin bar new menu #3974
* Tweak - Shortcode tag filters + updated menu names to make white labelling easier.
* Tweak - Removed placeholder polyfill. Use this plugin to replace functionality if required: https://wordpress.org/plugins/html5-placeholder-polyfill/
diff --git a/packages/js/components/changelog/dev-migrate-select-control-to-ts b/packages/js/components/changelog/dev-migrate-select-control-to-ts
new file mode 100644
index 00000000000..475884bfaa6
--- /dev/null
+++ b/packages/js/components/changelog/dev-migrate-select-control-to-ts
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Migrate select control component to TS
diff --git a/packages/js/components/changelog/fix-37502 b/packages/js/components/changelog/fix-37502
new file mode 100644
index 00000000000..115429c4b01
--- /dev/null
+++ b/packages/js/components/changelog/fix-37502
@@ -0,0 +1,4 @@
+Significance: patch
+Type: tweak
+
+Correct spelling errors
diff --git a/packages/js/components/changelog/update-37727 b/packages/js/components/changelog/update-37727
new file mode 100644
index 00000000000..9b6f5259944
--- /dev/null
+++ b/packages/js/components/changelog/update-37727
@@ -0,0 +1,4 @@
+Significance: minor
+Type: update
+
+Show comma separated list in ready only mode of select tree control
diff --git a/packages/js/components/src/chart/README.md b/packages/js/components/src/chart/README.md
index 28082ca574a..a8a4474a6cb 100644
--- a/packages/js/components/src/chart/README.md
+++ b/packages/js/components/src/chart/README.md
@@ -94,7 +94,7 @@ Name | Type | Default | Description
`legendPosition` | One of: 'bottom', 'side', 'top', 'hidden' | `null` | Position the legend must be displayed in. If it's not defined, it's calculated depending on the viewport width and the mode
`legendTotals` | Object | `null` | Values to overwrite the legend totals. If not defined, the sum of all line values will be used
`screenReaderFormat` | One of type: string, func | `'%B %-d, %Y'` | A datetime formatting string or overriding function to format the screen reader labels
-`showHeaderControls` | Boolean | `true` | Wether header UI controls must be displayed
+`showHeaderControls` | Boolean | `true` | Whether header UI controls must be displayed
`title` | String | `null` | A title describing this chart
`tooltipLabelFormat` | One of type: string, func | `'%B %-d, %Y'` | A datetime formatting string or overriding function to format the tooltip label
`tooltipValueFormat` | One of type: string, func | `','` | A number formatting string or function to format the value displayed in the tooltips
diff --git a/packages/js/components/src/chart/index.js b/packages/js/components/src/chart/index.js
index c5afe925f08..101753f08bd 100644
--- a/packages/js/components/src/chart/index.js
+++ b/packages/js/components/src/chart/index.js
@@ -577,7 +577,7 @@ Chart.propTypes = {
PropTypes.func,
] ),
/**
- * Wether header UI controls must be displayed.
+ * Whether header UI controls must be displayed.
*/
showHeaderControls: PropTypes.bool,
/**
diff --git a/packages/js/components/src/experimental-select-control/combo-box.tsx b/packages/js/components/src/experimental-select-control/combo-box.tsx
index a71a323ff94..9bbbea87778 100644
--- a/packages/js/components/src/experimental-select-control/combo-box.tsx
+++ b/packages/js/components/src/experimental-select-control/combo-box.tsx
@@ -75,8 +75,8 @@ export const ComboBox = ( {
{
+ inputRef.current = node;
if ( typeof inputProps.ref === 'function' ) {
- inputRef.current = node;
(
inputProps.ref as unknown as (
node: HTMLInputElement | null
diff --git a/packages/js/components/src/experimental-select-control/select-control.scss b/packages/js/components/src/experimental-select-control/select-control.scss
index cf71dadd8cd..0ec18150b59 100644
--- a/packages/js/components/src/experimental-select-control/select-control.scss
+++ b/packages/js/components/src/experimental-select-control/select-control.scss
@@ -12,6 +12,18 @@
border-color: var( --wp-admin-theme-color );
}
+ &.is-read-only.is-multiple.has-selected-items {
+ .woocommerce-experimental-select-control__combo-box-wrapper {
+ cursor: default;
+ }
+
+ .woocommerce-experimental-select-control__input {
+ opacity: 0;
+ width: 0;
+ height: 0;
+ }
+ }
+
&__label {
display: inline-block;
margin-bottom: $gap-smaller;
diff --git a/packages/js/components/src/experimental-select-control/select-control.tsx b/packages/js/components/src/experimental-select-control/select-control.tsx
index 7957e980d55..ccab1447611 100644
--- a/packages/js/components/src/experimental-select-control/select-control.tsx
+++ b/packages/js/components/src/experimental-select-control/select-control.tsx
@@ -9,13 +9,14 @@ import {
useMultipleSelection,
GetInputPropsOptions,
} from 'downshift';
+import { useInstanceId } from '@wordpress/compose';
import {
useState,
useEffect,
createElement,
Fragment,
} from '@wordpress/element';
-import { search } from '@wordpress/icons';
+import { chevronDown } from '@wordpress/icons';
/**
* Internal dependencies
@@ -123,12 +124,16 @@ function SelectControl< ItemType = DefaultItemType >( {
className,
disabled,
inputProps = {},
- suffix = ,
+ suffix = ,
showToggleButton = false,
__experimentalOpenMenuOnFocus = false,
}: SelectControlProps< ItemType > ) {
const [ isFocused, setIsFocused ] = useState( false );
const [ inputValue, setInputValue ] = useState( '' );
+ const instanceId = useInstanceId(
+ SelectControl,
+ 'woocommerce-experimental-select-control'
+ );
let selectedItems = selected === null ? [] : selected;
selectedItems = Array.isArray( selectedItems )
@@ -230,15 +235,24 @@ function SelectControl< ItemType = DefaultItemType >( {
},
} );
+ const isEventOutside = ( event: React.FocusEvent ) => {
+ return ! document
+ .querySelector( '.' + instanceId )
+ ?.contains( event.relatedTarget );
+ };
+
const onRemoveItem = ( item: ItemType ) => {
selectItem( null );
removeSelectedItem( item );
onRemove( item );
};
+ const isReadOnly = ! isOpen && ! isFocused;
+
const selectedItemTags = multiple ? (
( {
className={ classnames(
'woocommerce-experimental-select-control',
className,
+ instanceId,
{
+ 'is-read-only': isReadOnly,
'is-focused': isFocused,
+ 'is-multiple': multiple,
+ 'has-selected-items': selectedItems.length,
}
) }
>
@@ -282,7 +300,11 @@ function SelectControl< ItemType = DefaultItemType >( {
openMenu();
}
},
- onBlur: () => setIsFocused( false ),
+ onBlur: ( event: React.FocusEvent ) => {
+ if ( isEventOutside( event ) ) {
+ setIsFocused( false );
+ }
+ },
placeholder,
disabled,
...inputProps,
diff --git a/packages/js/components/src/experimental-select-control/selected-items.scss b/packages/js/components/src/experimental-select-control/selected-items.scss
index 8f7c223483a..e9565582172 100644
--- a/packages/js/components/src/experimental-select-control/selected-items.scss
+++ b/packages/js/components/src/experimental-select-control/selected-items.scss
@@ -1,3 +1,9 @@
+.woocommerce-experimental-select-control__selected-items.is-read-only {
+ font-size: 13px;
+ color: $gray-900;
+ font-family: var(--wp--preset--font-family--system-font);
+}
+
.woocommerce-experimental-select-control__selected-item {
margin-right: $gap-smallest;
margin-top: 2px;
diff --git a/packages/js/components/src/experimental-select-control/selected-items.tsx b/packages/js/components/src/experimental-select-control/selected-items.tsx
index 65aab895f76..6f82039e640 100644
--- a/packages/js/components/src/experimental-select-control/selected-items.tsx
+++ b/packages/js/components/src/experimental-select-control/selected-items.tsx
@@ -1,7 +1,8 @@
/**
* External dependencies
*/
-import { createElement, Fragment } from '@wordpress/element';
+import classnames from 'classnames';
+import { createElement } from '@wordpress/element';
/**
* Internal dependencies
@@ -10,6 +11,7 @@ import Tag from '../tag';
import { getItemLabelType, getItemValueType } from './types';
type SelectedItemsProps< ItemType > = {
+ isReadOnly: boolean;
items: ItemType[];
getItemLabel: getItemLabelType< ItemType >;
getItemValue: getItemValueType< ItemType >;
@@ -22,14 +24,34 @@ type SelectedItemsProps< ItemType > = {
};
export const SelectedItems = < ItemType, >( {
+ isReadOnly,
items,
getItemLabel,
getItemValue,
getSelectedItemProps,
onRemove,
}: SelectedItemsProps< ItemType > ) => {
+ const classes = classnames(
+ 'woocommerce-experimental-select-control__selected-items',
+ {
+ 'is-read-only': isReadOnly,
+ }
+ );
+
+ if ( isReadOnly ) {
+ return (
+