Skip to content

Commit

Permalink
Merge pull request #5453 from skateman/settings-menu-extract
Browse files Browse the repository at this point in the history
Menu Simplification: extract Configuration into the top-right bar
  • Loading branch information
mzazrivec authored Apr 17, 2019
2 parents bfeb5b3 + e1f565d commit 2e2543b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
3 changes: 1 addition & 2 deletions app/presenters/menu/default_menu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,7 @@ def monitor_menu_section
def settings_menu_section
Menu::Section.new(:set, N_("Settings"), 'pficon pficon-settings', [
Menu::Item.new('configuration', N_('My Settings'), 'my_settings', {:feature => 'my_settings', :any => true}, '/configuration/index'),
Menu::Item.new('my_tasks', N_('Tasks'), 'tasks', {:feature => 'tasks', :any => true}, '/miq_task/index?jobs_tab=tasks'),
Menu::Item.new('ops', N_('Configuration'), 'ops_explorer', {:feature => 'ops_explorer', :any => true}, '/ops/explorer')
Menu::Item.new('my_tasks', N_('Tasks'), 'tasks', {:feature => 'tasks', :any => true}, '/miq_task/index?jobs_tab=tasks')
], :top_right)
end

Expand Down
4 changes: 4 additions & 0 deletions app/views/layouts/_user_options.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
- if current_user
- if ApplicationHelper.role_allows?(:feature => 'ops_explorer', :any => true)
%li.dropdown
%a.nav-item-iconic{:href => '/ops/explorer', :title => _('Configuration')}
%i.fa.fa-cog
%li.dropdown
%a{:href => "#", :class => "dropdown-toggle nav-item-iconic", :id => "dropdownMenu2", "data-toggle" => "dropdown", "aria-haspopup" => "true"}
%span.pficon.pficon-user
Expand Down
16 changes: 0 additions & 16 deletions spec/controllers/dashboard_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -246,22 +246,6 @@
end
end

context "#main_tab redirects to correct url when maintab is pressed by user with only Tenant features" do
before do
allow_any_instance_of(described_class).to receive(:set_user_time_zone)
allow(controller).to receive(:check_privileges).and_return(true)
EvmSpecHelper.seed_specific_product_features("rbac_tenant")
feature_id = MiqProductFeature.find_all_by_identifier(["rbac_tenant"])
login_as FactoryBot.create(:user, :features => feature_id)
end

it "for Configure maintab" do
session[:tab_url] = {}
post :maintab, :params => { :tab => "set" }
expect(response.body).to include("ops/explorer")
end
end

describe "#start_url_for_user" do
before do
MiqShortcut.seed
Expand Down

0 comments on commit 2e2543b

Please sign in to comment.