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
23bd46cf
Commit
23bd46cf
authored
Jul 05, 2019
by
Winnie Hellmann
Committed by
Fatih Acet
Jul 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove applySuggestion from notes service
parent
c0e193db
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
10 deletions
+11
-10
app/assets/javascripts/notes/services/notes_service.js
app/assets/javascripts/notes/services/notes_service.js
+0
-4
app/assets/javascripts/notes/stores/actions.js
app/assets/javascripts/notes/stores/actions.js
+2
-2
changelogs/unreleased/winh-notes-service-applySuggestion.yml
changelogs/unreleased/winh-notes-service-applySuggestion.yml
+5
-0
spec/javascripts/notes/stores/actions_spec.js
spec/javascripts/notes/stores/actions_spec.js
+4
-4
No files found.
app/assets/javascripts/notes/services/notes_service.js
View file @
23bd46cf
import
Vue
from
'
vue
'
;
import
Api
from
'
~/api
'
;
import
VueResource
from
'
vue-resource
'
;
import
*
as
constants
from
'
../constants
'
;
...
...
@@ -45,7 +44,4 @@ export default {
toggleIssueState
(
endpoint
,
data
)
{
return
Vue
.
http
.
put
(
endpoint
,
data
);
},
applySuggestion
(
id
)
{
return
Api
.
applySuggestion
(
id
);
},
};
app/assets/javascripts/notes/stores/actions.js
View file @
23bd46cf
...
...
@@ -14,6 +14,7 @@ import sidebarTimeTrackingEventHub from '../../sidebar/event_hub';
import
{
isInViewport
,
scrollToElement
,
isInMRPage
}
from
'
../../lib/utils/common_utils
'
;
import
mrWidgetEventHub
from
'
../../vue_merge_request_widget/event_hub
'
;
import
{
__
}
from
'
~/locale
'
;
import
Api
from
'
~/api
'
;
let
eTagPoll
;
...
...
@@ -449,8 +450,7 @@ export const submitSuggestion = (
{
commit
,
dispatch
},
{
discussionId
,
noteId
,
suggestionId
,
flashContainer
},
)
=>
service
.
applySuggestion
(
suggestionId
)
Api
.
applySuggestion
(
suggestionId
)
.
then
(()
=>
commit
(
types
.
APPLY_SUGGESTION
,
{
discussionId
,
noteId
,
suggestionId
}))
.
then
(()
=>
dispatch
(
'
resolveDiscussion
'
,
{
discussionId
}).
catch
(()
=>
{}))
.
catch
(
err
=>
{
...
...
changelogs/unreleased/winh-notes-service-applySuggestion.yml
0 → 100644
View file @
23bd46cf
---
title
:
Remove applySuggestion from notes service
merge_request
:
30399
author
:
Frank van Rest
type
:
other
spec/javascripts/notes/stores/actions_spec.js
View file @
23bd46cf
import
Vue
from
'
vue
'
;
import
$
from
'
jquery
'
;
import
_
from
'
underscore
'
;
import
Api
from
'
~/api
'
;
import
{
TEST_HOST
}
from
'
spec/test_constants
'
;
import
{
headersInterceptor
}
from
'
spec/helpers/vue_resource_helper
'
;
import
actionsModule
,
*
as
actions
from
'
~/notes/stores/actions
'
;
...
...
@@ -8,7 +9,6 @@ import * as mutationTypes from '~/notes/stores/mutation_types';
import
*
as
notesConstants
from
'
~/notes/constants
'
;
import
createStore
from
'
~/notes/stores
'
;
import
mrWidgetEventHub
from
'
~/vue_merge_request_widget/event_hub
'
;
import
service
from
'
~/notes/services/notes_service
'
;
import
testAction
from
'
../../helpers/vuex_action_helper
'
;
import
{
resetStore
}
from
'
../helpers
'
;
import
{
...
...
@@ -846,9 +846,9 @@ describe('Actions Notes Store', () => {
let
flashContainer
;
beforeEach
(()
=>
{
spyOn
(
service
,
'
applySuggestion
'
);
spyOn
(
Api
,
'
applySuggestion
'
);
dispatch
.
and
.
returnValue
(
Promise
.
resolve
());
service
.
applySuggestion
.
and
.
returnValue
(
Promise
.
resolve
());
Api
.
applySuggestion
.
and
.
returnValue
(
Promise
.
resolve
());
flashContainer
=
{};
});
...
...
@@ -877,7 +877,7 @@ describe('Actions Notes Store', () => {
it
(
'
when service fails, flashes error message
'
,
done
=>
{
const
response
=
{
response
:
{
data
:
{
message
:
TEST_ERROR_MESSAGE
}
}
};
service
.
applySuggestion
.
and
.
returnValue
(
Promise
.
reject
(
response
));
Api
.
applySuggestion
.
and
.
returnValue
(
Promise
.
reject
(
response
));
testSubmitSuggestion
(
done
,
()
=>
{
expect
(
commit
).
not
.
toHaveBeenCalled
();
...
...
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