ManageIQ / ui-components

Angular UI Components for ManageIQ
Apache License 2.0
16 stars 52 forks source link

Add support for local validation of box, tab and field #443

Closed mzazrivec closed 4 years ago

mzazrivec commented 4 years ago

This PR implements field, tab & box level validation when creating / editing field, tab & box in current dialog editor. Should a particular validation fail, the Save button will be disabled and button title will be set with the validation message. Previously, the validation would take place on the service dialog level, which seemed counter-intuitive.

Field validation example: Screenshot from 2020-06-25 16-32-06

Box validation example: Screenshot from 2020-06-25 16-32-53

Tab validation example: Screenshot from 2020-06-25 16-33-10

https://bugzilla.redhat.com/show_bug.cgi?id=1741633

miq-bot commented 4 years ago

Checked commit https://github.com/mzazrivec/ui-components/commit/446dc3108958055bd33501af7192b004385e36a5 with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.28.0, and yamllint 0 files checked, 0 offenses detected Everything looks fine. :cookie:

simaishi commented 4 years ago

Jansa backport details:

$ git log -1
commit 359a7c03945f0a573a233f25c37ae496761eb839
Author: Martin Hradil <mhradil@redhat.com>
Date:   Tue Jun 30 19:21:57 2020 +0200

    Merge pull request #443 from mzazrivec/add_support_for_local_validation_of_box_tab_and_field

    Add support for local validation of box, tab and field

    (cherry picked from commit 334a9ea4ef5124e4b9c0c35ec1f9b2703bcd0b33)
simaishi commented 4 years ago

Backporting this to ivanchuk conflicts because of https://github.com/ManageIQ/ui-components/pull/408. Should I backport that as well, or resolve conflicts retaining the original message with 'group'?

mzazrivec commented 4 years ago

@simaishi I think it would be safe to backport https://github.com/ManageIQ/ui-components/pull/408/files as well.

simaishi commented 4 years ago

Thanks @mzazrivec, backported #408 as well.

Ivanchuk backport details:

$ git log -1
commit 4fbdf306e09958a8dbf1a662b3453fd6a18f193f
Author: Martin Hradil <mhradil@redhat.com>
Date:   Tue Jun 30 19:21:57 2020 +0200

    Merge pull request #443 from mzazrivec/add_support_for_local_validation_of_box_tab_and_field

    Add support for local validation of box, tab and field

    (cherry picked from commit 334a9ea4ef5124e4b9c0c35ec1f9b2703bcd0b33)

    https://bugzilla.redhat.com/show_bug.cgi?id=1741633