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

Use correct comparison for multi-value default value inclusion rules #16978

Merged
merged 1 commit into from
Feb 9, 2018

Conversation

eclarizio
Copy link
Member

Related to https://bugzilla.redhat.com/show_bug.cgi?id=1531316, found while I was testing with a multi-value drop down. The default value was being set correctly but the actual drop down wasn't displaying the default. It was because it was trying to see if the default value existed within the list of values. When it's a multi-value drop down, something like "[\"1\", \"2\"]" is not going to be one of the values, we have to parse it first and then check to see if there is any overlap.

@miq-bot assign @gmcculloug
@miq-bot add_label gaprindashvili/yes, bug, blocker

/cc @romanblanco

@d-m-u Can you review, please?

Copy link
Contributor

@d-m-u d-m-u left a comment

Choose a reason for hiding this comment

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

⚡️

@gmcculloug
Copy link
Member

@eclarizio Please see failing test and rubocop issues.

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

Since the default value for a multi-value drop-down is a string,
comparing directly to the list of values in a drop-down did not work. It
needs to be converted to an array and then compare the overlap to see if
the default value is appropriate.
@miq-bot
Copy link
Member

miq-bot commented Feb 9, 2018

Checked commit eclarizio@d512174 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
3 files checked, 0 offenses detected
Everything looks fine. 👍

@gmcculloug gmcculloug merged commit 6056dc8 into ManageIQ:master Feb 9, 2018
@gmcculloug gmcculloug added this to the Sprint 79 Ending Feb 12, 2018 milestone Feb 9, 2018
simaishi pushed a commit that referenced this pull request Feb 9, 2018
Use correct comparison for multi-value default value inclusion rules
(cherry picked from commit 6056dc8)

https://bugzilla.redhat.com/show_bug.cgi?id=1531316
@simaishi
Copy link
Contributor

simaishi commented Feb 9, 2018

Gaprindashvili backport details:

$ git log -1
commit 35c564c61ea4844c04476ed694b07176e5d3e4ca
Author: Greg McCullough <gmccullo@redhat.com>
Date:   Fri Feb 9 16:17:58 2018 -0500

    Merge pull request #16978 from eclarizio/BZ1531316
    
    Use correct comparison for multi-value default value inclusion rules
    (cherry picked from commit 6056dc85b025d7fa6b1a533fd5c6bd9ec03e7652)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1531316

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.

5 participants