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
228a48af
Commit
228a48af
authored
Feb 18, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
1faeb101
6293786e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
0 deletions
+49
-0
app/assets/javascripts/notes/components/noteable_discussion.vue
...sets/javascripts/notes/components/noteable_discussion.vue
+5
-0
app/assets/javascripts/notes/stores/actions.js
app/assets/javascripts/notes/stores/actions.js
+3
-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
+7
-0
spec/javascripts/notes/stores/actions_spec.js
spec/javascripts/notes/stores/actions_spec.js
+14
-0
spec/javascripts/notes/stores/mutation_spec.js
spec/javascripts/notes/stores/mutation_spec.js
+19
-0
No files found.
app/assets/javascripts/notes/components/noteable_discussion.vue
View file @
228a48af
...
...
@@ -263,6 +263,7 @@ export default {
'
removePlaceholderNotes
'
,
'
toggleResolveNote
'
,
'
expandDiscussion
'
,
'
removeConvertedDiscussion
'
,
]),
truncateSha
,
componentName
(
note
)
{
...
...
@@ -302,6 +303,10 @@ export default {
}
}
if
(
this
.
convertedDisscussionIds
.
includes
(
this
.
discussion
.
id
))
{
this
.
removeConvertedDiscussion
(
this
.
discussion
.
id
);
}
this
.
isReplying
=
false
;
this
.
resetAutoSave
();
},
...
...
app/assets/javascripts/notes/stores/actions.js
View file @
228a48af
...
...
@@ -443,5 +443,8 @@ export const submitSuggestion = (
export
const
convertToDiscussion
=
({
commit
},
noteId
)
=>
commit
(
types
.
CONVERT_TO_DISCUSSION
,
noteId
);
export
const
removeConvertedDiscussion
=
({
commit
},
noteId
)
=>
commit
(
types
.
REMOVE_CONVERTED_DISCUSSION
,
noteId
);
// prevent babel-plugin-rewire from generating an invalid default during karma tests
export
default
()
=>
{};
app/assets/javascripts/notes/stores/mutation_types.js
View file @
228a48af
...
...
@@ -18,6 +18,7 @@ export const SET_NOTES_LOADING_STATE = 'SET_NOTES_LOADING_STATE';
export
const
DISABLE_COMMENTS
=
'
DISABLE_COMMENTS
'
;
export
const
APPLY_SUGGESTION
=
'
APPLY_SUGGESTION
'
;
export
const
CONVERT_TO_DISCUSSION
=
'
CONVERT_TO_DISCUSSION
'
;
export
const
REMOVE_CONVERTED_DISCUSSION
=
'
REMOVE_CONVERTED_DISCUSSION
'
;
// DISCUSSION
export
const
COLLAPSE_DISCUSSION
=
'
COLLAPSE_DISCUSSION
'
;
...
...
app/assets/javascripts/notes/stores/mutations.js
View file @
228a48af
...
...
@@ -269,4 +269,11 @@ export default {
const
convertedDisscussionIds
=
[...
state
.
convertedDisscussionIds
,
discussionId
];
Object
.
assign
(
state
,
{
convertedDisscussionIds
});
},
[
types
.
REMOVE_CONVERTED_DISCUSSION
](
state
,
discussionId
)
{
const
convertedDisscussionIds
=
[...
state
.
convertedDisscussionIds
];
convertedDisscussionIds
.
splice
(
convertedDisscussionIds
.
indexOf
(
discussionId
),
1
);
Object
.
assign
(
state
,
{
convertedDisscussionIds
});
},
};
spec/javascripts/notes/stores/actions_spec.js
View file @
228a48af
...
...
@@ -737,4 +737,18 @@ describe('Actions Notes Store', () => {
);
});
});
describe
(
'
removeConvertedDiscussion
'
,
()
=>
{
it
(
'
commits CONVERT_TO_DISCUSSION with noteId
'
,
done
=>
{
const
noteId
=
'
dummy-id
'
;
testAction
(
actions
.
removeConvertedDiscussion
,
noteId
,
{},
[{
type
:
'
REMOVE_CONVERTED_DISCUSSION
'
,
payload
:
noteId
}],
[],
done
,
);
});
});
});
spec/javascripts/notes/stores/mutation_spec.js
View file @
228a48af
...
...
@@ -536,4 +536,23 @@ describe('Notes Store mutations', () => {
expect
(
state
.
convertedDisscussionIds
).
toContain
(
discussion
.
id
);
});
});
describe
(
'
REMOVE_CONVERTED_DISCUSSION
'
,
()
=>
{
let
discussion
;
let
state
;
beforeEach
(()
=>
{
discussion
=
{
id
:
42
,
individual_note
:
true
,
};
state
=
{
convertedDisscussionIds
:
[
41
,
42
]
};
});
it
(
'
removes a disucssion from convertedDisscussionIds
'
,
()
=>
{
mutations
.
REMOVE_CONVERTED_DISCUSSION
(
state
,
discussion
.
id
);
expect
(
state
.
convertedDisscussionIds
).
not
.
toContain
(
discussion
.
id
);
});
});
});
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