Skip to content

Commit

Permalink
Fixed accessibility issues with the server settings authentication page
Browse files Browse the repository at this point in the history
  • Loading branch information
GilbertCherrie committed Nov 2, 2023
1 parent 9eb0670 commit 06de03e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
24 changes: 24 additions & 0 deletions app/helpers/settings_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module SettingsHelper
def utilization_tab_configuration
[:Visual, :Default, :Time].map do |item|
{:name => item, :text => settings_tabs_types[item]}
end
end

def settings_tab_content(key_name, &block)
if utilization_tabs_types[key_name]
class_name = key_name == :summary ? 'tab_content active' : 'tab_content'
tag.div(:id => key_name, :class => class_name, &block)
end
end

private

def settings_tabs_types
{
:Visual => _('Visual'),
:Default => _('Default Filters'),
:Time => _('Time Profiles'),
}
end
end
21 changes: 10 additions & 11 deletions app/views/ops/_settings_authentication_tab.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
miqSelectPickerEvent('session_timeout_mins', "#{url}")
%span m
.form-group
%label.col-md-2.control-label
%label.col-md-2.control-label{"for" => "authentication_mode"}
= _("Mode")
.col-md-8
= select_tag('authentication_mode',
Expand All @@ -38,7 +38,7 @@
%h3= _("Amazon Primary AWS Account Settings for IAM")
.form-horizontal
.form-group
%label.col-md-2.control-label
%label.col-md-2.control-label{"for" => "authentication_amazon_key"}
= _("Access Key")
.col-md-8
= text_field_tag("authentication_amazon_key",
Expand All @@ -47,7 +47,7 @@
:class => "form-control",
"data-miq_observe" => {:interval => '.5', :url => url}.to_json)
.form-group
%label.col-md-2.control-label
%label.col-md-2.control-label{"for" => "authentication_amazon_secret"}
= _("Secret Key")
.col-md-8
= password_field_tag("authentication_amazon_secret", '',
Expand All @@ -62,7 +62,7 @@
= _("Role Settings")
.form-horizontal
.form-group
%label.col-md-2.control-label
%label.col-md-2.control-label{"for" => "amazon_role"}
= _("Get User Groups from Amazon")
.col-md-8
= check_box_tag("amazon_role", "1",
Expand All @@ -78,13 +78,12 @@
= _("External Authentication (httpd) Settings")
.form-horizontal
.form-group
%label.col-md-2.control-label
%label.col-md-2.control-label{"for" => "sso_enabled"}
= _("Enable Single Sign-On")
.col-md-8
= check_box_tag("sso_enabled", "1",
@edit[:new][:authentication][:sso_enabled],
"data-miq_observe_checkbox" => {:url => url}.to_json)
%h3
.form-horizontal
.form-group
%label.control-label.col-md-2
Expand All @@ -93,7 +92,7 @@
%label
%input{:type => 'radio',
:name => 'provider_type',
:id => 'provider_type',
:id => 'provider_type_none',
:value => 'none',
"data-miq_observe" => {:url => url}.to_json,
:checked => @edit[:new][:authentication][:provider_type] == "none"}
Expand All @@ -102,7 +101,7 @@
%label
%input{:type => 'radio',
:name => 'provider_type',
:id => 'provider_type',
:id => 'provider_type_saml',
:value => 'saml',
"data-miq_observe" => {:url => url}.to_json,
:checked => @edit[:new][:authentication][:provider_type] == "saml"}
Expand All @@ -111,15 +110,15 @@
%label
%input{:type => 'radio',
:name => 'provider_type',
:id => 'provider_type',
:id => 'provider_type_oidc',
:value => 'oidc',
"data-miq_observe" => {:url => url}.to_json,
:checked => @edit[:new][:authentication][:provider_type] == "oidc"}
= _("Enable OpenID-Connect")
= hidden_div_if(@edit[:new][:authentication][:provider_type] == "none", :id => "none_local_login_div") do
.form-group
%label.col-md-2.control-label
%label.col-md-2.control-label{"for" => "local_login_disabled"}
= _("Disable Local Login")
.col-md-4
= check_box_tag("local_login_disabled", "1",
Expand All @@ -132,7 +131,7 @@
= _("Role Settings")
.form-horizontal
.form-group
%label.col-md-2.control-label
%label.col-md-2.control-label{"for" => "httpd_role"}
= _("Get User Groups from External Authentication (httpd)")
.col-md-8
= check_box_tag("httpd_role", "1",
Expand Down

0 comments on commit 06de03e

Please sign in to comment.