Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #498: "Validation Message Should be User Friendly" #764

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions webapp/src/components/modals/create_issue/create_issue.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ export default class CreateIssueModal extends PureComponent {
e.preventDefault();
}

if (!this.validator.validate() || !this.state.issueTitle) {
const isValidTitle = this.state.issueTitle.trim().length !== 0;
if (!this.validator.validate() || !isValidTitle) {
this.setState({
issueTitleValid: Boolean(this.state.issueTitle),
issueTitleValid: Boolean(isValidTitle),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cyrusjc Thanks for the PR.
Here isValidTitle is already going to be a boolean value. Is there any need to type caste into a Boolean again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah no particular reason other than a small oversight on my part.

showErrors: true,
});
return;
Expand Down
Loading