Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate content for non-required fields #421

Merged
merged 1 commit into from
Sep 24, 2019

Conversation

romanblanco
Copy link
Member

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

In case the DateControl or DateTimeControl field are not set as required, the added code tests if the entered value is a date or an empty field and therefore valid.

@romanblanco romanblanco changed the title Validate content for non-required fields too Validate content for non-required fields Sep 16, 2019
@miq-bot
Copy link
Member

miq-bot commented Sep 16, 2019

Checked commit romanblanco@366f4c7 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. 🏆

} else {
if (field.type === 'DialogFieldDateControl' ||
field.type === 'DialogFieldDateTimeControl') {
if (!(_.isDate(value) || value === null)) {
Copy link
Contributor

@himdel himdel Sep 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null is valid when not required

the code is right, my eyes are not ;)

@himdel himdel self-assigned this Sep 24, 2019
@himdel himdel merged commit ab2e554 into ManageIQ:master Sep 24, 2019
@himdel himdel added this to the Sprint 121 Ending Sep 30, 2019 milestone Sep 24, 2019
@romanblanco romanblanco deleted the bz1670051 branch September 24, 2019 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants