diff --git a/app/assets/javascripts/merge_conflict_data_provider.js.es6 b/app/assets/javascripts/merge_conflict_data_provider.js.es6 index 183ba1a7864..f0f51a65b94 100644 --- a/app/assets/javascripts/merge_conflict_data_provider.js.es6 +++ b/app/assets/javascripts/merge_conflict_data_provider.js.es6 @@ -52,7 +52,9 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider { setParallelLines(data) { data.files.forEach( (file) => { - file.filePath = this.getFilePath(file); + file.filePath = this.getFilePath(file); + file.iconClass = `fa-${file.blob_icon}`; + file.blobPath = file.blob_path; file.parallelLines = []; const linesObj = { left: [], right: [] }; @@ -120,8 +122,10 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider { setInlineLines(data) { data.files.forEach( (file) => { + file.iconClass = `fa-${file.blob_icon}`; + file.blobPath = file.blob_path; + file.filePath = this.getFilePath(file); file.inlineLines = [] - file.filePath = this.getFilePath(file); file.sections.forEach( (section) => { let currentLineType = 'new'; @@ -309,7 +313,7 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider { getFilePath(file) { const { old_path, new_path } = file; - return old_path === new_path ? new_path : `${old_path} → ${new_path}`; + return old_path === new_path ? new_path : `${old_path} → ${new_path}`; } } diff --git a/app/views/projects/merge_requests/conflicts.html.haml b/app/views/projects/merge_requests/conflicts.html.haml index d667dbe19bc..154999f5309 100644 --- a/app/views/projects/merge_requests/conflicts.html.haml +++ b/app/views/projects/merge_requests/conflicts.html.haml @@ -39,9 +39,10 @@ .files{"v-if" => "isParallel"} .diff-file.file-holder.conflict.parallel-view{"v-for" => "file in conflictsData.files"} .file-title - %span {{{file.filePath}}} + %i.fa.fa-fw.fa{":class" => "file.iconClass"} + %strong {{file.filePath}} .file-actions - %a.btn.view-file.btn-file-option{":href" => "file.blobLink"} + %a.btn.view-file.btn-file-option{":href" => "file.blobPath"} View file @{{conflictsData.shortCommitSha}} .diff-content.diff-wrap-lines .diff-wrap-lines.code.file-content.js-syntax-highlight.white @@ -82,9 +83,10 @@ .files{"v-if" => "!isParallel"} .diff-file.file-holder.conflict.inline-view{"v-for" => "file in conflictsData.files"} .file-title - %span {{{file.filePath}}} + %i.fa.fa-fw{":class" => "file.iconClass"} + %strong {{file.filePath}} .file-actions - %a.btn.view-file.btn-file-option{":href" => "file.blobLink"} + %a.btn.view-file.btn-file-option{":href" => "file.blobPath"} View file @{{conflictsData.shortCommitSha}} .diff-content.diff-wrap-lines