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
e57a016d
Commit
e57a016d
authored
Aug 06, 2020
by
Justin Boyson
Committed by
Jose Ivan Vargas
Aug 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code review updates
Remove mapMutation usage Add action Update specs Fix lint error
parent
33d7ba0d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
1 deletion
+52
-1
app/assets/javascripts/notes/components/noteable_note.vue
app/assets/javascripts/notes/components/noteable_note.vue
+7
-1
app/assets/javascripts/notes/stores/actions.js
app/assets/javascripts/notes/stores/actions.js
+4
-0
app/assets/javascripts/notes/stores/mutation_types.js
app/assets/javascripts/notes/stores/mutation_types.js
+1
-0
app/assets/javascripts/notes/stores/mutations.js
app/assets/javascripts/notes/stores/mutations.js
+5
-0
changelogs/unreleased/jdb-fix-mlc-highlight-not-updating.yml
changelogs/unreleased/jdb-fix-mlc-highlight-not-updating.yml
+5
-0
spec/frontend/notes/stores/actions_spec.js
spec/frontend/notes/stores/actions_spec.js
+14
-0
spec/frontend/notes/stores/mutation_spec.js
spec/frontend/notes/stores/mutation_spec.js
+16
-0
No files found.
app/assets/javascripts/notes/components/noteable_note.vue
View file @
e57a016d
...
@@ -208,6 +208,7 @@ export default {
...
@@ -208,6 +208,7 @@ export default {
'
scrollToNoteIfNeeded
'
,
'
scrollToNoteIfNeeded
'
,
'
updateAssignees
'
,
'
updateAssignees
'
,
'
setSelectedCommentPositionHover
'
,
'
setSelectedCommentPositionHover
'
,
'
updateDiscussionPosition
'
,
]),
]),
editHandler
()
{
editHandler
()
{
this
.
isEditing
=
true
;
this
.
isEditing
=
true
;
...
@@ -250,8 +251,13 @@ export default {
...
@@ -250,8 +251,13 @@ export default {
...
this
.
note
.
position
,
...
this
.
note
.
position
,
};
};
if
(
this
.
commentLineStart
&&
this
.
line
)
if
(
this
.
discussionRoot
&&
this
.
commentLineStart
&&
this
.
line
)
{
position
.
line_range
=
formatLineRange
(
this
.
commentLineStart
,
this
.
line
);
position
.
line_range
=
formatLineRange
(
this
.
commentLineStart
,
this
.
line
);
this
.
updateDiscussionPosition
({
discussionId
:
this
.
note
.
discussion_id
,
position
,
});
}
this
.
$emit
(
'
handleUpdateNote
'
,
{
this
.
$emit
(
'
handleUpdateNote
'
,
{
note
:
this
.
note
,
note
:
this
.
note
,
...
...
app/assets/javascripts/notes/stores/actions.js
View file @
e57a016d
...
@@ -708,3 +708,7 @@ export const receiveDeleteDescriptionVersionError = ({ commit }, error) => {
...
@@ -708,3 +708,7 @@ export const receiveDeleteDescriptionVersionError = ({ commit }, error) => {
export
const
updateAssignees
=
({
commit
},
assignees
)
=>
{
export
const
updateAssignees
=
({
commit
},
assignees
)
=>
{
commit
(
types
.
UPDATE_ASSIGNEES
,
assignees
);
commit
(
types
.
UPDATE_ASSIGNEES
,
assignees
);
};
};
export
const
updateDiscussionPosition
=
({
commit
},
updatedPosition
)
=>
{
commit
(
types
.
UPDATE_DISCUSSION_POSITION
,
updatedPosition
);
};
app/assets/javascripts/notes/stores/mutation_types.js
View file @
e57a016d
...
@@ -12,6 +12,7 @@ export const SHOW_PLACEHOLDER_NOTE = 'SHOW_PLACEHOLDER_NOTE';
...
@@ -12,6 +12,7 @@ export const SHOW_PLACEHOLDER_NOTE = 'SHOW_PLACEHOLDER_NOTE';
export
const
TOGGLE_AWARD
=
'
TOGGLE_AWARD
'
;
export
const
TOGGLE_AWARD
=
'
TOGGLE_AWARD
'
;
export
const
UPDATE_NOTE
=
'
UPDATE_NOTE
'
;
export
const
UPDATE_NOTE
=
'
UPDATE_NOTE
'
;
export
const
UPDATE_DISCUSSION
=
'
UPDATE_DISCUSSION
'
;
export
const
UPDATE_DISCUSSION
=
'
UPDATE_DISCUSSION
'
;
export
const
UPDATE_DISCUSSION_POSITION
=
'
UPDATE_DISCUSSION_POSITION
'
;
export
const
SET_DISCUSSION_DIFF_LINES
=
'
SET_DISCUSSION_DIFF_LINES
'
;
export
const
SET_DISCUSSION_DIFF_LINES
=
'
SET_DISCUSSION_DIFF_LINES
'
;
export
const
SET_NOTES_FETCHED_STATE
=
'
SET_NOTES_FETCHED_STATE
'
;
export
const
SET_NOTES_FETCHED_STATE
=
'
SET_NOTES_FETCHED_STATE
'
;
export
const
SET_NOTES_LOADING_STATE
=
'
SET_NOTES_LOADING_STATE
'
;
export
const
SET_NOTES_LOADING_STATE
=
'
SET_NOTES_LOADING_STATE
'
;
...
...
app/assets/javascripts/notes/stores/mutations.js
View file @
e57a016d
...
@@ -278,6 +278,11 @@ export default {
...
@@ -278,6 +278,11 @@ export default {
Object
.
assign
(
selectedDiscussion
,
{
...
note
});
Object
.
assign
(
selectedDiscussion
,
{
...
note
});
},
},
[
types
.
UPDATE_DISCUSSION_POSITION
](
state
,
{
discussionId
,
position
})
{
const
selectedDiscussion
=
state
.
discussions
.
find
(
disc
=>
disc
.
id
===
discussionId
);
if
(
selectedDiscussion
)
Object
.
assign
(
selectedDiscussion
.
position
,
{
...
position
});
},
[
types
.
CLOSE_ISSUE
](
state
)
{
[
types
.
CLOSE_ISSUE
](
state
)
{
Object
.
assign
(
state
.
noteableData
,
{
state
:
constants
.
CLOSED
});
Object
.
assign
(
state
.
noteableData
,
{
state
:
constants
.
CLOSED
});
},
},
...
...
changelogs/unreleased/jdb-fix-mlc-highlight-not-updating.yml
0 → 100644
View file @
e57a016d
---
title
:
Fix highlight commented rows
merge_request
:
38420
author
:
type
:
fixed
spec/frontend/notes/stores/actions_spec.js
View file @
e57a016d
...
@@ -1322,4 +1322,18 @@ describe('Actions Notes Store', () => {
...
@@ -1322,4 +1322,18 @@ describe('Actions Notes Store', () => {
});
});
});
});
});
});
describe
(
'
updateDiscussionPosition
'
,
()
=>
{
it
(
'
update the assignees state
'
,
done
=>
{
const
updatedPosition
=
{
discussionId
:
1
,
position
:
{
test
:
true
}
};
testAction
(
actions
.
updateDiscussionPosition
,
updatedPosition
,
{
state
:
{
discussions
:
[]
}
},
[{
type
:
mutationTypes
.
UPDATE_DISCUSSION_POSITION
,
payload
:
updatedPosition
}],
[],
done
,
);
});
});
});
});
spec/frontend/notes/stores/mutation_spec.js
View file @
e57a016d
...
@@ -865,4 +865,20 @@ describe('Notes Store mutations', () => {
...
@@ -865,4 +865,20 @@ describe('Notes Store mutations', () => {
expect
(
state
.
noteableData
.
assignees
).
toEqual
([
userDataMock
.
id
]);
expect
(
state
.
noteableData
.
assignees
).
toEqual
([
userDataMock
.
id
]);
});
});
});
});
describe
(
'
UPDATE_DISCUSSION_POSITION
'
,
()
=>
{
it
(
'
should upate the discusion position
'
,
()
=>
{
const
discussion1
=
{
id
:
1
,
position
:
{
line_code
:
'
abc_1_1
'
}
};
const
discussion2
=
{
id
:
2
,
position
:
{
line_code
:
'
abc_2_2
'
}
};
const
discussion3
=
{
id
:
3
,
position
:
{
line_code
:
'
abc_3_3
'
}
};
const
state
=
{
discussions
:
[
discussion1
,
discussion2
,
discussion3
],
};
const
discussion1Position
=
{
...
discussion1
.
position
};
const
position
=
{
...
discussion1Position
,
test
:
true
};
mutations
.
UPDATE_DISCUSSION_POSITION
(
state
,
{
discussionId
:
discussion1
.
id
,
position
});
expect
(
state
.
discussions
[
0
].
position
).
toEqual
(
position
);
});
});
});
});
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