Commit 7a4e82b1 authored by Artur Fedorov's avatar Artur Fedorov

This MR replaces generic checkbox

This MR replaces generic checkbox with GitLab UI styled checkbox

Changelog: changed
MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/84848
EE: true
parent a0491ce9
= 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? - if @push_rule.errors.any?
.gl-alert.gl-alert-danger .gl-alert.gl-alert-danger
- @push_rule.errors.full_messages.each do |msg| - @push_rule.errors.full_messages.each do |msg|
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
%hr.clearfix %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? - if @push_rule.errors.any?
.gl-alert.gl-alert-danger .gl-alert.gl-alert-danger
- @push_rule.errors.full_messages.each do |msg| - @push_rule.errors.full_messages.each do |msg|
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
.settings-content .settings-content
%h5 %h5
= s_('PushRules|Select push rules') = 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) = form_errors(@push_rule)
= render "shared/push_rules/form", f: f, context: @project = render "shared/push_rules/form", f: f, context: @project
...@@ -5,9 +5,8 @@ ...@@ -5,9 +5,8 @@
- 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-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.gitlab_ui_checkbox_component :commit_committer_check,
= form.label :commit_committer_check, class: "label-bold form-check-label" do s_("PushRule|Reject unverified users"),
= s_("PushRule|Reject unverified users") checkbox_options: { data: { qa_selector: 'committer_restriction_checkbox' }, disabled: !can_change_push_rule?(form.object, :commit_committer_check, context) },
%p.text-muted help_text: commit_committer_check_description(push_rule)
= commit_committer_check_description(push_rule)
...@@ -3,27 +3,24 @@ ...@@ -3,27 +3,24 @@
- wiki_syntax_link_url = 'https://github.com/google/re2/wiki/Syntax' - 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 } - wiki_syntax_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: wiki_syntax_link_url }
.form-check - secret_files_link_url = help_page_path('user/project/repository/push_rules', anchor: 'prevent-pushing-secrets-to-the-repository')
= f.check_box :deny_delete_tag, class: "form-check-input", data: { qa_selector: 'deny_delete_tag_checkbox' } - secret_files_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: secret_files_link_url }
= 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 }
%p.text-muted
= s_('PushRules|Users can still delete tags through the GitLab UI.')
.form-check = f.gitlab_ui_checkbox_component :deny_delete_tag,
= f.check_box :member_check, class: "form-check-input", data: { qa_selector: 'restrict_author_checkbox' } 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 },
= f.label :member_check, "Check whether the commit author is a GitLab user", class: "label-bold form-check-label" checkbox_options: { data: { qa_selector: 'deny_delete_tag_checkbox' } },
%p.text-muted help_text: s_('PushRules|Users can still delete tags through the GitLab UI.')
= s_('PushRules|Restrict commits to existing GitLab users.')
.form-check = f.gitlab_ui_checkbox_component :member_check,
= f.check_box :prevent_secrets, class: "form-check-input", data: { qa_selector: 'prevent_secrets_checkbox' } "Check whether the commit author is a GitLab user",
= f.label :prevent_secrets, "Prevent pushing secret files", class: "label-bold form-check-label" checkbox_options: { data: { qa_selector: 'restrict_author_checkbox' } },
%p.text-muted help_text: s_('PushRules|Restrict commits to existing GitLab users.')
- 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 } = f.gitlab_ui_checkbox_component :prevent_secrets,
= 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 } "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 .form-group
= f.label :commit_message_regex, "Require expression in commit messages", class: "label-bold" = f.label :commit_message_regex, "Require expression in commit messages", class: "label-bold"
......
...@@ -5,9 +5,7 @@ ...@@ -5,9 +5,7 @@
- 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-check = form.gitlab_ui_checkbox_component :reject_unsigned_commits,
= 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' } "Reject unsigned commits",
= form.label :reject_unsigned_commits, class: "label-bold form-check-label" do checkbox_options: { data: { qa_selector: 'reject_unsigned_commits_checkbox' }, disabled: !can_change_push_rule?(form.object, :reject_unsigned_commits, context) },
Reject unsigned commits help_text: reject_unsigned_commits_description(push_rule)
%p.text-muted
= 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