Commit 011b747
committed
Fix input for groups validation in new user form
The hidden input used for form validation was not actually hidden, so it
was shown as a strange input field (it was either empty or it showed the
string representation of the groups array). Although just hiding it will
still keep the validation working when the input is hidden the browser
may not show any validation error in the UI, so it would not be possible
to create the user for "unknown" reasons.
Moreover, the validation API does not provide a way to bind the message
to a different element, and even if the message could be shown using a
Vue tooltip it would not follow the same style as the other native
messages in the rest of the elements.
The Multiselect component internally uses an input element, so now that
one is used for the validation instead of an additional "hidden" input.
That internal element is always empty (the selected groups are shown in
an auxiliary div), so the "required" attribute needs to be explicitly
set and removed on the input based on the currently selected groups.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>1 parent 03b424a commit 011b747
5 files changed
Lines changed: 43 additions & 16 deletions
File tree
- apps/settings
- js
- src/components
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 78 | + | |
| 79 | + | |
87 | 80 | | |
88 | 81 | | |
89 | 82 | | |
| |||
401 | 394 | | |
402 | 395 | | |
403 | 396 | | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
404 | 411 | | |
405 | 412 | | |
406 | 413 | | |
| |||
546 | 553 | | |
547 | 554 | | |
548 | 555 | | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
549 | 576 | | |
550 | 577 | | |
551 | 578 | | |
| |||
0 commit comments