-
Notifications
You must be signed in to change notification settings - Fork 1
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
Required Validation not working on multiselect and multiselect-checkboxes #13
Comments
Hello @luca-peruzzo, I don't know, I'm not aware of any validation that would be missing but it's very much possible. You can try simply with the react project with: git clone https://github.com/keycloakify/keycloakify-starter
cd keycloakify-starter
yarn
npx keycloakify start-keycloak Here you can reach https://localhost:8080, navigate to myrealm -> user profile attributes, create your attributes. Save, navigate to https://my-theme.keycloakify.dev see if it's broken or not. If it's broken please provide some screenshot, reproduction steps, and expected behavior. I'll adress it. If it works as expected it means that the issue is at the angular integration level. Best, |
{
"attributes": [
{
"name": "username",
"displayName": "${username}",
"validations": {
"length": {
"min": 3,
"max": 255
},
"username-prohibited-characters": {},
"up-username-not-idn-homograph": {}
},
"permissions": {
"view": [
"admin",
"user"
],
"edit": [
"admin",
"user"
]
},
"multivalued": false
},
{
"name": "favourite-pet",
"displayName": "${profile.attributes.favourite-pet}",
"validations": {
"options": {
"options": [
"dog",
"cat",
"fish"
]
}
},
"annotations": {
"inputType": "multiselect"
},
"required": {
"roles": [
"user"
]
},
"permissions": {
"view": [
"admin",
"user"
],
"edit": [
"admin",
"user"
]
},
"multivalued": true
},
{
"name": "email",
"displayName": "${email}",
"validations": {
"email": {},
"length": {
"max": 255
}
},
"required": {
"roles": [
"user"
]
},
"permissions": {
"view": [
"admin",
"user"
],
"edit": [
"admin",
"user"
]
},
"multivalued": false
},
{
"name": "firstName",
"displayName": "${firstName}",
"validations": {
"length": {
"max": 255
},
"person-name-prohibited-characters": {}
},
"required": {
"roles": [
"user"
]
},
"permissions": {
"view": [
"admin",
"user"
],
"edit": [
"admin",
"user"
]
},
"multivalued": false
},
{
"name": "lastName",
"displayName": "${lastName}",
"validations": {
"length": {
"max": 255
},
"person-name-prohibited-characters": {}
},
"required": {
"roles": [
"user"
]
},
"permissions": {
"view": [
"admin",
"user"
],
"edit": [
"admin",
"user"
]
},
"multivalued": false
}
],
"groups": [
{
"name": "user-metadata",
"displayHeader": "User metadata",
"displayDescription": "Attributes, which refer to user metadata"
}
]
} |
@garronej as you can see the button is enabled even if there aren't favourite pets selected and there is no error message. (also it is impossible to select any pet but I think this is another problem). |
Hello @luca-peruzzo, What's the context of thoses screenshot? |
yes it is, as requested. keycloak version: 26 |
Well, yes, there are a few bugs with these validators:
Yes, this is indeed a bug—not a terrible one, since they'd get the error immediately after pressing the submit button:
There is an error message, but it's only shown after the input loses focus. This is a default that I should change (by setting this to
It’s possible; it’s just that the input is cumbersome—you have to hold down All in all, yes, there are a few issues with the validation of this input type. However, the input itself is unusable in the default Keycloak theme. I consider it a broken feature in Keycloak (it’s unusable in the default theme). Simply enabling multi-valued input is also broken, both in the base theme and in Keycloakify. We should see an "add value" option below, but we don’t. If you want to issue a PR on Keycloakify to address some of these |
Hi @garronej this is more a request for clarification than an issue, but if I override kcContext with custom fileds (like your favourite-pet implementation) I can't se any
required
validation formultiselect
andmultiselect-checkboxes
.is it done on purpose? if yes, why?
I've tried it on angular, does it work on react?
This is my code:
FYI @kathari00
The text was updated successfully, but these errors were encountered: