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

Fix dropdown in tagging #3201

Merged
merged 1 commit into from
Jan 10, 2018
Merged

Conversation

ZitaNemeckova
Copy link
Contributor

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

Go to any tagging screen like Compute -> Infrastructure -> Virtual Machines -> Policy -> Edit Tags
At load second dropdown is not correctly populated. After change it's correct.

Before:
image

After:
image

IMPORTANT: Make sure that Classification.categories.select(&:show).min_by(&:description) and Classification.categories.select(&:show).min_by(&:name) are two different instances.

Classification.categories.select(&:show).sort_by(&:name)[0] that is used in layout as @categories is not equal to Classification.categories.select(&:show).sort_by(&:name).min_by(&:description) that is used as @edit[:cat] to generate its subcategories.
Replaced :description to :name to make it equal 😄

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

Classification.categories.select(&:show).sort_by(&:name)[0] != Classification.categories.select(&:show).sort_by(&:name).min_by[&:description]
Replaced description to name to make it equal
@miq-bot
Copy link
Member

miq-bot commented Jan 9, 2018

Checked commit ZitaNemeckova@72fa1f2 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 🏆

@ZitaNemeckova ZitaNemeckova reopened this Jan 9, 2018
@ZitaNemeckova ZitaNemeckova reopened this Jan 9, 2018
@mzazrivec mzazrivec self-assigned this Jan 10, 2018
@mzazrivec mzazrivec added this to the Sprint 77 Ending Jan 15, 2018 milestone Jan 10, 2018
@mzazrivec mzazrivec merged commit c1a7b38 into ManageIQ:master Jan 10, 2018
@ZitaNemeckova ZitaNemeckova deleted the fix_cat_dropdown branch January 10, 2018 12:27
simaishi pushed a commit that referenced this pull request Jan 10, 2018
@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit cb8145ee8780100626217f903e157fee78255515
Author: Milan Zázrivec <[email protected]>
Date:   Wed Jan 10 12:20:10 2018 +0100

    Merge pull request #3201 from ZitaNemeckova/fix_cat_dropdown
    
    Fix dropdown in tagging
    (cherry picked from commit c1a7b38b7ae06cbbb4afee8433079334675eb78c)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1533233

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.

4 participants