mirror of
https://github.com/ansible/awx.git
synced 2026-04-12 21:49:24 -02:30
Added 'Max Hosts' field in the Add/Edit Organization view
* max hosts field is enabled is user is superuser, otherwise it is disabled and default is 0 * OrganizationForm tests added for max hosts input * minMaxValue added in validators to validate user input for max hosts Signed-off-by: catjones9 <catjones@redhat.com>
This commit is contained in:
@@ -21,7 +21,7 @@ export function maxLength (max, i18n) {
|
||||
|
||||
export function minMaxValue (min, max, i18n) {
|
||||
return value => {
|
||||
if (typeof value !== 'number' || value > max || value < min) {
|
||||
if (value < min || value > max) {
|
||||
return i18n._(t`This field must be a number and have a value between ${min} and ${max}`);
|
||||
}
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user