Improve error messages on add new server dialog
Closes #438 Note: this solution is different than what @jasonblais suggested. @jasonblais suggested not highlighting the field that hasn't been filled out yet, but I think it's a better UX to continue to highlight them all as it currently does, but to clarify the error messages. Also notably, as far as I can tell, the react-bootstrap [forms API](https://react-bootstrap.github.io/components/forms/) does not appear to support selectively highlighting some fields in the form but not others anyway.
This commit is contained in:
@@ -68,7 +68,17 @@ export default class NewTeamModal extends React.Component {
|
||||
}
|
||||
|
||||
getError() {
|
||||
return this.getTeamNameValidationError() || this.getTeamUrlValidationError();
|
||||
const nameError = this.getTeamNameValidationError();
|
||||
const urlError = this.getTeamUrlValidationError();
|
||||
|
||||
if (nameError && urlError) {
|
||||
return 'Name and URL are required.';
|
||||
} else if (nameError) {
|
||||
return nameError;
|
||||
} else if (urlError) {
|
||||
return urlError;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
validateForm() {
|
||||
|
Reference in New Issue
Block a user