Commit e1bf3053 authored by Mike Greiling's avatar Mike Greiling

Merge branch '358378-replace-generic-checkbox' into 'master'

Replace generic checkbox with GitLab UI styled checkbox

See merge request gitlab-org/gitlab!84848
parents e4580caf 7a4e82b1
= form_for @push_rule, url: admin_push_rule_path(anchor: 'js-push-rule-settings'), method: :put, html: { class: 'fieldset-form' } do |f|
= gitlab_ui_form_for @push_rule, url: admin_push_rule_path(anchor: 'js-push-rule-settings'), method: :put, html: { class: 'fieldset-form' } do |f|
- if @push_rule.errors.any?
.gl-alert.gl-alert-danger
- @push_rule.errors.full_messages.each do |msg|
......
......@@ -6,7 +6,7 @@
%hr.clearfix
= form_for @push_rule, url: group_push_rules_path(@group), as: :push_rule, method: :put do |f|
= gitlab_ui_form_for @push_rule, url: group_push_rules_path(@group), as: :push_rule, method: :put do |f|
- if @push_rule.errors.any?
.gl-alert.gl-alert-danger
- @push_rule.errors.full_messages.each do |msg|
......
......@@ -13,7 +13,7 @@
.settings-content
%h5
= s_('PushRules|Select push rules')
= form_for [@project, @push_rule] do |f|
= gitlab_ui_form_for [@project, @push_rule] do |f|
= form_errors(@push_rule)
= render "shared/push_rules/form", f: f, context: @project
......@@ -5,9 +5,8 @@
- form = local_assigns.fetch(:form)
- push_rule = local_assigns.fetch(:push_rule)
.form-check
= form.check_box :commit_committer_check, class: "form-check-input", disabled: !can_change_push_rule?(form.object, :commit_committer_check, context), data: { qa_selector: 'committer_restriction_checkbox' }
= form.label :commit_committer_check, class: "label-bold form-check-label" do
= s_("PushRule|Reject unverified users")
%p.text-muted
= commit_committer_check_description(push_rule)
= form.gitlab_ui_checkbox_component :commit_committer_check,
s_("PushRule|Reject unverified users"),
checkbox_options: { data: { qa_selector: 'committer_restriction_checkbox' }, disabled: !can_change_push_rule?(form.object, :commit_committer_check, context) },
help_text: commit_committer_check_description(push_rule)
......@@ -3,27 +3,24 @@
- wiki_syntax_link_url = 'https://github.com/google/re2/wiki/Syntax'
- wiki_syntax_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: wiki_syntax_link_url }
.form-check
= f.check_box :deny_delete_tag, class: "form-check-input", data: { qa_selector: 'deny_delete_tag_checkbox' }
= f.label :deny_delete_tag, class: "label-bold form-check-label" do
= s_("PushRules|Do not allow users to remove Git tags with %{code_block_start}git push%{code_block_end}").html_safe % { code_block_start: '<code>'.html_safe, code_block_end: '</code>'.html_safe }
- secret_files_link_url = help_page_path('user/project/repository/push_rules', anchor: 'prevent-pushing-secrets-to-the-repository')
- secret_files_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: secret_files_link_url }
%p.text-muted
= s_('PushRules|Users can still delete tags through the GitLab UI.')
.form-check
= f.check_box :member_check, class: "form-check-input", data: { qa_selector: 'restrict_author_checkbox' }
= f.label :member_check, "Check whether the commit author is a GitLab user", class: "label-bold form-check-label"
%p.text-muted
= s_('PushRules|Restrict commits to existing GitLab users.')
= f.gitlab_ui_checkbox_component :deny_delete_tag,
s_("PushRules|Do not allow users to remove Git tags with %{code_block_start}git push%{code_block_end}").html_safe % { code_block_start: '<code>'.html_safe, code_block_end: '</code>'.html_safe },
checkbox_options: { data: { qa_selector: 'deny_delete_tag_checkbox' } },
help_text: s_('PushRules|Users can still delete tags through the GitLab UI.')
.form-check
= f.check_box :prevent_secrets, class: "form-check-input", data: { qa_selector: 'prevent_secrets_checkbox' }
= f.label :prevent_secrets, "Prevent pushing secret files", class: "label-bold form-check-label"
%p.text-muted
- secret_files_link_url = help_page_path('user/project/repository/push_rules', anchor: 'prevent-pushing-secrets-to-the-repository')
- secret_files_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: secret_files_link_url }
= s_("PushRules|Reject any files likely to contain secrets. %{secret_files_link_start}What secret files are rejected?%{secret_files_link_end}").html_safe % { secret_files_link_start: secret_files_link_start, secret_files_link_end: '</a>'.html_safe }
= f.gitlab_ui_checkbox_component :member_check,
"Check whether the commit author is a GitLab user",
checkbox_options: { data: { qa_selector: 'restrict_author_checkbox' } },
help_text: s_('PushRules|Restrict commits to existing GitLab users.')
= f.gitlab_ui_checkbox_component :prevent_secrets,
"Prevent pushing secret files",
checkbox_options: { data: { qa_selector: 'prevent_secrets_checkbox' } },
help_text: s_("PushRules|Reject any files likely to contain secrets. %{secret_files_link_start}What secret files are rejected?%{secret_files_link_end}").html_safe % { secret_files_link_start: secret_files_link_start, secret_files_link_end: '</a>'.html_safe }
.form-group
= f.label :commit_message_regex, "Require expression in commit messages", class: "label-bold"
......
......@@ -5,9 +5,7 @@
- form = local_assigns.fetch(:form)
- push_rule = local_assigns.fetch(:push_rule)
.form-check
= form.check_box :reject_unsigned_commits, class: "form-check-input", disabled: !can_change_push_rule?(form.object, :reject_unsigned_commits, context), data: { qa_selector: 'reject_unsigned_commits_checkbox' }
= form.label :reject_unsigned_commits, class: "label-bold form-check-label" do
Reject unsigned commits
%p.text-muted
= reject_unsigned_commits_description(push_rule)
= form.gitlab_ui_checkbox_component :reject_unsigned_commits,
"Reject unsigned commits",
checkbox_options: { data: { qa_selector: 'reject_unsigned_commits_checkbox' }, disabled: !can_change_push_rule?(form.object, :reject_unsigned_commits, context) },
help_text: 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