Commit 5d3e6e14 authored by peterhegman's avatar peterhegman Committed by David O'Regan

Update checkbox styles in group settings "Permissions, LFS, 2FA panel

So all checkboxes are consistently styled
parent e81eba24
......@@ -6,10 +6,8 @@
%p= s_('Check the %{docs_link_start}documentation%{docs_link_end}.').html_safe % { docs_link_start: docs_link_start, docs_link_end: '</a>'.html_safe }
.form-group.gl-mb-3
.form-check
= f.check_box :lfs_enabled, checked: @group.lfs_enabled?, class: 'form-check-input', data: { qa_selector: 'lfs_checkbox' }
= f.label :lfs_enabled, class: 'form-check-label' do
%span
= _('Allow projects within this group to use Git LFS')
%br/
%span.text-muted= _('This setting can be overridden in each project.')
.gl-form-checkbox.custom-control.custom-checkbox
= f.check_box :lfs_enabled, checked: @group.lfs_enabled?, class: 'custom-control-input', data: { qa_selector: 'lfs_checkbox' }
= f.label :lfs_enabled, class: 'custom-control-label' do
= _('Allow projects within this group to use Git LFS')
%p.help-text= _('This setting can be overridden in each project.')
......@@ -7,17 +7,17 @@
%p= s_('Check the %{docs_link_start}documentation%{docs_link_end}.').html_safe % { docs_link_start: docs_link_start, docs_link_end: '</a>'.html_safe }
.form-group
.form-check
= f.check_box :require_two_factor_authentication, class: 'form-check-input', data: { qa_selector: 'require_2fa_checkbox' }
= f.label :require_two_factor_authentication, class: 'form-check-label' do
%span= _('Require all users in this group to setup two-factor authentication')
.gl-form-checkbox.custom-control.custom-checkbox
= f.check_box :require_two_factor_authentication, class: 'custom-control-input', data: { qa_selector: 'require_2fa_checkbox' }
= f.label :require_two_factor_authentication, class: 'custom-control-label' do
= _('Require all users in this group to setup two-factor authentication')
.form-group
= f.label :two_factor_grace_period, _('Time before enforced'), class: 'label-bold'
= f.text_field :two_factor_grace_period, class: 'form-control form-control-sm w-auto'
.form-text.text-muted= _('Amount of time (in hours) that users are allowed to skip forced configuration of two-factor authentication')
- unless group.has_parent?
.form-group
.form-check
= f.check_box :allow_mfa_for_subgroups, class: 'form-check-input', checked: group.namespace_settings&.allow_mfa_for_subgroups
= f.label :allow_mfa_for_subgroups, class: 'form-check-label' do
.gl-form-checkbox.custom-control.custom-checkbox
= f.check_box :allow_mfa_for_subgroups, class: 'custom-control-input', checked: group.namespace_settings&.allow_mfa_for_subgroups
= f.label :allow_mfa_for_subgroups, class: 'custom-control-label' do
= _('Allow subgroups to set up their own two-factor authentication rules')
- label_class = local_assigns.fetch(:bold_label, false) ? 'font-weight-bold' : ''
.form-check
= form.check_box :request_access_enabled, class: 'form-check-input', data: { qa_selector: 'request_access_checkbox' }
= form.label :request_access_enabled, class: 'form-check-label' do
.gl-form-checkbox.custom-control.custom-checkbox
= form.check_box :request_access_enabled, class: 'custom-control-input', data: { qa_selector: 'request_access_checkbox' }
= form.label :request_access_enabled, class: 'custom-control-label' do
%span{ class: label_class }= _('Allow users to request access (if visibility is public or internal)')
---
title: Update checkbox styles in "Group" -> "Settings" -> "General" -> "Permissions,
LFS, 2FA"
merge_request: 61294
author:
type: other
......@@ -2,7 +2,7 @@
%h5= _('Member lock')
.form-group
.form-check
= f.check_box :membership_lock, class: 'form-check-input', data: { qa_selector: 'membership_lock_checkbox' }
= f.label :membership_lock, class: 'form-check-label' do
%span= _('Prevent adding new members to project membership within this group')
.gl-form-checkbox.custom-control.custom-checkbox
= f.check_box :membership_lock, class: 'custom-control-input', data: { qa_selector: 'membership_lock_checkbox' }
= f.label :membership_lock, class: 'custom-control-label' do
= _('Prevent adding new members to project membership within this group')
%h5= _('Prevent project forking outside current group')
.form-group.gl-mb-3
.form-check
= f.check_box :prevent_forking_outside_group, checked: group.prevent_forking_outside_group?, class: 'form-check-input', disabled: !can_change_prevent_forking?(current_user, group), data: { qa_selector: 'prevent_forking_outside_group_checkbox' }
= f.label :prevent_forking_outside_group, class: 'form-check-label' do
%span.gl-display-block= s_('GroupSettings|Prevent forking outside of the group')
%span.text-muted= s_('GroupSettings|This setting will prevent group members from forking projects outside of the group.')
.gl-form-checkbox.custom-control.custom-checkbox
= f.check_box :prevent_forking_outside_group, checked: group.prevent_forking_outside_group?, class: 'custom-control-input', disabled: !can_change_prevent_forking?(current_user, group), data: { qa_selector: 'prevent_forking_outside_group_checkbox' }
= f.label :prevent_forking_outside_group, class: 'custom-control-label' do
= s_('GroupSettings|Prevent forking outside of the group')
%p.help-text= s_('GroupSettings|This setting will prevent group members from forking projects outside of the group.')
......@@ -82,25 +82,25 @@ module QA
def set_membership_lock_enabled
expand_content(:permission_lfs_2fa_content)
check_element(:membership_lock_checkbox)
check_element(:membership_lock_checkbox, true)
click_element(:save_permissions_changes_button)
end
def set_membership_lock_disabled
expand_content(:permission_lfs_2fa_content)
uncheck_element(:membership_lock_checkbox)
uncheck_element(:membership_lock_checkbox, true)
click_element(:save_permissions_changes_button)
end
def set_prevent_forking_outside_group_enabled
expand_content(:permission_lfs_2fa_content)
check_element(:prevent_forking_outside_group_checkbox)
check_element(:prevent_forking_outside_group_checkbox, true)
click_element(:save_permissions_changes_button)
end
def set_prevent_forking_outside_group_disabled
expand_content(:permission_lfs_2fa_content)
uncheck_element(:prevent_forking_outside_group_checkbox)
uncheck_element(:prevent_forking_outside_group_checkbox, true)
click_element(:save_permissions_changes_button)
end
......
......@@ -59,37 +59,37 @@ module QA
def set_lfs_enabled
expand_content(:permission_lfs_2fa_content)
check_element(:lfs_checkbox)
check_element(:lfs_checkbox, true)
click_element(:save_permissions_changes_button)
end
def set_lfs_disabled
expand_content(:permission_lfs_2fa_content)
uncheck_element(:lfs_checkbox)
uncheck_element(:lfs_checkbox, true)
click_element(:save_permissions_changes_button)
end
def set_request_access_enabled
expand_content(:permission_lfs_2fa_content)
check_element(:request_access_checkbox)
check_element(:request_access_checkbox, true)
click_element(:save_permissions_changes_button)
end
def set_request_access_disabled
expand_content(:permission_lfs_2fa_content)
uncheck_element(:request_access_checkbox)
uncheck_element(:request_access_checkbox, true)
click_element(:save_permissions_changes_button)
end
def set_require_2fa_enabled
expand_content(:permission_lfs_2fa_content)
check_element(:require_2fa_checkbox)
check_element(:require_2fa_checkbox, true)
click_element(:save_permissions_changes_button)
end
def set_require_2fa_disabled
expand_content(:permission_lfs_2fa_content)
uncheck_element(:require_2fa_checkbox)
uncheck_element(:require_2fa_checkbox, true)
click_element(:save_permissions_changes_button)
end
......@@ -102,10 +102,10 @@ module QA
def toggle_request_access
expand_content(:permission_lfs_2fa_content)
if find_element(:request_access_checkbox).checked?
uncheck_element(:request_access_checkbox)
if find_element(:request_access_checkbox, visible: false).checked?
uncheck_element(:request_access_checkbox, true)
else
check_element(:request_access_checkbox)
check_element(:request_access_checkbox, true)
end
click_element(:save_permissions_changes_button)
......
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