2018-02-27 19:10:43 -05:00
|
|
|
- @gfm_form = true
|
2020-09-02 05:10:23 -04:00
|
|
|
- @content_class = "merge-request-container#{' limit-container-width' unless fluid_layout}"
|
2020-06-22 08:08:47 -04:00
|
|
|
- add_to_breadcrumbs _("Merge Requests"), project_merge_requests_path(@project)
|
2017-08-17 05:42:04 -04:00
|
|
|
- breadcrumb_title @merge_request.to_reference
|
2020-06-22 08:08:47 -04:00
|
|
|
- page_title "#{@merge_request.title} (#{@merge_request.to_reference})", _("Merge Requests")
|
2020-10-01 02:09:59 -04:00
|
|
|
- page_description @merge_request.description_html
|
2018-04-16 11:09:19 -04:00
|
|
|
- page_card_attributes @merge_request.card_attributes
|
2018-12-17 16:58:00 -05:00
|
|
|
- suggest_changes_help_path = help_page_path('user/discussions/index.md', anchor: 'suggest-changes')
|
2019-08-28 17:09:22 -04:00
|
|
|
- number_of_pipelines = @pipelines.size
|
2020-07-16 14:09:35 -04:00
|
|
|
- mr_action = j(params[:tab].presence || 'show')
|
2020-10-13 05:08:27 -04:00
|
|
|
- add_page_specific_style 'page_bundles/merge_requests'
|
2020-10-07 08:09:12 -04:00
|
|
|
- add_page_specific_style 'page_bundles/pipelines'
|
2020-10-08 23:08:25 -04:00
|
|
|
- add_page_specific_style 'page_bundles/reports'
|
2020-10-23 05:08:41 -04:00
|
|
|
- add_page_specific_style 'page_bundles/ci_status'
|
2018-02-27 19:10:43 -05:00
|
|
|
|
2020-07-16 14:09:35 -04: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 18:12:31 -04: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 10:44:13 -04:00
|
|
|
%ul.merge-request-tabs.nav-tabs.nav.nav-links
|
2019-12-02 22:06:35 -05:00
|
|
|
= render "projects/merge_requests/tabs/tab", class: "notes-tab", qa_selector: "notes_tab" do
|
2019-06-06 10:44:13 -04:00
|
|
|
= tab_link_for @merge_request, :show, force_link: @commit.present? do
|
2020-08-20 05:09:55 -04:00
|
|
|
= _("Overview")
|
2019-06-06 10:44:13 -04:00
|
|
|
%span.badge.badge-pill= @merge_request.related_notes.user.count
|
|
|
|
- if @merge_request.source_project
|
2019-12-02 22:06:35 -05:00
|
|
|
= render "projects/merge_requests/tabs/tab", name: "commits", class: "commits-tab" do
|
2019-06-06 10:44:13 -04:00
|
|
|
= tab_link_for @merge_request, :commits do
|
|
|
|
= _("Commits")
|
|
|
|
%span.badge.badge-pill= @commits_count
|
2019-08-28 17:09:22 -04:00
|
|
|
- if number_of_pipelines.nonzero?
|
2019-12-02 22:06:35 -05:00
|
|
|
= render "projects/merge_requests/tabs/tab", name: "pipelines", class: "pipelines-tab" do
|
2019-06-06 10:44:13 -04:00
|
|
|
= tab_link_for @merge_request, :pipelines do
|
|
|
|
= _("Pipelines")
|
2019-08-28 17:09:22 -04:00
|
|
|
%span.badge.badge-pill.js-pipelines-mr-count= number_of_pipelines
|
2019-12-02 22:06:35 -05:00
|
|
|
= render "projects/merge_requests/tabs/tab", name: "diffs", class: "diffs-tab qa-diffs-tab", id: "diffs-tab" do
|
2019-06-06 10:44:13 -04:00
|
|
|
= tab_link_for @merge_request, :diffs do
|
|
|
|
= _("Changes")
|
|
|
|
%span.badge.badge-pill= @merge_request.diff_size
|
|
|
|
.d-flex.flex-wrap.align-items-center.justify-content-lg-end
|
2018-10-23 05:49:45 -04:00
|
|
|
#js-vue-discussion-counter
|
2017-06-13 18:12:31 -04:00
|
|
|
|
|
|
|
.tab-content#diff-notes-app
|
2019-01-16 10:17:10 -05:00
|
|
|
#js-diff-file-finder
|
2020-04-09 02:09:30 -04:00
|
|
|
#js-code-navigation
|
2019-12-02 22:06:35 -05:00
|
|
|
= render "projects/merge_requests/tabs/pane", id: "notes", class: "notes voting_notes" do
|
2017-06-13 18:12:31 -04:00
|
|
|
.row
|
|
|
|
%section.col-md-12
|
2018-02-27 19:10:43 -05: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 05:09:55 -04: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 04:09:13 -05:00
|
|
|
- if mr_action === "show"
|
2021-02-04 07:09:25 -05: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-01-14 16:10:37 -05:00
|
|
|
- add_page_startup_api_call widget_project_json_merge_request_path(@project, @merge_request, format: :json)
|
|
|
|
- add_page_startup_api_call cached_widget_project_json_merge_request_path(@project, @merge_request, format: :json)
|
2021-02-04 07:09:25 -05:00
|
|
|
#js-vue-mr-discussions{ data: { notes_data: notes_data(@merge_request, Feature.enabled?(:paginated_notes, @project)).to_json,
|
2019-08-28 17:09:22 -04:00
|
|
|
noteable_data: serialize_issuable(@merge_request, serializer: 'noteable'),
|
2018-06-21 08:22:40 -04:00
|
|
|
noteable_type: 'MergeRequest',
|
|
|
|
target_type: 'merge_request',
|
2018-12-17 16:58:00 -05:00
|
|
|
help_page_path: suggest_changes_help_path,
|
2020-07-24 05:09:41 -04:00
|
|
|
current_user_data: @current_user_data,
|
|
|
|
is_locked: @merge_request.discussion_locked.to_s } }
|
2017-06-13 18:12:31 -04:00
|
|
|
|
2019-12-02 22:06:35 -05:00
|
|
|
= render "projects/merge_requests/tabs/pane", name: "commits", id: "commits", class: "commits" do
|
2017-06-13 18:12:31 -04:00
|
|
|
-# This tab is always loaded via AJAX
|
2019-12-02 22:06:35 -05:00
|
|
|
= render "projects/merge_requests/tabs/pane", name: "pipelines", id: "pipelines", class: "pipelines" do
|
2019-08-28 17:09:22 -04:00
|
|
|
- if number_of_pipelines.nonzero?
|
2017-06-29 13:06:35 -04:00
|
|
|
= render 'projects/commit/pipelines_list', disable_initialization: true, endpoint: pipelines_project_merge_request_path(@project, @merge_request)
|
2020-07-16 14:09:35 -04:00
|
|
|
- if mr_action === "diffs"
|
|
|
|
- add_page_startup_api_call @endpoint_metadata_url
|
2020-09-16 02:09:24 -04:00
|
|
|
- params = request.query_parameters
|
2021-02-16 13:09:24 -05:00
|
|
|
- if Feature.enabled?(:default_merge_ref_for_diffs, @project, default_enabled: :yaml)
|
2020-09-16 02:09:24 -04:00
|
|
|
- params = params.merge(diff_head: true)
|
2019-12-02 22:06:35 -05:00
|
|
|
= render "projects/merge_requests/tabs/pane", name: "diffs", id: "js-diffs-app", class: "diffs", data: { "is-locked": @merge_request.discussion_locked?,
|
2020-09-16 02:09:24 -04:00
|
|
|
endpoint: diffs_project_merge_request_path(@project, @merge_request, 'json', params),
|
2020-07-16 14:09:35 -04:00
|
|
|
endpoint_metadata: @endpoint_metadata_url,
|
2020-09-16 02:09:24 -04:00
|
|
|
endpoint_batch: diffs_batch_project_json_merge_request_path(@project, @merge_request, 'json', params),
|
2020-03-17 14:09:44 -04:00
|
|
|
endpoint_coverage: @coverage_path,
|
2018-12-17 16:58:00 -05:00
|
|
|
help_page_path: suggest_changes_help_path,
|
2019-08-28 17:09:22 -04:00
|
|
|
current_user_data: @current_user_data,
|
2018-12-13 05:57:45 -05:00
|
|
|
project_path: project_path(@merge_request.project),
|
2019-04-12 04:32:05 -04:00
|
|
|
changes_empty_state_illustration: image_path('illustrations/merge_request_changes_empty.svg'),
|
2019-06-14 09:01:24 -04:00
|
|
|
is_fluid_layout: fluid_layout.to_s,
|
|
|
|
dismiss_endpoint: user_callouts_path,
|
2019-09-16 05:06:25 -04:00
|
|
|
show_suggest_popover: show_suggest_popover?.to_s,
|
2020-07-15 02:09:35 -04:00
|
|
|
show_whitespace_default: @show_whitespace_default.to_s,
|
2021-01-19 07:10:46 -05:00
|
|
|
file_by_file_default: @file_by_file_default.to_s,
|
|
|
|
default_suggestion_commit_message: default_suggestion_commit_message }
|
2017-06-13 18:12:31 -04:00
|
|
|
|
|
|
|
.mr-loading-status
|
2020-02-13 07:08:49 -05:00
|
|
|
.loading.hide
|
|
|
|
.spinner.spinner-md
|
2017-06-13 18:12:31 -04:00
|
|
|
|
2020-09-29 05:09:49 -04: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 11:53:16 -05:00
|
|
|
|
2017-06-13 18:12:31 -04:00
|
|
|
- if @merge_request.can_be_reverted?(current_user)
|
2021-02-05 16:09:19 -05:00
|
|
|
= render "projects/commit/change", type: 'revert', commit: @merge_request.merge_commit
|
2017-06-13 18:12:31 -04:00
|
|
|
- if @merge_request.can_be_cherry_picked?
|
2021-02-05 16:09:19 -05:00
|
|
|
= render "projects/commit/change", type: 'cherry-pick', commit: @merge_request.merge_commit
|
2020-06-01 02:08:21 -04:00
|
|
|
|
|
|
|
#js-review-bar
|