Skip to content

Commit

Permalink
Prevent rendering User to Look Up form field twice and with same id
Browse files Browse the repository at this point in the history
Issue: #2316
  • Loading branch information
hstastna committed Dec 18, 2019
1 parent 7b4b88e commit d232c0b
Showing 1 changed file with 46 additions and 68 deletions.
114 changes: 46 additions & 68 deletions app/views/ops/_rbac_group_details.html.haml
Expand Up @@ -125,29 +125,6 @@
= _("LDAP Group Look Up")
.form-horizontal
.form-group#user_id_ext_auth_form_group
%label.col-md-2.control-label
= _("User to Look Up")
.col-md-8
= text_field_tag("user",
@edit[:new][:user],
:maxlength => 255,
:class => "form-control",
"data-miq_observe" => {:interval => '.5',
:url => url}.to_json)
.col-md-12{:align => "right", :valign => "bottom"}
= link_to("Retrieve",
{:action => "rbac_group_user_lookup",
:button => "submit",
:id => @edit[:group_id] || "new"},
:class => "btn btn-primary",
:alt => t = _("LDAP Group Lookup"),
"data-miq_sparkle_on" => true,
"data-miq_sparkle_off" => true,
:remote => true,
"data-method" => :post,
:title => t)
.form-group#user_id_form_group
%label.col-md-2.control-label
= _("User to Look Up")
.col-md-8
Expand All @@ -157,40 +134,54 @@
:class => "form-control",
"data-miq_observe" => {:interval => '.5',
:url => url}.to_json)
- if mode == "httpd"
.col-md-12{:align => "right", :valign => "bottom"}
= link_to("Retrieve",
{:action => "rbac_group_user_lookup",
:button => "submit",
:id => @edit[:group_id] || "new"},
:class => "btn btn-primary",
:alt => t = _("LDAP Group Lookup"),
"data-miq_sparkle_on" => true,
"data-miq_sparkle_off" => true,
:remote => true,
"data-method" => :post,
:title => t)
.form-group#user_name_form_group
%label.col-md-2.control-label
= _("Username")
.col-md-8
= text_field_tag("user_id",
@edit[:new][:user_id],
:maxlength => 255,
:class => "form-control",
"data-miq_observe" => {:interval => '.5',
:url => url}.to_json)
- unless mode == "httpd"
.form-group#user_name_form_group
%label.col-md-2.control-label
= _("Username")
.col-md-8
= text_field_tag("user_id",
@edit[:new][:user_id],
:maxlength => 255,
:class => "form-control",
"data-miq_observe" => {:interval => '.5',
:url => url}.to_json)
.form-group#user_password_form_group
%label.col-md-2.control-label
= _("Password")
.col-md-8
= password_field_tag("password",
@edit[:new][:password],
:maxlength => 50,
:class => "form-control",
"data-miq_observe" => {:interval => '.5',
:url => url}.to_json)
.col-md-12{:align => "right", :valign => "bottom"}
= link_to("Retrieve",
{:action => "rbac_group_user_lookup",
:button => "submit",
:id => @edit[:group_id] || "new"},
:class => "btn btn-primary",
:alt => t = _("LDAP Group Lookup"),
"data-miq_sparkle_on" => true,
"data-miq_sparkle_off" => true,
:remote => true,
"data-method" => :post,
:title => t)
.form-group#user_password_form_group
%label.col-md-2.control-label
= _("Password")
.col-md-8
= password_field_tag("password",
@edit[:new][:password],
:maxlength => 50,
:class => "form-control",
"data-miq_observe" => {:interval => '.5',
:url => url}.to_json)
.col-md-12{:align => "right", :valign => "bottom"}
= link_to("Retrieve",
{:action => "rbac_group_user_lookup",
:button => "submit",
:id => @edit[:group_id] || "new"},
:class => "btn btn-primary",
:alt => t = _("LDAP Group Lookup"),
"data-miq_sparkle_on" => true,
"data-miq_sparkle_off" => true,
:remote => true,
"data-method" => :post,
:title => t)
%hr
%h3
Expand Down Expand Up @@ -219,16 +210,3 @@
:javascript
miq_tabs_init('#rbac_group_tabs');
- if @edit
%script{:type => "text/javascript"}
- if ::Settings.authentication.mode == "httpd"
$('#user_id_ext_auth_form_group').show();
$('#user_id_form_group').hide();
$('#user_name_form_group').hide();
$('#user_password_form_group').hide();
- else
$('#user_id_ext_auth_form_group').hide();
$('#user_id_form_group').show();
$('#user_name_form_group').show();
$('#user_password_form_group').show();

0 comments on commit d232c0b

Please sign in to comment.