Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
49d5cc34
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
49d5cc34
编写于
7月 10, 2019
作者:
W
Winnie Hellmann
提交者:
Clement Ho
7月 10, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove deleteNote from notes service
上级
42659759
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
15 deletion
+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
未找到文件。
app/assets/javascripts/notes/services/notes_service.js
浏览文件 @
49d5cc34
...
...
@@ -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
浏览文件 @
49d5cc34
...
...
@@ -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
浏览文件 @
49d5cc34
---
title
:
Remove deleteNote from notes service
merge_request
:
30537
author
:
Frank van Rest
type
:
other
spec/javascripts/notes/stores/actions_spec.js
浏览文件 @
49d5cc34
...
...
@@ -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
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录