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 automate_output_value() for tag control #20685

Merged

Conversation

mzazrivec
Copy link
Contributor

@mzazrivec mzazrivec commented Oct 13, 2020

  1. Create a service dialog, add a Tag control element to it
  2. Make sure the selected tag in the above tag control element allows multiple choices
  3. Add the above created service dialog to a catalog item (a generic catalog item for example)
  4. Order the above created catalog item and select at least two tags in the presented dialog
  5. Check the created service, see if it mentions all selected tags

Before (a service using a service dialog with 3 tag controls, first one allowing multiple choices, selected 4 tags):

irb(main):008:0> pp Service.find_by(:name => 'bug-1886887-20201013-144146').options
{:dialog=>
  {"Array::dialog_tag_control_1"=>"",
   "Array::dialog_tag_control_2"=>"Classification::19",
   "Array::dialog_tag_control_3"=>"Classification::45",
   "dialog_tag_control_2"=>["prod_ops"],
   "dialog_tag_control_3"=>["engineering"]}}

After:

irb(main):002:0> pp Service.find_by(:name => 'bug-1886887-20201013-144444').options
{:dialog=>
  {"Array::dialog_tag_control_1"=>
    "Classification::7,Classification::10,Classification::14,Classification::15",
   "Array::dialog_tag_control_2"=>"Classification::19",
   "Array::dialog_tag_control_3"=>"Classification::45",
   "dialog_tag_control_1"=>["desktop", "database", "messaging", "security"],
   "dialog_tag_control_2"=>["prod_ops"],
   "dialog_tag_control_3"=>["engineering"]}}

The @value variable, as far as I can tell, is an either an array of integers (classification ids) or a string of comma-separated integers (again classification ids).

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

@mzazrivec mzazrivec force-pushed the fix_automate_output_value_for_tag_control branch from 745ed4e to 1f6fb85 Compare October 13, 2020 15:35
@gtanzillo gtanzillo added the bug label Oct 15, 2020
@gtanzillo gtanzillo self-assigned this Oct 15, 2020
@mzazrivec mzazrivec force-pushed the fix_automate_output_value_for_tag_control branch from 1f6fb85 to 936e645 Compare October 20, 2020 14:18
@mzazrivec mzazrivec force-pushed the fix_automate_output_value_for_tag_control branch from 936e645 to ef194a6 Compare October 20, 2020 14:26
@miq-bot
Copy link
Member

miq-bot commented Oct 20, 2020

Checked commit mzazrivec@ef194a6 with ruby 2.6.3, rubocop 0.69.0, haml-lint 0.28.0, and yamllint
1 file checked, 0 offenses detected
Everything looks fine. ⭐

@mzazrivec
Copy link
Contributor Author

@tinaafitz Could you review please? Thank you.

Copy link
Member

@tinaafitz tinaafitz left a comment

Choose a reason for hiding this comment

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

Thanks @mzazrivec.

@mzazrivec
Copy link
Contributor Author

@gtanzillo can this be merged please? Thank you.

@gtanzillo gtanzillo merged commit 2f545e0 into ManageIQ:master Nov 11, 2020
@mzazrivec mzazrivec deleted the fix_automate_output_value_for_tag_control branch November 11, 2020 14:31
@simaishi
Copy link
Contributor

@mzazrivec ivanchuk/yes ?

@mzazrivec
Copy link
Contributor Author

@simaishi yep, this is also for ivanchuk.

simaishi pushed a commit that referenced this pull request Nov 11, 2020
…r_tag_control

Fix automate_output_value() for tag control

(cherry picked from commit 2f545e0)

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

Ivanchuk backport details:

$ git log -1
commit cdd35487cad20bf1b684201dbceb6dda147fa387
Author: Gregg Tanzillo <gtanzill@redhat.com>
Date:   Wed Nov 11 09:29:33 2020 -0500

    Merge pull request #20685 from mzazrivec/fix_automate_output_value_for_tag_control

    Fix automate_output_value() for tag control

    (cherry picked from commit 2f545e0809d69f5e153bdb6d4a89325e7cc0e1e0)

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

simaishi pushed a commit that referenced this pull request Nov 11, 2020
…r_tag_control

Fix automate_output_value() for tag control

(cherry picked from commit 2f545e0)
@simaishi
Copy link
Contributor

Jansa backport details:

$ git log -1
commit 915533bb91202dd15b5ff864e2f30c365bbc09e5
Author: Gregg Tanzillo <gtanzill@redhat.com>
Date:   Wed Nov 11 09:29:33 2020 -0500

    Merge pull request #20685 from mzazrivec/fix_automate_output_value_for_tag_control

    Fix automate_output_value() for tag control

    (cherry picked from commit 2f545e0809d69f5e153bdb6d4a89325e7cc0e1e0)

simaishi pushed a commit that referenced this pull request Nov 11, 2020
…r_tag_control

Fix automate_output_value() for tag control

(cherry picked from commit 2f545e0)
@simaishi
Copy link
Contributor

Kasparov backport details:

$ git log -1
commit 71f8bd9f95d6331151d76bce783a1985ba522cc0
Author: Gregg Tanzillo <gtanzill@redhat.com>
Date:   Wed Nov 11 09:29:33 2020 -0500

    Merge pull request #20685 from mzazrivec/fix_automate_output_value_for_tag_control

    Fix automate_output_value() for tag control

    (cherry picked from commit 2f545e0809d69f5e153bdb6d4a89325e7cc0e1e0)

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.

None yet

5 participants