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

Added new Detailed Description field to Group edit/details screen #6680

Merged
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
12 changes: 7 additions & 5 deletions app/controllers/ops_controller/ops_rbac.rb
Expand Up @@ -1058,7 +1058,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 @@ -1125,10 +1125,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 @@ -1229,6 +1230,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