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

Add Storage Product Features for Adding Roles #12701

Merged

Conversation

jerryk55
Copy link
Member

In accordance with Bugzilla ticket https://bugzilla.redhat.com/show_bug.cgi?id=1395528
the Storage entries are missing from the list of Product Features shown
when attempting to add a new role.

This simple fix restores the Storage entries to the list of Product Features.

screen shot 2016-11-16 at 5 18 42 pm

Links [Optional]

Steps for Testing/QA [Optional]

  1. Click on "Configuration" in the menu in the upper right-hand side of the screen.
  2. Click on "Access Control" in the accordion menu on the left, then click on "Roles".
  3. Configuration -> Add a New Role in the left-hand side drop-down menu.
  4. "Storage" should be visible under "Product Features (Editing)", as well as sub-items under Storage.

@h-kataria @dclarizio @roliveri Please review and merge. Thanks much.

In accordance with Bugzilla ticket https://bugzilla.redhat.com/show_bug.cgi?id=1395528
the Storage entries are missing from the list of Product Features shown
when attempting to add a new role.

This simple fix restores the Storage entries to the list of Product Features.
Previously the NetApp menu would show up for testing based on a configuration setting.
In order to allow the Roles configuration to work correctly, the empty menu used
when the NetApp configuration was disabled needed to be removed.  The test for the
NetApp item is removed via this commit. The remainder of the NetApp menu info is left
in the file for future use.
@jerryk55
Copy link
Member Author

The spec test for the NetApp submenu was removed since we have disabled the submenu as part of this fix. The NetApp menu will be re-enabled when it is fully integrated into the Storage Managers implementation.

@miq-bot
Copy link
Member

miq-bot commented Nov 16, 2016

Checked commits jerryk55/manageiq@fdcb66f~...e1c02b8 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1
3 files checked, 0 offenses detected
Everything looks good. 👍

@h-kataria
Copy link
Contributor

looks good.

@h-kataria h-kataria added this to the Sprint 50 Ending Dec 5, 2016 milestone Nov 17, 2016
@h-kataria h-kataria merged commit 1738663 into ManageIQ:master Nov 17, 2016
@chessbyte
Copy link
Member

Euwe Backport conflict:

$ git cherry-pick -e -x -m 1 1738663 
error: could not apply 1738663... Merge pull request #12701 from jerryk55/add_storage_role_to_product_features
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'

$ git status
On branch euwe
Your branch is up-to-date with 'upstream/euwe'.
You are currently cherry-picking commit 1738663.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:

    modified:   app/controllers/ops_controller/rbac_tree.rb

Unmerged paths:
  (use "git add <file>..." to mark resolution)

    both modified:   app/presenters/menu/default_menu.rb
    both modified:   spec/presenters/menu/default_menu_spec.rb

$ git diff
diff --cc app/presenters/menu/default_menu.rb
index 1f69b66,bba58bf..0000000
--- a/app/presenters/menu/default_menu.rb
+++ b/app/presenters/menu/default_menu.rb
@@@ -170,25 -139,12 +170,32 @@@ module Men
        end

        def storage_menu_section
 -        netapp_enabled = ::Settings.product.storage
 +        netapp_enabled = VMDB::Config.new("vmdb").config[:product][:storage]
          Menu::Section.new(:sto, N_("Storage"), 'fa fa-database fa-2x', [
++<<<<<<< HEAD
 +                            Menu::Item.new('ems_storage',
 +                                           N_('Storage Providers'),
 +                                           'ems_storage',
 +                                           {:feature => 'ems_storage_show_list'},
 +                                           '/ems_storage'),
 +                            Menu::Item.new('cloud_volume',
 +                                           N_('Volumes'),
 +                                           'cloud_volume',
 +                                           {:feature => 'cloud_volume_show_list'},
 +                                           '/cloud_volume'),
 +                            Menu::Item.new('cloud_object_store_container',
 +                                           N_('Object Stores'),
 +                                           'cloud_object_store_container',
 +                                           {:feature => 'cloud_object_store_container_show_list'},
 +                                           '/cloud_object_store_container'),
 +                            netapp_enabled ? netapp_storage_menu_section : empty_menu_section
 +                          ])
++=======
+           Menu::Item.new('ems_storage',                  N_('Storage Providers'), 'ems_storage',                  {:feature => 'ems_storage_show_list'},                  '/ems_storage'),
+           Menu::Item.new('cloud_volume',                 N_('Volumes'),           'cloud_volume',                 {:feature => 'cloud_volume_show_list'},                 '/cloud_volume'),
+           Menu::Item.new('cloud_object_store_container', N_('Object Stores'),     'cloud_object_store_container', {:feature => 'cloud_object_store_container_show_list'}, '/cloud_object_store_container'),
+         ])
++>>>>>>> 1738663... Merge pull request #12701 from jerryk55/add_storage_role_to_product_features
        end

        def empty_menu_section
diff --cc spec/presenters/menu/default_menu_spec.rb
index 5ec86d4,610807c..0000000
--- a/spec/presenters/menu/default_menu_spec.rb
+++ b/spec/presenters/menu/default_menu_spec.rb
@@@ -78,16 -78,10 +78,21 @@@ describe Menu::DefaultMenu d

    describe "#storage_menu_section" do
      let(:menu) { Menu::DefaultMenu }
 +    let(:configuration) { double(:config => {:product => {:storage => product_setting}}) }
 +
 +    before do
 +      allow(VMDB::Config).to receive(:new).with("vmdb").and_return(configuration)
 +    end

      context "when the configuration storage product setting is set to true" do
++<<<<<<< HEAD
 +      let(:product_setting) { true }
 +
 +      it "contains the generic objects item" do
++=======
+       it "still does not contain the NetApp item" do
+         stub_settings(:product => {:storage => true})
++>>>>>>> 1738663... Merge pull request #12701 from jerryk55/add_storage_role_to_product_features
          expect(menu.storage_menu_section.items.map(&:name)).to include(
            "Storage Providers",
            "Volumes",

jerryk55 pushed a commit to jerryk55/manageiq that referenced this pull request Nov 17, 2016
…roduct_features

Add Storage Product Features for Adding Roles
(cherry picked from commit 1738663)
jerryk55 pushed a commit to jerryk55/manageiq that referenced this pull request Nov 17, 2016
…roduct_features

Add Storage Product Features for Adding Roles
(cherry picked from commit 1738663)
jerryk55 pushed a commit to jerryk55/manageiq that referenced this pull request Nov 17, 2016
…roduct_features

Add Storage Product Features for Adding Roles
(cherry picked from commit 1738663)
@chessbyte
Copy link
Member

Backported to Euwe via #12731

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