Commit 8d2e4071 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'create-suggested-approvers-partial' into 'master'

Utilize approver suggestion partial

See merge request gitlab-org/gitlab!47976
parents e03602a1 3ac9d96a
- issuable = local_assigns.fetch(:issuable)
- presenter = local_assigns.fetch(:presenter)
- form = local_assigns.fetch(:form)
- return unless issuable.is_a?(MergeRequest)
- return unless issuable.approval_feature_available?
- can_update_approvers = can?(current_user, :update_approvers, issuable)
.form-group.row
.col-sm-2.col-form-label
= form.label :approver_ids, "Approval rules"
.col-sm-10
#js-mr-approvals-input{ data: { 'project_id': @target_project.id,
'can_edit': can?(current_user, :update_approvers, issuable).to_s,
'allow_multi_rule': @target_project.multiple_approval_rules_available?.to_s,
'mr_id': issuable.iid,
'mr_settings_path': presenter.api_approval_settings_path,
'eligible_approvers_docs_path': help_page_path('user/project/merge_requests/merge_request_approvals', anchor: 'eligible-approvers'),
'project_settings_path': presenter.api_project_approval_settings_path } }
= sprite_icon('spinner', size: 24, css_class: 'gl-spinner')
- if can_update_approvers
- approver_presenter = MergeRequestApproverPresenter.new(issuable, skip_user: current_user)
.form-text.text-muted.suggested-approvers
- if approver_presenter.any?
Suggested approvers:
= approver_presenter.render
- if approver_presenter.show_code_owner_tips?
.form-text.text-muted
Tip: add a
= link_to 'CODEOWNERS', help_page_path('user/project/code_owners'), target: '_blank', tabindex: -1
to automatically add approvers based on file paths and file types.
= render 'projects/merge_requests/code_owner_approval_rules', merge_request: @mr_presenter
= render_if_exists 'shared/issuable/approver_suggestion', issuable: issuable, presenter: presenter
- issuable = local_assigns.fetch(:issuable)
- presenter = local_assigns.fetch(:presenter)
- can_update_approvers = can?(current_user, :update_approvers, issuable)
#js-mr-approvals-input{ data: { 'project_id': @target_project.id,
'can_edit': can?(current_user, :update_approvers, issuable).to_s,
'allow_multi_rule': @target_project.multiple_approval_rules_available?.to_s,
'mr_id': issuable.iid,
'mr_settings_path': presenter.api_approval_settings_path,
'eligible_approvers_docs_path': help_page_path('user/project/merge_requests/merge_request_approvals', anchor: 'eligible-approvers'),
'project_settings_path': presenter.api_project_approval_settings_path } }
= sprite_icon('spinner', size: 24, css_class: 'gl-spinner')
- if can_update_approvers
- approver_presenter = MergeRequestApproverPresenter.new(issuable, skip_user: current_user)
.form-text.text-muted.suggested-approvers
- if approver_presenter.any?
Suggested approvers:
= approver_presenter.render
- if approver_presenter.show_code_owner_tips?
.form-text.text-muted
= _('Tip: add a')
= link_to 'CODEOWNERS', help_page_path('user/project/code_owners'), target: '_blank', tabindex: -1
= _('to automatically add approvers based on file paths and file types.')
= render 'projects/merge_requests/code_owner_approval_rules', merge_request: @mr_presenter
......@@ -28377,6 +28377,9 @@ msgstr ""
msgid "Tip:"
msgstr ""
msgid "Tip: add a"
msgstr ""
msgid "Title"
msgstr ""
......@@ -33041,6 +33044,9 @@ msgstr ""
msgid "time summary"
msgstr ""
msgid "to automatically add approvers based on file paths and file types."
msgstr ""
msgid "to help your contributors communicate effectively!"
msgstr ""
......
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