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
aa2fd250
Commit
aa2fd250
authored
Jan 13, 2021
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes applied state with batch suggestions
parent
9d193f5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
11 deletions
+1
-11
app/assets/javascripts/notes/stores/actions.js
app/assets/javascripts/notes/stores/actions.js
+1
-7
spec/frontend/notes/stores/actions_spec.js
spec/frontend/notes/stores/actions_spec.js
+0
-4
No files found.
app/assets/javascripts/notes/stores/actions.js
View file @
aa2fd250
...
...
@@ -559,7 +559,7 @@ export const updateResolvableDiscussionsCounts = ({ commit }) =>
export
const
submitSuggestion
=
(
{
commit
,
dispatch
},
{
discussionId
,
noteId
,
suggestionId
,
flashContainer
},
{
discussionId
,
suggestionId
,
flashContainer
},
)
=>
{
const
dispatchResolveDiscussion
=
()
=>
dispatch
(
'
resolveDiscussion
'
,
{
discussionId
}).
catch
(()
=>
{});
...
...
@@ -589,11 +589,6 @@ export const submitSuggestion = (
export
const
submitSuggestionBatch
=
({
commit
,
dispatch
,
state
},
{
flashContainer
})
=>
{
const
suggestionIds
=
state
.
batchSuggestionsInfo
.
map
(({
suggestionId
})
=>
suggestionId
);
const
applyAllSuggestions
=
()
=>
state
.
batchSuggestionsInfo
.
map
((
suggestionInfo
)
=>
commit
(
types
.
APPLY_SUGGESTION
,
suggestionInfo
),
);
const
resolveAllDiscussions
=
()
=>
state
.
batchSuggestionsInfo
.
map
((
suggestionInfo
)
=>
{
const
{
discussionId
}
=
suggestionInfo
;
...
...
@@ -605,7 +600,6 @@ export const submitSuggestionBatch = ({ commit, dispatch, state }, { flashContai
dispatch
(
'
stopPolling
'
);
return
Api
.
applySuggestionBatch
(
suggestionIds
)
.
then
(()
=>
Promise
.
all
(
applyAllSuggestions
()))
.
then
(()
=>
Promise
.
all
(
resolveAllDiscussions
()))
.
then
(()
=>
commit
(
types
.
CLEAR_SUGGESTION_BATCH
))
.
catch
((
err
)
=>
{
...
...
spec/frontend/notes/stores/actions_spec.js
View file @
aa2fd250
...
...
@@ -1000,8 +1000,6 @@ describe('Actions Notes Store', () => {
expect
(
commit
.
mock
.
calls
).
toEqual
([
[
mutationTypes
.
SET_APPLYING_BATCH_STATE
,
true
],
[
mutationTypes
.
SET_RESOLVING_DISCUSSION
,
true
],
[
mutationTypes
.
APPLY_SUGGESTION
,
batchSuggestionsInfo
[
0
]],
[
mutationTypes
.
APPLY_SUGGESTION
,
batchSuggestionsInfo
[
1
]],
[
mutationTypes
.
CLEAR_SUGGESTION_BATCH
],
[
mutationTypes
.
SET_APPLYING_BATCH_STATE
,
false
],
[
mutationTypes
.
SET_RESOLVING_DISCUSSION
,
false
],
...
...
@@ -1065,8 +1063,6 @@ describe('Actions Notes Store', () => {
expect
(
commit
.
mock
.
calls
).
toEqual
([
[
mutationTypes
.
SET_APPLYING_BATCH_STATE
,
true
],
[
mutationTypes
.
SET_RESOLVING_DISCUSSION
,
true
],
[
mutationTypes
.
APPLY_SUGGESTION
,
batchSuggestionsInfo
[
0
]],
[
mutationTypes
.
APPLY_SUGGESTION
,
batchSuggestionsInfo
[
1
]],
[
mutationTypes
.
CLEAR_SUGGESTION_BATCH
],
[
mutationTypes
.
SET_APPLYING_BATCH_STATE
,
false
],
[
mutationTypes
.
SET_RESOLVING_DISCUSSION
,
false
],
...
...
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