lib/js/app/stores/ExplorerStore.js
function _migrateToFunnel(explorer, newModel) {
  var firstStep = _defaultStep();
  firstStep.active = true;

  _.each(SHARED_FUNNEL_STEP_PROPERTIES, function (key) {
    if(!_.isUndefined(explorer.query[key]) && !_.isNull(explorer.query[key])) {
      firstStep[key] = explorer.query[key]
    }

    newModel.query[key] = (key === 'filters') ? [] : null;
  });

  if(!_.isUndefined(explorer.query.target_property) && !_.isNull(explorer.query.target_property)) {
    firstStep.actor_property = explorer.query.target_property;
    explorer.query.target_property = null;
  }

  newModel.query.steps = [firstStep];

  return newModel;
}
function _migrateToFunnel(explorer, newModel) {
  var firstStep = _defaultStep();
  firstStep.active = true;

  _.each(SHARED_FUNNEL_STEP_PROPERTIES, function (key) {
    if(!_.isUndefined(explorer.query[key]) && !_.isNull(explorer.query[key])) {
      firstStep[key] = explorer.query[key]
    }

    newModel.query[key] = (key === 'filters') ? [] : null;
  });

  if(!_.isUndefined(explorer.query.target_property) && !_.isNull(explorer.query.target_property)) {
    firstStep.actor_property = explorer.query.target_property;
    explorer.query.target_property = null;
  }

  newModel.query.steps = [firstStep];

  return newModel;
}
function _migrateToFunnel ( explorer , newModel ) { var firstStep = _defaultStep ( ) ; firstStep . active = true ; _ . each ( SHARED_FUNNEL_STEP_PROPERTIES , function ( key ) { if ( ! _ . isUndefined ( explorer . query [ key ] ) && ! _ . isNull ( explorer . query [ key ] ) ) { firstStep [ key ] = explorer . query [ key ] } newModel . query [ key ] = ( key === 'filters' ) ? [ ] : null ; } ) ; if ( ! _ . isUndefined ( explorer . query . target_property ) && ! _ . isNull ( explorer . query . target_property ) ) { firstStep . actor_property = explorer . query . target_property ; explorer . query . target_property = null ; } newModel . query . steps = [ firstStep ] ; return newModel ; }
If the query got changed to a funnel, move the step-specific parameters to a steps object.
@param {Object} explorer The explorer model that is being updated
@param {Object} newModel The updated explorer model
@return {Object}         The new set of updates
If the query got changed to a funnel move the step - specific parameters to a steps object .