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
73406191
Commit
73406191
authored
Nov 15, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed batch comments
parent
290f8281
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
10 deletions
+10
-10
app/assets/javascripts/diffs/components/inline_diff_view.vue
app/assets/javascripts/diffs/components/inline_diff_view.vue
+2
-2
app/assets/javascripts/diffs/components/parallel_diff_view.vue
...ssets/javascripts/diffs/components/parallel_diff_view.vue
+2
-2
ee/app/assets/javascripts/batch_comments/mixins/diff_line_note_form.js
.../javascripts/batch_comments/mixins/diff_line_note_form.js
+1
-1
ee/app/assets/javascripts/batch_comments/stores/modules/batch_comments/getters.js
...s/batch_comments/stores/modules/batch_comments/getters.js
+2
-2
ee/app/assets/javascripts/batch_comments/utils.js
ee/app/assets/javascripts/batch_comments/utils.js
+3
-3
No files found.
app/assets/javascripts/diffs/components/inline_diff_view.vue
View file @
73406191
...
...
@@ -60,9 +60,9 @@ export default {
:line-index=
"index"
/>
<inline-draft-comment-row
v-if=
"shouldRenderDraftRow(diffFile.file
H
ash, line)"
v-if=
"shouldRenderDraftRow(diffFile.file
_h
ash, line)"
:key=
"`draft_$
{index}`"
:draft="draftForLine(diffFile.file
H
ash, line)"
:draft="draftForLine(diffFile.file
_h
ash, line)"
/>
</
template
>
</tbody>
...
...
app/assets/javascripts/diffs/components/parallel_diff_view.vue
View file @
73406191
...
...
@@ -62,10 +62,10 @@ export default {
:line-index="index"
/>
<parallel-draft-comment-row
v-if=
"shouldRenderParallelDraftRow(diffFile.file
H
ash, line)"
v-if=
"shouldRenderParallelDraftRow(diffFile.file
_h
ash, line)"
:key=
"`drafts-$
{index}`"
:line="line"
:diff-file-content-sha="diffFile.file
H
ash"
:diff-file-content-sha="diffFile.file
_h
ash"
/>
</
template
>
</tbody>
...
...
ee/app/assets/javascripts/batch_comments/mixins/diff_line_note_form.js
View file @
73406191
...
...
@@ -55,7 +55,7 @@ export default {
return
this
.
saveDraft
(
postData
)
.
then
(()
=>
{
this
.
handleClearForm
(
this
.
line
.
line
C
ode
);
this
.
handleClearForm
(
this
.
line
.
line
_c
ode
);
})
.
catch
(()
=>
{
createFlash
(
s__
(
'
MergeRequests|An error occurred while saving the draft comment.
'
));
...
...
ee/app/assets/javascripts/batch_comments/stores/modules/batch_comments/getters.js
View file @
73406191
...
...
@@ -31,7 +31,7 @@ export const draftsPerFileHashAndLine = state =>
export
const
shouldRenderDraftRow
=
(
state
,
getters
)
=>
(
diffFileSha
,
line
)
=>
!!
(
diffFileSha
in
getters
.
draftsPerFileHashAndLine
&&
getters
.
draftsPerFileHashAndLine
[
diffFileSha
][
line
.
line
C
ode
]
getters
.
draftsPerFileHashAndLine
[
diffFileSha
][
line
.
line
_c
ode
]
);
export
const
shouldRenderParallelDraftRow
=
(
state
,
getters
)
=>
(
diffFileSha
,
line
)
=>
{
...
...
@@ -50,7 +50,7 @@ export const draftForDiscussion = (state, getters) => discussionId =>
export
const
draftForLine
=
(
state
,
getters
)
=>
(
diffFileSha
,
line
,
side
=
null
)
=>
{
const
draftsForFile
=
getters
.
draftsPerFileHashAndLine
[
diffFileSha
];
const
key
=
side
!==
null
?
parallelLineKey
(
line
,
side
)
:
line
.
line
C
ode
;
const
key
=
side
!==
null
?
parallelLineKey
(
line
,
side
)
:
line
.
line
_c
ode
;
if
(
draftsForFile
)
{
const
draft
=
draftsForFile
[
key
];
...
...
ee/app/assets/javascripts/batch_comments/utils.js
View file @
73406191
...
...
@@ -10,7 +10,7 @@ export const getDraftFormData = params => ({
data
:
getFormData
(
params
),
});
export
const
parallelLineKey
=
(
line
,
side
)
=>
(
line
[
side
]
?
line
[
side
].
line
C
ode
:
''
);
export
const
parallelLineKey
=
(
line
,
side
)
=>
(
line
[
side
]
?
line
[
side
].
line
_c
ode
:
''
);
export
const
showDraftOnSide
=
(
line
,
side
)
=>
{
// inline mode
...
...
@@ -21,8 +21,8 @@ export const showDraftOnSide = (line, side) => {
// parallel
if
(
side
===
'
left
'
||
side
===
'
right
'
)
{
const
otherSide
=
side
===
'
left
'
?
'
right
'
:
'
left
'
;
const
thisCode
=
(
line
[
side
]
&&
line
[
side
].
line
C
ode
)
||
''
;
const
otherCode
=
(
line
[
otherSide
]
&&
line
[
otherSide
].
line
C
ode
)
||
''
;
const
thisCode
=
(
line
[
side
]
&&
line
[
side
].
line
_c
ode
)
||
''
;
const
otherCode
=
(
line
[
otherSide
]
&&
line
[
otherSide
].
line
_c
ode
)
||
''
;
// either the lineCodes are different
// or if they're the same, only show on the left side
...
...
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