-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add check that EE name is correct when typed in #1220
Conversation
1a30b60
to
589bea9
Compare
58ec52c
to
95159a3
Compare
src/containers/execution-environment-list/execution_environment_list.tsx
Outdated
Show resolved
Hide resolved
(test failures seem relevant...) |
558ffb5
to
3f5e6da
Compare
c333bb1
to
55fe4e3
Compare
(adding this to a few recently updated PRs…) We need CI in this repo that enforces this, but for now please:
|
97cf928
to
ff7f1c2
Compare
src/containers/execution-environment-list/execution_environment_list.tsx
Show resolved
Hide resolved
ff7f1c2
to
b8cb851
Compare
80dc45a
to
5fc6c40
Compare
Needs a rebase, but LGTM :) |
5fc6c40
to
4b12632
Compare
@himdel rebased and ready for review :) |
Tested in the UI, looks like everything works, just one more thing... :) (correct:) Namespaces > Create ...there is no error when name is empty, until you enter something and remove it again. (and we may need a better message for when the field is empty .. namespaces uses Looks like namespaces is running the validation from onChange, not sure if you want to do the same thing or not, maybe all we need is to set |
@himdel Fixed as suggested. Just had to move it to the |
1d086dd
to
3c2b154
Compare
</Form> | ||
</Modal> | ||
); | ||
} | ||
|
||
private validateName(name) { | ||
const regex = /^([0-9A-Za-z._-]+\/)?[0-9A-Za-z._-]+$/; | ||
if (name === '' || regex.test(name)) { |
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.
@himdel This is the change you are looking for.
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.
Works for me :), formIsValid
still ensures non-empty name 👍
3c2b154
to
bf46fc2
Compare
Issue: https://issues.redhat.com/browse/AAH-968 Disable Save button if name is not correct Do not check name if EE is remote Add alert when EE is saved to let an user to know Check that slash is not there or once Show error messages in the form Fix regex according to review Do not check to validate name if editing Remove testing changes Move new isDisabled logic to a function. Fix the condition to be simple Do not check length if local Make the formIsValid function more readable Issue: AAH-968 Fix typo numbers -> characters And linting issue. Move Alert out of FormGroup Add error handling to detail page as well Don't show name format error message when that input is empty Add changelog
bf46fc2
to
d05b0ad
Compare
Issue: https://issues.redhat.com/browse/AAH-968 Disable Save button if name is not correct Do not check name if EE is remote Add alert when EE is saved to let an user to know Check that slash is not there or once Show error messages in the form Fix regex according to review Do not check to validate name if editing Remove testing changes Move new isDisabled logic to a function. Fix the condition to be simple Do not check length if local Make the formIsValid function more readable Issue: AAH-968 Fix typo numbers -> characters And linting issue. Move Alert out of FormGroup Add error handling to detail page as well Don't show name format error message when that input is empty Add changelog (cherry picked from commit f7b1e2b)
backporting manually in #1497 |
Issue: https://issues.redhat.com/browse/AAH-968 Disable Save button if name is not correct Do not check name if EE is remote Add alert when EE is saved to let an user to know Check that slash is not there or once Show error messages in the form Fix regex according to review Do not check to validate name if editing Remove testing changes Move new isDisabled logic to a function. Fix the condition to be simple Do not check length if local Make the formIsValid function more readable Issue: AAH-968 Fix typo numbers -> characters And linting issue. Move Alert out of FormGroup Add error handling to detail page as well Don't show name format error message when that input is empty Add changelog (cherry picked from commit f7b1e2b)
Issue: https://issues.redhat.com/browse/AAH-968 Disable Save button if name is not correct Do not check name if EE is remote Add alert when EE is saved to let an user to know Check that slash is not there or once Show error messages in the form Fix regex according to review Do not check to validate name if editing Remove testing changes Move new isDisabled logic to a function. Fix the condition to be simple Do not check length if local Make the formIsValid function more readable Issue: AAH-968 Fix typo numbers -> characters And linting issue. Move Alert out of FormGroup Add error handling to detail page as well Don't show name format error message when that input is empty Add changelog (cherry picked from commit f7b1e2b) Co-authored-by: ZitaNemeckova <znemecko@redhat.com>
Fixes https://issues.redhat.com/browse/AAH-968
Steps to reproduce:
(Screenshots are in French because I'm looking for possible problems with translation)
Before:
After:
This is not fixed in #1115 and is not related to that PR.
@himdel please have a look, thanks :)