Skip to content

Commit

Permalink
Signup: remove removeUnneededSteps (Automattic#35461)
Browse files Browse the repository at this point in the history
  • Loading branch information
spen authored Aug 28, 2019
1 parent 4b4f323 commit fc3b5c6
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 20 deletions.
8 changes: 1 addition & 7 deletions client/lib/signup/flow-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ import { ProgressState } from 'state/signup/progress/schema';
import { getSignupProgress } from 'state/signup/progress/selectors';
import { getSignupDependencyStore } from 'state/signup/dependency-store/selectors';
import { resetSignup, updateDependencies } from 'state/signup/actions';
import {
completeSignupStep,
invalidateStep,
processStep,
removeUnneededSteps,
} from 'state/signup/progress/actions';
import { completeSignupStep, invalidateStep, processStep } from 'state/signup/progress/actions';

interface Dependencies {
[other: string]: any;
Expand Down Expand Up @@ -359,6 +354,5 @@ export default class SignupFlowController {
flows.resetExcludedSteps();
this._flowName = flowName;
this._flow = flows.getFlow( flowName );
this._reduxStore.dispatch( removeUnneededSteps( this._flowName ) );
}
}
4 changes: 1 addition & 3 deletions client/signup/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import {
import isUserRegistrationDaysWithinRange from 'state/selectors/is-user-registration-days-within-range';
import { getSignupDependencyStore } from 'state/signup/dependency-store/selectors';
import { getSignupProgress } from 'state/signup/progress/selectors';
import { removeUnneededSteps, submitSignupStep } from 'state/signup/progress/actions';
import { submitSignupStep } from 'state/signup/progress/actions';
import { setSurvey } from 'state/signup/steps/survey/actions';
import { submitSiteType } from 'state/signup/steps/site-type/actions';
import { submitSiteVertical } from 'state/signup/steps/site-vertical/actions';
Expand Down Expand Up @@ -452,7 +452,6 @@ class Signup extends React.Component {
const nextStepSection = ( nextProgressItem && nextProgressItem.stepSectionName ) || '';

if ( nextFlowName !== this.props.flowName ) {
this.props.removeUnneededSteps( nextFlowName );
this.setState( { previousFlowName: this.props.flowName } );
}

Expand Down Expand Up @@ -634,6 +633,5 @@ export default connect(
submitSiteVertical,
submitSignupStep,
loadTrackingTool,
removeUnneededSteps,
}
)( Signup );
1 change: 0 additions & 1 deletion client/state/action-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,6 @@ export const SIGNUP_OPTIONAL_DEPENDENCY_SUGGESTED_USERNAME_SET =
export const SIGNUP_PROGRESS_COMPLETE_STEP = 'SIGNUP_PROGRESS_COMPLETE_STEP';
export const SIGNUP_PROGRESS_INVALIDATE_STEP = 'SIGNUP_PROGRESS_INVALIDATE_STEP';
export const SIGNUP_PROGRESS_PROCESS_STEP = 'SIGNUP_PROGRESS_PROCESS_STEP';
export const SIGNUP_PROGRESS_REMOVE_UNNEEDED_STEPS = 'SIGNUP_PROGRESS_REMOVE_UNNEEDED_STEPS';
export const SIGNUP_PROGRESS_RESUME_AFTER_LOGIN_SET = 'SIGNUP_PROGRESS_RESUME_AFTER_LOGIN_SET';
export const SIGNUP_PROGRESS_SAVE_STEP = 'SIGNUP_PROGRESS_SAVE_STEP';
export const SIGNUP_PROGRESS_SUBMIT_STEP = 'SIGNUP_PROGRESS_SUBMIT_STEP';
Expand Down
8 changes: 0 additions & 8 deletions client/state/signup/progress/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
SIGNUP_PROGRESS_COMPLETE_STEP,
SIGNUP_PROGRESS_PROCESS_STEP,
SIGNUP_PROGRESS_INVALIDATE_STEP,
SIGNUP_PROGRESS_REMOVE_UNNEEDED_STEPS,
SIGNUP_PROGRESS_RESUME_AFTER_LOGIN_SET,
} from 'state/action-types';
import { assertValidDependencies } from 'lib/signup/asserts';
Expand Down Expand Up @@ -130,13 +129,6 @@ export function invalidateStep( step, errors ) {
};
}

export function removeUnneededSteps( flowName ) {
return {
type: SIGNUP_PROGRESS_REMOVE_UNNEEDED_STEPS,
flowName,
};
}

export function setResumeAfterLogin( step ) {
const lastUpdated = Date.now();
return {
Expand Down
2 changes: 1 addition & 1 deletion client/state/signup/progress/test/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
SIGNUP_PROGRESS_SUBMIT_STEP,
} from 'state/action-types';

// Mock necessary for testing removeUnneededSteps
// Mock necessary for testing certain utils
jest.mock( 'signup/config/flows-pure', () => ( {
'new-flow': {
steps: [ 'something', 'everything' ],
Expand Down

0 comments on commit fc3b5c6

Please sign in to comment.