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
49d5cc34
Commit
49d5cc34
authored
Jul 10, 2019
by
Winnie Hellmann
Committed by
Clement Ho
Jul 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deleteNote from notes service
parent
42659759
Changes
4
Show 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 @
49d5cc34
...
@@ -9,9 +9,6 @@ export default {
...
@@ -9,9 +9,6 @@ export default {
const
config
=
filter
!==
undefined
?
{
params
:
{
notes_filter
:
filter
}
}
:
null
;
const
config
=
filter
!==
undefined
?
{
params
:
{
notes_filter
:
filter
}
}
:
null
;
return
Vue
.
http
.
get
(
endpoint
,
config
);
return
Vue
.
http
.
get
(
endpoint
,
config
);
},
},
deleteNote
(
endpoint
)
{
return
Vue
.
http
.
delete
(
endpoint
);
},
replyToDiscussion
(
endpoint
,
data
)
{
replyToDiscussion
(
endpoint
,
data
)
{
return
Vue
.
http
.
post
(
endpoint
,
data
,
{
emulateJSON
:
true
});
return
Vue
.
http
.
post
(
endpoint
,
data
,
{
emulateJSON
:
true
});
},
},
...
...
app/assets/javascripts/notes/stores/actions.js
View file @
49d5cc34
...
@@ -62,7 +62,7 @@ export const updateDiscussion = ({ commit, state }, discussion) => {
...
@@ -62,7 +62,7 @@ export const updateDiscussion = ({ commit, state }, discussion) => {
};
};
export
const
deleteNote
=
({
commit
,
dispatch
,
state
},
note
)
=>
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
);
const
discussion
=
state
.
discussions
.
find
(({
id
})
=>
id
===
note
.
discussion_id
);
commit
(
types
.
DELETE_NOTE
,
note
);
commit
(
types
.
DELETE_NOTE
,
note
);
...
...
changelogs/unreleased/winh-notes-service-deleteNote.yml
0 → 100644
View file @
49d5cc34
---
title
:
Remove deleteNote from notes service
merge_request
:
30537
author
:
Frank van Rest
type
:
other
spec/javascripts/notes/stores/actions_spec.js
View file @
49d5cc34
...
@@ -18,6 +18,8 @@ import {
...
@@ -18,6 +18,8 @@ import {
noteableDataMock
,
noteableDataMock
,
individualNote
,
individualNote
,
}
from
'
../mock_data
'
;
}
from
'
../mock_data
'
;
import
AxiosMockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
const
TEST_ERROR_MESSAGE
=
'
Test error message
'
;
const
TEST_ERROR_MESSAGE
=
'
Test error message
'
;
...
@@ -335,28 +337,24 @@ describe('Actions Notes Store', () => {
...
@@ -335,28 +337,24 @@ describe('Actions Notes Store', () => {
});
});
describe
(
'
deleteNote
'
,
()
=>
{
describe
(
'
deleteNote
'
,
()
=>
{
const
interceptor
=
(
request
,
next
)
=>
{
const
endpoint
=
`
${
TEST_HOST
}
/note`
;
next
(
let
axiosMock
;
request
.
respondWith
(
JSON
.
stringify
({}),
{
status
:
200
,
}),
);
};
beforeEach
(()
=>
{
beforeEach
(()
=>
{
Vue
.
http
.
interceptors
.
push
(
interceptor
);
axiosMock
=
new
AxiosMockAdapter
(
axios
);
axiosMock
.
onDelete
(
endpoint
).
replyOnce
(
200
,
{});
$
(
'
body
'
).
attr
(
'
data-page
'
,
''
);
$
(
'
body
'
).
attr
(
'
data-page
'
,
''
);
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
Vue
.
http
.
interceptors
=
_
.
without
(
Vue
.
http
.
interceptors
,
interceptor
);
axiosMock
.
restore
(
);
$
(
'
body
'
).
attr
(
'
data-page
'
,
''
);
$
(
'
body
'
).
attr
(
'
data-page
'
,
''
);
});
});
it
(
'
commits DELETE_NOTE and dispatches updateMergeRequestWidget
'
,
done
=>
{
it
(
'
commits DELETE_NOTE and dispatches updateMergeRequestWidget
'
,
done
=>
{
const
note
=
{
path
:
`
${
gl
.
TEST_HOST
}
`
,
id
:
1
};
const
note
=
{
path
:
endpoint
,
id
:
1
};
testAction
(
testAction
(
actions
.
deleteNote
,
actions
.
deleteNote
,
...
@@ -381,7 +379,7 @@ describe('Actions Notes Store', () => {
...
@@ -381,7 +379,7 @@ describe('Actions Notes Store', () => {
});
});
it
(
'
dispatches removeDiscussionsFromDiff on merge request page
'
,
done
=>
{
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
'
);
$
(
'
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