Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4d710ce4
Commit
4d710ce4
authored
Feb 17, 2021
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move ParallelConflictLines to SFC
This already was a simple template string, why not use a SFC instead.
parent
9c51b277
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
39 deletions
+49
-39
app/assets/javascripts/merge_conflicts/components/parallel_conflict_lines.js
...pts/merge_conflicts/components/parallel_conflict_lines.js
+0
-37
app/assets/javascripts/merge_conflicts/components/parallel_conflict_lines.vue
...ts/merge_conflicts/components/parallel_conflict_lines.vue
+47
-0
app/assets/javascripts/merge_conflicts/merge_conflicts_bundle.js
...ets/javascripts/merge_conflicts/merge_conflicts_bundle.js
+2
-2
No files found.
app/assets/javascripts/merge_conflicts/components/parallel_conflict_lines.js
deleted
100644 → 0
View file @
9c51b277
/* eslint-disable no-param-reassign */
import
Vue
from
'
vue
'
;
import
actionsMixin
from
'
../mixins/line_conflict_actions
'
;
import
utilsMixin
from
'
../mixins/line_conflict_utils
'
;
((
global
)
=>
{
global
.
mergeConflicts
=
global
.
mergeConflicts
||
{};
global
.
mergeConflicts
.
parallelConflictLines
=
Vue
.
extend
({
mixins
:
[
utilsMixin
,
actionsMixin
],
props
:
{
file
:
{
type
:
Object
,
required
:
true
,
},
},
// This is a true violation of @gitlab/no-runtime-template-compiler, as it
// has a template string.
// eslint-disable-next-line @gitlab/no-runtime-template-compiler
template
:
`
<table class="diff-wrap-lines code js-syntax-highlight">
<tr class="line_holder parallel" v-for="section in file.parallelLines">
<template v-for="line in section">
<td class="diff-line-num header" :class="lineCssClass(line)" v-if="line.isHeader"></td>
<td class="line_content header" :class="lineCssClass(line)" v-if="line.isHeader">
<strong>{{line.richText}}</strong>
<button class="btn" @click="handleSelected(file, line.id, line.section)">{{line.buttonTitle}}</button>
</td>
<td class="diff-line-num old_line" :class="lineCssClass(line)" v-if="!line.isHeader">{{line.lineNumber}}</td>
<td class="line_content parallel" :class="lineCssClass(line)" v-if="!line.isHeader" v-html="line.richText"></td>
</template>
</tr>
</table>
`
,
});
})(
window
.
gl
||
(
window
.
gl
=
{}));
app/assets/javascripts/merge_conflicts/components/parallel_conflict_lines.vue
0 → 100644
View file @
4d710ce4
<
script
>
import
{
GlSafeHtmlDirective
as
SafeHtml
}
from
'
@gitlab/ui
'
;
import
actionsMixin
from
'
../mixins/line_conflict_actions
'
;
import
utilsMixin
from
'
../mixins/line_conflict_utils
'
;
export
default
{
directives
:
{
SafeHtml
,
},
mixins
:
[
utilsMixin
,
actionsMixin
],
props
:
{
file
:
{
type
:
Object
,
required
:
true
,
},
},
};
</
script
>
<
template
>
<!-- Unfortunately there isn't a good key for these sections -->
<!-- eslint-disable vue/require-v-for-key -->
<table
class=
"diff-wrap-lines code js-syntax-highlight"
>
<tr
v-for=
"section in file.parallelLines"
class=
"line_holder parallel"
>
<template
v-for=
"line in section"
>
<template
v-if=
"line.isHeader"
>
<td
class=
"diff-line-num header"
:class=
"lineCssClass(line)"
></td>
<td
class=
"line_content header"
:class=
"lineCssClass(line)"
>
<strong>
{{
line
.
richText
}}
</strong>
<button
class=
"btn"
@
click=
"handleSelected(file, line.id, line.section)"
>
{{
line
.
buttonTitle
}}
</button>
</td>
</
template
>
<
template
v-else
>
<td
class=
"diff-line-num old_line"
:class=
"lineCssClass(line)"
>
{{
line
.
lineNumber
}}
</td>
<td
v-safe-html=
"line.richText"
class=
"line_content parallel"
:class=
"lineCssClass(line)"
></td>
</
template
>
</template>
</tr>
</table>
</template>
app/assets/javascripts/merge_conflicts/merge_conflicts_bundle.js
View file @
4d710ce4
...
...
@@ -12,8 +12,8 @@ import './merge_conflict_store';
import
syntaxHighlight
from
'
../syntax_highlight
'
;
import
DiffFileEditor
from
'
./components/diff_file_editor.vue
'
;
import
InlineConflictLines
from
'
./components/inline_conflict_lines.vue
'
;
import
ParallelConflictLines
from
'
./components/parallel_conflict_lines.vue
'
;
import
MergeConflictsService
from
'
./merge_conflict_service
'
;
import
'
./components/parallel_conflict_lines
'
;
export
default
function
initMergeConflicts
()
{
const
INTERACTIVE_RESOLVE_MODE
=
'
interactive
'
;
...
...
@@ -30,9 +30,9 @@ export default function initMergeConflicts() {
el
:
'
#conflicts
'
,
components
:
{
FileIcon
,
'
parallel-conflict-lines
'
:
gl
.
mergeConflicts
.
parallelConflictLines
,
DiffFileEditor
,
InlineConflictLines
,
ParallelConflictLines
,
},
data
:
mergeConflictsStore
.
state
,
computed
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment