Use better variable name
[MAILPOET-1809]
This commit is contained in:
@@ -13,7 +13,7 @@ const container = document.getElementById('import_container');
|
|||||||
const subscribersLimitForValidation = 500;
|
const subscribersLimitForValidation = 500;
|
||||||
|
|
||||||
const ImportSubscribers = () => {
|
const ImportSubscribers = () => {
|
||||||
const [stepMethodSelection, setStepMethodSelection] = useState(undefined);
|
const [stepMethodSelectionData, setStepMethodSelectionData] = useState(undefined);
|
||||||
return (
|
return (
|
||||||
<HashRouter>
|
<HashRouter>
|
||||||
<Switch>
|
<Switch>
|
||||||
@@ -22,7 +22,7 @@ const ImportSubscribers = () => {
|
|||||||
render={props => (
|
render={props => (
|
||||||
<StepMethodSelection
|
<StepMethodSelection
|
||||||
{...props}
|
{...props}
|
||||||
setStepMethodSelection={setStepMethodSelection}
|
setStepMethodSelectionData={setStepMethodSelectionData}
|
||||||
subscribersLimitForValidation={subscribersLimitForValidation}
|
subscribersLimitForValidation={subscribersLimitForValidation}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -32,7 +32,7 @@ const ImportSubscribers = () => {
|
|||||||
render={props => (
|
render={props => (
|
||||||
<StepInputValidation
|
<StepInputValidation
|
||||||
{...props}
|
{...props}
|
||||||
stepMethodSelection={stepMethodSelection}
|
stepMethodSelectionData={stepMethodSelectionData}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
@@ -41,7 +41,7 @@ const ImportSubscribers = () => {
|
|||||||
render={props => (
|
render={props => (
|
||||||
<StepDataManipulation
|
<StepDataManipulation
|
||||||
{...props}
|
{...props}
|
||||||
stepMethodSelection={stepMethodSelection}
|
stepMethodSelectionData={stepMethodSelectionData}
|
||||||
subscribersLimitForValidation={subscribersLimitForValidation}
|
subscribersLimitForValidation={subscribersLimitForValidation}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@@ -18,16 +18,16 @@ function getPreviousStepLink(importData, subscribersLimitForValidation) {
|
|||||||
|
|
||||||
function StepDataManipulation({
|
function StepDataManipulation({
|
||||||
history,
|
history,
|
||||||
stepMethodSelection,
|
stepMethodSelectionData,
|
||||||
subscribersLimitForValidation,
|
subscribersLimitForValidation,
|
||||||
}) {
|
}) {
|
||||||
useEffect(
|
useEffect(
|
||||||
() => {
|
() => {
|
||||||
if (typeof (stepMethodSelection) === 'undefined') {
|
if (typeof (stepMethodSelectionData) === 'undefined') {
|
||||||
history.replace('step_method_selection');
|
history.replace('step_method_selection');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[stepMethodSelection],
|
[stepMethodSelectionData],
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -35,7 +35,7 @@ function StepDataManipulation({
|
|||||||
<PreviousNextStepButtons
|
<PreviousNextStepButtons
|
||||||
canGoNext={false}
|
canGoNext={false}
|
||||||
onPreviousAction={() => (
|
onPreviousAction={() => (
|
||||||
history.push(getPreviousStepLink(stepMethodSelection, subscribersLimitForValidation))
|
history.push(getPreviousStepLink(stepMethodSelectionData, subscribersLimitForValidation))
|
||||||
)}
|
)}
|
||||||
onNextAction={() => history.push('todo')}
|
onNextAction={() => history.push('todo')}
|
||||||
/>
|
/>
|
||||||
@@ -48,7 +48,7 @@ StepDataManipulation.propTypes = {
|
|||||||
push: PropTypes.func.isRequired,
|
push: PropTypes.func.isRequired,
|
||||||
replace: PropTypes.func.isRequired,
|
replace: PropTypes.func.isRequired,
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
stepMethodSelection: PropTypes.shape({
|
stepMethodSelectionData: PropTypes.shape({
|
||||||
duplicate: PropTypes.arrayOf(PropTypes.string),
|
duplicate: PropTypes.arrayOf(PropTypes.string),
|
||||||
header: PropTypes.arrayOf(PropTypes.string),
|
header: PropTypes.arrayOf(PropTypes.string),
|
||||||
invalid: PropTypes.arrayOf(PropTypes.string),
|
invalid: PropTypes.arrayOf(PropTypes.string),
|
||||||
@@ -60,7 +60,7 @@ StepDataManipulation.propTypes = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
StepDataManipulation.defaultProps = {
|
StepDataManipulation.defaultProps = {
|
||||||
stepMethodSelection: undefined,
|
stepMethodSelectionData: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withRouter(StepDataManipulation);
|
export default withRouter(StepDataManipulation);
|
||||||
|
@@ -50,7 +50,7 @@ class StepInputValidation extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
if (typeof (this.props.stepMethodSelection) === 'undefined') {
|
if (typeof (this.props.stepMethodSelectionData) === 'undefined') {
|
||||||
this.props.history.replace('step_method_selection');
|
this.props.history.replace('step_method_selection');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -132,7 +132,7 @@ StepInputValidation.propTypes = {
|
|||||||
push: PropTypes.func.isRequired,
|
push: PropTypes.func.isRequired,
|
||||||
replace: PropTypes.func.isRequired,
|
replace: PropTypes.func.isRequired,
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
stepMethodSelection: PropTypes.shape({
|
stepMethodSelectionData: PropTypes.shape({
|
||||||
duplicate: PropTypes.arrayOf(PropTypes.string),
|
duplicate: PropTypes.arrayOf(PropTypes.string),
|
||||||
header: PropTypes.arrayOf(PropTypes.string),
|
header: PropTypes.arrayOf(PropTypes.string),
|
||||||
invalid: PropTypes.arrayOf(PropTypes.string),
|
invalid: PropTypes.arrayOf(PropTypes.string),
|
||||||
@@ -143,7 +143,7 @@ StepInputValidation.propTypes = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
StepInputValidation.defaultProps = {
|
StepInputValidation.defaultProps = {
|
||||||
stepMethodSelection: undefined,
|
stepMethodSelectionData: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withRouter(StepInputValidation);
|
export default withRouter(StepInputValidation);
|
||||||
|
@@ -23,7 +23,7 @@ const getNextStepLink = (importData, subscribersLimitForValidation) => {
|
|||||||
|
|
||||||
function StepMethodSelection({
|
function StepMethodSelection({
|
||||||
history,
|
history,
|
||||||
setStepMethodSelection,
|
setStepMethodSelectionData,
|
||||||
subscribersLimitForValidation,
|
subscribersLimitForValidation,
|
||||||
}) {
|
}) {
|
||||||
const [method, setMethod] = useState(undefined);
|
const [method, setMethod] = useState(undefined);
|
||||||
@@ -31,7 +31,7 @@ function StepMethodSelection({
|
|||||||
const [file, setFile] = useState(undefined);
|
const [file, setFile] = useState(undefined);
|
||||||
|
|
||||||
const finish = (parsedData) => {
|
const finish = (parsedData) => {
|
||||||
setStepMethodSelection(parsedData);
|
setStepMethodSelectionData(parsedData);
|
||||||
history.push(getNextStepLink(parsedData, subscribersLimitForValidation));
|
history.push(getNextStepLink(parsedData, subscribersLimitForValidation));
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ StepMethodSelection.propTypes = {
|
|||||||
history: PropTypes.shape({
|
history: PropTypes.shape({
|
||||||
push: PropTypes.func.isRequired,
|
push: PropTypes.func.isRequired,
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
setStepMethodSelection: PropTypes.func.isRequired,
|
setStepMethodSelectionData: PropTypes.func.isRequired,
|
||||||
subscribersLimitForValidation: PropTypes.number.isRequired,
|
subscribersLimitForValidation: PropTypes.number.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user