diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 1fbdc73cabeeb19cf1217d7eaf7c974a10c1220b..e34f4d102ced9dcd9af948cb648a4b029b2b0865 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -135,10 +135,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController return render_404 unless @merge_request.cannot_be_merged? respond_to do |format| - format.html do - define_discussion_vars - render 'show' - end + format.html { define_discussion_vars } format.json do begin diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml index e5683d5a9874f1657b00798b61ed2b88178698b2..269198adf913cacc43c9d92deaa78cff51ab1128 100644 --- a/app/views/projects/merge_requests/_show.html.haml +++ b/app/views/projects/merge_requests/_show.html.haml @@ -61,10 +61,6 @@ = link_to diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: 'div#diffs', action: 'diffs', toggle: 'tab'} do Changes %span.badge= @merge_request.diff_size - %li.conflicts-tab - = link_to conflicts_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: 'div#conflicts', action: 'conflicts', toggle: 'tab'} do - Conflicts - %span.badge 3 .tab-content #notes.notes.tab-pane.voting_notes @@ -82,9 +78,6 @@ - # This tab is always loaded via AJAX #diffs.diffs.tab-pane - # This tab is always loaded via AJAX - #conflicts.conflicts.tab-pane - - # This tab is always loaded via AJAX - = render 'projects/merge_requests/show/conflicts' .mr-loading-status = spinner diff --git a/app/views/projects/merge_requests/conflicts.haml b/app/views/projects/merge_requests/conflicts.haml new file mode 100644 index 0000000000000000000000000000000000000000..a34a58baad60fa662d2fdaa844b0ae9325dc2827 --- /dev/null +++ b/app/views/projects/merge_requests/conflicts.haml @@ -0,0 +1,111 @@ +- page_title "Merge Conflicts", "#{@merge_request.title} (#{@merge_request.to_reference}", "Merge Requests" + += render "projects/merge_requests/show/mr_title" + +.merge-request-details.issuable-details{data: {id: @merge_request.project.id}} + = render "projects/merge_requests/show/mr_box" + +#conflicts + .loading{ "v-if" => "isLoading" } + %i.fa.fa-spinner.fa-spin + + .content-block.oneline-block.files-changed{ "v-if" => "!isLoading" } + .inline-parallel-buttons + .btn-group + %a.btn{ | + ":class" => "{'active': !isParallel}", | + "@click" => "handleViewTypeChange('inline')"} + Inline + %a.btn{ | + ":class" => "{'active': isParallel}", | + "@click" => "handleViewTypeChange('parallel')"} + Side-by-side + + .js-toggle-container + .commit-stat-summary + Showing + %strong.cred {{conflictsCount}} conflicts + for + %strong {{conflictsData.source_branch}} + into + %strong {{conflictsData.target_branch}} + + .files-wrapper{ "v-if" => "!isLoading" } + .files{"v-if" => "isParallel"} + .diff-file.file-holder.conflict.parallel-view{"v-for" => "file in conflictsData.files"} + .file-title + %span {{file.new_path}} + .file-actions + %a.btn.btn-sm View file @{{conflictsData.shortCommitSha}} + + .diff-content.diff-wrap-lines + .diff-wrap-lines.code.file-content.js-syntax-highlight.white + %table{"v-for" => "(key, group) in file.parallelLines"} + %tr.line_holder.parallel{"v-for" => "line in group", | + ":class" => "{ | + 'head': line.isHead, | + 'origin': line.isOrigin, | + 'match': line.hasMatch, | + 'selected': line.isSelected, | + 'unselected': line.isUnselected }"} + + %template{"v-if" => "line.isHeader"} + %td.diff-line-num.header + %td.line_content.header + %strong {{line.richText}} + %button.btn{"@click" => "handleSelected(line.id, line.section)"} Use this + + %template{"v-if" => "!line.isHeader"} + %td.diff-line-num.old_line + {{line.lineNumber}} + %td.line_content + {{{line.richText}}} + + .files{"v-if" => "!isParallel"} + .diff-file.file-holder.conflict.inline-view{"v-for" => "file in conflictsData.files"} + .file-title + %span {{file.new_path}} + .file-actions + %a.btn.btn-sm View file @{{conflictsData.shortCommitSha}} + + .diff-content.diff-wrap-lines + .diff-wrap-lines.code.file-content.js-syntax-highlight.white + %table + %tr.line_holder{"v-for" => "line in file.inlineLines", | + ":class" => "{ | + 'head': line.isHead, | + 'origin': line.isOrigin, | + 'match': line.hasMatch, | + 'selected': line.isSelected, | + 'unselected': line.isUnselected }"} + + %template{"v-if" => "!line.isHeader"} + %td.diff-line-num.new_line + %a {{line.new_line}} + %td.diff-line-num.old_line + %a {{line.old_line}} + %td.line_content + {{{line.richText}}} + + %template{"v-if" => "line.isHeader"} + %td.diff-line-num.header + %td.diff-line-num.header + %td.line_content.header + %strong {{{line.richText}}} + %button.btn{"@click" => "handleSelected(line.id, line.section)"} Use this + + .content-block.oneline-block.files-changed + %strong.resolved-count {{resolvedCount}} + of + %strong.total-count {{conflictsCount}} + conflicts have been resolved + + .commit-message-container.form-group + .max-width-marker + %textarea.form-control.js-commit-message{":disabled" => "!allResolved"} {{{conflictsData.commitMessage}}} + + %button{type: 'button', class: 'btn btn-success js-submit-button', ":disabled" => "!allResolved"} + Commit conflict resolution + + %button{type: 'button', class: 'btn btn-cancel'} + Cancel diff --git a/app/views/projects/merge_requests/show/_conflicts.html.haml b/app/views/projects/merge_requests/show/_conflicts.html.haml deleted file mode 100644 index 83be422ff35e706a7af239935283e86b2c5343ad..0000000000000000000000000000000000000000 --- a/app/views/projects/merge_requests/show/_conflicts.html.haml +++ /dev/null @@ -1,103 +0,0 @@ -.loading{ "v-if" => "isLoading" } - %i.fa.fa-spinner.fa-spin - -.content-block.oneline-block.files-changed{ "v-if" => "!isLoading" } - .inline-parallel-buttons - .btn-group - %a.btn{ | - ":class" => "{'active': !isParallel}", | - "@click" => "handleViewTypeChange('inline')"} - Inline - %a.btn{ | - ":class" => "{'active': isParallel}", | - "@click" => "handleViewTypeChange('parallel')"} - Side-by-side - - .js-toggle-container - .commit-stat-summary - Showing - %strong.cred {{conflictsCount}} conflicts - for - %strong {{conflictsData.source_branch}} - into - %strong {{conflictsData.target_branch}} - -.files-wrapper{ "v-if" => "!isLoading" } - .files{"v-if" => "isParallel"} - .diff-file.file-holder.conflict.parallel-view{"v-for" => "file in conflictsData.files"} - .file-title - %span {{file.new_path}} - .file-actions - %a.btn.btn-sm View file @{{conflictsData.shortCommitSha}} - - .diff-content.diff-wrap-lines - .diff-wrap-lines.code.file-content.js-syntax-highlight.white - %table{"v-for" => "(key, group) in file.parallelLines"} - %tr.line_holder.parallel{"v-for" => "line in group", | - ":class" => "{ | - 'head': line.isHead, | - 'origin': line.isOrigin, | - 'match': line.hasMatch, | - 'selected': line.isSelected, | - 'unselected': line.isUnselected }"} - - %template{"v-if" => "line.isHeader"} - %td.diff-line-num.header - %td.line_content.header - %strong {{line.richText}} - %button.btn{"@click" => "handleSelected(line.id, line.section)"} Use this - - %template{"v-if" => "!line.isHeader"} - %td.diff-line-num.old_line - {{line.lineNumber}} - %td.line_content - {{{line.richText}}} - - .files{"v-if" => "!isParallel"} - .diff-file.file-holder.conflict.inline-view{"v-for" => "file in conflictsData.files"} - .file-title - %span {{file.new_path}} - .file-actions - %a.btn.btn-sm View file @{{conflictsData.shortCommitSha}} - - .diff-content.diff-wrap-lines - .diff-wrap-lines.code.file-content.js-syntax-highlight.white - %table - %tr.line_holder{"v-for" => "line in file.inlineLines", | - ":class" => "{ | - 'head': line.isHead, | - 'origin': line.isOrigin, | - 'match': line.hasMatch, | - 'selected': line.isSelected, | - 'unselected': line.isUnselected }"} - - %template{"v-if" => "!line.isHeader"} - %td.diff-line-num.new_line - %a {{line.new_line}} - %td.diff-line-num.old_line - %a {{line.old_line}} - %td.line_content - {{{line.richText}}} - - %template{"v-if" => "line.isHeader"} - %td.diff-line-num.header - %td.diff-line-num.header - %td.line_content.header - %strong {{{line.richText}}} - %button.btn{"@click" => "handleSelected(line.id, line.section)"} Use this - - .content-block.oneline-block.files-changed - %strong.resolved-count {{resolvedCount}} - of - %strong.total-count {{conflictsCount}} - conflicts have been resolved - - .commit-message-container.form-group - .max-width-marker - %textarea.form-control.js-commit-message{":disabled" => "!allResolved"} {{{conflictsData.commitMessage}}} - - %button{type: 'button', class: 'btn btn-success js-submit-button', ":disabled" => "!allResolved"} - Commit conflict resolution - - %button{type: 'button', class: 'btn btn-cancel'} - Cancel