--- .../controllers/provider_accounts_controller.rb | 2 +- src/app/controllers/providers_controller.rb | 25 ++++++------------- src/app/stylesheets/layout.scss | 1 - src/app/views/provider_accounts/edit.haml | 2 +- src/app/views/provider_accounts/new.haml | 2 +- src/app/views/provider_accounts/show.haml | 2 +- src/app/views/providers/edit.haml | 9 +----- src/features/provider_account.feature | 6 +--- src/features/support/paths.rb | 2 +- 9 files changed, 17 insertions(+), 34 deletions(-)
diff --git a/src/app/controllers/provider_accounts_controller.rb b/src/app/controllers/provider_accounts_controller.rb index b3f6394..ee84f77 100644 --- a/src/app/controllers/provider_accounts_controller.rb +++ b/src/app/controllers/provider_accounts_controller.rb @@ -163,7 +163,7 @@ class ProviderAccountsController < ApplicationController unless failed.empty? flash[:error] = t 'provider_accounts.index.account_not_deleted', :count => failed.length, :list => failed.join(', ') end - redirect_to edit_provider_path(@provider, :view => 'filter', :details_tab => 'connectivity') + redirect_to edit_provider_path(@provider, :details_tab => 'accounts') end
def set_selected_provider diff --git a/src/app/controllers/providers_controller.rb b/src/app/controllers/providers_controller.rb index c977d1b..13b8840 100644 --- a/src/app/controllers/providers_controller.rb +++ b/src/app/controllers/providers_controller.rb @@ -116,6 +116,7 @@ class ProvidersController < ApplicationController if !@provider.connect flash.now[:warning] = "Failed to connect to Provider" load_provider_tabs + @alerts = provider_alerts(@provider) render :action => "edit" else if @provider.errors.empty? and @provider.save @@ -124,6 +125,7 @@ class ProvidersController < ApplicationController else flash[:warning] = "Cannot update the provider." load_provider_tabs + @alerts = provider_alerts(@provider) render :action => 'edit' end end @@ -186,27 +188,16 @@ class ProvidersController < ApplicationController end
def load_provider_tabs - @view = filter_view? ? 'provider_accounts/list' : 'edit' unless params[:details_tab] - if params[:details_tab] == 'connectivity' - @view = filter_view? ? 'provider_accounts/list' : 'edit' - elsif params[:details_tab] == 'realms' - @view = filter_view? ? 'realms/list' : 'realms/list' - elsif params[:details_tab] == 'hardware_profiles' - @view = filter_view? ? 'hardware_profiles/list' : 'hardware_profiles/list' - #elsif params[:details_tab] == 'roles' - # @view = filter_view? ? 'permissions/list' : 'permissions/list' - end - #TODO add links to real data for history,properties,permissions - @tabs = [{:name => 'Connectivity', :view => @view, :id => 'connectivity', :count => @provider.provider_accounts.count}, - {:name => 'Realms', :view => @view, :id => 'realms', :count => @provider.frontend_realms.count}, - {:name => 'Hardware', :view => @view, :id => 'hardware_profiles', :count => @provider.hardware_profiles.count}, - #{:name => 'Roles & Permissions', :view => @view, :id => 'roles', :count => @provider.permissions.count}, + @tabs = [{:name => 'Connectivity', :view => 'edit', :id => 'connectivity'}, + {:name => 'Accounts', :view => 'provider_accounts/list', :id => 'accounts', :count => @provider.provider_accounts.count}, + {:name => 'Realms', :view => 'realms/list', :id => 'realms', :count => @provider.frontend_realms.count}, + {:name => 'Hardware', :view => 'hardware_profiles/list', :id => 'hardware_profiles', :count => @provider.hardware_profiles.count}, + #{:name => 'Roles & Permissions', :view => 'permissions/list', :id => 'roles', :count => @provider.permissions.count}, ] details_tab_name = params[:details_tab].blank? ? 'connectivity' : params[:details_tab] @details_tab = @tabs.find {|t| t[:id] == details_tab_name} || @tabs.first[:name].downcase
- @provider_accounts = @provider.provider_accounts if @details_tab[:id] == 'connectivity' - #@realms = @provider.realms if @details_tab[:id] == 'realms' + @provider_accounts = @provider.provider_accounts if @details_tab[:id] == 'accounts' @realms = @provider.frontend_realms if @details_tab[:id] == 'realms' @hardware_profiles = @provider.hardware_profiles if @details_tab[:id] == 'hardware_profiles' #@permissions = @provider.permissions if @details_tab[:id] == 'roles' diff --git a/src/app/stylesheets/layout.scss b/src/app/stylesheets/layout.scss index b2724b9..b88ff89 100644 --- a/src/app/stylesheets/layout.scss +++ b/src/app/stylesheets/layout.scss @@ -1588,7 +1588,6 @@ section.admin-content-section{ /* nav */ nav.faceted{ float: right; - margin-right: 100px; ul{ list-style: none; display: inline-block; font-family: $font-family-primary; } li{ display: inline-block; margin-bottom: 1px; } li + li{ margin-left: 40px; } diff --git a/src/app/views/provider_accounts/edit.haml b/src/app/views/provider_accounts/edit.haml index 71d15ee..925fc48 100644 --- a/src/app/views/provider_accounts/edit.haml +++ b/src/app/views/provider_accounts/edit.haml @@ -5,7 +5,7 @@ = @provider_account.name #obj_actions Return to: - = link_to "Cloud Providers", edit_provider_path(@provider, :view => 'filter', :details_tab => 'connectivity'), :class => 'rounded-link' + = link_to "Cloud Providers", edit_provider_path(@provider, :details_tab => 'accounts'), :class => 'rounded-link'
%section.admin-content-section %header diff --git a/src/app/views/provider_accounts/new.haml b/src/app/views/provider_accounts/new.haml index 0ce42f8..565d771 100644 --- a/src/app/views/provider_accounts/new.haml +++ b/src/app/views/provider_accounts/new.haml @@ -3,7 +3,7 @@ %h1 New Provider Account #obj_actions Return to: - = link_to "Cloud Providers", edit_provider_path(@provider, :view => 'filter', :details_tab => 'connectivity'), :class => 'rounded-link' + = link_to "Cloud Providers", edit_provider_path(@provider, :details_tab => 'accounts'), :class => 'rounded-link'
%section.admin-content-section.provider_accounts .content diff --git a/src/app/views/provider_accounts/show.haml b/src/app/views/provider_accounts/show.haml index 0079b43..415de72 100644 --- a/src/app/views/provider_accounts/show.haml +++ b/src/app/views/provider_accounts/show.haml @@ -5,7 +5,7 @@ = @provider_account.name #obj_actions Return to: - = link_to "Cloud Providers", edit_provider_path(@provider, :view => 'filter', :details_tab => 'connectivity'), :class => 'rounded-link' + = link_to "Cloud Providers", edit_provider_path(@provider, :details_tab => 'accounts'), :class => 'rounded-link'
%section.admin-content-section %header diff --git a/src/app/views/providers/edit.haml b/src/app/views/providers/edit.haml index 6491e2c..dc0b56e 100644 --- a/src/app/views/providers/edit.haml +++ b/src/app/views/providers/edit.haml @@ -35,13 +35,8 @@ = tab[:name] -if tab[:count] %span.label.badge.count.dark=tab[:count] - .section-controls - #obj_actions.button-container - .button-group - = pretty_filter_toggle(edit_provider_path(@provider, :view => 'pretty', :details_tab => @details_tab[:id]), edit_provider_path(@provider, :view => 'filter', :details_tab => @details_tab[:id])) - .content.collapsible.toggle-view.pools#tab - %ul.deployable-cards - = render :partial => @view + .content#tab + = render :partial => @view - else %section.admin-content-section %header.align-center diff --git a/src/features/provider_account.feature b/src/features/provider_account.feature index c0ad0ba..58f1e9e 100644 --- a/src/features/provider_account.feature +++ b/src/features/provider_account.feature @@ -10,8 +10,7 @@ Feature: Manage Provider Accounts Scenario: List provider accounts for provider Given I am on the homepage And there is a provider named "testprovider" - When I go to the testprovider's edit provider page - And I follow "filter_view" + When I go to the testprovider's provider accounts page Then I should see "New Account" And there should be no provider accounts
@@ -98,8 +97,7 @@ Feature: Manage Provider Accounts When I follow "Edit" And I fill in "provider_account[label]" with "testaccount_updated" And I press "Save" - Then I should see "testaccount_updated" - And I should see "Provider Account updated!" within ".flashes" + Then I should see "Provider Account updated!" within ".flashes"
Scenario: Edit a existing Provider Account with invalid credentials Given there is a provider named "testprovider" diff --git a/src/features/support/paths.rb b/src/features/support/paths.rb index a849956..bbeea10 100644 --- a/src/features/support/paths.rb +++ b/src/features/support/paths.rb @@ -48,7 +48,7 @@ module NavigationHelpers edit_provider_path(Provider.find_by_name($1))
when /^the (.*)'s provider accounts page$/ - edit_provider_path(Provider.find_by_name($1), :view => 'filter', :details_tab => 'connectivity') + edit_provider_path(Provider.find_by_name($1), :details_tab => 'accounts')
when /the settings page/ settings_path