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 missing button for re-checking authentication status for middleware #10153

Merged
merged 2 commits into from
Aug 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/controllers/ems_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,9 @@ def button
javascript_redirect :back
return
end
if params[:pressed] == "ems_cloud_recheck_auth_status" ||
params[:pressed] == "ems_infra_recheck_auth_status" ||
if params[:pressed] == "ems_cloud_recheck_auth_status" ||
params[:pressed] == "ems_infra_recheck_auth_status" ||
params[:pressed] == "ems_middleware_recheck_auth_status" ||
params[:pressed] == "ems_container_recheck_auth_status"
@record = find_by_id_filtered(model, params[:id])
result, details = @record.authentication_check_types_queue(@record.authentication_for_summary.pluck(:authtype),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class ApplicationHelper::Button::EmsMiddlewareRecheckAuthStatus < ApplicationHelper::Button::Basic
def skip?
!@record.is_available?(:authentication_status)
end
end
16 changes: 16 additions & 0 deletions app/helpers/application_helper/toolbar/ems_middleware_center.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,20 @@ class ApplicationHelper::Toolbar::EmsMiddlewareCenter < ApplicationHelper::Toolb
]
),
])
button_group('ems_middleware_authentication', [
select(
:ems_middleware_authentication_choice,
'fa fa-lock fa-lg',
t = N_('Authentication'),
t,
:items => [
button(
:ems_middleware_recheck_auth_status,
'fa fa-search fa-lg',
N_("Re-check Authentication Status for this #{ui_lookup(:table=>'ems_middleware')}"),
N_('Re-check Authentication Status'),
:klass => ApplicationHelper::Button::EmsMiddlewareRecheckAuthStatus),
]
),
])
end
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ def verify_credentials(_auth_type = nil, options = {})
true
end

def validate_authentication_status
{:available => true, :message => nil}
end

# Hawkular Client
def self.raw_connect(hostname, port, username, password)
entrypoint = URI::HTTP.build(:host => hostname, :port => port.to_i).to_s
Expand Down
4 changes: 4 additions & 0 deletions db/fixtures/miq_product_features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3308,6 +3308,10 @@
:description: Refresh Middleware Providers
:feature_type: control
:identifier: ems_middleware_refresh
- :name: Re-check Authentication Status
:description: Re-check Authentication Status of Middleware Providers
:feature_type: control
:identifier: ems_middleware_recheck_auth_status
- :name: Edit Tags
:description: Edit Tags of Middleware Providers
:feature_type: control
Expand Down