Change in ovirt-engine[master]: webadmin: Add validation for create/edit pool (#849426)

Tomas Jelinek has submitted this change and it was merged. Change subject: webadmin: Add validation for create/edit pool (#849426) ...................................................................... webadmin: Add validation for create/edit pool (#849426) https://bugzilla.redhat.com/849426 The VM name length is limited. When the new pool is created, the names of the VMs in the pool is limited as well. When the limit is, say 6 chars, then when you create a pool with name like 'pool' with 10 VMs in it, the names of the VMs will be pool-1, pool-2,..., pool-10. But the pool-10 is 7 chars long and the creation of such a VM fails. This patch adds a validation to the new/edit pool dialog which prevents the user from doing this. The behavior of the validation is the following: New Pool: The name field gets validated with a message like: 'The max allowed name length is X for Y VMs in pool' Edit Pool: The 'Increase number of VMs in pool by' gets validated with a message like: 'The max allowed num of VMs is X when the length of the pool name is Y' Where the X is 'num of vms already assigned' + 'num of VMs by which the pool should be increased' Change-Id: I66f765ceb0567beb006d1ef4f45db3902ef95ea6 Signed-off-by: Tomas Jelinek <tjelinek@redhat.com> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingPoolModelBehavior.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewPoolModelBehavior.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/PoolModelBehaviorBase.java A frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/validation/ExistingPoolNameLengthValidation.java A frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/validation/NewPoolNameLengthValidation.java A frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/validation/PoolNameLengthValidation.java A frontend/webadmin/modules/uicommonweb/src/test/java/org/ovirt/engine/ui/uicommonweb/validation/ExistingPoolNameLengthValidationTest.java A frontend/webadmin/modules/uicommonweb/src/test/java/org/ovirt/engine/ui/uicommonweb/validation/PoolNameLengthValidationTest.java M frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Messages.java 9 files changed, 251 insertions(+), 6 deletions(-) Approvals: Tomas Jelinek: Verified; Looks good to me, approved -- To view, visit http://gerrit.ovirt.org/7649 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I66f765ceb0567beb006d1ef4f45db3902ef95ea6 Gerrit-PatchSet: 6 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Tomas Jelinek <tjelinek@redhat.com> Gerrit-Reviewer: Daniel Erez <derez@redhat.com> Gerrit-Reviewer: Gilad Chaplik <gchaplik@redhat.com> Gerrit-Reviewer: Tomas Jelinek <tjelinek@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server
participants (1)
-
tjelinek@redhat.com