From 675591a593c72b4f7921773a107702ca9ae2b42c Mon Sep 17 00:00:00 2001 From: Fernando Date: Thu, 19 Mar 2020 09:13:14 -0300 Subject: [PATCH] Onboarding: Modified the recorded data in profile wizard (https://github.com/woocommerce/woocommerce-admin/pull/3929) * Onboarding: Modified the recorded data in profile wizard In the second step of the profile wizard, now 'industries_with_detail' is a 'string' instead of an 'object'. * Selected industries converted to a string Selected industries are converted to a string to send to recordEvent Co-authored-by: Fernando Marichal --- .../client/dashboard/profile-wizard/steps/industry.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/woocommerce-admin/client/dashboard/profile-wizard/steps/industry.js b/plugins/woocommerce-admin/client/dashboard/profile-wizard/steps/industry.js index 876413a8d05..59af9c826a5 100644 --- a/plugins/woocommerce-admin/client/dashboard/profile-wizard/steps/industry.js +++ b/plugins/woocommerce-admin/client/dashboard/profile-wizard/steps/industry.js @@ -5,7 +5,7 @@ import { __ } from '@wordpress/i18n'; import { Component, Fragment } from '@wordpress/element'; import { Button, CheckboxControl } from '@wordpress/components'; import { compose } from '@wordpress/compose'; -import { filter, get, find, findIndex } from 'lodash'; +import { filter, find, findIndex, get } from 'lodash'; import { withDispatch } from '@wordpress/data'; /** @@ -52,9 +52,12 @@ class Industry extends Component { const selectedIndustriesList = this.state.selected.map( ( industry ) => industry.slug ); - const industriesWithDetail = filter( this.state.selected, ( value ) => { - return typeof value.detail !== 'undefined'; - } ); + + // Here the selected industries are converted to a string that is a comma separated list + const industriesWithDetail = this.state.selected + .map( ( industry ) => industry.detail ) + .filter( ( n ) => n ) + .join( ',' ); recordEvent( 'storeprofiler_store_industry_continue', { store_industry: selectedIndustriesList,