Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
696de46a
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,发现更多精彩内容 >>
提交
696de46a
编写于
6月 16, 2017
作者:
F
Fatih Acet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
IssueNotesRefactor: Implement note delete.
上级
96ede7f7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
25 addition
and
21 deletion
+25
-21
app/assets/javascripts/notes/components/issue_discussion.vue
app/assets/javascripts/notes/components/issue_discussion.vue
+4
-4
app/assets/javascripts/notes/components/issue_note.vue
app/assets/javascripts/notes/components/issue_note.vue
+18
-13
app/assets/javascripts/notes/components/issue_note_actions.vue
...ssets/javascripts/notes/components/issue_note_actions.vue
+1
-0
app/assets/javascripts/notes/services/issue_notes_service.js
app/assets/javascripts/notes/services/issue_notes_service.js
+1
-1
app/assets/javascripts/notes/stores/issue_notes_store.js
app/assets/javascripts/notes/stores/issue_notes_store.js
+1
-3
未找到文件。
app/assets/javascripts/notes/components/issue_discussion.vue
浏览文件 @
696de46a
...
@@ -58,10 +58,10 @@ export default {
...
@@ -58,10 +58,10 @@ export default {
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-icon"
>
<div
class=
"timeline-icon"
>
<user-avatar-link
<user-avatar-link
:link
-h
ref=
"author.path"
:link
H
ref=
"author.path"
:img
-s
rc=
"author.avatar_url"
:img
S
rc=
"author.avatar_url"
:img
-a
lt=
"author.name"
:img
A
lt=
"author.name"
:img
-s
ize=
"40"
/>
:img
S
ize=
"40"
/>
</div>
</div>
<div
class=
"timeline-content"
>
<div
class=
"timeline-content"
>
<div
class=
"discussion"
>
<div
class=
"discussion"
>
...
...
app/assets/javascripts/notes/components/issue_note.vue
浏览文件 @
696de46a
...
@@ -39,15 +39,20 @@ export default {
...
@@ -39,15 +39,20 @@ export default {
this
.
isEditing
=
true
;
this
.
isEditing
=
true
;
},
},
deleteHandler
()
{
deleteHandler
()
{
this
.
isDeleting
=
true
;
const
msg
=
'
Are you sure you want to delete this list?
'
;
this
.
$store
const
isConfirmed
=
confirm
(
msg
);
// eslint-disable-line
.
dispatch
(
'
deleteNote
'
,
this
.
note
)
.
then
(()
=>
{
if
(
isConfirmed
)
{
this
.
isDeleting
=
false
;
this
.
isDeleting
=
true
;
})
this
.
$store
.
catch
(()
=>
{
.
dispatch
(
'
deleteNote
'
,
this
.
note
)
this
.
isDeleting
=
false
;
.
then
(()
=>
{
});
this
.
isDeleting
=
false
;
})
.
catch
(()
=>
{
this
.
isDeleting
=
false
;
});
}
},
},
formUpdateHandler
()
{
formUpdateHandler
()
{
// console.log('update requested', data);
// console.log('update requested', data);
...
@@ -66,10 +71,10 @@ export default {
...
@@ -66,10 +71,10 @@ export default {
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-icon"
>
<div
class=
"timeline-icon"
>
<user-avatar-link
<user-avatar-link
:link
-h
ref=
"author.path"
:link
H
ref=
"author.path"
:img
-s
rc=
"author.avatar_url"
:img
S
rc=
"author.avatar_url"
:img
-a
lt=
"author.name"
:img
A
lt=
"author.name"
:img
-s
ize=
"40"
/>
:img
S
ize=
"40"
/>
</div>
</div>
<div
class=
"timeline-content"
>
<div
class=
"timeline-content"
>
<div
class=
"note-header"
>
<div
class=
"note-header"
>
...
...
app/assets/javascripts/notes/components/issue_note_actions.vue
浏览文件 @
696de46a
...
@@ -97,6 +97,7 @@ export default {
...
@@ -97,6 +97,7 @@ export default {
</li>
</li>
<li>
<li>
<a
<a
v-if=
"canEdit"
@
click.prevent=
"deleteHandler"
@
click.prevent=
"deleteHandler"
class=
"js-note-delete"
class=
"js-note-delete"
href=
"#"
>
href=
"#"
>
...
...
app/assets/javascripts/notes/services/issue_notes_service.js
浏览文件 @
696de46a
...
@@ -8,6 +8,6 @@ export default {
...
@@ -8,6 +8,6 @@ export default {
return
Vue
.
http
.
get
(
endpoint
);
return
Vue
.
http
.
get
(
endpoint
);
},
},
deleteNote
(
endpoint
)
{
deleteNote
(
endpoint
)
{
return
Vue
.
http
.
get
(
endpoint
);
return
Vue
.
http
.
delete
(
endpoint
);
},
},
};
};
app/assets/javascripts/notes/stores/issue_notes_store.js
浏览文件 @
696de46a
...
@@ -53,10 +53,8 @@ const actions = {
...
@@ -53,10 +53,8 @@ const actions = {
});
});
},
},
deleteNote
(
context
,
note
)
{
deleteNote
(
context
,
note
)
{
// FIXME: Implement request, remove fake delete timer...
return
service
return
service
.
deleteNote
(
`
${
document
.
location
.
href
}
.json`
)
.
deleteNote
(
note
.
path
)
.
then
(
res
=>
res
.
json
)
.
then
(()
=>
{
.
then
(()
=>
{
context
.
commit
(
'
deleteNote
'
,
note
);
context
.
commit
(
'
deleteNote
'
,
note
);
})
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录