ManageIQ / ui-components

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

Dialog editor - validate tag category #407

Closed himdel closed 5 years ago

himdel commented 5 years ago

Adding a Tag control without chosing a category should fail dialog editor validation.

Previously, this didn't work because it's set to "" not null when unset, and it's field.options.category_id, not field.category_id.

Now, the validation will fail with "'Category needs to be set for TagControl field".

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


The problem with that ^ is that we never actually show the validation message anywhere. We're trying to show it on the submit button in ui-classic, but the button is disabled (and thus not rendering title) when validation fails.

=> Moving validation to the top of the dialog, together with https://github.com/ManageIQ/manageiq-ui-classic/pull/5938 (or https://github.com/ManageIQ/manageiq-ui-classic/pull/5922 for the future)

(merge ui-components first)

himdel commented 5 years ago

cc @romanblanco

miq-bot commented 5 years ago

Checked commits https://github.com/himdel/ui-components/compare/0ef2acb87f28906112ed9b4f397e5174275bae34~...4defc62ce254cbd567e253082e31366b72f188f8 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 0 files checked, 0 offenses detected Everything looks fine. :trophy:

simaishi commented 5 years ago

Ivanchuk backport details:

$ git log -1
commit 2974d1dde7b8640897b044c4c049589c97ad4043
Author: Martin Povolny <mpovolny@redhat.com>
Date:   Wed Aug 7 13:16:10 2019 +0200

    Merge pull request #407 from himdel/validate-tag-category

    Dialog editor - validate tag category

    (cherry picked from commit e172cbc3513660e23542bb0c1907a6621b973d00)

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