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
51581edf
Commit
51581edf
authored
Jul 10, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
3f85b4c2
19a8a3d5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
15 deletions
+15
-15
app/assets/javascripts/notes/services/notes_service.js
app/assets/javascripts/notes/services/notes_service.js
+0
-3
app/assets/javascripts/notes/stores/actions.js
app/assets/javascripts/notes/stores/actions.js
+1
-1
changelogs/unreleased/winh-notes-service-deleteNote.yml
changelogs/unreleased/winh-notes-service-deleteNote.yml
+5
-0
spec/javascripts/notes/stores/actions_spec.js
spec/javascripts/notes/stores/actions_spec.js
+9
-11
No files found.
app/assets/javascripts/notes/services/notes_service.js
View file @
51581edf
...
...
@@ -9,9 +9,6 @@ export default {
const
config
=
filter
!==
undefined
?
{
params
:
{
notes_filter
:
filter
}
}
:
null
;
return
Vue
.
http
.
get
(
endpoint
,
config
);
},
deleteNote
(
endpoint
)
{
return
Vue
.
http
.
delete
(
endpoint
);
},
replyToDiscussion
(
endpoint
,
data
)
{
return
Vue
.
http
.
post
(
endpoint
,
data
,
{
emulateJSON
:
true
});
},
...
...
app/assets/javascripts/notes/stores/actions.js
View file @
51581edf
...
...
@@ -62,7 +62,7 @@ export const updateDiscussion = ({ commit, state }, discussion) => {
};
export
const
deleteNote
=
({
commit
,
dispatch
,
state
},
note
)
=>
service
.
deleteNo
te
(
note
.
path
).
then
(()
=>
{
axios
.
dele
te
(
note
.
path
).
then
(()
=>
{
const
discussion
=
state
.
discussions
.
find
(({
id
})
=>
id
===
note
.
discussion_id
);
commit
(
types
.
DELETE_NOTE
,
note
);
...
...
changelogs/unreleased/winh-notes-service-deleteNote.yml
0 → 100644
View file @
51581edf
---
title
:
Remove deleteNote from notes service
merge_request
:
30537
author
:
Frank van Rest
type
:
other
spec/javascripts/notes/stores/actions_spec.js
View file @
51581edf
...
...
@@ -18,6 +18,8 @@ import {
noteableDataMock
,
individualNote
,
}
from
'
../mock_data
'
;
import
AxiosMockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
const
TEST_ERROR_MESSAGE
=
'
Test error message
'
;
...
...
@@ -335,28 +337,24 @@ describe('Actions Notes Store', () => {
});
describe
(
'
deleteNote
'
,
()
=>
{
const
interceptor
=
(
request
,
next
)
=>
{
next
(
request
.
respondWith
(
JSON
.
stringify
({}),
{
status
:
200
,
}),
);
};
const
endpoint
=
`
${
TEST_HOST
}
/note`
;
let
axiosMock
;
beforeEach
(()
=>
{
Vue
.
http
.
interceptors
.
push
(
interceptor
);
axiosMock
=
new
AxiosMockAdapter
(
axios
);
axiosMock
.
onDelete
(
endpoint
).
replyOnce
(
200
,
{});
$
(
'
body
'
).
attr
(
'
data-page
'
,
''
);
});
afterEach
(()
=>
{
Vue
.
http
.
interceptors
=
_
.
without
(
Vue
.
http
.
interceptors
,
interceptor
);
axiosMock
.
restore
(
);
$
(
'
body
'
).
attr
(
'
data-page
'
,
''
);
});
it
(
'
commits DELETE_NOTE and dispatches updateMergeRequestWidget
'
,
done
=>
{
const
note
=
{
path
:
`
${
gl
.
TEST_HOST
}
`
,
id
:
1
};
const
note
=
{
path
:
endpoint
,
id
:
1
};
testAction
(
actions
.
deleteNote
,
...
...
@@ -381,7 +379,7 @@ describe('Actions Notes Store', () => {
});
it
(
'
dispatches removeDiscussionsFromDiff on merge request page
'
,
done
=>
{
const
note
=
{
path
:
`
${
gl
.
TEST_HOST
}
`
,
id
:
1
};
const
note
=
{
path
:
endpoint
,
id
:
1
};
$
(
'
body
'
).
attr
(
'
data-page
'
,
'
projects:merge_requests:show
'
);
...
...
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