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

Adjust how default_value is calculated for multi-select drop downs #17449

Merged
merged 1 commit into from
May 21, 2018

Conversation

eclarizio
Copy link
Member

Somewhat related to this PR, but will clean up some of the specs and attempt to force the default_value for multiselect drop downs to behave consistently.

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

Basically, with this change, multiselects driven by automate domains should behave slightly differently. Before, you could select a "nil" value, but that doesn't really make too much sense when you're dealing with a multiselect, because you will have to unselect the nil value after you pick another value. So instead of a nil value being selected, nothing will be selected.

Also, with this fix, within automate, the user can set their default values in a few ways:

dialog_field = $evm.object
dialog_field['values'] = [["foo", "Foo"], ["bar", "Bar"], ["baz", "Baz"]]

dialog_field['default_value'] = "foo" # This method for selecting a single item only
dialog_field['default_value'] = ["foo", "bar"] # The preferred way to select two items
dialog_field['default_value'] = '["foo", "bar"]' # Another way to select two items (though admittedly a bit strange)

dialog_field['default_value'] = "foo, bar" # This DOES NOT work, and the field will end up with "Nothing selected"

@himdel I know this was kinda messy before, hopefully this cleans it up a bit. Think you can review quickly so this can get in for the build?

@d-m-u Can you review please?

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

@miq-bot assign @gmcculloug

@miq-bot
Copy link
Member

miq-bot commented May 21, 2018

Checked commit eclarizio@b73e8f6 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
4 files checked, 0 offenses detected
Everything looks fine. 🏆

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.

BEAUTIFUL

@JPrause
Copy link
Member

JPrause commented May 21, 2018

@gmcculloug there's a build tomorrow, so if this can be merged, that'd be awesome.

Copy link
Member

@gmcculloug gmcculloug left a comment

Choose a reason for hiding this comment

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

👍

@gmcculloug gmcculloug merged commit ad699ee into ManageIQ:master May 21, 2018
@gmcculloug gmcculloug added this to the Sprint 86 Ending May 21, 2018 milestone May 21, 2018
simaishi pushed a commit that referenced this pull request May 22, 2018
Adjust how default_value is calculated for multi-select drop downs
(cherry picked from commit ad699ee)

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

Gaprindashvili backport details:

$ git log -1
commit f7147ee4f2ab68a93bde0dd5341ed18fa0b78eac
Author: Greg McCullough <[email protected]>
Date:   Mon May 21 14:07:53 2018 -0400

    Merge pull request #17449 from eclarizio/BZ1576288
    
    Adjust how default_value is calculated for multi-select drop downs
    (cherry picked from commit ad699eef42aa47d55bda205f583265a81f3691d0)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1581307

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.

6 participants