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 <contacto@fernandomarichal.com>
This commit is contained in:
Fernando 2020-03-19 09:13:14 -03:00 committed by GitHub
parent 0343ef2b78
commit 675591a593
1 changed files with 7 additions and 4 deletions

View File

@ -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,