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 Generic Object tagging #3045

Merged
merged 2 commits into from
Dec 14, 2017
Merged

Conversation

AparnaKarve
Copy link
Contributor

Fixes the below error -

F, [2017-12-12T16:48:11.009175 #26813] FATAL -- : Error caught: [RuntimeError] Can't access selected records
~/manageiq/plugins/manageiq-ui-classic/app/controllers/mixins/checked_id_mixin.rb:127:in `find_records_with_rbac'
~/manageiq/plugins/manageiq-ui-classic/app/controllers/application_controller/tags.rb:87:in `get_tag_items'
~/manageiq/plugins/manageiq-ui-classic/app/controllers/application_controller/tags.rb:268:in `tag'
~/manageiq/plugins/manageiq-ui-classic/app/controllers/generic_object_definition_controller.rb:46:in `button'

Pass :send_checked => true to the Edit Tags button which ensures that params[miq_grid_checks] would be defined.

@AparnaKarve
Copy link
Contributor Author

@miq-bot add_label bug,gaprindashvili/yes

@AparnaKarve
Copy link
Contributor Author

/cc @dclarizio

@miq-bot
Copy link
Member

miq-bot commented Dec 13, 2017

Checked commits AparnaKarve/manageiq-ui-classic@d7b12a6~...40be256 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🏆

@lgalis
Copy link
Contributor

lgalis commented Dec 13, 2017

looks good, verified that the tagging works for Generic Objects selected from the list in the Service UI. The PR that added the send_checked functionality was merged after the tagging was added for generic objects.

@martinpovolny martinpovolny merged commit a2e52fd into ManageIQ:master Dec 14, 2017
@martinpovolny martinpovolny added this to the Sprint 76 Ending Jan 1, 2018 milestone Dec 14, 2017
@AparnaKarve AparnaKarve deleted the fix_go_tagging branch December 14, 2017 17:32
simaishi pushed a commit that referenced this pull request Dec 14, 2017
Fix Generic Object tagging
(cherry picked from commit a2e52fd)
@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit b8653ddff758ef76b5a76d2c0c99259858057680
Author: Martin Povolny <mpovolny@redhat.com>
Date:   Thu Dec 14 10:05:37 2017 +0100

    Merge pull request #3045 from AparnaKarve/fix_go_tagging
    
    Fix Generic Object tagging
    (cherry picked from commit a2e52fdf3116a9ec291baffd521314007724cfec)

@simaishi
Copy link
Contributor

@AparnaKarve Travis is failing in Gaprindashvili branch. Can you take a look?

Failures:
  1) ApplicationHelper::ToolbarBuilder #build_toolbar when the toolbar is a generic object instances toolbar includes the 'send_checked' parameter
     Failure/Error:
       expect(_toolbar_builder.build_toolbar(toolbar_to_build).first).to include(
         :id    => "generic_object_policy_choice",
         :icon  => "fa fa-shield fa-lg",
         :title => "Policy",
         :text  => "Policy",
         :items => [a_hash_including(items_hash)]
       )
       expected {:id => "generic_object_policy_choice", :type => :buttonSelect, :img => "generic_object_policy_choice.png",..."Edit Tags for the selected Generic Object Instances", :text => "Edit Tags", :url_parms => "main_div"}]} to include {:items => [(a hash including {:child_id => "generic_object_tag", :id => "generic_object_policy_choice__generic_object_tag", :type => :button, :img => "generic_object_tag.png", :img_url => "/images/toolbars/generic_object_tag.png", :imgdis => "generic_object_tag.png", :hidden => false, :icon => "pficon pficon-edit fa-lg", :name => "generic_object_policy_choice__generic_object_tag", :onwhen => "1+", :send_checked => true, :enabled => false, :title => "Edit Tags for the selected Generic Object Instances", :text => "Edit Tags", :url_parms => "main_div"})]}
       Diff:
       @@ -1,6 +1,16 @@
       +:color => nil,
       +:data => nil,
       +:enabled => false,
       +:hidden => false,
        :icon => "fa fa-shield fa-lg",
        :id => "generic_object_policy_choice",
       -:items => [(a hash including {:child_id => "generic_object_tag", :id => "generic_object_policy_choice__generic_object_tag", :type => :button, :img => "generic_object_tag.png", :img_url => "/images/toolbars/generic_object_tag.png", :imgdis => "generic_object_tag.png", :hidden => false, :icon => "pficon pficon-edit fa-lg", :name => "generic_object_policy_choice__generic_object_tag", :onwhen => "1+", :send_checked => true, :enabled => false, :title => "Edit Tags for the selected Generic Object Instances", :text => "Edit Tags", :url_parms => "main_div"})],
       +:img => "generic_object_policy_choice.png",
       +:imgdis => "generic_object_policy_choice.png",
       +:items => [{:child_id=>"generic_object_tag", :id=>"generic_object_policy_choice__generic_object_tag", :type=>:button, :img=>"generic_object_tag.png", :img_url=>"/images/toolbars/generic_object_tag.png", :imgdis=>"generic_object_tag.png", :icon=>"pficon pficon-edit fa-lg", :color=>nil, :name=>"generic_object_policy_choice__generic_object_tag", :hidden=>false, :pressed=>nil, :onwhen=>"1+", :data=>nil, :enabled=>false, :title=>"Edit Tags for the selected Generic Object Instances", :text=>"Edit Tags", :url_parms=>"main_div"}],
       +:name => "generic_object_policy_choice",
       +:onwhen => "1+",
       +:pressed => nil,
        :text => "Policy",
        :title => "Policy",
       +:type => :buttonSelect,
     # ./spec/helpers/application_helper/toolbar_builder_spec.rb:523:in `block (4 levels) in <top (required)>'
     # ./spec/spec_helper.rb:73:in `block (3 levels) in <top (required)>'
     # ./spec/manageiq/spec/support/evm_spec_helper.rb:35:in `clear_caches'
     # ./spec/spec_helper.rb:73:in `block (2 levels) in <top (required)>'
       )

@AparnaKarve
Copy link
Contributor Author

@simaishi Two things -

  1. The reason for the above failure is because Toolbars - use send_checked, refactor params in miqToolbarOnClick #2398 was not backported

  2. But it also looks like the issue described in this PR is an upstream issue only. I verified this.

which means we can revert this PR from Gaprindashvili.

simaishi added a commit that referenced this pull request Dec 15, 2017
@simaishi
Copy link
Contributor

Thanks Aparna, reverted the backport.

$ git log -1
commit d20291ddae7c2fa41e671f14ed6f765182724aca
Author: Satoe Imaishi <simaishi@redhat.com>
Date:   Fri Dec 15 17:34:03 2017 -0500

    Revert "Merge pull request #3045 from AparnaKarve/fix_go_tagging"
    
    This reverts commit b8653ddff758ef76b5a76d2c0c99259858057680.

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