-
Notifications
You must be signed in to change notification settings - Fork 896
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
Add Storage Product Features for Adding Roles #12701
Conversation
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.
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. |
Checked commits jerryk55/manageiq@fdcb66f~...e1c02b8 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
looks good. |
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", |
…roduct_features Add Storage Product Features for Adding Roles (cherry picked from commit 1738663)
…roduct_features Add Storage Product Features for Adding Roles (cherry picked from commit 1738663)
…roduct_features Add Storage Product Features for Adding Roles (cherry picked from commit 1738663)
Backported to Euwe via #12731 |
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.
Links [Optional]
Steps for Testing/QA [Optional]
@h-kataria @dclarizio @roliveri Please review and merge. Thanks much.