Commit 7f63cc0d authored by Kev's avatar Kev Committed by Peter Hegman

Migrate group permissions checkboxes to gitlab_ui_checkbox_component

parent 3e8bc389
...@@ -15,26 +15,22 @@ ...@@ -15,26 +15,22 @@
checkbox_options: { disabled: !can_change_prevent_sharing_groups_outside_hierarchy?(@group) } checkbox_options: { disabled: !can_change_prevent_sharing_groups_outside_hierarchy?(@group) }
.form-group.gl-mb-3 .form-group.gl-mb-3
.gl-form-checkbox.custom-control.custom-checkbox = f.gitlab_ui_checkbox_component :share_with_group_lock,
= f.check_box :share_with_group_lock, disabled: !can_change_share_with_group_lock?(@group), class: 'custom-control-input' s_('GroupSettings|Prevent sharing a project within %{group} with other groups').html_safe % { group: link_to_group(@group) },
= f.label :share_with_group_lock, class: 'custom-control-label' do checkbox_options: { disabled: !can_change_share_with_group_lock?(@group) },
%span help_text: share_with_group_lock_help_text(@group)
= s_('GroupSettings|Prevent sharing a project within %{group} with other groups').html_safe % { group: link_to_group(@group) }
%p.js-descr.help-text= share_with_group_lock_help_text(@group)
.form-group.gl-mb-3 .form-group.gl-mb-3
.gl-form-checkbox.custom-control.custom-checkbox = f.gitlab_ui_checkbox_component :emails_disabled,
= f.check_box :emails_disabled, checked: @group.emails_disabled?, disabled: !can_disable_group_emails?(@group), class: 'custom-control-input' s_('GroupSettings|Disable email notifications'),
= f.label :emails_disabled, class: 'custom-control-label' do checkbox_options: { checked: @group.emails_disabled?, disabled: !can_disable_group_emails?(@group) },
%span= s_('GroupSettings|Disable email notifications') help_text: s_('GroupSettings|This setting will override user notification preferences for all members of the group, subgroups, and projects.')
%p.help-text= s_('GroupSettings|This setting will override user notification preferences for all members of the group, subgroups, and projects.')
.form-group.gl-mb-3 .form-group.gl-mb-3
.gl-form-checkbox.custom-control.custom-checkbox = f.gitlab_ui_checkbox_component :mentions_disabled,
= f.check_box :mentions_disabled, checked: @group.mentions_disabled?, class: 'custom-control-input' s_('GroupSettings|Disable group mentions'),
= f.label :mentions_disabled, class: 'custom-control-label' do checkbox_options: { checked: @group.mentions_disabled? },
%span= s_('GroupSettings|Disable group mentions') help_text: s_('GroupSettings|This setting will prevent group members from being notified if the group is mentioned.')
%p.help-text= s_('GroupSettings|This setting will prevent group members from being notified if the group is mentioned.')
= render 'groups/settings/project_access_token_creation', f: f, group: @group = render 'groups/settings/project_access_token_creation', f: f, group: @group
= render_if_exists 'groups/settings/delayed_project_removal', f: f, group: @group = render_if_exists 'groups/settings/delayed_project_removal', f: f, group: @group
......
...@@ -25,7 +25,7 @@ RSpec.describe 'groups/edit.html.haml' do ...@@ -25,7 +25,7 @@ RSpec.describe 'groups/edit.html.haml' do
render render
expect(rendered).to have_content("Prevent sharing a project within #{test_group.name} with other groups") expect(rendered).to have_content("Prevent sharing a project within #{test_group.name} with other groups")
expect(rendered).to have_css('.js-descr', text: 'help text here') expect(rendered).to have_css('.help-text', text: 'help text here')
expect(rendered).to have_field('group_share_with_group_lock', **checkbox_options) expect(rendered).to have_field('group_share_with_group_lock', **checkbox_options)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment