Use better variable name

[MAILPOET-1809]
This commit is contained in:
Pavel Dohnal
2019-07-02 13:41:43 +02:00
committed by M. Shull
parent 6da6e9b62c
commit 729efbb62f
5 changed files with 16 additions and 16 deletions

View File

@@ -13,7 +13,7 @@ const container = document.getElementById('import_container');
const subscribersLimitForValidation = 500;
const ImportSubscribers = () => {
const [stepMethodSelection, setStepMethodSelection] = useState(undefined);
const [stepMethodSelectionData, setStepMethodSelectionData] = useState(undefined);
return (
<HashRouter>
<Switch>
@@ -22,7 +22,7 @@ const ImportSubscribers = () => {
render={props => (
<StepMethodSelection
{...props}
setStepMethodSelection={setStepMethodSelection}
setStepMethodSelectionData={setStepMethodSelectionData}
subscribersLimitForValidation={subscribersLimitForValidation}
/>
)}
@@ -32,7 +32,7 @@ const ImportSubscribers = () => {
render={props => (
<StepInputValidation
{...props}
stepMethodSelection={stepMethodSelection}
stepMethodSelectionData={stepMethodSelectionData}
/>
)}
/>
@@ -41,7 +41,7 @@ const ImportSubscribers = () => {
render={props => (
<StepDataManipulation
{...props}
stepMethodSelection={stepMethodSelection}
stepMethodSelectionData={stepMethodSelectionData}
subscribersLimitForValidation={subscribersLimitForValidation}
/>
)}

View File

@@ -18,16 +18,16 @@ function getPreviousStepLink(importData, subscribersLimitForValidation) {
function StepDataManipulation({
history,
stepMethodSelection,
stepMethodSelectionData,
subscribersLimitForValidation,
}) {
useEffect(
() => {
if (typeof (stepMethodSelection) === 'undefined') {
if (typeof (stepMethodSelectionData) === 'undefined') {
history.replace('step_method_selection');
}
},
[stepMethodSelection],
[stepMethodSelectionData],
);
return (
@@ -35,7 +35,7 @@ function StepDataManipulation({
<PreviousNextStepButtons
canGoNext={false}
onPreviousAction={() => (
history.push(getPreviousStepLink(stepMethodSelection, subscribersLimitForValidation))
history.push(getPreviousStepLink(stepMethodSelectionData, subscribersLimitForValidation))
)}
onNextAction={() => history.push('todo')}
/>
@@ -48,7 +48,7 @@ StepDataManipulation.propTypes = {
push: PropTypes.func.isRequired,
replace: PropTypes.func.isRequired,
}).isRequired,
stepMethodSelection: PropTypes.shape({
stepMethodSelectionData: PropTypes.shape({
duplicate: PropTypes.arrayOf(PropTypes.string),
header: PropTypes.arrayOf(PropTypes.string),
invalid: PropTypes.arrayOf(PropTypes.string),
@@ -60,7 +60,7 @@ StepDataManipulation.propTypes = {
};
StepDataManipulation.defaultProps = {
stepMethodSelection: undefined,
stepMethodSelectionData: undefined,
};
export default withRouter(StepDataManipulation);

View File

@@ -50,7 +50,7 @@ class StepInputValidation extends Component {
}
componentDidMount() {
if (typeof (this.props.stepMethodSelection) === 'undefined') {
if (typeof (this.props.stepMethodSelectionData) === 'undefined') {
this.props.history.replace('step_method_selection');
}
}
@@ -132,7 +132,7 @@ StepInputValidation.propTypes = {
push: PropTypes.func.isRequired,
replace: PropTypes.func.isRequired,
}).isRequired,
stepMethodSelection: PropTypes.shape({
stepMethodSelectionData: PropTypes.shape({
duplicate: PropTypes.arrayOf(PropTypes.string),
header: PropTypes.arrayOf(PropTypes.string),
invalid: PropTypes.arrayOf(PropTypes.string),
@@ -143,7 +143,7 @@ StepInputValidation.propTypes = {
};
StepInputValidation.defaultProps = {
stepMethodSelection: undefined,
stepMethodSelectionData: undefined,
};
export default withRouter(StepInputValidation);

View File

@@ -23,7 +23,7 @@ const getNextStepLink = (importData, subscribersLimitForValidation) => {
function StepMethodSelection({
history,
setStepMethodSelection,
setStepMethodSelectionData,
subscribersLimitForValidation,
}) {
const [method, setMethod] = useState(undefined);
@@ -31,7 +31,7 @@ function StepMethodSelection({
const [file, setFile] = useState(undefined);
const finish = (parsedData) => {
setStepMethodSelection(parsedData);
setStepMethodSelectionData(parsedData);
history.push(getNextStepLink(parsedData, subscribersLimitForValidation));
};
@@ -93,7 +93,7 @@ StepMethodSelection.propTypes = {
history: PropTypes.shape({
push: PropTypes.func.isRequired,
}).isRequired,
setStepMethodSelection: PropTypes.func.isRequired,
setStepMethodSelectionData: PropTypes.func.isRequired,
subscribersLimitForValidation: PropTypes.number.isRequired,
};