Skip to content

Commit

Permalink
Merge pull request #6680 from h-kataria/add_detailed_description_to_g…
Browse files Browse the repository at this point in the history
…roup

Added new Detailed Description field to Group edit/details screen
  • Loading branch information
mzazrivec committed Feb 17, 2020
2 parents 2826d7a + d2edf1f commit ff625bc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/controllers/ops_controller/ops_rbac.rb
Expand Up @@ -1065,7 +1065,7 @@ def rbac_group_get_form_vars
move_cols_up if params[:button] == "up"
move_cols_down if params[:button] == "down"
else
copy_params_if_present(@edit[:new], params, %i[ldap_groups_user description user user_id])
copy_params_if_present(@edit[:new], params, %i[ldap_groups_user description detailed_description user user_id])

if params[:group_role]
if valid_role?(new_role_id = params[:group_role].to_i)
Expand Down Expand Up @@ -1132,10 +1132,11 @@ def rbac_group_set_form_vars
@group = @record
@edit = {
:new => {
:filters => {},
:filter_expression => {},
:belongsto => {},
:description => @group.description,
:filters => {},
:filter_expression => {},
:belongsto => {},
:description => @group.description,
:detailed_description => @group.detailed_description,
},
:ldap_groups_by_user => [],
:projects_tenants => [],
Expand Down Expand Up @@ -1236,6 +1237,7 @@ def rbac_group_set_record_vars(group)
# Set group record variables such as Description, Role and Tenant to new values
def rbac_group_set_record_description_role(group)
group.description = @edit[:new][:description]
group.detailed_description = @edit[:new][:detailed_description]
group.miq_user_role = MiqUserRole.find(@edit[:new][:role]) if @edit[:new][:role]
group.tenant = Tenant.find(@edit[:new][:group_tenant]) if @edit[:new][:group_tenant]
end
Expand Down
13 changes: 13 additions & 0 deletions app/views/ops/_rbac_group_details.html.haml
Expand Up @@ -54,6 +54,19 @@
"data-miq_observe_checkbox" => {:url => url}.to_json)
= _("(Look up %{authentication_mode_name} Groups)") % {:authentication_mode_name => auth_mode_name}
= javascript_tag(javascript_focus('description'))
.form-group
%label.col-md-2.control-label
= _("Detailed Description")
.col-md-8
- if !@edit
= h(@group.detailed_description)
- else
= text_field_tag("detailed_description",
@edit[:new][:detailed_description],
:maxlength => 255,
:class => "form-control",
"data-miq_observe" => {:interval => '.5',
:url => url}.to_json)
.form-group
%label.col-md-2.control-label
= _("Role")
Expand Down

0 comments on commit ff625bc

Please sign in to comment.