-
Notifications
You must be signed in to change notification settings - Fork 21
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
Flowauth serverpage validation #749
Conversation
Codecov Report
@@ Coverage Diff @@
## master #749 +/- ##
=======================================
Coverage 93.16% 93.16%
=======================================
Files 130 130
Lines 6522 6522
Branches 691 691
=======================================
Hits 6076 6076
Misses 326 326
Partials 120 120 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff :)
state = Object.assign(state, { | ||
name_helper_text: "Server name may only contain letters, numbers and underscores." | ||
}); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor comment: I personally like to be explicit about the condition that triggers a conditional branch. In this case it's obvious that the else
branch can only be triggered if the servername is too long, but it's easy to later add another condition in the if
statement and forget to update the else
branch, and then the error message displayed is inconsistent with the condition that triggered it.
How about turning this else
branch into another else if
?
} else { | |
} else if (servername.length > 120) { |
Of course then we need to add a catch-all else branch which blows up if it's triggered (because it should never be reached). I'm not sure what a good way to "blow up" is in Javascript land, though, so maybe this isn't a feasible approach. ;)
Closes #748
I have:
Description
Added client-side validation and error message on new server page for admin users.