diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-05-09 04:15:34 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2017-05-09 04:15:34 +0000 |
commit | 0151325dacebb99d54b6effb1d5842c0c712168c (patch) | |
tree | 767ea3c8cfeedab5a0ce1921d5842b149ea7c0be /app/views/projects/merge_requests | |
parent | 9ada13d343a4736275d2c026ee980abe5c5e5763 (diff) | |
download | gitlab-ce-0151325dacebb99d54b6effb1d5842c0c712168c.tar.gz |
Merge request widget redesign
Diffstat (limited to 'app/views/projects/merge_requests')
25 files changed, 13 insertions, 471 deletions
diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml index 9e306d4543c..25b8567b78f 100644 --- a/app/views/projects/merge_requests/_show.html.haml +++ b/app/views/projects/merge_requests/_show.html.haml @@ -1,6 +1,6 @@ - @content_class = "limit-container-width" unless fluid_layout -- page_title "#{@merge_request.title} (#{@merge_request.to_reference})", "Merge Requests" -- page_description @merge_request.description +- page_title "#{@merge_request.title} (#{@merge_request.to_reference})", "Merge Requests" +- page_description @merge_request.description - page_card_attributes @merge_request.card_attributes - content_for :page_specific_javascripts do = page_specific_javascript_bundle_tag('common_vue') @@ -11,42 +11,17 @@ .merge-request-details.issuable-details{ data: { id: @merge_request.project.id } } = render "projects/merge_requests/show/mr_box" - .append-bottom-default.mr-source-target.prepend-top-default - - if @merge_request.open? - .pull-right - - if @merge_request.source_branch_exists? - - if koding_enabled? && @repository.koding_yml - = link_to koding_project_url(@merge_request.source_project, @merge_request.source_branch, @merge_request.commits.first.short_id), class: "btn inline btn-grouped btn-sm", target: '_blank', rel: 'noopener noreferrer' do - Run in IDE (Koding) - = link_to "#modal_merge_info", class: "btn inline btn-grouped btn-sm", "data-toggle" => "modal" do - Check out branch - - %span.dropdown.inline.prepend-left-5 - %a.btn.btn-sm.dropdown-toggle{ data: {toggle: :dropdown} } - Download as - = icon('caret-down') - %ul.dropdown-menu.dropdown-menu-align-right - %li= link_to "Email Patches", merge_request_path(@merge_request, format: :patch) - %li= link_to "Plain Diff", merge_request_path(@merge_request, format: :diff) - .normal - %span <b>Request to merge</b> - %span.label-branch= source_branch_with_namespace(@merge_request) - %span <b>into</b> - %span.label-branch - = link_to_if @merge_request.target_branch_exists?, @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch) - - if @merge_request.open? && @merge_request.diverged_from_target_branch? - %span (#{pluralize(@merge_request.diverged_commits_count, 'commit')} behind) - if @merge_request.source_branch_exists? = render "projects/merge_requests/show/how_to_merge" - = render "projects/merge_requests/widget/show.html.haml" + :javascript + window.gl.mrWidgetData = #{serialize_issuable(@merge_request)} + + #js-vue-mr-widget.mr-widget - - if @merge_request.source_branch_exists? && @merge_request.mergeable? && @merge_request.can_be_merged_by?(current_user) - .merge-manually.light.prepend-top-default - You can also accept this merge request manually using the - = succeed '.' do - = link_to "command line", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal" + - content_for :page_specific_javascripts do + = page_specific_javascript_bundle_tag('vue_merge_request_widget') .content-block.content-block-small.emoji-list-container = render 'award_emoji/awards_block', awardable: @merge_request, inline: true @@ -113,9 +88,7 @@ :javascript $(function () { - new MergeRequest({ + window.mergeRequest = new MergeRequest({ action: "#{controller.action_name}" }); }); - - var mrRefreshWidgetUrl = "#{mr_widget_refresh_url(@merge_request)}"; diff --git a/app/views/projects/merge_requests/cancel_merge_when_pipeline_succeeds.js.haml b/app/views/projects/merge_requests/cancel_merge_when_pipeline_succeeds.js.haml deleted file mode 100644 index eab5be488b5..00000000000 --- a/app/views/projects/merge_requests/cancel_merge_when_pipeline_succeeds.js.haml +++ /dev/null @@ -1,2 +0,0 @@ -:plain - $('.mr-widget-body').html("#{escape_javascript(render('projects/merge_requests/widget/open/accept'))}"); diff --git a/app/views/projects/merge_requests/merge.js.haml b/app/views/projects/merge_requests/merge.js.haml deleted file mode 100644 index e632fc681cf..00000000000 --- a/app/views/projects/merge_requests/merge.js.haml +++ /dev/null @@ -1,14 +0,0 @@ -- case @status -- when :success - - remove_source_branch = params[:should_remove_source_branch] == '1' || @merge_request.remove_source_branch? - :plain - merge_request_widget.mergeInProgress(#{remove_source_branch}); -- when :merge_when_pipeline_succeeds - :plain - $('.mr-widget-body').html("#{escape_javascript(render('projects/merge_requests/widget/open/merge_when_pipeline_succeeds'))}"); -- when :sha_mismatch - :plain - $('.mr-widget-body').html("#{escape_javascript(render('projects/merge_requests/widget/open/sha_mismatch'))}"); -- else - :plain - $('.mr-widget-body').html("#{escape_javascript(render('projects/merge_requests/widget/open/reload'))}"); diff --git a/app/views/projects/merge_requests/widget/_closed.html.haml b/app/views/projects/merge_requests/widget/_closed.html.haml deleted file mode 100644 index 15f47ecf210..00000000000 --- a/app/views/projects/merge_requests/widget/_closed.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -.mr-state-widget - = render 'projects/merge_requests/widget/heading' - .mr-widget-body - %h4 - Closed - - if @merge_request.closed_event - by #{link_to_member(@project, @merge_request.closed_event.author, avatar: true)} - #{time_ago_with_tooltip(@merge_request.closed_event.created_at)} - %p - = succeed '.' do - The changes were not merged into - %span.label-branch= @merge_request.target_branch diff --git a/app/views/projects/merge_requests/widget/_commit_change_content.html.haml b/app/views/projects/merge_requests/widget/_commit_change_content.html.haml new file mode 100644 index 00000000000..ad0ce7bf501 --- /dev/null +++ b/app/views/projects/merge_requests/widget/_commit_change_content.html.haml @@ -0,0 +1,4 @@ +- if @merge_request.can_be_reverted?(current_user) + = render "projects/commit/change", type: 'revert', commit: @merge_request.merge_commit, title: @merge_request.title +- if @merge_request.can_be_cherry_picked? + = render "projects/commit/change", type: 'cherry-pick', commit: @merge_request.merge_commit, title: @merge_request.title diff --git a/app/views/projects/merge_requests/widget/_heading.html.haml b/app/views/projects/merge_requests/widget/_heading.html.haml deleted file mode 100644 index 1298376ac25..00000000000 --- a/app/views/projects/merge_requests/widget/_heading.html.haml +++ /dev/null @@ -1,50 +0,0 @@ -- if @pipeline - .mr-widget-heading - - %w[success success_with_warnings skipped manual canceled failed running pending].each do |status| - .ci_widget{ class: "ci-#{status}", style: ("display:none" unless @pipeline.status == status) } - %div{ class: "ci-status-icon ci-status-icon-#{status}" } - = link_to namespace_project_pipeline_path(@pipeline.project.namespace, @pipeline.project, @pipeline.id), class: 'icon-link' do - = ci_icon_for_status(status) - %span - Pipeline - = link_to "##{@pipeline.id}", namespace_project_pipeline_path(@pipeline.project.namespace, @pipeline.project, @pipeline.id), class: 'pipeline' - = ci_label_for_status(status) - - if @pipeline.stages.any? - .mr-widget-pipeline-graph - = render 'shared/mini_pipeline_graph', pipeline: @pipeline, klass: 'js-pipeline-inline-mr-widget-graph' - %span - for - = succeed "." do - = link_to @pipeline.short_sha, namespace_project_commit_path(@merge_request.source_project.namespace, @merge_request.source_project, @pipeline.sha), class: "monospace js-commit-link" - %span.ci-coverage - -- elsif @merge_request.has_ci? - -# Compatibility with old CI integrations (ex jenkins) when you request status from CI server via AJAX - -# TODO, remove in later versions when services like Jenkins will set CI status via Commit status API - .mr-widget-heading - - %w[success skipped canceled failed running pending].each do |status| - .ci_widget{ class: "ci-#{status} ci-status-icon-#{status}", style: "display:none" } - = ci_icon_for_status(status) - %span - CI job - = ci_label_for_status(status) - for - - commit = @merge_request.diff_head_commit - = succeed "." do - = link_to commit.short_id, namespace_project_commit_path(@merge_request.source_project.namespace, @merge_request.source_project, commit), class: "monospace" - %span.ci-coverage - - .ci_widget - = icon("spinner spin") - Checking CI status for #{@merge_request.diff_head_commit.short_id}… - - .ci_widget.ci-not_found{ style: "display:none" } - = icon("times-circle") - Could not find CI status for #{@merge_request.diff_head_commit.short_id}. - - .ci_widget.ci-error{ style: "display:none" } - = icon("times-circle") - Could not connect to the CI server. Please check your settings and try again. - -.js-success-icon.hidden - = ci_icon_for_status('success') diff --git a/app/views/projects/merge_requests/widget/_locked.html.haml b/app/views/projects/merge_requests/widget/_locked.html.haml deleted file mode 100644 index 78d0783cba0..00000000000 --- a/app/views/projects/merge_requests/widget/_locked.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -.mr-state-widget - = render 'projects/merge_requests/widget/heading' - .mr-widget-body - %h4 - = icon("spinner spin") - Merge in progress… - %p - This merge request is in the process of being merged, during which time it is locked and cannot be closed. - diff --git a/app/views/projects/merge_requests/widget/_merged.html.haml b/app/views/projects/merge_requests/widget/_merged.html.haml deleted file mode 100644 index adc3bbc37f3..00000000000 --- a/app/views/projects/merge_requests/widget/_merged.html.haml +++ /dev/null @@ -1,52 +0,0 @@ -.mr-state-widget - = render 'projects/merge_requests/widget/heading' - .mr-widget-body - %h4 - Merged - - if @merge_request.merge_event - by #{link_to_member(@project, @merge_request.merge_event.author, avatar: true)} - #{time_ago_with_tooltip(@merge_request.merge_event.created_at)} - - if !@merge_request.source_branch_exists? || params[:deleted_source_branch] - .remove-message-pipes - %ul - %li - %span - The changes were merged into - #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}. - %li - %span - The source branch has been removed. - = render 'projects/merge_requests/widget/merged_buttons' - - elsif @merge_request.can_remove_source_branch?(current_user) - .remove_source_branch_widget.remove-message-pipes - %ul - %li - %span - The changes were merged into - #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}. - %li - %span - You can remove the source branch now. - = render 'projects/merge_requests/widget/merged_buttons', source_branch_exists: true - .remove_source_branch_widget.failed.remove-message-pipes.hide - %ul - %li - %span - Failed to remove source branch '#{@merge_request.source_branch}'. - .remove_source_branch_in_progress.remove-message-pipes.hide - %ul - %li - %span - = icon('spinner spin') - Removing source branch '#{@merge_request.source_branch}'. - %li - %span - Please wait, this page will be automatically reloaded. - - else - .remove-message-pipes - %ul - %li - %span - The changes were merged into - #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}. - = render 'projects/merge_requests/widget/merged_buttons' diff --git a/app/views/projects/merge_requests/widget/_merged_buttons.haml b/app/views/projects/merge_requests/widget/_merged_buttons.haml deleted file mode 100644 index a0f54bd28ec..00000000000 --- a/app/views/projects/merge_requests/widget/_merged_buttons.haml +++ /dev/null @@ -1,14 +0,0 @@ -- can_remove_source_branch = local_assigns.fetch(:source_branch_exists, false) && @merge_request.can_remove_source_branch?(current_user) -- mr_can_be_reverted = @merge_request.can_be_reverted?(current_user) -- mr_can_be_cherry_picked = @merge_request.can_be_cherry_picked? - -- if can_remove_source_branch || mr_can_be_reverted || mr_can_be_cherry_picked - .clearfix.merged-buttons - - if can_remove_source_branch - = link_to namespace_project_branch_path(@merge_request.source_project.namespace, @merge_request.source_project, @merge_request.source_branch), remote: true, method: :delete, class: "btn btn-default remove_source_branch" do - = icon('trash-o') - Remove source branch - - if mr_can_be_reverted - = revert_commit_link(@merge_request.merge_commit, namespace_project_merge_request_path(@project.namespace, @project, @merge_request), btn_class: "close") - - if mr_can_be_cherry_picked - = cherry_pick_commit_link(@merge_request.merge_commit, namespace_project_merge_request_path(@project.namespace, @project, @merge_request), btn_class: "default") diff --git a/app/views/projects/merge_requests/widget/_open.html.haml b/app/views/projects/merge_requests/widget/_open.html.haml deleted file mode 100644 index 0872a1a0503..00000000000 --- a/app/views/projects/merge_requests/widget/_open.html.haml +++ /dev/null @@ -1,49 +0,0 @@ -.mr-state-widget - = render 'projects/merge_requests/widget/heading' - .mr-widget-body - -# After conflicts are resolved, the user is redirected back to the MR page. - -# There is a short window before background workers run and GitLab processes - -# the new push and commits, during which it will think the conflicts still exist. - -# We send this param to get the widget to treat the MR as having no more conflicts. - - resolved_conflicts = params[:resolved_conflicts] - - - if @project.archived? - = render 'projects/merge_requests/widget/open/archived' - - elsif @merge_request.branch_missing? - = render 'projects/merge_requests/widget/open/missing_branch' - - elsif @merge_request.has_no_commits? - = render 'projects/merge_requests/widget/open/nothing' - - elsif @merge_request.unchecked? - = render 'projects/merge_requests/widget/open/check' - - elsif @merge_request.cannot_be_merged? && !resolved_conflicts - = render 'projects/merge_requests/widget/open/conflicts' - - elsif @merge_request.work_in_progress? - = render 'projects/merge_requests/widget/open/wip' - - elsif @merge_request.merge_when_pipeline_succeeds? && @merge_request.merge_error.present? - = render 'projects/merge_requests/widget/open/error' - - elsif @merge_request.merge_when_pipeline_succeeds? - = render 'projects/merge_requests/widget/open/merge_when_pipeline_succeeds' - - elsif !@merge_request.can_be_merged_by?(current_user) - = render 'projects/merge_requests/widget/open/not_allowed' - - elsif !@merge_request.mergeable_ci_state? && (@pipeline.failed? || @pipeline.canceled?) - = render 'projects/merge_requests/widget/open/build_failed' - - elsif !@merge_request.mergeable_discussions_state? - = render 'projects/merge_requests/widget/open/unresolved_discussions' - - elsif @pipeline&.blocked? - = render 'projects/merge_requests/widget/open/manual' - - elsif @merge_request.can_be_merged? || resolved_conflicts - = render 'projects/merge_requests/widget/open/accept' - - - if mr_closes_issues.present? || mr_issues_mentioned_but_not_closing.present? - .mr-widget-footer - %span - = icon('check') - - if mr_closes_issues.present? - Accepting this merge request will close #{"issue".pluralize(mr_closes_issues.size)} - = succeed '.' do - != markdown issues_sentence(mr_closes_issues), pipeline: :gfm, author: @merge_request.author - = mr_assign_issues_link - - if mr_issues_mentioned_but_not_closing.present? - #{"Issue".pluralize(mr_issues_mentioned_but_not_closing.size)} - != markdown issues_sentence(mr_issues_mentioned_but_not_closing), pipeline: :gfm, author: @merge_request.author - #{mr_issues_mentioned_but_not_closing.size > 1 ? 'are' : 'is'} mentioned but will not be closed. diff --git a/app/views/projects/merge_requests/widget/_show.html.haml b/app/views/projects/merge_requests/widget/_show.html.haml deleted file mode 100644 index c716b69b35b..00000000000 --- a/app/views/projects/merge_requests/widget/_show.html.haml +++ /dev/null @@ -1,40 +0,0 @@ -- if @merge_request.open? - = render 'projects/merge_requests/widget/open' -- elsif @merge_request.merged? - = render 'projects/merge_requests/widget/merged' -- elsif @merge_request.closed? - = render 'projects/merge_requests/widget/closed' -- elsif @merge_request.locked? - = render 'projects/merge_requests/widget/locked' - -:javascript - var opts = { - merge_check_url: "#{merge_check_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}", - check_enable: #{@merge_request.unchecked? ? "true" : "false"}, - ci_status_url: "#{ci_status_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}", - pipeline_status_url: "#{pipeline_status_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}", - ci_environments_status_url: "#{ci_environments_status_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}", - gitlab_icon: "#{asset_path 'gitlab_logo.png'}", - ci_status: "#{@merge_request.head_pipeline ? @merge_request.head_pipeline.status : ''}", - ci_message: { - normal: "Pipeline {{status}} for \"{{title}}\"", - preparing: "{{status}} pipeline for \"{{title}}\"" - }, - ci_enable: #{@project.ci_service ? "true" : "false"}, - ci_title: { - preparing: "{{status}} pipeline", - normal: "Pipeline {{status}}" - }, - ci_sha: "#{@merge_request.head_pipeline ? @merge_request.head_pipeline.short_sha : ''}", - ci_pipeline: #{@merge_request.head_pipeline.try(:id).to_json}, - commits_path: "#{project_commits_path(@project)}", - pipeline_path: "#{project_pipelines_path(@project)}", - pipelines_path: "#{pipelines_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}" - }; - - if (typeof merge_request_widget !== 'undefined') { - merge_request_widget.cancelPolling(); - merge_request_widget.clearEventListeners(); - } - - merge_request_widget = new window.gl.MergeRequestWidget(opts); diff --git a/app/views/projects/merge_requests/widget/open/_accept.html.haml b/app/views/projects/merge_requests/widget/open/_accept.html.haml deleted file mode 100644 index 4cbd22150c7..00000000000 --- a/app/views/projects/merge_requests/widget/open/_accept.html.haml +++ /dev/null @@ -1,50 +0,0 @@ -- content_for :page_specific_javascripts do - = page_specific_javascript_bundle_tag('merge_request_widget') - -= form_for [:merge, @project.namespace.becomes(Namespace), @project, @merge_request], remote: true, method: :post, html: { class: 'accept-mr-form js-quick-submit js-requires-input' } do |f| - = hidden_field_tag :authenticity_token, form_authenticity_token - = hidden_field_tag :sha, @merge_request.diff_head_sha - .accept-merge-holder.clearfix.js-toggle-container - .clearfix - .accept-action - - if @pipeline && @pipeline.active? - %span.btn-group - = button_tag class: "btn btn-info js-merge-when-pipeline-succeeds-button merge-when-pipeline-succeeds" do - Merge when pipeline succeeds - - unless @project.only_allow_merge_if_pipeline_succeeds? - = button_tag class: "btn btn-info dropdown-toggle", 'data-toggle' => 'dropdown' do - = icon('caret-down') - %span.sr-only - Select merge moment - %ul.js-merge-dropdown.dropdown-menu.dropdown-menu-right{ role: 'menu' } - %li - = link_to "#", class: "merge-when-pipeline-succeeds" do - = icon('check fw') - Merge when pipeline succeeds - %li - = link_to "#", class: "accept-merge-request" do - = icon('warning fw') - Merge immediately - - else - = f.button class: "btn btn-grouped js-merge-button accept-merge-request" do - Accept merge request - - if @merge_request.force_remove_source_branch? - .accept-control - The source branch will be removed. - - elsif @merge_request.can_remove_source_branch?(current_user) - .accept-control.checkbox - = label_tag :should_remove_source_branch, class: "merge-param-checkbox" do - = check_box_tag :should_remove_source_branch - Remove source branch - .accept-control - %button.modify-merge-commit-link.js-toggle-button{ type: "button" } - = icon('edit') - Modify commit message - .js-toggle-content.hide.prepend-top-default - = render 'shared/commit_message_container', params: params, - message_with_description: @merge_request.merge_commit_message(include_description: true), - message_without_description: @merge_request.merge_commit_message, - text: @merge_request.merge_commit_message, - rows: 14, hint: true - - = hidden_field_tag :merge_when_pipeline_succeeds, "", autocomplete: "off" diff --git a/app/views/projects/merge_requests/widget/open/_archived.html.haml b/app/views/projects/merge_requests/widget/open/_archived.html.haml deleted file mode 100644 index 0d61e56d8fb..00000000000 --- a/app/views/projects/merge_requests/widget/open/_archived.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -%h4 - Project is archived -%p - This merge request cannot be merged because archived projects cannot be written to. diff --git a/app/views/projects/merge_requests/widget/open/_build_failed.html.haml b/app/views/projects/merge_requests/widget/open/_build_failed.html.haml deleted file mode 100644 index 3979d5fa8ed..00000000000 --- a/app/views/projects/merge_requests/widget/open/_build_failed.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -%h4 - = icon('exclamation-triangle') - The pipeline for this merge request failed - -%p - Please retry the job or push a new commit to fix the failure. diff --git a/app/views/projects/merge_requests/widget/open/_check.html.haml b/app/views/projects/merge_requests/widget/open/_check.html.haml deleted file mode 100644 index 909dc52fc06..00000000000 --- a/app/views/projects/merge_requests/widget/open/_check.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -- content_for :page_specific_javascripts do - = page_specific_javascript_bundle_tag('merge_request_widget') - -%strong - = icon("spinner spin") - Checking ability to merge automatically… diff --git a/app/views/projects/merge_requests/widget/open/_conflicts.html.haml b/app/views/projects/merge_requests/widget/open/_conflicts.html.haml deleted file mode 100644 index 621ee313026..00000000000 --- a/app/views/projects/merge_requests/widget/open/_conflicts.html.haml +++ /dev/null @@ -1,27 +0,0 @@ -- can_resolve = @merge_request.conflicts_can_be_resolved_by?(current_user) -- can_resolve_in_ui = @merge_request.conflicts_can_be_resolved_in_ui? -- can_merge = @merge_request.can_be_merged_via_command_line_by?(current_user) - -%h4.has-conflicts - %p - = icon("exclamation-triangle") - This merge request contains merge conflicts - -.remove-message-pipes - %ul - %li - %span - To merge this request, resolve these conflicts - - if can_resolve && !can_resolve_in_ui - locally - or - - unless can_merge - ask someone with write access to this repository to - merge it locally. - -- if (can_resolve && can_resolve_in_ui) || can_merge - .merged-buttons.clearfix - - if can_resolve && can_resolve_in_ui - = link_to "Resolve conflicts", conflicts_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: "btn" - - if can_merge - = link_to "Merge locally", "#modal_merge_info", class: "btn how_to_merge_link vlink", "data-toggle" => "modal" diff --git a/app/views/projects/merge_requests/widget/open/_manual.html.haml b/app/views/projects/merge_requests/widget/open/_manual.html.haml deleted file mode 100644 index 9078b7e21dd..00000000000 --- a/app/views/projects/merge_requests/widget/open/_manual.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -%h4 - Pipeline blocked -%p - The pipeline for this merge request requires a manual action to proceed. diff --git a/app/views/projects/merge_requests/widget/open/_merge_when_pipeline_succeeds.html.haml b/app/views/projects/merge_requests/widget/open/_merge_when_pipeline_succeeds.html.haml deleted file mode 100644 index 76cc1ecd8a5..00000000000 --- a/app/views/projects/merge_requests/widget/open/_merge_when_pipeline_succeeds.html.haml +++ /dev/null @@ -1,33 +0,0 @@ -- content_for :page_specific_javascripts do - = page_specific_javascript_bundle_tag('merge_request_widget') - -%h4 - Set by #{link_to_member(@project, @merge_request.merge_user, avatar: true)} - to be merged automatically when the pipeline succeeds. -.remove-message-pipes - %ul - %li - %span - = succeed '.' do - The changes will be merged into #{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"} - - if @merge_request.remove_source_branch? - %li - %span - The source branch will be removed. - - else - %li - %span - The source branch will not be removed. - - - remove_source_branch_button = !@merge_request.remove_source_branch? && @merge_request.can_remove_source_branch?(current_user) && @merge_request.merge_user == current_user - - user_can_cancel_automatic_merge = @merge_request.can_cancel_merge_when_pipeline_succeeds?(current_user) - - if remove_source_branch_button || user_can_cancel_automatic_merge - .clearfix.prepend-top-10 - - if remove_source_branch_button - = link_to merge_namespace_project_merge_request_path(@merge_request.target_project.namespace, @merge_request.target_project, @merge_request, merge_params(@merge_request)), remote: true, method: :post, class: "btn btn-grouped btn-primary btn-sm remove_source_branch" do - = icon('times') - Remove source branch when merged - - - if user_can_cancel_automatic_merge - = link_to cancel_merge_when_pipeline_succeeds_namespace_project_merge_request_path(@merge_request.target_project.namespace, @merge_request.target_project, @merge_request), remote: true, method: :post, class: "btn btn-grouped btn-sm" do - Cancel automatic merge diff --git a/app/views/projects/merge_requests/widget/open/_missing_branch.html.haml b/app/views/projects/merge_requests/widget/open/_missing_branch.html.haml deleted file mode 100644 index c9f07629493..00000000000 --- a/app/views/projects/merge_requests/widget/open/_missing_branch.html.haml +++ /dev/null @@ -1,16 +0,0 @@ -- unless @merge_request.source_branch_exists? - %h4 - = icon("exclamation-triangle") - Source branch - %span.label-branch= source_branch_with_namespace(@merge_request) - does not exist - %p - Please restore the source branch or close this merge request and open a new merge request with a different source branch. -- else - %h4 - = icon("exclamation-triangle") - Target branch - %span.label-branch= @merge_request.target_branch - does not exist - %p - Please restore the target branch or use a different target branch. diff --git a/app/views/projects/merge_requests/widget/open/_not_allowed.html.haml b/app/views/projects/merge_requests/widget/open/_not_allowed.html.haml deleted file mode 100644 index 57ce1959021..00000000000 --- a/app/views/projects/merge_requests/widget/open/_not_allowed.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -%h4 - Ready to be merged automatically -%p - Ask someone with write access to this repository to merge this request. - - if @merge_request.force_remove_source_branch? - The source branch will be removed. diff --git a/app/views/projects/merge_requests/widget/open/_nothing.html.haml b/app/views/projects/merge_requests/widget/open/_nothing.html.haml deleted file mode 100644 index 7af8c01c134..00000000000 --- a/app/views/projects/merge_requests/widget/open/_nothing.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -%h4 - = icon("exclamation-triangle") - Nothing to merge from - %span.label-branch= source_branch_with_namespace(@merge_request) - into - %span.label-branch= @merge_request.target_branch -%p - Please push new commits to the source branch or use a different target branch. diff --git a/app/views/projects/merge_requests/widget/open/_reload.html.haml b/app/views/projects/merge_requests/widget/open/_reload.html.haml deleted file mode 100644 index acfc31725eb..00000000000 --- a/app/views/projects/merge_requests/widget/open/_reload.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -%h4 - = icon("exclamation-triangle") - This merge request failed to be merged automatically - -%p - Please reload the page to find out the reason. diff --git a/app/views/projects/merge_requests/widget/open/_sha_mismatch.html.haml b/app/views/projects/merge_requests/widget/open/_sha_mismatch.html.haml deleted file mode 100644 index 499624f8dd8..00000000000 --- a/app/views/projects/merge_requests/widget/open/_sha_mismatch.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -%h4 - = icon("exclamation-triangle") - This merge request has received new commits since the page was loaded. - -%p - Please reload the page to review the new commits before merging. diff --git a/app/views/projects/merge_requests/widget/open/_unresolved_discussions.html.haml b/app/views/projects/merge_requests/widget/open/_unresolved_discussions.html.haml deleted file mode 100644 index ec9346ce89b..00000000000 --- a/app/views/projects/merge_requests/widget/open/_unresolved_discussions.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -%h4 - = icon('exclamation-triangle') - This merge request has unresolved discussions - -%p - Please resolve these discussions - - if @project.issues_enabled? && can?(current_user, :create_issue, @project) - or - = link_to "open an issue to resolve them later", new_namespace_project_issue_path(@project.namespace, @project, merge_request_to_resolve_discussions_of: @merge_request.iid) - to allow this merge request to be merged. diff --git a/app/views/projects/merge_requests/widget/open/_wip.html.haml b/app/views/projects/merge_requests/widget/open/_wip.html.haml deleted file mode 100644 index c296422a9cf..00000000000 --- a/app/views/projects/merge_requests/widget/open/_wip.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -%h4 - This merge request is currently a Work In Progress - -- if can?(current_user, :update_merge_request, @merge_request) - %p - When this merge request is ready, - = link_to remove_wip_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), method: :post do - remove the - %code WIP: - prefix from the title - to allow it to be merged. |