Skip to content

Commit

Permalink
fix(addSourceWizard): copy updates (#26)
Browse files Browse the repository at this point in the history
* copy updates for error handling
  • Loading branch information
cdcabrera authored Mar 25, 2019
1 parent 496df34 commit 2107682
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ exports[`AccountWizardStepResults Component should render a wizard results step
<p
className="blank-slate-pf-secondary-action"
>
There are errors on the previous step
There are errors on a previous step. Use the Back button to review your settings and try again.
</p>
</div>
</AddSourceWizardStepThree>
Expand Down Expand Up @@ -99,7 +99,7 @@ exports[`AccountWizardStepResults Component should render a wizard results step
<p
className="blank-slate-pf-secondary-action"
>
There are errors on the previous step
There are errors on a previous step. Use the Back button to review your settings and try again.
</p>
</div>
</AddSourceWizardStepThree>
Expand Down
4 changes: 3 additions & 1 deletion src/components/addSourceWizard/addSourceWizardStepThree.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ const AddSourceWizardStepThree = ({ add, error, fulfilled, pending, name }) => (
<Icon type="pf" name="error-circle-o" />
</div>
<h3 className="blank-slate-pf-main-action">Error {add ? 'Creating' : 'Updating'} Source</h3>
<p className="blank-slate-pf-secondary-action">There are errors on the previous step</p>
<p className="blank-slate-pf-secondary-action">
There are errors on a previous step. Use the Back button to review your settings and try again.
</p>
</div>
)}
{fulfilled && (
Expand Down
10 changes: 5 additions & 5 deletions src/components/addSourceWizard/addSourceWizardStepTwo.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class AddSourceWizardStepTwo extends React.Component {
<FormField
label="Name"
error={(touched.name && errors.name) || stepTwoErrorMessages.name}
errorMessage={stepTwoErrorMessages.name || 'You must enter a source name '}
errorMessage={stepTwoErrorMessages.name || 'A source name is required'}
>
<Form.FormControl
type="text"
Expand Down Expand Up @@ -201,7 +201,7 @@ class AddSourceWizardStepTwo extends React.Component {
<FormField
label="Search addresses"
error={(touched.hostsMultiple && errors.hosts) || stepTwoErrorMessages.hosts}
errorMessage="You must enter a valid IP address or hostname"
errorMessage="A valid IP address or hostname is required"
>
<Form.FormControl
componentClass="textarea"
Expand Down Expand Up @@ -237,7 +237,7 @@ class AddSourceWizardStepTwo extends React.Component {
case 'satellite':
const hostPortError = (
<React.Fragment>
{touched.hostsSingle && errors.hosts && 'You must enter a valid IP address or hostname '}
{touched.hostsSingle && errors.hosts && 'A valid IP address or hostname is required '}
{errors.port && 'Port must be valid'}
</React.Fragment>
);
Expand All @@ -253,7 +253,7 @@ class AddSourceWizardStepTwo extends React.Component {
stepTwoErrorMessages.port
}
errorMessage={
(stepTwoErrorMessages.hosts && 'You must enter a valid IP address or hostname') ||
(stepTwoErrorMessages.hosts && 'A valid IP address or hostname is required') ||
(stepTwoErrorMessages.port && 'Port must be valid') ||
hostPortError
}
Expand Down Expand Up @@ -296,7 +296,7 @@ class AddSourceWizardStepTwo extends React.Component {
<FormField
label="Credentials"
error={(touched.credentials && errors.credentials) || stepTwoErrorMessages.credentials}
errorMessage={stepTwoErrorMessages.credentials || 'You must add a credential'}
errorMessage={stepTwoErrorMessages.credentials || 'A credential is required'}
>
<Form.InputGroup>
<DropdownSelect
Expand Down

0 comments on commit 2107682

Please sign in to comment.