diff options
Diffstat (limited to 'app/views/groups/settings')
5 files changed, 36 insertions, 44 deletions
diff --git a/app/views/groups/settings/_advanced.html.haml b/app/views/groups/settings/_advanced.html.haml index fea0736ffc8..cdff533e3c7 100644 --- a/app/views/groups/settings/_advanced.html.haml +++ b/app/views/groups/settings/_advanced.html.haml @@ -20,10 +20,12 @@ = f.text_field :path, placeholder: 'open-source', class: 'form-control', autofocus: local_assigns[:autofocus] || false, required: true, pattern: Gitlab::PathRegex::NAMESPACE_FORMAT_REGEX_JS, - title: s_('GroupSettings|Please choose a group URL with no special characters.'), + title: group_url_error_message, + maxlength: ::Namespace::URL_MAX_LENGTH, "data-bind-in" => "#{'create_chat_team' if Gitlab.config.mattermost.enabled}" = f.submit s_('GroupSettings|Change group URL'), class: 'btn gl-button btn-warning' = render 'groups/settings/transfer', group: @group = render 'groups/settings/remove', group: @group = render_if_exists 'groups/settings/restore', group: @group += render_if_exists 'groups/settings/immediately_remove', group: @group diff --git a/app/views/groups/settings/_lfs.html.haml b/app/views/groups/settings/_lfs.html.haml index b16c9faafa4..1255a2901ea 100644 --- a/app/views/groups/settings/_lfs.html.haml +++ b/app/views/groups/settings/_lfs.html.haml @@ -6,8 +6,7 @@ %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 - .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.') + = f.gitlab_ui_checkbox_component :lfs_enabled, + _('Allow projects within this group to use Git LFS'), + help_text: _('This setting can be overridden in each project.'), + checkbox_options: { checked: @group.lfs_enabled?, data: { qa_selector: 'lfs_checkbox' } } diff --git a/app/views/groups/settings/_permissions.html.haml b/app/views/groups/settings/_permissions.html.haml index d1f356ed665..683e70248b6 100644 --- a/app/views/groups/settings/_permissions.html.haml +++ b/app/views/groups/settings/_permissions.html.haml @@ -1,4 +1,4 @@ -= form_for @group, html: { multipart: true, class: 'gl-show-field-errors js-general-permissions-form' }, authenticity_token: true do |f| += gitlab_ui_form_for @group, html: { multipart: true, class: 'gl-show-field-errors js-general-permissions-form' }, authenticity_token: true do |f| %input{ type: 'hidden', name: 'update_section', value: 'js-permissions-settings' } = form_errors(@group) @@ -9,34 +9,28 @@ - if @group.root? .form-group.gl-mb-3 - .gl-form-checkbox.custom-control.custom-checkbox - = f.check_box :prevent_sharing_groups_outside_hierarchy, disabled: !can_change_prevent_sharing_groups_outside_hierarchy?(@group), class: 'custom-control-input' - = f.label :prevent_sharing_groups_outside_hierarchy, class: 'custom-control-label' do - %span - = s_('GroupSettings|Prevent members from sending invitations to groups outside of %{group} and its subgroups.').html_safe % { group: link_to_group(@group) } - %p.js-descr.help-text= prevent_sharing_groups_outside_hierarchy_help_text(@group) + = f.gitlab_ui_checkbox_component :prevent_sharing_groups_outside_hierarchy, + s_('GroupSettings|Prevent members from sending invitations to groups outside of %{group} and its subgroups.').html_safe % { group: link_to_group(@group) }, + help_text: prevent_sharing_groups_outside_hierarchy_help_text(@group), + checkbox_options: { disabled: !can_change_prevent_sharing_groups_outside_hierarchy?(@group) } .form-group.gl-mb-3 - .gl-form-checkbox.custom-control.custom-checkbox - = f.check_box :share_with_group_lock, disabled: !can_change_share_with_group_lock?(@group), class: 'custom-control-input' - = f.label :share_with_group_lock, class: 'custom-control-label' do - %span - = 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) + = f.gitlab_ui_checkbox_component :share_with_group_lock, + s_('GroupSettings|Prevent sharing a project within %{group} with other groups').html_safe % { group: link_to_group(@group) }, + checkbox_options: { disabled: !can_change_share_with_group_lock?(@group) }, + help_text: share_with_group_lock_help_text(@group) .form-group.gl-mb-3 - .gl-form-checkbox.custom-control.custom-checkbox - = f.check_box :emails_disabled, checked: @group.emails_disabled?, disabled: !can_disable_group_emails?(@group), class: 'custom-control-input' - = f.label :emails_disabled, class: 'custom-control-label' do - %span= s_('GroupSettings|Disable email notifications') - %p.help-text= s_('GroupSettings|This setting will override user notification preferences for all members of the group, subgroups, and projects.') + = f.gitlab_ui_checkbox_component :emails_disabled, + s_('GroupSettings|Disable email notifications'), + checkbox_options: { checked: @group.emails_disabled?, disabled: !can_disable_group_emails?(@group) }, + 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 - .gl-form-checkbox.custom-control.custom-checkbox - = f.check_box :mentions_disabled, checked: @group.mentions_disabled?, class: 'custom-control-input' - = f.label :mentions_disabled, class: 'custom-control-label' do - %span= s_('GroupSettings|Disable group mentions') - %p.help-text= s_('GroupSettings|This setting will prevent group members from being notified if the group is mentioned.') + = f.gitlab_ui_checkbox_component :mentions_disabled, + s_('GroupSettings|Disable group mentions'), + checkbox_options: { checked: @group.mentions_disabled? }, + 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_if_exists 'groups/settings/delayed_project_removal', f: f, group: @group diff --git a/app/views/groups/settings/_project_access_token_creation.html.haml b/app/views/groups/settings/_project_access_token_creation.html.haml index 8be17c6cc30..948b25390ba 100644 --- a/app/views/groups/settings/_project_access_token_creation.html.haml +++ b/app/views/groups/settings/_project_access_token_creation.html.haml @@ -1,10 +1,9 @@ - return unless render_setting_to_allow_project_access_token_creation?(group) .form-group.gl-mb-3 - .gl-form-checkbox.custom-control.custom-checkbox - = f.check_box :resource_access_token_creation_allowed, checked: group.namespace_settings.resource_access_token_creation_allowed?, class: 'custom-control-input', data: { qa_selector: 'resource_access_token_creation_allowed_checkbox' } - = f.label :resource_access_token_creation_allowed, class: 'custom-control-label' do - %span= s_('GroupSettings|Allow project access token creation') - - project_access_tokens_link = help_page_path('user/project/settings/project_access_tokens') - - link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: project_access_tokens_link } - %p.help-text= s_('GroupSettings|Users can create %{link_start}project access tokens%{link_end} for projects in this group.').html_safe % { link_start: link_start, link_end: '</a>'.html_safe } + - project_access_tokens_link = help_page_path('user/project/settings/project_access_tokens') + - link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: project_access_tokens_link } + = f.gitlab_ui_checkbox_component :resource_access_token_creation_allowed, + s_('GroupSettings|Allow project access token creation'), + checkbox_options: { checked: group.namespace_settings.resource_access_token_creation_allowed?, data: { qa_selector: 'resource_access_token_creation_allowed_checkbox' } }, + help_text: s_('GroupSettings|Users can create %{link_start}project access tokens%{link_end} for projects in this group.').html_safe % { link_start: link_start, link_end: '</a>'.html_safe } diff --git a/app/views/groups/settings/_two_factor_auth.html.haml b/app/views/groups/settings/_two_factor_auth.html.haml index bd3b3283288..9e5eeee2e2a 100644 --- a/app/views/groups/settings/_two_factor_auth.html.haml +++ b/app/views/groups/settings/_two_factor_auth.html.haml @@ -7,17 +7,15 @@ %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-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') + = f.gitlab_ui_checkbox_component :require_two_factor_authentication, + _('Require all users in this group to setup two-factor authentication'), + checkbox_options: { data: { qa_selector: 'require_2fa_checkbox' } } .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 - .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') + = f.gitlab_ui_checkbox_component :allow_mfa_for_subgroups, + _('Allow subgroups to set up their own two-factor authentication rules'), + checkbox_options: { checked: group.namespace_settings&.allow_mfa_for_subgroups } |