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

Flowauth serverpage validation #749

Merged
merged 17 commits into from
May 14, 2019
Merged

Conversation

BhavinPanch
Copy link
Contributor

@BhavinPanch BhavinPanch commented May 10, 2019

Closes #748

I have:

  • Formatted any Python files with black
  • Brought the branch up to date with master
  • Added any relevant Github labels
  • Added tests for any new additions
  • Added or updated any relevant documentation
  • Added an Architectural Decision Record (ADR), if appropriate
  • Added an MPLv2 License Header if appropriate
  • Updated the Changelog

Description

Added client-side validation and error message on new server page for admin users.

@codecov
Copy link

codecov bot commented May 10, 2019

Codecov Report

Merging #749 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7d8dd9...2939066. Read the comment docs.

Copy link
Member

@greenape greenape left a comment

Choose a reason for hiding this comment

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

Great stuff :)

CHANGELOG.md Outdated Show resolved Hide resolved
@greenape greenape added enhancement New feature or request FlowAuth Issues related to FlowAuth ready-to-merge Label indicating a PR is OK to automerge UX/UI and removed ready-to-merge Label indicating a PR is OK to automerge labels May 13, 2019
state = Object.assign(state, {
name_helper_text: "Server name may only contain letters, numbers and underscores."
});
} else {
Copy link
Contributor

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?

Suggested change
} 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. ;)

@maxalbert maxalbert added the ready-to-merge Label indicating a PR is OK to automerge label May 14, 2019
@mergify mergify bot merged commit 4754da6 into master May 14, 2019
@mergify mergify bot deleted the Flowauth-Serverpage-Validation branch May 14, 2019 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request FlowAuth Issues related to FlowAuth ready-to-merge Label indicating a PR is OK to automerge UX/UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client side validation and display appropriate messages
3 participants