ManageIQ / ui-components

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

Dialog user - fix validation for date & date&time when field is required; clearing the fields #401

Closed himdel closed 5 years ago

himdel commented 5 years ago

Fixes some fallout from #399 and some earlier issues:

Now, date & date&time should behave the same, both go to null when cleared, both fail validation when null and required, neither fail validation when non-null or not required.

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

Cc @eclarizio , @romanblanco

himdel commented 5 years ago

This does change the previous behaviour where an empty date would fail validation even when it was not a required field.

I think that was a bug, but just in case it's not... :)

miq-bot commented 5 years ago

Checked commits https://github.com/himdel/ui-components/compare/14196161ae937ac3f23961c5250eacb6eea342e0~...b5a58bea04467d5e3afbc71f0772aecc87eac49f 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. :cookie:

romanblanco commented 5 years ago

:+1:

simaishi commented 5 years ago

Hammer backport details:

$ git log -1
commit 1d7732078b6fb3ee2b6ef72586529629a723f2a6
Author: Harpreet Kataria <hkataria@redhat.com>
Date:   Fri Jul 19 09:22:44 2019 -0400

    Merge pull request #401 from himdel/datetimesubmit-bz1728600

    Dialog user - fix validation for date & date&time when field is required; clearing the fields

    (cherry picked from commit 28592b743fd4092f1c8b9d4df8e984ba85dc4197)

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