Commit 075fd5cc authored by Phil Hughes's avatar Phil Hughes

Fixed UI issues in merge conflict app

Fixes mode button alignment bug
Removed font awesome and added in file icons
parent 67b6e388
...@@ -54,7 +54,6 @@ import { s__ } from '~/locale'; ...@@ -54,7 +54,6 @@ import { s__ } from '~/locale';
file.promptDiscardConfirmation = false; file.promptDiscardConfirmation = false;
file.resolveMode = DEFAULT_RESOLVE_MODE; file.resolveMode = DEFAULT_RESOLVE_MODE;
file.filePath = this.getFilePath(file); file.filePath = this.getFilePath(file);
file.iconClass = `fa-${file.blob_icon}`;
file.blobPath = file.blob_path; file.blobPath = file.blob_path;
if (file.type === CONFLICT_TYPES.TEXT) { if (file.type === CONFLICT_TYPES.TEXT) {
......
import $ from 'jquery'; import $ from 'jquery';
import Vue from 'vue'; import Vue from 'vue';
import FileIcon from '~/vue_shared/components/file_icon.vue';
import { deprecatedCreateFlash as createFlash } from '../flash'; import { deprecatedCreateFlash as createFlash } from '../flash';
import initIssuableSidebar from '../init_issuable_sidebar'; import initIssuableSidebar from '../init_issuable_sidebar';
import './merge_conflict_store'; import './merge_conflict_store';
...@@ -24,6 +25,7 @@ export default function initMergeConflicts() { ...@@ -24,6 +25,7 @@ export default function initMergeConflicts() {
gl.MergeConflictsResolverApp = new Vue({ gl.MergeConflictsResolverApp = new Vue({
el: '#conflicts', el: '#conflicts',
components: { components: {
FileIcon,
'diff-file-editor': gl.mergeConflicts.diffFileEditor, 'diff-file-editor': gl.mergeConflicts.diffFileEditor,
'inline-conflict-lines': gl.mergeConflicts.inlineConflictLines, 'inline-conflict-lines': gl.mergeConflicts.inlineConflictLines,
'parallel-conflict-lines': gl.mergeConflicts.parallelConflictLines, 'parallel-conflict-lines': gl.mergeConflicts.parallelConflictLines,
......
...@@ -2,10 +2,6 @@ ...@@ -2,10 +2,6 @@
.diff-file { .diff-file {
margin-bottom: $gl-padding; margin-bottom: $gl-padding;
&.conflict {
border-top: 1px solid $border-color;
}
&.has-body { &.has-body {
.file-title { .file-title {
box-shadow: 0 -2px 0 0 var(--white); box-shadow: 0 -2px 0 0 var(--white);
......
.content-block.oneline-block.files-changed{ "v-if" => "!isLoading && !hasError" } .content-block.oneline-block.files-changed{ "v-if" => "!isLoading && !hasError" }
.inline-parallel-buttons{ "v-if" => "showDiffViewTypeSwitcher" } .inline-parallel-buttons{ "v-if" => "showDiffViewTypeSwitcher" }
.btn-group .btn-group
%button.btn{ ":class" => "{'active': !isParallel}", "@click" => "handleViewTypeChange('inline')" } %button.btn.gl-button{ ":class" => "{'active': !isParallel}", "@click" => "handleViewTypeChange('inline')" }
Inline = _('Inline')
%button.btn{ ":class" => "{'active': isParallel}", "@click" => "handleViewTypeChange('parallel')" } %button.btn.gl-button{ ":class" => "{'active': isParallel}", "@click" => "handleViewTypeChange('parallel')" }
Side-by-side = _('Side-by-side')
.js-toggle-container .js-toggle-container
.commit-stat-summary .commit-stat-summary
Showing = _('Showing %{conflict_start}%{conflicts_text}%{strong_end} between %{ref_start}%{source_branch}%{strong_end} and %{ref_start}%{target_branch}%{strong_end}').html_safe % { conflict_start: '<strong class="cred">'.html_safe, ref_start: '<strong class="ref-name">'.html_safe, strong_end: '</strong>'.html_safe, conflicts_text: '{{conflictsCountText}}', source_branch: '{{conflictsData.sourceBranch}}', target_branch: '{{conflictsData.targetBranch}}' }
%strong.cred {{conflictsCountText}}
between
%strong.ref-name {{conflictsData.sourceBranch}}
and
%strong.ref-name {{conflictsData.targetBranch}}
.file-actions .file-actions.d-flex.align-items-center.gl-ml-auto.gl-align-self-start
.btn-group{ "v-if" => "file.type === 'text'" } .btn-group.gl-mr-3{ "v-if" => "file.type === 'text'" }
%button.btn{ ":class" => "{ 'active': file.resolveMode == 'interactive' }", %button.btn.gl-button{ ":class" => "{ 'active': file.resolveMode == 'interactive' }",
'@click' => "onClickResolveModeButton(file, 'interactive')", '@click' => "onClickResolveModeButton(file, 'interactive')",
type: 'button' } type: 'button' }
Interactive mode = _('Interactive mode')
%button.btn{ ':class' => "{ 'active': file.resolveMode == 'edit' }", %button.btn.gl-button{ ':class' => "{ 'active': file.resolveMode == 'edit' }",
'@click' => "onClickResolveModeButton(file, 'edit')", '@click' => "onClickResolveModeButton(file, 'edit')",
type: 'button' } type: 'button' }
Edit inline = _('Edit inline')
%a.btn.view-file{ ":href" => "file.blobPath" } %a.btn.gl-button.view-file{ ":href" => "file.blobPath" }
View file @{{conflictsData.shortCommitSha}} = _('View file @%{commit_sha}') % { commit_sha: '{{conflictsData.shortCommitSha}}' }
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
.offset-md-4.col-md-8 .offset-md-4.col-md-8
.row .row
.col-6 .col-6
%button.btn.btn-success.js-submit-button{ type: "button", "@click" => "commit()", ":disabled" => "!readyToCommit" } %button.btn.gl-button.btn-success.js-submit-button{ type: "button", "@click" => "commit()", ":disabled" => "!readyToCommit" }
%span {{commitButtonText}} %span {{commitButtonText}}
.col-6.text-right .col-6.text-right
= link_to "Cancel", project_merge_request_path(@merge_request.project, @merge_request), class: "gl-button btn btn-cancel" = link_to "Cancel", project_merge_request_path(@merge_request.project, @merge_request), class: "gl-button btn btn-cancel"
...@@ -20,9 +20,10 @@ ...@@ -20,9 +20,10 @@
.files-wrapper{ "v-if" => "!isLoading && !hasError" } .files-wrapper{ "v-if" => "!isLoading && !hasError" }
.files .files
.diff-file.file-holder.conflict{ "v-for" => "file in conflictsData.files" } .diff-file.file-holder.conflict{ "v-for" => "file in conflictsData.files" }
.js-file-title.file-title .js-file-title.file-title.file-title-flex-parent.cursor-default
%i.fa.fa-fw{ ":class" => "file.iconClass" } .file-header-content
%strong {{file.filePath}} %file-icon{ ':file-name': 'file.filePath', ':size': '18', 'css-classes': 'gl-mr-2' }
%strong.file-title-name {{file.filePath}}
= render partial: 'projects/merge_requests/conflicts/file_actions' = render partial: 'projects/merge_requests/conflicts/file_actions'
.diff-content.diff-wrap-lines .diff-content.diff-wrap-lines
.file-content{ "v-show" => "!isParallel && file.resolveMode === 'interactive' && file.type === 'text'" } .file-content{ "v-show" => "!isParallel && file.resolveMode === 'interactive' && file.type === 'text'" }
......
...@@ -9924,6 +9924,9 @@ msgstr "" ...@@ -9924,6 +9924,9 @@ msgstr ""
msgid "Edit in single-file editor" msgid "Edit in single-file editor"
msgstr "" msgstr ""
msgid "Edit inline"
msgstr ""
msgid "Edit issues" msgid "Edit issues"
msgstr "" msgstr ""
...@@ -14705,6 +14708,9 @@ msgstr "" ...@@ -14705,6 +14708,9 @@ msgstr ""
msgid "Integrations|You can now close this window and return to the GitLab for Jira application." msgid "Integrations|You can now close this window and return to the GitLab for Jira application."
msgstr "" msgstr ""
msgid "Interactive mode"
msgstr ""
msgid "Interested parties can even contribute by pushing commits if they want to." msgid "Interested parties can even contribute by pushing commits if they want to."
msgstr "" msgstr ""
...@@ -24901,6 +24907,9 @@ msgid_plural "Showing %d events" ...@@ -24901,6 +24907,9 @@ msgid_plural "Showing %d events"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "Showing %{conflict_start}%{conflicts_text}%{strong_end} between %{ref_start}%{source_branch}%{strong_end} and %{ref_start}%{target_branch}%{strong_end}"
msgstr ""
msgid "Showing %{count} of %{total} projects" msgid "Showing %{count} of %{total} projects"
msgstr "" msgstr ""
...@@ -29808,6 +29817,9 @@ msgstr "" ...@@ -29808,6 +29817,9 @@ msgstr ""
msgid "View file @ %{commitSha}" msgid "View file @ %{commitSha}"
msgstr "" msgstr ""
msgid "View file @%{commit_sha}"
msgstr ""
msgid "View full dashboard" msgid "View full dashboard"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment