2018-02-28 00:10:43 +00:00
|
|
|
- @gfm_form = true
|
2020-09-02 09:10:23 +00:00
|
|
|
- @content_class = "merge-request-container#{' limit-container-width' unless fluid_layout}"
|
2021-03-30 15:11:08 +00:00
|
|
|
- add_to_breadcrumbs _("Merge requests"), project_merge_requests_path(@project)
|
2017-08-17 09:42:04 +00:00
|
|
|
- breadcrumb_title @merge_request.to_reference
|
2021-03-30 15:11:08 +00:00
|
|
|
- page_title "#{@merge_request.title} (#{@merge_request.to_reference})", _("Merge requests")
|
2020-10-01 06:09:59 +00:00
|
|
|
- page_description @merge_request.description_html
|
2018-04-16 15:09:19 +00:00
|
|
|
- page_card_attributes @merge_request.card_attributes
|
2021-05-04 21:10:01 +00:00
|
|
|
- suggest_changes_help_path = help_page_path('user/project/merge_requests/reviews/suggestions.md')
|
2019-08-28 21:09:22 +00:00
|
|
|
- number_of_pipelines = @pipelines.size
|
2020-07-16 18:09:35 +00:00
|
|
|
- mr_action = j(params[:tab].presence || 'show')
|
2020-10-13 09:08:27 +00:00
|
|
|
- add_page_specific_style 'page_bundles/merge_requests'
|
2020-10-07 12:09:12 +00:00
|
|
|
- add_page_specific_style 'page_bundles/pipelines'
|
2020-10-09 03:08:25 +00:00
|
|
|
- add_page_specific_style 'page_bundles/reports'
|
2020-10-23 09:08:41 +00:00
|
|
|
- add_page_specific_style 'page_bundles/ci_status'
|
2018-02-28 00:10:43 +00:00
|
|
|
|
2021-03-17 18:09:01 +00:00
|
|
|
- add_page_startup_api_call @endpoint_metadata_url
|
|
|
|
|
2020-07-16 18:09:35 +00:00
|
|
|
.merge-request{ data: { mr_action: mr_action, url: merge_request_path(@merge_request, format: :json), project_path: project_path(@merge_request.project), lock_version: @merge_request.lock_version } }
|
2017-06-13 22:12:31 +00:00
|
|
|
= render "projects/merge_requests/mr_title"
|
|
|
|
|
|
|
|
.merge-request-details.issuable-details{ data: { id: @merge_request.project.id } }
|
|
|
|
= render "projects/merge_requests/mr_box"
|
|
|
|
.merge-request-tabs-holder{ class: ("js-tabs-affix" unless ENV['RAILS_ENV'] == 'test') }
|
|
|
|
.merge-request-tabs-container
|
2019-06-06 14:44:13 +00:00
|
|
|
%ul.merge-request-tabs.nav-tabs.nav.nav-links
|
2019-12-03 03:06:35 +00:00
|
|
|
= render "projects/merge_requests/tabs/tab", class: "notes-tab", qa_selector: "notes_tab" do
|
2019-06-06 14:44:13 +00:00
|
|
|
= tab_link_for @merge_request, :show, force_link: @commit.present? do
|
2020-08-20 09:09:55 +00:00
|
|
|
= _("Overview")
|
2021-04-19 18:09:09 +00:00
|
|
|
%span.badge.badge-pill.gl-badge.badge-muted.sm= @merge_request.related_notes.user.count
|
2019-06-06 14:44:13 +00:00
|
|
|
- if @merge_request.source_project
|
2021-04-06 03:09:02 +00:00
|
|
|
= render "projects/merge_requests/tabs/tab", name: "commits", class: "commits-tab", qa_selector: "commits_tab" do
|
2019-06-06 14:44:13 +00:00
|
|
|
= tab_link_for @merge_request, :commits do
|
|
|
|
= _("Commits")
|
2021-04-19 18:09:09 +00:00
|
|
|
%span.badge.badge-pill.gl-badge.badge-muted.sm= @commits_count
|
2019-08-28 21:09:22 +00:00
|
|
|
- if number_of_pipelines.nonzero?
|
2019-12-03 03:06:35 +00:00
|
|
|
= render "projects/merge_requests/tabs/tab", name: "pipelines", class: "pipelines-tab" do
|
2019-06-06 14:44:13 +00:00
|
|
|
= tab_link_for @merge_request, :pipelines do
|
|
|
|
= _("Pipelines")
|
2021-04-19 18:09:09 +00:00
|
|
|
%span.badge.badge-pill.gl-badge.badge-muted.sm.js-pipelines-mr-count= number_of_pipelines
|
2021-03-15 21:09:16 +00:00
|
|
|
= render "projects/merge_requests/tabs/tab", name: "diffs", class: "diffs-tab", id: "diffs-tab", qa_selector: "diffs_tab" do
|
2019-06-06 14:44:13 +00:00
|
|
|
= tab_link_for @merge_request, :diffs do
|
|
|
|
= _("Changes")
|
2021-04-29 15:10:07 +00:00
|
|
|
%span.badge.badge-pill.gl-badge.badge-muted.sm= @diffs_count
|
2019-06-06 14:44:13 +00:00
|
|
|
.d-flex.flex-wrap.align-items-center.justify-content-lg-end
|
2018-10-23 09:49:45 +00:00
|
|
|
#js-vue-discussion-counter
|
2017-06-13 22:12:31 +00:00
|
|
|
|
|
|
|
.tab-content#diff-notes-app
|
2019-01-16 15:17:10 +00:00
|
|
|
#js-diff-file-finder
|
2020-04-09 06:09:30 +00:00
|
|
|
#js-code-navigation
|
2019-12-03 03:06:35 +00:00
|
|
|
= render "projects/merge_requests/tabs/pane", id: "notes", class: "notes voting_notes" do
|
2017-06-13 22:12:31 +00:00
|
|
|
.row
|
|
|
|
%section.col-md-12
|
2018-02-28 00:10:43 +00:00
|
|
|
%script.js-notes-data{ type: "application/json" }= initial_notes_data(true).to_json.html_safe
|
|
|
|
.issuable-discussion.js-vue-notes-event
|
2020-08-20 09:09:55 +00:00
|
|
|
- if @merge_request.description.present?
|
|
|
|
.detail-page-description
|
|
|
|
= render "projects/merge_requests/description"
|
|
|
|
= render "projects/merge_requests/widget"
|
|
|
|
= render "projects/merge_requests/awards_block"
|
2020-11-23 09:09:13 +00:00
|
|
|
- if mr_action === "show"
|
2021-02-04 12:09:25 +00:00
|
|
|
- if Feature.enabled?(:paginated_notes, @project)
|
|
|
|
- add_page_startup_api_call notes_url
|
|
|
|
- else
|
|
|
|
- add_page_startup_api_call discussions_path(@merge_request)
|
2021-06-16 12:10:18 +00:00
|
|
|
- add_page_startup_api_call widget_project_json_merge_request_path(@project, @merge_request, format: :json)
|
2021-01-14 21:10:37 +00:00
|
|
|
- add_page_startup_api_call cached_widget_project_json_merge_request_path(@project, @merge_request, format: :json)
|
2021-02-04 12:09:25 +00:00
|
|
|
#js-vue-mr-discussions{ data: { notes_data: notes_data(@merge_request, Feature.enabled?(:paginated_notes, @project)).to_json,
|
2021-03-17 18:09:01 +00:00
|
|
|
endpoint_metadata: @endpoint_metadata_url,
|
2019-08-28 21:09:22 +00:00
|
|
|
noteable_data: serialize_issuable(@merge_request, serializer: 'noteable'),
|
2018-06-21 12:22:40 +00:00
|
|
|
noteable_type: 'MergeRequest',
|
|
|
|
target_type: 'merge_request',
|
2018-12-17 21:58:00 +00:00
|
|
|
help_page_path: suggest_changes_help_path,
|
2020-07-24 09:09:41 +00:00
|
|
|
current_user_data: @current_user_data,
|
|
|
|
is_locked: @merge_request.discussion_locked.to_s } }
|
2017-06-13 22:12:31 +00:00
|
|
|
|
2019-12-03 03:06:35 +00:00
|
|
|
= render "projects/merge_requests/tabs/pane", name: "commits", id: "commits", class: "commits" do
|
2017-06-13 22:12:31 +00:00
|
|
|
-# This tab is always loaded via AJAX
|
2019-12-03 03:06:35 +00:00
|
|
|
= render "projects/merge_requests/tabs/pane", name: "pipelines", id: "pipelines", class: "pipelines" do
|
2019-08-28 21:09:22 +00:00
|
|
|
- if number_of_pipelines.nonzero?
|
2017-06-29 17:06:35 +00:00
|
|
|
= render 'projects/commit/pipelines_list', disable_initialization: true, endpoint: pipelines_project_merge_request_path(@project, @merge_request)
|
2020-09-16 06:09:24 +00:00
|
|
|
- params = request.query_parameters
|
2021-02-16 18:09:24 +00:00
|
|
|
- if Feature.enabled?(:default_merge_ref_for_diffs, @project, default_enabled: :yaml)
|
2020-09-16 06:09:24 +00:00
|
|
|
- params = params.merge(diff_head: true)
|
2021-04-03 00:09:02 +00:00
|
|
|
= render "projects/merge_requests/tabs/pane", name: "diffs", id: "js-diffs-app", class: "diffs", data: diffs_tab_pane_data(@project, @merge_request, params)
|
2017-06-13 22:12:31 +00:00
|
|
|
|
|
|
|
.mr-loading-status
|
2020-02-13 12:08:49 +00:00
|
|
|
.loading.hide
|
2021-04-29 21:10:03 +00:00
|
|
|
.gl-spinner.gl-spinner-md
|
2017-06-13 22:12:31 +00:00
|
|
|
|
2020-09-29 09:09:49 +00:00
|
|
|
= render 'shared/issuable/sidebar', issuable_sidebar: @issuable_sidebar, assignees: @merge_request.assignees, reviewers: @merge_request.reviewers, source_branch: @merge_request.source_branch
|
2018-11-27 16:53:16 +00:00
|
|
|
|
2017-06-13 22:12:31 +00:00
|
|
|
- if @merge_request.can_be_reverted?(current_user)
|
2021-02-05 21:09:19 +00:00
|
|
|
= render "projects/commit/change", type: 'revert', commit: @merge_request.merge_commit
|
2017-06-13 22:12:31 +00:00
|
|
|
- if @merge_request.can_be_cherry_picked?
|
2021-02-05 21:09:19 +00:00
|
|
|
= render "projects/commit/change", type: 'cherry-pick', commit: @merge_request.merge_commit
|
2020-06-01 06:08:21 +00:00
|
|
|
|
|
|
|
#js-review-bar
|
2021-03-16 15:11:17 +00:00
|
|
|
|
2021-06-24 18:07:15 +00:00
|
|
|
= render 'projects/invite_members_modal', project: @project
|
2021-08-14 00:10:05 +00:00
|
|
|
- if Gitlab::CurrentSettings.gitpod_enabled && !current_user&.gitpod_enabled
|
|
|
|
= render 'shared/gitpod/enable_gitpod_modal'
|