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
5c39c7c3
Commit
5c39c7c3
authored
Sep 17, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated latestDiff logic to only be used to LegacyDiffNotes
parent
5eef5f24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
app/assets/javascripts/diffs/store/mutations.js
app/assets/javascripts/diffs/store/mutations.js
+1
-3
app/assets/javascripts/diffs/store/utils.js
app/assets/javascripts/diffs/store/utils.js
+2
-2
No files found.
app/assets/javascripts/diffs/store/mutations.js
View file @
5c39c7c3
...
@@ -86,8 +86,6 @@ export default {
...
@@ -86,8 +86,6 @@ export default {
},
},
[
types
.
SET_LINE_DISCUSSIONS_FOR_FILE
](
state
,
{
fileHash
,
discussions
,
diffPositionByLineCode
})
{
[
types
.
SET_LINE_DISCUSSIONS_FOR_FILE
](
state
,
{
fileHash
,
discussions
,
diffPositionByLineCode
})
{
if
(
!
state
.
latestDiff
)
return
;
const
selectedFile
=
state
.
diffFiles
.
find
(
f
=>
f
.
fileHash
===
fileHash
);
const
selectedFile
=
state
.
diffFiles
.
find
(
f
=>
f
.
fileHash
===
fileHash
);
const
firstDiscussion
=
discussions
[
0
];
const
firstDiscussion
=
discussions
[
0
];
const
isDiffDiscussion
=
firstDiscussion
.
diff_discussion
;
const
isDiffDiscussion
=
firstDiscussion
.
diff_discussion
;
...
@@ -99,7 +97,7 @@ export default {
...
@@ -99,7 +97,7 @@ export default {
isDiffDiscussion
&&
isDiffDiscussion
&&
hasLineCode
&&
hasLineCode
&&
diffPosition
&&
diffPosition
&&
isDiscussionApplicableToLine
(
firstDiscussion
,
diffPosition
)
isDiscussionApplicableToLine
(
firstDiscussion
,
diffPosition
,
state
.
latestDiff
)
)
{
)
{
const
targetLine
=
selectedFile
.
parallelDiffLines
.
find
(
const
targetLine
=
selectedFile
.
parallelDiffLines
.
find
(
line
=>
line
=>
...
...
app/assets/javascripts/diffs/store/utils.js
View file @
5c39c7c3
...
@@ -254,7 +254,7 @@ export function getDiffPositionByLineCode(diffFiles) {
...
@@ -254,7 +254,7 @@ export function getDiffPositionByLineCode(diffFiles) {
// This method will check whether the discussion is still applicable
// This method will check whether the discussion is still applicable
// to the diff line in question regarding different versions of the MR
// to the diff line in question regarding different versions of the MR
export
function
isDiscussionApplicableToLine
(
discussion
,
diffPosition
)
{
export
function
isDiscussionApplicableToLine
(
discussion
,
diffPosition
,
latestDiff
)
{
const
{
lineCode
,
...
diffPositionCopy
}
=
diffPosition
;
const
{
lineCode
,
...
diffPositionCopy
}
=
diffPosition
;
if
(
discussion
.
original_position
&&
discussion
.
position
)
{
if
(
discussion
.
original_position
&&
discussion
.
position
)
{
...
@@ -264,5 +264,5 @@ export function isDiscussionApplicableToLine(discussion, diffPosition) {
...
@@ -264,5 +264,5 @@ export function isDiscussionApplicableToLine(discussion, diffPosition) {
return
_
.
isEqual
(
refs
,
diffPositionCopy
)
||
_
.
isEqual
(
originalRefs
,
diffPositionCopy
);
return
_
.
isEqual
(
refs
,
diffPositionCopy
)
||
_
.
isEqual
(
originalRefs
,
diffPositionCopy
);
}
}
return
discussion
.
active
&&
lineCode
===
discussion
.
line_code
;
return
latestDiff
&&
discussion
.
active
&&
lineCode
===
discussion
.
line_code
;
}
}
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