Commit 679e9426 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '358349-metadata-checkbox-migration' into 'master'

Migrate metadata checkbox to pajamas component

See merge request gitlab-org/gitlab!84834
parents 960243b9 fb6c88ab
= form_for [@project, @issue], = gitlab_ui_form_for [@project, @issue],
html: { class: 'issue-form common-note-form gl-mt-3 js-quick-submit gl-show-field-errors', data: issues_form_data(@project) } do |f| html: { class: 'issue-form common-note-form gl-mt-3 js-quick-submit gl-show-field-errors', data: issues_form_data(@project) } do |f|
= render 'shared/issuable/form', f: f, issuable: @issue = render 'shared/issuable/form', f: f, issuable: @issue
= form_for [@project, @merge_request], = gitlab_ui_form_for [@project, @merge_request],
html: { class: 'merge-request-form common-note-form js-requires-input js-quick-submit' } do |f| html: { class: 'merge-request-form common-note-form js-requires-input js-quick-submit' } do |f|
= render 'shared/issuable/form', f: f, issuable: @merge_request, presenter: @mr_presenter = render 'shared/issuable/form', f: f, issuable: @merge_request, presenter: @mr_presenter
%h3.page-title %h3.page-title
= _('New merge request') = _('New merge request')
= form_for [@project, @merge_request], html: { class: 'merge-request-form common-note-form js-requires-input js-quick-submit' } do |f| = gitlab_ui_form_for [@project, @merge_request], html: { class: 'merge-request-form common-note-form js-requires-input js-quick-submit' } do |f|
= render 'shared/issuable/form', f: f, issuable: @merge_request, commits: @commits, presenter: @mr_presenter = render 'shared/issuable/form', f: f, issuable: @merge_request, commits: @commits, presenter: @mr_presenter
= f.hidden_field :source_project_id = f.hidden_field :source_project_id
= f.hidden_field :source_branch = f.hidden_field :source_branch
......
- issuable = local_assigns.fetch(:issuable) - issuable = local_assigns.fetch(:issuable)
- form = local_assigns.fetch(:form) - form = local_assigns.fetch(:form)
- contribution_help_link = help_page_path('user/project/merge_requests/allow_collaboration')
- contribution_help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: contribution_help_link }
- return unless issuable.is_a?(MergeRequest) - return unless issuable.is_a?(MergeRequest)
- return unless issuable.for_fork? - return unless issuable.for_fork?
...@@ -11,10 +13,7 @@ ...@@ -11,10 +13,7 @@
%label.col-form-label.col-sm-2 %label.col-form-label.col-sm-2
= _('Contribution') = _('Contribution')
.col-sm-10 .col-sm-10
.form-check.gl-mt-2 = form.gitlab_ui_checkbox_component :allow_collaboration,
= form.check_box :allow_collaboration, disabled: !issuable.can_allow_collaboration?(current_user), class: 'form-check-input' _('Allow commits from members who can merge to the target branch. %{link_start}About this feature.%{link_end}').html_safe % { link_start: contribution_help_link_start, link_end: '</a>'.html_safe },
= form.label :allow_collaboration, class: 'form-check-label' do checkbox_options: { disabled: !issuable.can_allow_collaboration?(current_user) },
= _('Allow commits from members who can merge to the target branch.') help_text: allow_collaboration_unavailable_reason(issuable)
= link_to 'About this feature', help_page_path('user/project/merge_requests/allow_collaboration'), target: '_blank', rel: 'noopener noreferrer nofollow'
.form-text.text-muted
= allow_collaboration_unavailable_reason(issuable)
...@@ -17,10 +17,8 @@ ...@@ -17,10 +17,8 @@
- if issuable.respond_to?(:confidential) && can?(current_user, :set_confidentiality, issuable) - if issuable.respond_to?(:confidential) && can?(current_user, :set_confidentiality, issuable)
.form-group.row .form-group.row
.offset-sm-2.col-sm-10 .offset-sm-2.col-sm-10
.form-check = form.gitlab_ui_checkbox_component :confidential,
= form.check_box :confidential, class: 'form-check-input' _('This issue is confidential and should only be visible to team members with at least Reporter access.')
= form.label :confidential, class: 'form-check-label' do
#{_('This issue is confidential and should only be visible to team members with at least Reporter access.')}
- if can?(current_user, :"set_#{issuable.to_ability_name}_metadata", issuable) - if can?(current_user, :"set_#{issuable.to_ability_name}_metadata", issuable)
%hr %hr
......
...@@ -3675,7 +3675,7 @@ msgstr "" ...@@ -3675,7 +3675,7 @@ msgstr ""
msgid "Allow access to the following IP addresses" msgid "Allow access to the following IP addresses"
msgstr "" msgstr ""
msgid "Allow commits from members who can merge to the target branch." msgid "Allow commits from members who can merge to the target branch. %{link_start}About this feature.%{link_end}"
msgstr "" msgstr ""
msgid "Allow group owners to manage LDAP-related settings" msgid "Allow group owners to manage LDAP-related settings"
......
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