From 0d45811e733881e6a955a057f9478ab7d3a33963 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Fri, 9 Aug 2019 15:15:16 -0300 Subject: [PATCH 01/21] fix warnings in chart segmenting --- .../src/API/Reports/Segmenter.php | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce-admin/src/API/Reports/Segmenter.php b/plugins/woocommerce-admin/src/API/Reports/Segmenter.php index 7b57bdacfe4..836e9cf3aa5 100644 --- a/plugins/woocommerce-admin/src/API/Reports/Segmenter.php +++ b/plugins/woocommerce-admin/src/API/Reports/Segmenter.php @@ -151,6 +151,10 @@ class Segmenter { foreach ( $result1 as $segment_data ) { $segment_id = $segment_data[ $segment_dimension ]; + if ( ! isset( $segment_labels[ $segment_id ] ) ) { + continue; + } + unset( $segment_data[ $segment_dimension ] ); $result_segments[ $segment_id ] = array( 'segment_label' => $segment_labels[ $segment_id ], @@ -161,6 +165,10 @@ class Segmenter { foreach ( $result2 as $segment_data ) { $segment_id = $segment_data[ $segment_dimension ]; + if ( ! isset( $segment_labels[ $segment_id ] ) ) { + continue; + } + unset( $segment_data[ $segment_dimension ] ); if ( ! isset( $result_segments[ $segment_id ] ) ) { $result_segments[ $segment_id ] = array( @@ -216,14 +224,19 @@ class Segmenter { $segment_labels = $this->get_segment_labels(); foreach ( $result1 as $segment_data ) { + $segment_id = $segment_data[ $segment_dimension ]; + if ( ! isset( $segment_labels[ $segment_id ] ) ) { + continue; + } + $time_interval = $segment_data['time_interval']; if ( ! isset( $result_segments[ $time_interval ] ) ) { $result_segments[ $time_interval ] = array(); $result_segments[ $time_interval ]['segments'] = array(); } + unset( $segment_data['time_interval'] ); unset( $segment_data['datetime_anchor'] ); - $segment_id = $segment_data[ $segment_dimension ]; unset( $segment_data[ $segment_dimension ] ); $segment_datum = array( 'segment_label' => $segment_labels[ $segment_id ], @@ -234,14 +247,19 @@ class Segmenter { } foreach ( $result2 as $segment_data ) { + $segment_id = $segment_data[ $segment_dimension ]; + if ( ! isset( $segment_labels[ $segment_id ] ) ) { + continue; + } + $time_interval = $segment_data['time_interval']; if ( ! isset( $result_segments[ $time_interval ] ) ) { $result_segments[ $time_interval ] = array(); $result_segments[ $time_interval ]['segments'] = array(); } + unset( $segment_data['time_interval'] ); unset( $segment_data['datetime_anchor'] ); - $segment_id = $segment_data[ $segment_dimension ]; unset( $segment_data[ $segment_dimension ] ); if ( ! isset( $result_segments[ $time_interval ]['segments'][ $segment_id ] ) ) { From 57e27568a142192a3e7737c7cb5eccd371893acf Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Wed, 14 Aug 2019 16:10:40 -0300 Subject: [PATCH 02/21] update the class filename exclusion to /src/ for PSR-4 --- plugins/woocommerce-admin/phpcs.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce-admin/phpcs.xml.dist b/plugins/woocommerce-admin/phpcs.xml.dist index 81b2b973e30..136137fdeb9 100644 --- a/plugins/woocommerce-admin/phpcs.xml.dist +++ b/plugins/woocommerce-admin/phpcs.xml.dist @@ -28,7 +28,7 @@ - includes/**/abstract-*.php + src/* tests/* woocommerce-admin.php From 2851bef09e5b256e394fb5e948c483973dbe52db Mon Sep 17 00:00:00 2001 From: Paul Sealock Date: Thu, 15 Aug 2019 10:36:53 +1200 Subject: [PATCH 03/21] add composer install in pre-release step --- plugins/woocommerce-admin/bin/pre-release.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/woocommerce-admin/bin/pre-release.sh b/plugins/woocommerce-admin/bin/pre-release.sh index f0a78f98628..dfe85ade144 100755 --- a/plugins/woocommerce-admin/bin/pre-release.sh +++ b/plugins/woocommerce-admin/bin/pre-release.sh @@ -43,6 +43,10 @@ git pull origin master success "Pulled latest commits" +composer install + +success "Installed PHP dependencies" + status "What version would you like to release?" echo -n "Version: " From 3e17a1254ba32fb0411e76e144268119b807dd29 Mon Sep 17 00:00:00 2001 From: Paul Sealock Date: Thu, 15 Aug 2019 11:44:15 +1200 Subject: [PATCH 04/21] use package.json changes --- plugins/woocommerce-admin/bin/pre-release.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/woocommerce-admin/bin/pre-release.sh b/plugins/woocommerce-admin/bin/pre-release.sh index dfe85ade144..5b63be0ee9e 100755 --- a/plugins/woocommerce-admin/bin/pre-release.sh +++ b/plugins/woocommerce-admin/bin/pre-release.sh @@ -82,10 +82,6 @@ status "Run docs script to make sure docs are updated." npm run docs -status "Remove changes to package-lock.json to prevent merge conflicts." - -git checkout package-lock.json - status "Here are the changes so far. Make sure the following changes are reflected." echo "- docs/: folder will have changes to documentation, if any." From 42bba7b3765f765e272a654892fd58d43fe3379d Mon Sep 17 00:00:00 2001 From: Paul Sealock Date: Thu, 15 Aug 2019 11:35:02 +1200 Subject: [PATCH 05/21] release 0.17.0 --- .../woocommerce-admin/bin/build-plugin-zip.sh | 8 ++- .../docs/components/_sidebar.md | 4 +- .../docs/components/packages/form.md | 51 +++++++++++++++++++ .../docs/components/packages/stepper.md | 10 ++-- .../docs/components/packages/web-preview.md | 45 ++++++++++++++++ plugins/woocommerce-admin/package-lock.json | 43 +++++----------- plugins/woocommerce-admin/package.json | 2 +- plugins/woocommerce-admin/readme.txt | 20 ++++++++ .../woocommerce-admin/src/FeaturePlugin.php | 4 +- .../woocommerce-admin/woocommerce-admin.php | 2 +- 10 files changed, 148 insertions(+), 41 deletions(-) create mode 100644 plugins/woocommerce-admin/docs/components/packages/form.md create mode 100644 plugins/woocommerce-admin/docs/components/packages/web-preview.md diff --git a/plugins/woocommerce-admin/bin/build-plugin-zip.sh b/plugins/woocommerce-admin/bin/build-plugin-zip.sh index c080a658010..52c21e3c41a 100755 --- a/plugins/woocommerce-admin/bin/build-plugin-zip.sh +++ b/plugins/woocommerce-admin/bin/build-plugin-zip.sh @@ -61,6 +61,10 @@ else exit 1 fi +# Install PHP dependencies +status "Gathering PHP dependencies... 🐿️" +composer install --no-dev + # Run the build. status "Generating build... 👷‍♀️" npm run build @@ -78,6 +82,8 @@ zip -r woocommerce-admin.zip \ $build_files \ languages/woocommerce-admin.pot \ languages/woocommerce-admin.php \ - readme.txt + readme.txt \ + src/ \ + vendor/ success "Done. You've built WooCommerce Admin! 🎉 " diff --git a/plugins/woocommerce-admin/docs/components/_sidebar.md b/plugins/woocommerce-admin/docs/components/_sidebar.md index 5d90a163196..e66e19586ea 100644 --- a/plugins/woocommerce-admin/docs/components/_sidebar.md +++ b/plugins/woocommerce-admin/docs/components/_sidebar.md @@ -19,6 +19,7 @@ * [EmptyContent](components/packages/empty-content.md) * [Filters](components/packages/filters.md) * [Flag](components/packages/flag.md) + * [Form](components/packages/form.md) * [Gravatar](components/packages/gravatar.md) * [ImageAsset](components/packages/image-asset.md) * [Link](components/packages/link.md) @@ -40,4 +41,5 @@ * [Table](components/packages/table.md) * [Tag](components/packages/tag.md) * [TextControlWithAffixes](components/packages/text-control-with-affixes.md) - * [ViewMoreList](components/packages/view-more-list.md) \ No newline at end of file + * [ViewMoreList](components/packages/view-more-list.md) + * [WebPreview](components/packages/web-preview.md) \ No newline at end of file diff --git a/plugins/woocommerce-admin/docs/components/packages/form.md b/plugins/woocommerce-admin/docs/components/packages/form.md new file mode 100644 index 00000000000..1f8b2958b4f --- /dev/null +++ b/plugins/woocommerce-admin/docs/components/packages/form.md @@ -0,0 +1,51 @@ +`Form` (component) +================== + +A form component to handle form state and provide input helper props. + +Props +----- + +### `children` + +- Type: * +- Default: null + +A renderable component in which to pass this component's state and helpers. +Generally a number of input or other form elements. + +### `errors` + +- Type: Object +- Default: `{}` + +Object of all initial errors to store in state. + +### `initialValues` + +- Type: Object +- Default: `{}` + +Object key:value pair list of all initial field values. + +### `onSubmitCallback` + +- Type: Function +- Default: `noop` + +Function to call when a form is submitted with valid fields. + +### `validate` + +- Type: Function +- Default: null + +A function that is passed a list of all values and +should return an `errors` object with error response. + +### `touched` + +- Type: undefined +- Default: `{}` + + diff --git a/plugins/woocommerce-admin/docs/components/packages/stepper.md b/plugins/woocommerce-admin/docs/components/packages/stepper.md index 8ebbbf7b5d4..25b1245fd0f 100644 --- a/plugins/woocommerce-admin/docs/components/packages/stepper.md +++ b/plugins/woocommerce-admin/docs/components/packages/stepper.md @@ -27,17 +27,19 @@ The current step's key. - Type: Array - key: String - Key used to identify step. - label: String - Label displayed in stepper. + - description: String - Description displayed beneath the label. - isComplete: Boolean - Optionally mark a step complete regardless of step index. + - content: ReactNode - Content displayed when the step is active. - Default: null An array of steps used. -### `direction` +### `isVertical` -- Type: One of: 'horizontal', 'vertical' -- Default: `'horizontal'` +- Type: Boolean +- Default: `false` -Direction of the stepper. +If the stepper is vertical instead of horizontal. ### `isPending` diff --git a/plugins/woocommerce-admin/docs/components/packages/web-preview.md b/plugins/woocommerce-admin/docs/components/packages/web-preview.md new file mode 100644 index 00000000000..2dbe8b09698 --- /dev/null +++ b/plugins/woocommerce-admin/docs/components/packages/web-preview.md @@ -0,0 +1,45 @@ +`WebPreview` (component) +======================== + +WebPreview component to display an iframe of another page. + +Props +----- + +### `className` + +- Type: String +- Default: null + +Additional class name to style the component. + +### `loadingContent` + +- Type: ReactNode +- Default: `` + +Content shown when iframe is still loading. + +### `onLoad` + +- Type: Function +- Default: `noop` + +Function to fire when iframe content is loaded. + +### `src` + +- **Required** +- Type: String +- Default: null + +Iframe src to load. + +### `title` + +- **Required** +- Type: String +- Default: null + +Iframe title. + diff --git a/plugins/woocommerce-admin/package-lock.json b/plugins/woocommerce-admin/package-lock.json index 28314a1371e..61aa419d1f1 100644 --- a/plugins/woocommerce-admin/package-lock.json +++ b/plugins/woocommerce-admin/package-lock.json @@ -1,6 +1,6 @@ { "name": "@woocommerce/admin-library", - "version": "0.16.0", + "version": "0.17.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -9303,8 +9303,7 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true, - "optional": true + "bundled": true }, "aproba": { "version": "1.2.0", @@ -9322,13 +9321,11 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, - "optional": true + "bundled": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -9341,18 +9338,15 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "concat-map": { "version": "0.0.1", - "bundled": true, - "optional": true + "bundled": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "core-util-is": { "version": "1.0.2", @@ -9455,8 +9449,7 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, - "optional": true + "bundled": true }, "ini": { "version": "1.3.5", @@ -9466,7 +9459,6 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -9479,20 +9471,17 @@ "minimatch": { "version": "3.0.4", "bundled": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true, - "optional": true + "bundled": true }, "minipass": { "version": "2.3.5", "bundled": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -9509,7 +9498,6 @@ "mkdirp": { "version": "0.5.1", "bundled": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -9582,8 +9570,7 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, - "optional": true + "bundled": true }, "object-assign": { "version": "4.1.1", @@ -9593,7 +9580,6 @@ "once": { "version": "1.4.0", "bundled": true, - "optional": true, "requires": { "wrappy": "1" } @@ -9669,8 +9655,7 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true, - "optional": true + "bundled": true }, "safer-buffer": { "version": "2.1.2", @@ -9700,7 +9685,6 @@ "string-width": { "version": "1.0.2", "bundled": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -9718,7 +9702,6 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -9757,13 +9740,11 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, - "optional": true + "bundled": true }, "yallist": { "version": "3.0.3", - "bundled": true, - "optional": true + "bundled": true } } }, diff --git a/plugins/woocommerce-admin/package.json b/plugins/woocommerce-admin/package.json index 8c1941ce401..b85de67f550 100644 --- a/plugins/woocommerce-admin/package.json +++ b/plugins/woocommerce-admin/package.json @@ -1,6 +1,6 @@ { "name": "@woocommerce/admin-library", - "version": "0.16.0", + "version": "0.17.0", "homepage": "https://woocommerce.github.io/woocommerce-admin/", "repository": { "type": "git", diff --git a/plugins/woocommerce-admin/readme.txt b/plugins/woocommerce-admin/readme.txt index 0ead3ad5f37..44f6d32f240 100644 --- a/plugins/woocommerce-admin/readme.txt +++ b/plugins/woocommerce-admin/readme.txt @@ -71,6 +71,26 @@ Release and roadmap notes are available on the [WooCommerce Developers Blog](htt == Changelog == += 0.17.0 2019-08-15 = + +- Fix: chart data fetch/render over long time periods #2785 (Analytics) +- Task: update the class filename exclusion to /src/ for PSR-4 #2794 +- Tweak: Increase zIndex on popover elements. #2777 +- Fix: chart display when comparing categories. #2710 (Analytics) +- Fix: Allow WooCommerce Admin to be deleted through the plugin screen when WooCommerce is not active. #2762 +- Fix: Charts being partially rendered on long time periods. #2776 (Analytics) +- Task: update WC tested to version to 3.7.0 #2782 +- Fix: Customer last active date showing `Invalid date`. #2764 (Analytics) +- Task: Update report endpoints to be PSR-4 autoloaded #2755 (Build) +- Bug: Fix daily cron event (PSR-4) #2754 (Build) +- Fix: issue where product category update button was not always clickable #2753 +- Fix: Add version parameter to `_doing_it_wrong` on `current_screen`. #2733 +- Task: Update feature classes to be PSR-4 autoloaded. #2736 (Build) +- Fix: Short circuit admin title filter when applied by third parties too early. #2744 +- Fix: chart display when comparing categories. #2708 (Analytics) +- Bug: Only apply current submenu CSS reset on non-embed pages. #2687 +- Dev: Add `wc_admin_get_feature_config` filter to feature config array. #2689 + = 0.16.0 2019-07-24 = - Tweak: Change verbiage of feedback notification. #2677 diff --git a/plugins/woocommerce-admin/src/FeaturePlugin.php b/plugins/woocommerce-admin/src/FeaturePlugin.php index 040486d20a6..77ff417cdd6 100644 --- a/plugins/woocommerce-admin/src/FeaturePlugin.php +++ b/plugins/woocommerce-admin/src/FeaturePlugin.php @@ -121,7 +121,7 @@ class FeaturePlugin { $this->define( 'WC_ADMIN_PLUGIN_FILE', WC_ADMIN_ABSPATH . 'woocommerce-admin.php' ); // WARNING: Do not directly edit this version number constant. // It is updated as part of the prebuild process from the package.json value. - $this->define( 'WC_ADMIN_VERSION_NUMBER', '0.16.0' ); + $this->define( 'WC_ADMIN_VERSION_NUMBER', '0.17.0' ); } /** @@ -313,4 +313,4 @@ class FeaturePlugin { * Prevent unserializing. */ private function __wakeup() {} -} \ No newline at end of file +} diff --git a/plugins/woocommerce-admin/woocommerce-admin.php b/plugins/woocommerce-admin/woocommerce-admin.php index 128200418d7..3fdf060cbe0 100755 --- a/plugins/woocommerce-admin/woocommerce-admin.php +++ b/plugins/woocommerce-admin/woocommerce-admin.php @@ -7,7 +7,7 @@ * Author URI: https://woocommerce.com/ * Text Domain: woocommerce-admin * Domain Path: /languages - * Version: 0.16.0 + * Version: 0.17.0 * Requires at least: 5.2.0 * Requires PHP: 5.6.20 * From 5b56c866052db19f52b961483e130275649b4f53 Mon Sep 17 00:00:00 2001 From: Paul Sealock Date: Thu, 15 Aug 2019 14:10:10 +1200 Subject: [PATCH 06/21] remover composer install --- plugins/woocommerce-admin/bin/pre-release.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/woocommerce-admin/bin/pre-release.sh b/plugins/woocommerce-admin/bin/pre-release.sh index 5b63be0ee9e..c5c1371606f 100755 --- a/plugins/woocommerce-admin/bin/pre-release.sh +++ b/plugins/woocommerce-admin/bin/pre-release.sh @@ -43,10 +43,6 @@ git pull origin master success "Pulled latest commits" -composer install - -success "Installed PHP dependencies" - status "What version would you like to release?" echo -n "Version: " From cfd2bf376c91cce8b83fbfba91dd6ef0daea30be Mon Sep 17 00:00:00 2001 From: Paul Sealock Date: Thu, 15 Aug 2019 14:24:34 +1200 Subject: [PATCH 07/21] replace version function --- .../woocommerce-admin/bin/update-version.php | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) mode change 100644 => 100755 plugins/woocommerce-admin/bin/update-version.php diff --git a/plugins/woocommerce-admin/bin/update-version.php b/plugins/woocommerce-admin/bin/update-version.php old mode 100644 new mode 100755 index 58cfce681ca..57c9e85f8ef --- a/plugins/woocommerce-admin/bin/update-version.php +++ b/plugins/woocommerce-admin/bin/update-version.php @@ -7,16 +7,21 @@ $package_json = file_get_contents( 'package.json' ); $package = json_decode( $package_json ); -$plugin_file = file( 'woocommerce-admin.php' ); -$lines = array(); -foreach ( $plugin_file as $line ) { - if ( stripos( $line, ' * Version: ' ) !== false ) { - $line = " * Version: {$package->version}\n"; +function replace_version( $filename, $package_json ) { + $lines = array(); + $file = file( $filename ); + foreach ( $file as $line ) { + if ( stripos( $line, ' * Version: ' ) !== false ) { + $line = " * Version: {$package_json->version}\n"; + } + if ( stripos( $line, ">define( 'WC_ADMIN_VERSION_NUMBER'," ) !== false ) { + $line = "\t\t\$this->define( 'WC_ADMIN_VERSION_NUMBER', '{$package_json->version}' );\n"; + } + $lines[] = $line; } - if ( stripos( $line, ">define( 'WC_ADMIN_VERSION_NUMBER'," ) !== false ) { - $line = "\t\t\$this->define( 'WC_ADMIN_VERSION_NUMBER', '{$package->version}' );\n"; - } - $lines[] = $line; + file_put_contents( $filename, $lines ); } -file_put_contents( 'woocommerce-admin.php', $lines ); + +replace_version( 'woocommerce-admin.php', $package ); +replace_version( 'src/FeaturePlugin.php', $package ); From b4185d986a6f1076c09753c78c584d37766543ca Mon Sep 17 00:00:00 2001 From: Paul Sealock Date: Thu, 15 Aug 2019 14:25:18 +1200 Subject: [PATCH 08/21] styles --- plugins/woocommerce-admin/bin/update-version.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce-admin/bin/update-version.php b/plugins/woocommerce-admin/bin/update-version.php index 57c9e85f8ef..5581c9ff6e9 100755 --- a/plugins/woocommerce-admin/bin/update-version.php +++ b/plugins/woocommerce-admin/bin/update-version.php @@ -9,8 +9,9 @@ $package_json = file_get_contents( 'package.json' ); $package = json_decode( $package_json ); function replace_version( $filename, $package_json ) { - $lines = array(); - $file = file( $filename ); + $lines = array(); + $file = file( $filename ); + foreach ( $file as $line ) { if ( stripos( $line, ' * Version: ' ) !== false ) { $line = " * Version: {$package_json->version}\n"; From bece81b75751912babebc324512b92b57b5eda6d Mon Sep 17 00:00:00 2001 From: Jeff Stieler Date: Wed, 14 Aug 2019 19:32:59 -0700 Subject: [PATCH 09/21] Add inbox notice promoting the Facebook extension. --- .../src/API/OnboardingPlugins.php | 5 +- plugins/woocommerce-admin/src/Events.php | 2 + .../woocommerce-admin/src/FeaturePlugin.php | 2 + .../WC_Admin_Notes_Facebook_Extension.php | 103 ++++++++++++++++++ 4 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Facebook_Extension.php diff --git a/plugins/woocommerce-admin/src/API/OnboardingPlugins.php b/plugins/woocommerce-admin/src/API/OnboardingPlugins.php index af0d28fecac..bf49219307f 100644 --- a/plugins/woocommerce-admin/src/API/OnboardingPlugins.php +++ b/plugins/woocommerce-admin/src/API/OnboardingPlugins.php @@ -122,8 +122,9 @@ class OnboardingPlugins extends \WC_REST_Data_Controller { return apply_filters( 'woocommerce_onboarding_plugins_whitelist', array( - 'jetpack' => 'jetpack/jetpack.php', - 'woocommerce-services' => 'woocommerce-services/woocommerce-services.php', + 'facebook-for-woocommerce' => 'facebook-for-woocommerce/facebook-for-woocommerce.php', + 'jetpack' => 'jetpack/jetpack.php', + 'woocommerce-services' => 'woocommerce-services/woocommerce-services.php', ) ); } diff --git a/plugins/woocommerce-admin/src/Events.php b/plugins/woocommerce-admin/src/Events.php index 2114cea02b6..9dd40352df2 100644 --- a/plugins/woocommerce-admin/src/Events.php +++ b/plugins/woocommerce-admin/src/Events.php @@ -10,6 +10,7 @@ namespace Automattic\WooCommerce\Admin; defined( 'ABSPATH' ) || exit; +use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Facebook_Extension; use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Giving_Feedback_Notes; use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Mobile_App; use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_New_Sales_Record; @@ -60,5 +61,6 @@ class Events { WC_Admin_Notes_New_Sales_Record::possibly_add_sales_record_note(); WC_Admin_Notes_Giving_Feedback_Notes::add_notes_for_admin_giving_feedback(); WC_Admin_Notes_Mobile_App::possibly_add_mobile_app_note(); + WC_Admin_Notes_Facebook_Extension::possibly_add_facebook_note(); } } diff --git a/plugins/woocommerce-admin/src/FeaturePlugin.php b/plugins/woocommerce-admin/src/FeaturePlugin.php index 040486d20a6..c34350f6d9c 100644 --- a/plugins/woocommerce-admin/src/FeaturePlugin.php +++ b/plugins/woocommerce-admin/src/FeaturePlugin.php @@ -10,6 +10,7 @@ namespace Automattic\WooCommerce\Admin; defined( 'ABSPATH' ) || exit; use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes; +use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Facebook_Extension; use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Historical_Data; use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Order_Milestones; use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Welcome_Message; @@ -151,6 +152,7 @@ class FeaturePlugin { new WC_Admin_Notes_Historical_Data(); new WC_Admin_Notes_Order_Milestones(); new WC_Admin_Notes_Welcome_Message(); + new WC_Admin_Notes_Facebook_Extension(); } /** diff --git a/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Facebook_Extension.php b/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Facebook_Extension.php new file mode 100644 index 00000000000..839cbcc816a --- /dev/null +++ b/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Facebook_Extension.php @@ -0,0 +1,103 @@ +publish < 1 ) { + return; + } + + $current_time = time(); + $three_days_in_seconds = 3 * DAY_IN_SECONDS; + + // We want to show the Facebook note after day 3. + if ( $current_time - $wc_admin_installed < $three_days_in_seconds ) { + return; + } + + $data_store = \WC_Data_Store::load( 'admin-note' ); + + // We already have this note? Then exit, we're done. + $note_ids = $data_store->get_notes_with_name( self::NOTE_NAME ); + if ( ! empty( $note_ids ) ) { + return; + } + + include_once ABSPATH . '/wp-admin/includes/plugin.php'; + + $content = __( 'Grow your business by targeting the right people and driving sales with Facebook. You can install this free extension now.', 'woocommerce-admin' ); + + $note = new WC_Admin_Note(); + $note->set_title( __( 'Market on Facebook', 'woocommerce-admin' ) ); + $note->set_content( $content ); + $note->set_content_data( (object) array() ); + $note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL ); + $note->set_icon( 'thumbs-up' ); + $note->set_name( self::NOTE_NAME ); + $note->set_source( 'woocommerce-admin' ); + $note->add_action( 'learn-more', __( 'Learn more', 'woocommerce-admin' ), 'https://woocommerce.com/products/facebook/', WC_Admin_Note::E_WC_ADMIN_NOTE_UNACTIONED ); + $note->add_action( 'install-now', __( 'Install now', 'woocommerce-admin' ), false, WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED, true ); + + // Create the note as "actioned" if the Facebook extension is already installed. + if ( 0 === validate_plugin( 'facebook-for-woocommerce/facebook-for-woocommerce.php' ) ) { + $note->set_status( WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED ); + } + + $note->save(); + } + + /** + * Install Facebook extension when note is actioned. + */ + public function install_facebook_extension( $note ) { + if ( self::NOTE_NAME === $note->get_name() ) { + $plugin = array( 'plugin' => 'facebook-for-woocommerce' ); + $installer = new \Automattic\WooCommerce\Admin\API\OnboardingPlugins(); + $result = $installer->install_plugin( $plugin ); + + if ( is_wp_error( $result ) ) { + // @todo Reset note actioned status? + return; + } + + $installer->activate_plugin( $plugin ); + } + } +} From c1eac01cd2633d1bbfa199d5fc9c1c0c9428ea25 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2019 14:03:09 +0800 Subject: [PATCH 10/21] Update dependency composer/installers to v1.7.0 (https://github.com/woocommerce/woocommerce-admin/pull/2786) --- plugins/woocommerce-admin/composer.json | 2 +- plugins/woocommerce-admin/composer.lock | 65 +++++++++++++------------ 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/plugins/woocommerce-admin/composer.json b/plugins/woocommerce-admin/composer.json index e6ba4804ec9..d51e0892518 100644 --- a/plugins/woocommerce-admin/composer.json +++ b/plugins/woocommerce-admin/composer.json @@ -7,7 +7,7 @@ "prefer-stable": true, "minimum-stability": "dev", "require": { - "composer/installers": "1.6.0" + "composer/installers": "1.7.0" }, "require-dev": { "phpunit/phpunit": "6.5.13", diff --git a/plugins/woocommerce-admin/composer.lock b/plugins/woocommerce-admin/composer.lock index 6a39548b8d9..ceded867f90 100644 --- a/plugins/woocommerce-admin/composer.lock +++ b/plugins/woocommerce-admin/composer.lock @@ -1,23 +1,23 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c4e5044bed13f99e535b3d692d12005c", + "content-hash": "4b09720e59ab60b00e569bfb72bfd5f4", "packages": [ { "name": "composer/installers", - "version": "v1.6.0", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", - "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b" + "reference": "141b272484481432cda342727a427dc1e206bfa0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/cfcca6b1b60bc4974324efb5783c13dca6932b5b", - "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b", + "url": "https://api.github.com/repos/composer/installers/zipball/141b272484481432cda342727a427dc1e206bfa0", + "reference": "141b272484481432cda342727a427dc1e206bfa0", "shasum": "" }, "require": { @@ -73,6 +73,7 @@ "RadPHP", "SMF", "Thelia", + "Whmcs", "WolfCMS", "agl", "aimeos", @@ -95,6 +96,7 @@ "installer", "itop", "joomla", + "known", "kohana", "laravel", "lavalite", @@ -124,7 +126,7 @@ "zend", "zikula" ], - "time": "2018-08-27T06:10:37+00:00" + "time": "2019-08-12T15:00:31+00:00" } ], "packages-dev": [ @@ -168,9 +170,9 @@ "authors": [ { "name": "Franck Nijhof", + "role": "Developer / IT Manager", "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" + "homepage": "http://www.frenck.nl" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", @@ -336,18 +338,18 @@ "authors": [ { "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "role": "Developer", + "email": "arne@blankerts.de" }, { "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" + "role": "Developer", + "email": "sebastian@phpeople.de" }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "role": "Developer", + "email": "sebastian@phpunit.de" } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", @@ -383,18 +385,18 @@ "authors": [ { "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "role": "Developer", + "email": "arne@blankerts.de" }, { "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" + "role": "Developer", + "email": "sebastian@phpeople.de" }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "role": "Developer", + "email": "sebastian@phpunit.de" } ], "description": "Library for handling version information and constraints", @@ -871,8 +873,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "role": "lead", + "email": "sb@sebastian-bergmann.de" } ], "description": "FilterIterator implementation that filters files based on a list of suffixes.", @@ -913,8 +915,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "role": "lead", + "email": "sebastian@phpunit.de" } ], "description": "Simple template engine.", @@ -962,8 +964,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "role": "lead", + "email": "sb@sebastian-bergmann.de" } ], "description": "Utility class for timing", @@ -1163,6 +1165,7 @@ "mock", "xunit" ], + "abandoned": true, "time": "2018-08-09T05:50:03+00:00" }, { @@ -1716,8 +1719,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "role": "lead", + "email": "sebastian@phpunit.de" } ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", @@ -1969,12 +1972,12 @@ "version": "1.2.1", "source": { "type": "git", - "url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git", + "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", "reference": "f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c", "reference": "f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c", "shasum": "" }, From ae45a2031e9e4366c396622733590c0b39bf15f2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2019 14:09:51 +0800 Subject: [PATCH 11/21] Update dependency d3-scale-chromatic to v1.4.0 (https://github.com/woocommerce/woocommerce-admin/pull/2787) --- plugins/woocommerce-admin/package-lock.json | 6 +++--- plugins/woocommerce-admin/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/woocommerce-admin/package-lock.json b/plugins/woocommerce-admin/package-lock.json index 28314a1371e..2793c4c32ed 100644 --- a/plugins/woocommerce-admin/package-lock.json +++ b/plugins/woocommerce-admin/package-lock.json @@ -7158,9 +7158,9 @@ } }, "d3-scale-chromatic": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-1.3.3.tgz", - "integrity": "sha512-BWTipif1CimXcYfT02LKjAyItX5gKiwxuPRgr4xM58JwlLocWbjPLI7aMEjkcoOQXMkYsmNsvv3d2yl/OKuHHw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-1.4.0.tgz", + "integrity": "sha512-0vyEt8ZqhdgzC+IvdkJZL7fc3k7UZyJvMxR3zvU312z/HilJ0N+WSY3099jAxdfhe99ak9VhcK1ChDVVGc8Q0Q==", "requires": { "d3-color": "1", "d3-interpolate": "1" diff --git a/plugins/woocommerce-admin/package.json b/plugins/woocommerce-admin/package.json index 8c1941ce401..9e3164b3db6 100644 --- a/plugins/woocommerce-admin/package.json +++ b/plugins/woocommerce-admin/package.json @@ -86,7 +86,7 @@ "d3-axis": "1.0.12", "d3-format": "1.3.2", "d3-scale": "2.2.2", - "d3-scale-chromatic": "1.3.3", + "d3-scale-chromatic": "1.4.0", "d3-selection": "1.4.0", "d3-shape": "1.3.5", "d3-time-format": "2.1.3", From 4549557e5c288470689508c9c8dbf82d3e04a94b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2019 14:13:47 +0800 Subject: [PATCH 12/21] Update dependency eslint-plugin-jest to v22.15.1 (https://github.com/woocommerce/woocommerce-admin/pull/2788) --- plugins/woocommerce-admin/package-lock.json | 6 +++--- plugins/woocommerce-admin/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/woocommerce-admin/package-lock.json b/plugins/woocommerce-admin/package-lock.json index 2793c4c32ed..49c8414bcd3 100644 --- a/plugins/woocommerce-admin/package-lock.json +++ b/plugins/woocommerce-admin/package-lock.json @@ -8338,9 +8338,9 @@ } }, "eslint-plugin-jest": { - "version": "22.15.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-22.15.0.tgz", - "integrity": "sha512-hgnPbSqAIcLLS9ePb12hNHTRkXnkVaCfOwCt2pzQ8KpOKPWGA4HhLMaFN38NBa/0uvLfrZpcIRjT+6tMAfr58Q==", + "version": "22.15.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-22.15.1.tgz", + "integrity": "sha512-CWq/RR/3tLaKFB+FZcCJwU9hH5q/bKeO3rFP8G07+q7hcDCFNqpvdphVbEbGE6o6qo1UbciEev4ejUWv7brUhw==", "dev": true, "requires": { "@typescript-eslint/experimental-utils": "^1.13.0" diff --git a/plugins/woocommerce-admin/package.json b/plugins/woocommerce-admin/package.json index 9e3164b3db6..2d0365f6694 100644 --- a/plugins/woocommerce-admin/package.json +++ b/plugins/woocommerce-admin/package.json @@ -143,7 +143,7 @@ "eslint": "5.16.0", "eslint-config-wpcalypso": "4.0.1", "eslint-loader": "2.2.1", - "eslint-plugin-jest": "22.15.0", + "eslint-plugin-jest": "22.15.1", "eslint-plugin-jsx-a11y": "6.2.3", "eslint-plugin-react": "7.14.3", "eslint-plugin-wpcalypso": "4.1.0", From 594936ef880a0afa5b04111acba7b93555ec0a66 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2019 14:16:39 +0800 Subject: [PATCH 13/21] Update dependency html-to-react to v1.4.1 (https://github.com/woocommerce/woocommerce-admin/pull/2789) --- plugins/woocommerce-admin/package-lock.json | 6 +++--- plugins/woocommerce-admin/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/woocommerce-admin/package-lock.json b/plugins/woocommerce-admin/package-lock.json index 49c8414bcd3..1d7f3acf16d 100644 --- a/plugins/woocommerce-admin/package-lock.json +++ b/plugins/woocommerce-admin/package-lock.json @@ -10880,9 +10880,9 @@ "integrity": "sha1-ELMKOGCF9Dzt41PMj6fLDe7qZos=" }, "html-to-react": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/html-to-react/-/html-to-react-1.4.0.tgz", - "integrity": "sha512-VmpVO6gAw75MxRu7OgptdwtG5/thOFxTiXevsBt3gdmup2srUewHGNJWilknb334YNsMIIS0/+sGztxyClGuZA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/html-to-react/-/html-to-react-1.4.1.tgz", + "integrity": "sha512-Ys2gGxF8LBF9bD8tbnsU0xgEDOTC3Sy81mtpIH/61hSqGE1l4QetnN1yv0oAK/PuvwABmiNS+ggqvuzo+GfoiA==", "requires": { "domhandler": "^3.0", "htmlparser2": "^4.0", diff --git a/plugins/woocommerce-admin/package.json b/plugins/woocommerce-admin/package.json index 2d0365f6694..5add9ef8b3d 100644 --- a/plugins/woocommerce-admin/package.json +++ b/plugins/woocommerce-admin/package.json @@ -96,7 +96,7 @@ "gfm-code-blocks": "1.0.0", "gridicons": "3.3.1", "history": "4.9.0", - "html-to-react": "1.4.0", + "html-to-react": "1.4.1", "interpolate-components": "1.1.1", "marked": "0.7.0", "memoize-one": "5.0.5", From 2feeee452193152ba3645464315d820fe7284293 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2019 14:20:19 +0800 Subject: [PATCH 14/21] Update dependency node-watch to v0.6.3 (https://github.com/woocommerce/woocommerce-admin/pull/2790) --- plugins/woocommerce-admin/package-lock.json | 6 +++--- plugins/woocommerce-admin/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/woocommerce-admin/package-lock.json b/plugins/woocommerce-admin/package-lock.json index 1d7f3acf16d..96ea16525d2 100644 --- a/plugins/woocommerce-admin/package-lock.json +++ b/plugins/woocommerce-admin/package-lock.json @@ -14190,9 +14190,9 @@ } }, "node-watch": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.6.2.tgz", - "integrity": "sha512-qmb/2ehVk1DC4gZYox7JgWXNucKnVk7uQmcoSeRaC7kzXsT8VOPIe7mbrR9Vc2TpGggS2yGUcgC98A2fKE53AA==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.6.3.tgz", + "integrity": "sha512-InVPsg51EemnMVH3fvrrSVgqVBMlksZ/mK7ZDWx/NuWdNQi28wcVJX1/BP38alraPFXbRi9jZ35OfK4Ra7l8Bg==", "dev": true }, "node-wp-i18n": { diff --git a/plugins/woocommerce-admin/package.json b/plugins/woocommerce-admin/package.json index 5add9ef8b3d..2aa93f2b220 100644 --- a/plugins/woocommerce-admin/package.json +++ b/plugins/woocommerce-admin/package.json @@ -155,7 +155,7 @@ "locutus": "2.0.11", "mini-css-extract-plugin": "0.8.0", "node-sass": "4.12.0", - "node-watch": "0.6.2", + "node-watch": "0.6.3", "postcss-color-function": "4.1.0", "postcss-loader": "3.0.0", "prettier": "github:automattic/calypso-prettier#c56b4251", From 8530435771846a1d192dbbda98e4ac0696c0c402 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2019 14:22:45 +0800 Subject: [PATCH 15/21] Update dependency readline-sync to v1.4.10 (https://github.com/woocommerce/woocommerce-admin/pull/2791) --- plugins/woocommerce-admin/package-lock.json | 6 +++--- plugins/woocommerce-admin/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/woocommerce-admin/package-lock.json b/plugins/woocommerce-admin/package-lock.json index 96ea16525d2..812cccb69f4 100644 --- a/plugins/woocommerce-admin/package-lock.json +++ b/plugins/woocommerce-admin/package-lock.json @@ -18908,9 +18908,9 @@ } }, "readline-sync": { - "version": "1.4.9", - "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.9.tgz", - "integrity": "sha1-PtqOZfI80qF+YTAbHwADOWr17No=", + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz", + "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==", "dev": true }, "realpath-native": { diff --git a/plugins/woocommerce-admin/package.json b/plugins/woocommerce-admin/package.json index 2aa93f2b220..3b1d41a1077 100644 --- a/plugins/woocommerce-admin/package.json +++ b/plugins/woocommerce-admin/package.json @@ -163,7 +163,7 @@ "prop-types": "15.7.2", "raw-loader": "1.0.0", "react-docgen": "2.21.0", - "readline-sync": "1.4.9", + "readline-sync": "1.4.10", "recast": "0.18.1", "replace": "1.1.0", "request-promise": "4.2.4", From 21dbbe88d0337001d5fe16d85f853a1214ef0d4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Thu, 15 Aug 2019 09:30:03 +0200 Subject: [PATCH 16/21] Search List Control: fix long count values cut-off in IE11 (https://github.com/woocommerce/woocommerce-admin/pull/2783) * Search List Control: fix long item count values cut-off in IE11 * Update CHANGELOG --- plugins/woocommerce-admin/packages/components/CHANGELOG.md | 4 ++-- .../packages/components/src/search-list-control/style.scss | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/woocommerce-admin/packages/components/CHANGELOG.md b/plugins/woocommerce-admin/packages/components/CHANGELOG.md index 604a09b5140..d4ce90e6d06 100644 --- a/plugins/woocommerce-admin/packages/components/CHANGELOG.md +++ b/plugins/woocommerce-admin/packages/components/CHANGELOG.md @@ -1,14 +1,14 @@ # unreleased -- SearchListItem component: new `countLabel` prop that will overwrite the `item.count` value. - AdvancedFilters component: fire `onAdvancedFilterAction` for match changes. - TableCard component: add `onSearch` an `onSort` function props. - Add new component `` for displaying interactive list items. - Fix z-index issue in `` empty message. - Added a new `` component. - Added a new `` component. +- SearchListItem component: fix long count values being cut-off in IE11. # 3.1.0 -- Added support for a countLabel prop on SearchListItem to allow custom counts. +- Added support for a `countLabel` prop on `SearchListItem` to allow custom counts. # 3.0.0 - and got a `disabled` prop. diff --git a/plugins/woocommerce-admin/packages/components/src/search-list-control/style.scss b/plugins/woocommerce-admin/packages/components/src/search-list-control/style.scss index 4182bb1d984..8ebd7907ac6 100644 --- a/plugins/woocommerce-admin/packages/components/src/search-list-control/style.scss +++ b/plugins/woocommerce-admin/packages/components/src/search-list-control/style.scss @@ -175,7 +175,7 @@ } .woocommerce-search-list__item-count { - flex: 0; + flex: 0 1 auto; padding: $gap-smallest/2 $gap-smaller; border: 1px solid $core-grey-light-500; border-radius: 12px; From ed17b3f9519c363e0c959ad3415092d67d3f8c9e Mon Sep 17 00:00:00 2001 From: Jeff Stieler Date: Thu, 15 Aug 2019 09:19:33 -0700 Subject: [PATCH 17/21] Refactor Note "has plugin been installed for" login into reusable trait. --- .../src/Notes/NoteTraits.php | 36 +++++++++++++++++++ .../WC_Admin_Notes_Facebook_Extension.php | 16 ++++----- .../WC_Admin_Notes_Giving_Feedback_Notes.php | 18 ++++------ .../src/Notes/WC_Admin_Notes_Mobile_App.php | 17 ++++----- 4 files changed, 55 insertions(+), 32 deletions(-) create mode 100644 plugins/woocommerce-admin/src/Notes/NoteTraits.php diff --git a/plugins/woocommerce-admin/src/Notes/NoteTraits.php b/plugins/woocommerce-admin/src/Notes/NoteTraits.php new file mode 100644 index 00000000000..4e63bfe75c6 --- /dev/null +++ b/plugins/woocommerce-admin/src/Notes/NoteTraits.php @@ -0,0 +1,36 @@ += $seconds ); + } +} diff --git a/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Facebook_Extension.php b/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Facebook_Extension.php index 839cbcc816a..8acb5a13d7b 100644 --- a/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Facebook_Extension.php +++ b/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Facebook_Extension.php @@ -15,6 +15,10 @@ defined( 'ABSPATH' ) || exit; * WC_Admin_Notes_Facebook_Extension */ class WC_Admin_Notes_Facebook_Extension { + /** + * Note traits. + */ + use NoteTraits; /** * Name of the note for use in the database. @@ -32,23 +36,15 @@ class WC_Admin_Notes_Facebook_Extension { * Possibly add Facebook extension note. */ public static function possibly_add_facebook_note() { - $wc_admin_installed = get_option( 'wc_admin_install_timestamp', false ); - if ( false === $wc_admin_installed ) { - $wc_admin_installed = time(); - update_option( 'wc_admin_install_timestamp', $wc_admin_installed ); - } - // Only show the Facebook note to stores with products. $products = wp_count_posts( 'product' ); if ( (int) $products->publish < 1 ) { return; } - $current_time = time(); - $three_days_in_seconds = 3 * DAY_IN_SECONDS; - // We want to show the Facebook note after day 3. - if ( $current_time - $wc_admin_installed < $three_days_in_seconds ) { + $three_days_in_seconds = 3 * DAY_IN_SECONDS; + if ( ! self::wc_admin_active_for( $three_days_in_seconds ) ) { return; } diff --git a/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Giving_Feedback_Notes.php b/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Giving_Feedback_Notes.php index bec83a58332..1ba1e885ba7 100644 --- a/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Giving_Feedback_Notes.php +++ b/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Giving_Feedback_Notes.php @@ -15,6 +15,11 @@ defined( 'ABSPATH' ) || exit; * WC_Admin_Notes_Giving_Feedback_Notes */ class WC_Admin_Notes_Giving_Feedback_Notes { + /** + * Note traits. + */ + use NoteTraits; + /** * Add notes for admin giving feedback. */ @@ -36,18 +41,9 @@ class WC_Admin_Notes_Giving_Feedback_Notes { return; } - // Getting install timestamp reference class-wc-admin-install.php. - $wc_admin_installed = get_option( 'wc_admin_install_timestamp', false ); - if ( false === $wc_admin_installed ) { - $wc_admin_installed = time(); - update_option( 'wc_admin_install_timestamp', $wc_admin_installed ); - } - - $current_time = time(); - $three_days_in_seconds = 259200; - // We need to show Admin Giving feeback notification after 3 days of install. - if ( $current_time - $wc_admin_installed < $three_days_in_seconds ) { + $three_days_in_seconds = 3 * DAY_IN_SECONDS; + if ( ! self::wc_admin_active_for( $three_days_in_seconds ) ) { return; } diff --git a/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Mobile_App.php b/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Mobile_App.php index c2e7aeab6b1..6669faa6100 100644 --- a/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Mobile_App.php +++ b/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Mobile_App.php @@ -15,6 +15,10 @@ defined( 'ABSPATH' ) || exit; * WC_Admin_Notes_Mobile_App */ class WC_Admin_Notes_Mobile_App { + /** + * Note traits. + */ + use NoteTraits; /** * Name of the note for use in the database. @@ -25,18 +29,9 @@ class WC_Admin_Notes_Mobile_App { * Possibly add mobile app note. */ public static function possibly_add_mobile_app_note() { - - $wc_admin_installed = get_option( 'wc_admin_install_timestamp', false ); - if ( false === $wc_admin_installed ) { - $wc_admin_installed = time(); - update_option( 'wc_admin_install_timestamp', $wc_admin_installed ); - } - - $current_time = time(); - $two_days_in_seconds = 172800; - // We want to show the mobile app note after day 2. - if ( $current_time - $wc_admin_installed < $two_days_in_seconds ) { + $two_days_in_seconds = 2 * DAY_IN_SECONDS; + if ( ! self::wc_admin_active_for( $two_days_in_seconds ) ) { return; } From e07064861857c01325c6b0b493645f7cf22d0e2c Mon Sep 17 00:00:00 2001 From: Jeff Stieler Date: Thu, 15 Aug 2019 09:51:21 -0700 Subject: [PATCH 18/21] Import all used Gutenberg component styles. (https://github.com/woocommerce/woocommerce-admin/pull/2679) Fixes postcss theme overrides. --- .../client/dashboard/style.scss | 26 ++++++ .../client/stylesheets/abstracts/_mixins.scss | 83 ++++++++++++++++++- .../stylesheets/abstracts/_variables.scss | 42 +++++++++- .../shared/_gutenberg-components.scss | 9 ++ 4 files changed, 156 insertions(+), 4 deletions(-) diff --git a/plugins/woocommerce-admin/client/dashboard/style.scss b/plugins/woocommerce-admin/client/dashboard/style.scss index 4acaccc7069..5b2417e8a84 100644 --- a/plugins/woocommerce-admin/client/dashboard/style.scss +++ b/plugins/woocommerce-admin/client/dashboard/style.scss @@ -74,3 +74,29 @@ padding-bottom: 10px; } } + +.woocommerce-dashboard__body { + background: $muriel-gray-0; + color: $muriel-gray-600; + font-family: $default-font; + + #wpbody-content { + min-height: 100vh; + } + + /* Hide wp-admin and WooCommerce elements when the dashboard body class is present */ + #adminmenumain, + .woocommerce-layout__header, + .update-nag, + .woocommerce-store-alerts, + .woocommerce-message, + .notice, + .error, + .updated { + display: none; + } + + #wpcontent { + margin-left: 0; + } +} diff --git a/plugins/woocommerce-admin/client/stylesheets/abstracts/_mixins.scss b/plugins/woocommerce-admin/client/stylesheets/abstracts/_mixins.scss index 836de085f8e..a7678163f3a 100644 --- a/plugins/woocommerce-admin/client/stylesheets/abstracts/_mixins.scss +++ b/plugins/woocommerce-admin/client/stylesheets/abstracts/_mixins.scss @@ -42,12 +42,84 @@ } // Gutenberg mixins. These are temporary until Gutenberg's mixins are exposed. +/** + * Breakpoint mixins + */ + +@mixin break-huge() { + @media (min-width: #{ ($break-huge) }) { + @content; + } +} + +@mixin break-wide() { + @media (min-width: #{ ($break-wide) }) { + @content; + } +} + +@mixin break-xlarge() { + @media (min-width: #{ ($break-xlarge) }) { + @content; + } +} + +@mixin break-large() { + @media (min-width: #{ ($break-large) }) { + @content; + } +} + +@mixin break-medium() { + @media (min-width: #{ ($break-medium) }) { + @content; + } +} + +@mixin break-small() { + @media (min-width: #{ ($break-small) }) { + @content; + } +} + +@mixin break-mobile() { + @media (min-width: #{ ($break-mobile) }) { + @content; + } +} + +@mixin break-zoomed-in() { + @media (min-width: #{ ($break-zoomed-in) }) { + @content; + } +} + +// Buttons with rounded corners. +@mixin button-style__disabled { + opacity: 0.6; + cursor: default; +} + +@mixin button-style__hover { + background-color: $white; + color: $dark-gray-900; + box-shadow: inset 0 0 0 1px $light-gray-500, inset 0 0 0 2px $white, + 0 1px 1px rgba($dark-gray-900, 0.2); +} + +@mixin button-style__active() { + outline: none; + background-color: $white; + color: $dark-gray-900; + box-shadow: inset 0 0 0 1px $light-gray-700, inset 0 0 0 2px $white; +} + @mixin button-style__focus-active() { background-color: $white; color: $dark-gray-900; box-shadow: inset 0 0 0 1px $dark-gray-300, inset 0 0 0 2px $white; - // Windows High Contrast mode will show this outline, but not the box-shadow + // Windows High Contrast mode will show this outline, but not the box-shadow. outline: 2px solid transparent; outline-offset: -2px; } @@ -77,6 +149,15 @@ } } +// Gutenberg Switch. +@mixin switch-style__focus-active() { + box-shadow: 0 0 0 2px $white, 0 0 0 3px $dark-gray-300; + + // Windows High Contrast mode will show this outline, but not the box-shadow. + outline: 2px solid transparent; + outline-offset: 2px; +} + // Sets positions for children of grid elements @mixin set-grid-item-position( $wrap-after, $number-of-items ) { @for $i from 1 through $number-of-items { diff --git a/plugins/woocommerce-admin/client/stylesheets/abstracts/_variables.scss b/plugins/woocommerce-admin/client/stylesheets/abstracts/_variables.scss index 6f72c8389a7..12d3aa6f94b 100644 --- a/plugins/woocommerce-admin/client/stylesheets/abstracts/_variables.scss +++ b/plugins/woocommerce-admin/client/stylesheets/abstracts/_variables.scss @@ -23,19 +23,55 @@ $sidebar-width: 272px; $spacing: 16px; // Gutenberg variables. These are temporary until Gutenberg's variables are exposed. +$break-huge: 1440px; +$break-wide: 1280px; +$break-xlarge: 1080px; +$break-large: 960px; // admin sidebar auto folds +$break-medium: 782px; // adminbar goes big +$break-small: 600px; +$break-mobile: 480px; +$break-zoomed-in: 280px; +$border-width: 1px; $default-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; $default-font-size: 13px; $default-line-height: 1.4; -$break-small: 600px; -$border-width: 1px; +$blue-medium-900: #006589; +$blue-medium-800: #00739c; +$blue-medium-700: #007fac; +$blue-medium-600: #008dbe; +$blue-medium-500: #00a0d2; +$blue-medium-400: #33b3db; +$blue-medium-300: #66c6e4; +$blue-medium-200: #bfe7f3; +$blue-medium-100: #e5f5fa; +$blue-medium-highlight: #b3e7fe; $blue-medium-focus: #007cba; +$light-gray-100: $core-grey-light-100; +$light-gray-200: $core-grey-light-200; +$light-gray-300: $core-grey-light-300; +$light-gray-400: $core-grey-light-400; $light-gray-500: $core-grey-light-500; -$dark-gray-300: $core-grey-dark-300; +$light-gray-600: $core-grey-light-600; +$light-gray-700: $core-grey-light-700; +$light-gray-800: $core-grey-light-800; +$light-gray-900: $core-grey-light-900; +$dark-gray-100: $core-grey-dark-100; +$dark-gray-200: $core-grey-dark-200; +$dark-gray-300: $core-grey-dark-300; // This & below have 4.5+ contrast against white +$dark-gray-400: $core-grey-dark-400; +$dark-gray-500: $core-grey-dark-500; +$dark-gray-600: $core-grey-dark-600; $dark-gray-700: $core-grey-dark-700; +$dark-gray-800: $core-grey-dark-800; $dark-gray-900: $core-grey-dark-900; $alert-red: $error-red; +$alert-yellow: $notice-yellow; +$alert-green: $valid-green; +$toggle-border-width: 2px; $radius-round-rectangle: 4px; +$icon-button-size: 36px; +$icon-button-size-small: 24px; // WordPress defaults $adminbar-height: 32px; diff --git a/plugins/woocommerce-admin/client/stylesheets/shared/_gutenberg-components.scss b/plugins/woocommerce-admin/client/stylesheets/shared/_gutenberg-components.scss index f4f4b705d06..f151f16aa2a 100644 --- a/plugins/woocommerce-admin/client/stylesheets/shared/_gutenberg-components.scss +++ b/plugins/woocommerce-admin/client/stylesheets/shared/_gutenberg-components.scss @@ -5,4 +5,13 @@ Import Gutenberg component SCSS so webpack's postcss process can handle theme-in allows Woo themed components based on the config found in postcss.config.js */ @import 'gutenberg-components/button/style.scss'; +@import 'gutenberg-components/checkbox-control/style.scss'; +@import 'gutenberg-components/dashicon/style.scss'; +@import 'gutenberg-components/form-toggle/style.scss'; +@import 'gutenberg-components/icon-button/style.scss'; +@import 'gutenberg-components/notice/style.scss'; +@import 'gutenberg-components/select-control/style.scss'; @import 'gutenberg-components/snackbar/style.scss'; +@import 'gutenberg-components/spinner/style.scss'; +@import 'gutenberg-components/text-control/style.scss'; +@import 'gutenberg-components/tooltip/style.scss'; From ccf0723faa699841d20fcde004c297b12e3bfb19 Mon Sep 17 00:00:00 2001 From: Jeff Stieler Date: Thu, 15 Aug 2019 12:00:46 -0700 Subject: [PATCH 19/21] Add a "no data" cell to the Table component. --- .../packages/components/src/table/style.scss | 20 +++++++- .../packages/components/src/table/table.js | 50 ++++++++++++------- 2 files changed, 49 insertions(+), 21 deletions(-) diff --git a/plugins/woocommerce-admin/packages/components/src/table/style.scss b/plugins/woocommerce-admin/packages/components/src/table/style.scss index 319279abf91..0c4faed84ba 100644 --- a/plugins/woocommerce-admin/packages/components/src/table/style.scss +++ b/plugins/woocommerce-admin/packages/components/src/table/style.scss @@ -186,10 +186,15 @@ } .woocommerce-table__header, -.woocommerce-table__item { - @include font-size( 13 ); +.woocommerce-table__item, +.woocommerce-table__empty-item { padding: $gap $gap-large; border-bottom: 1px solid $core-grey-light-500; +} + +.woocommerce-table__header, +.woocommerce-table__item { + @include font-size( 13 ); text-align: left; > a:only-child { @@ -243,6 +248,17 @@ } } +.woocommerce-table__empty-item { + text-align: center; + @include font-size( 18 ); + color: $core-grey-dark-300; + font-weight: bold; + + @include breakpoint( '<782px' ) { + @include font-size( 13 ); + } +} + th.woocommerce-table__item { font-weight: normal; } diff --git a/plugins/woocommerce-admin/packages/components/src/table/table.js b/plugins/woocommerce-admin/packages/components/src/table/table.js index 9e00d761404..51ef5084177 100644 --- a/plugins/woocommerce-admin/packages/components/src/table/table.js +++ b/plugins/woocommerce-admin/packages/components/src/table/table.js @@ -117,6 +117,7 @@ class Table extends Component { } ); const sortedBy = query.orderby || get( find( headers, { defaultSort: true } ), 'key', false ); const sortDir = query.order || get( find( headers, { key: sortedBy } ), 'defaultOrder', DESC ); + const hasData = !! rows.length; return (
- { rows.map( ( row, i ) => ( - - { row.map( ( cell, j ) => { - const { cellClassName, isLeftAligned, isNumeric } = headers[ j ]; - const isHeader = rowHeader === j; - const Cell = isHeader ? 'th' : 'td'; - const cellClasses = classnames( 'woocommerce-table__item', cellClassName, { - 'is-left-aligned': isLeftAligned, - 'is-numeric': isNumeric, - 'is-sorted': sortedBy === headers[ j ].key, - } ); - return ( - - { getDisplay( cell ) } - - ); - } ) } - - ) ) } + { hasData + ? ( + rows.map( ( row, i ) => ( + + { row.map( ( cell, j ) => { + const { cellClassName, isLeftAligned, isNumeric } = headers[ j ]; + const isHeader = rowHeader === j; + const Cell = isHeader ? 'th' : 'td'; + const cellClasses = classnames( 'woocommerce-table__item', cellClassName, { + 'is-left-aligned': isLeftAligned, + 'is-numeric': isNumeric, + 'is-sorted': sortedBy === headers[ j ].key, + } ); + return ( + + { getDisplay( cell ) } + + ); + } ) } + + ) ) + ) + : ( + + + { __( 'No data for the selected date range', 'woocommerce-admin' ) } + + + ) + }
From 77967d2824429cb63477dbd36e791af4046ca588 Mon Sep 17 00:00:00 2001 From: Jeff Stieler Date: Thu, 15 Aug 2019 12:54:31 -0700 Subject: [PATCH 20/21] Disable table controls (except column visibility) when the table is empty. --- .../packages/components/src/filters/compare/button.js | 9 +++++++-- .../packages/components/src/search/index.js | 8 ++++++++ .../packages/components/src/table/index.js | 9 +++++++-- .../packages/components/src/table/table.js | 2 +- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/plugins/woocommerce-admin/packages/components/src/filters/compare/button.js b/plugins/woocommerce-admin/packages/components/src/filters/compare/button.js index c6f4fbcab6c..00b88315012 100644 --- a/plugins/woocommerce-admin/packages/components/src/filters/compare/button.js +++ b/plugins/woocommerce-admin/packages/components/src/filters/compare/button.js @@ -12,8 +12,8 @@ import { Button, Tooltip } from '@wordpress/components'; * * @return { object } - */ -const CompareButton = ( { className, count, children, helpText, onClick } ) => - count < 2 ? ( +const CompareButton = ( { className, count, children, disabled, helpText, onClick } ) => + ! disabled && count < 2 ? ( @@ -52,6 +53,10 @@ CompareButton.propTypes = { * The function called when the button is clicked. */ onClick: PropTypes.func.isRequired, + /** + * Whether the control is disabled or not. + */ + disabled: PropTypes.bool, }; export default CompareButton; diff --git a/plugins/woocommerce-admin/packages/components/src/search/index.js b/plugins/woocommerce-admin/packages/components/src/search/index.js index 3e7083e7a2e..b23ad2fdf7e 100644 --- a/plugins/woocommerce-admin/packages/components/src/search/index.js +++ b/plugins/woocommerce-admin/packages/components/src/search/index.js @@ -178,6 +178,7 @@ class Search extends Component { selected, showClearButton, staticResults, + disabled, } = this.props; const { value = '', isActive } = this.state; const aria = { @@ -239,6 +240,7 @@ class Search extends Component { shouldRenderTags ? `search-inline-input-${ instanceId }` : null } { ...aria } + disabled={ disabled } /> { __( 'Move backward for selected items', 'woocommerce-admin' ) } @@ -257,6 +259,7 @@ class Search extends Component { aria-owns={ listBoxId } aria-activedescendant={ activeId } { ...aria } + disabled={ disabled } /> ) @@ -338,6 +341,10 @@ Search.propTypes = { * Render results list positioned statically instead of absolutely. */ staticResults: PropTypes.bool, + /** + * Whether the control is disabled or not. + */ + disabled: PropTypes.bool, }; Search.defaultProps = { @@ -347,6 +354,7 @@ Search.defaultProps = { inlineTags: false, showClearButton: false, staticResults: false, + disabled: false, }; export default withInstanceId( Search ); diff --git a/plugins/woocommerce-admin/packages/components/src/table/index.js b/plugins/woocommerce-admin/packages/components/src/table/index.js index fbf93170063..1da4853bc12 100644 --- a/plugins/woocommerce-admin/packages/components/src/table/index.js +++ b/plugins/woocommerce-admin/packages/components/src/table/index.js @@ -250,7 +250,8 @@ class TableCard extends Component { getAllCheckbox() { const { ids = [] } = this.props; const { selectedRows } = this.state; - const isAllChecked = ids.length > 0 && ids.length === selectedRows.length; + const hasData = ids.length > 0; + const isAllChecked = hasData && ids.length === selectedRows.length; return { cellClassName: 'is-checkbox-column', label: ( @@ -259,6 +260,7 @@ class TableCard extends Component { onChange={ this.selectAllRows } aria-label={ __( 'Select All' ) } checked={ isAllChecked } + disabled={ ! hasData } /> ), required: true, @@ -295,6 +297,7 @@ class TableCard extends Component { } ); headers = [ this.getAllCheckbox(), ...headers ]; } + const hasData = 0 < totalRows; const className = classnames( 'woocommerce-analytics__card', { 'woocommerce-table': true, @@ -316,6 +319,7 @@ class TableCard extends Component { labels.helpText || __( 'Check at least two items below to compare', 'woocommerce-admin' ) } onClick={ this.onCompare } + disabled={ ! hasData } > { labels.compareButton || __( 'Compare', 'woocommerce-admin' ) } @@ -330,13 +334,14 @@ class TableCard extends Component { selected={ searchedLabels } showClearButton={ true } type={ searchBy } + disabled={ ! hasData } /> ), ( downloadable || onClickDownload ) && ( diff --git a/plugins/woocommerce-admin/packages/components/src/table/table.js b/plugins/woocommerce-admin/packages/components/src/table/table.js index 51ef5084177..60f015a24d6 100644 --- a/plugins/woocommerce-admin/packages/components/src/table/table.js +++ b/plugins/woocommerce-admin/packages/components/src/table/table.js @@ -184,7 +184,7 @@ class Table extends Component { ) } aria-describedby={ labelId } - onClick={ this.sortBy( key ) } + onClick={ hasData ? this.sortBy( key ) : noop } isDefault > { textLabel } From 6b18a6d93ee78e2af6fbea5a7103d8f1eb1fb70d Mon Sep 17 00:00:00 2001 From: Jeff Stieler Date: Thu, 15 Aug 2019 12:54:45 -0700 Subject: [PATCH 21/21] Component changelog entry. --- plugins/woocommerce-admin/packages/components/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/woocommerce-admin/packages/components/CHANGELOG.md b/plugins/woocommerce-admin/packages/components/CHANGELOG.md index d4ce90e6d06..00159abfdef 100644 --- a/plugins/woocommerce-admin/packages/components/CHANGELOG.md +++ b/plugins/woocommerce-admin/packages/components/CHANGELOG.md @@ -6,6 +6,8 @@ - Added a new `` component. - Added a new `` component. - SearchListItem component: fix long count values being cut-off in IE11. +- Add `disabled` prop to CompareButton, Search, and TableCard components. +- Table component: add empty table display. # 3.1.0 - Added support for a `countLabel` prop on `SearchListItem` to allow custom counts.