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

Disable Save button and show hint if email or default vote weight in <new account>/<new participant> is faulty #2899

Closed
Elblinator opened this issue Oct 17, 2023 · 6 comments · Fixed by #2911
Assignees
Labels
enhancement General enhancement which is neither bug nor feature good first issue
Milestone

Comments

@Elblinator
Copy link
Member

Elblinator commented Oct 17, 2023

Current behaviour:
new account:
If the mask is opened and a wrong e-mail address or vote weight is put into the field the save button is not disabled and if the new account is saved the error Cannot read properties of undefined (reading '0') is displayed but the mask with every input stays on screen
new participant:
If in step 1 or step 3 in the mask a wrong email-address is assigned to the new participant then the save button is not disabled and if pressed the error Error: email must be valid email. it thrown and the are navigated back to the participant-list (the input for the new participant is being lost)

Correct input (as far as I understand it):
Correct vote weight: number >= 0.000001

Correct Email: @.
Description in words:
A correct mail-address consists out of three strings with to separators:

  • a string
  • "@"
  • a string
  • "."
  • a string

Wanted behaviour:
If there is a wrong input in these masks then two things should happen:

  1. the save button should be disabled
  2. the input-field which has the faulty input should get coloured in the warn colour and a text should be displayed unter the line:
    • for a wrong email: "Please enter a valid email address. "
    • for a wrong vote weight: "Please select a vote weight bigger than or equal to zero."
@Elblinator Elblinator added enhancement General enhancement which is neither bug nor feature good first issue labels Oct 17, 2023
@reiterl reiterl self-assigned this Oct 18, 2023
@reiterl
Copy link
Member

reiterl commented Oct 19, 2023

We should use a email validation from Angular or a lib. Email validation is more complex than what @Elblinator wrote.

@rrenkert
Copy link
Member

Yes, email validation is more complex but a regex should be enough for the validation we need at this place.

@reiterl
Copy link
Member

reiterl commented Oct 19, 2023

We should use the default Angular Validator here.

@jsangmeister
Copy link
Contributor

Vote weight must be at least 0.000001, see OpenSlides/openslides-backend#1926. Updated the description.

@reiterl
Copy link
Member

reiterl commented Nov 2, 2023

Yes, that is right, but this requirement is part of an own client issue.

@reiterl
Copy link
Member

reiterl commented Nov 2, 2023

I have added the default vote weight Validator and error check and have updated the error message.
(To prevent zero)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement General enhancement which is neither bug nor feature good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants