Commit 07ed273a authored by Annabel Gray's avatar Annabel Gray

Merge branch '6210-admin-area-push-rules-checkboxes' into 'master'

Resolve "Admin area > Push rules > Checkboxes"

Closes #6210

See merge request gitlab-org/gitlab-ee!6096
parents af7f37c1 76ae76cf
...@@ -3,10 +3,9 @@ ...@@ -3,10 +3,9 @@
- form = local_assigns.fetch(:form) - form = local_assigns.fetch(:form)
- push_rule = local_assigns.fetch(:push_rule) - push_rule = local_assigns.fetch(:push_rule)
.form-group .form-check
= form.check_box :commit_committer_check, class: "float-left", disabled: !can_change_push_rule?(form.object, :commit_committer_check) = form.check_box :commit_committer_check, class: "form-check-input", disabled: !can_change_push_rule?(form.object, :commit_committer_check)
.prepend-left-20 = form.label :commit_committer_check, class: "label-light form-check-label" do
= form.label :commit_committer_check, class: "label-light append-bottom-0" do
= s_("PushRule|Committer restriction") = s_("PushRule|Committer restriction")
%p.light.append-bottom-0 %p.text-muted
= commit_committer_check_description(push_rule) = commit_committer_check_description(push_rule)
...@@ -2,33 +2,30 @@ ...@@ -2,33 +2,30 @@
= render 'shared/push_rules/reject_unsigned_commits_setting', form: f, push_rule: f.object = render 'shared/push_rules/reject_unsigned_commits_setting', form: f, push_rule: f.object
.form-group .form-check
= f.check_box :deny_delete_tag, class: "float-left" = f.check_box :deny_delete_tag, class: "form-check-input"
.prepend-left-20 = f.label :deny_delete_tag, class: "label-light form-check-label" do
= f.label :deny_delete_tag, class: "label-light append-bottom-0" do
Do not allow users to remove git tags with Do not allow users to remove git tags with
%code git push %code git push
%p.light.append-bottom-0 %p.text-muted
Tags can still be deleted through the web UI. Tags can still be deleted through the web UI.
.form-group .form-check
= f.check_box :member_check, class: "float-left" = f.check_box :member_check, class: "form-check-input"
.prepend-left-20 = f.label :member_check, "Check whether author is a GitLab user", class: "label-light form-check-label"
= f.label :member_check, "Check whether author is a GitLab user", class: "label-light append-bottom-0" %p.text-muted
%p.light.append-bottom-0
Restrict commits by author (email) to existing GitLab users Restrict commits by author (email) to existing GitLab users
.form-group .form-check
= f.check_box :prevent_secrets, class: "float-left" = f.check_box :prevent_secrets, class: "form-check-input"
.prepend-left-20 = f.label :prevent_secrets, "Prevent committing secrets to Git", class: "label-light form-check-label"
= f.label :prevent_secrets, "Prevent committing secrets to Git", class: "label-light append-bottom-0" %p.text-muted
%p.light.append-bottom-0
GitLab will reject any files that are likely to contain secrets. GitLab will reject any files that are likely to contain secrets.
The list of file names we reject is available in the #{link_to "documentation", help_page_path('push_rules/push_rules')}. The list of file names we reject is available in the #{link_to "documentation", help_page_path('push_rules/push_rules')}.
.form-group .form-group
= f.label :commit_message_regex, "Commit message", class: 'label-light' = f.label :commit_message_regex, "Commit message", class: "label-light"
= f.text_field :commit_message_regex, class: "form-control", placeholder: 'Example: Fixes \d+\..*' = f.text_field :commit_message_regex, class: "form-control", placeholder: 'Example: Fixes \d+\..*'
.form-text.text-muted .form-text.text-muted
All commit messages must match this All commit messages must match this
...@@ -38,7 +35,7 @@ ...@@ -38,7 +35,7 @@
For example you can require that an issue number is always mentioned in the commit message. For example you can require that an issue number is always mentioned in the commit message.
.form-group .form-group
= f.label :branch_name_regex, "Branch name", class: 'label-light' = f.label :branch_name_regex, "Branch name", class: "label-light"
= f.text_field :branch_name_regex, class: "form-control", placeholder: 'Example: (feature|hotfix)\/*' = f.text_field :branch_name_regex, class: "form-control", placeholder: 'Example: (feature|hotfix)\/*'
.form-text.text-muted .form-text.text-muted
All branch names must match this All branch names must match this
...@@ -47,7 +44,7 @@ ...@@ -47,7 +44,7 @@
If this field is empty it allows any branch name. If this field is empty it allows any branch name.
.form-group .form-group
= f.label :author_email_regex, "Commit author's email", class: 'label-light' = f.label :author_email_regex, "Commit author's email", class: "label-light"
= f.text_field :author_email_regex, class: "form-control", placeholder: 'Example: @my-company.com$' = f.text_field :author_email_regex, class: "form-control", placeholder: 'Example: @my-company.com$'
.form-text.text-muted .form-text.text-muted
All commit author's email must match this All commit author's email must match this
...@@ -56,7 +53,7 @@ ...@@ -56,7 +53,7 @@
If this field is empty it allows any email. If this field is empty it allows any email.
.form-group .form-group
= f.label :file_name_regex, "Prohibited file names", class: 'label-light' = f.label :file_name_regex, "Prohibited file names", class: "label-light"
= f.text_field :file_name_regex, class: "form-control", placeholder: 'Example: (jar|exe)$' = f.text_field :file_name_regex, class: "form-control", placeholder: 'Example: (jar|exe)$'
.form-text.text-muted .form-text.text-muted
All commited filenames must not match this All commited filenames must not match this
...@@ -65,7 +62,7 @@ ...@@ -65,7 +62,7 @@
If this field is empty it allows any filenames. If this field is empty it allows any filenames.
.form-group .form-group
= f.label :max_file_size, "Maximum file size (MB)", class: 'label-light' = f.label :max_file_size, "Maximum file size (MB)", class: "label-light"
= f.number_field :max_file_size, class: "form-control", min: 0 = f.number_field :max_file_size, class: "form-control", min: 0
.form-text.text-muted .form-text.text-muted
Pushes that contain added or updated files that exceed this file size are rejected. Pushes that contain added or updated files that exceed this file size are rejected.
......
...@@ -3,10 +3,9 @@ ...@@ -3,10 +3,9 @@
- form = local_assigns.fetch(:form) - form = local_assigns.fetch(:form)
- push_rule = local_assigns.fetch(:push_rule) - push_rule = local_assigns.fetch(:push_rule)
.form-group .form-check
= form.check_box :reject_unsigned_commits, class: "float-left", disabled: !can_change_push_rule?(form.object, :reject_unsigned_commits) = form.check_box :reject_unsigned_commits, class: "form-check-input", disabled: !can_change_push_rule?(form.object, :reject_unsigned_commits)
.prepend-left-20 = form.label :reject_unsigned_commits, class: "label-light form-check-label" do
= form.label :reject_unsigned_commits, class: "label-light append-bottom-0" do
Reject unsigned commits Reject unsigned commits
%p.light.append-bottom-0 %p.text-muted
= reject_unsigned_commits_description(push_rule) = reject_unsigned_commits_description(push_rule)
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