Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
d24e47a9
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,发现更多精彩内容 >>
提交
d24e47a9
编写于
6月 28, 2017
作者:
F
Fatih Acet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
IssueDiscussionsRefactor: Do changes after data format change and fix dummy data.
上级
44ccf2b1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
43 addition
and
34 deletion
+43
-34
app/assets/javascripts/notes/components/issue_comment_form.vue
...ssets/javascripts/notes/components/issue_comment_form.vue
+18
-20
app/assets/javascripts/notes/components/issue_discussion.vue
app/assets/javascripts/notes/components/issue_discussion.vue
+7
-7
app/assets/javascripts/notes/components/issue_note.vue
app/assets/javascripts/notes/components/issue_note.vue
+2
-2
app/assets/javascripts/notes/components/issue_note_awards_list.vue
...s/javascripts/notes/components/issue_note_awards_list.vue
+2
-2
app/assets/javascripts/notes/stores/issue_notes_store.js
app/assets/javascripts/notes/stores/issue_notes_store.js
+14
-3
未找到文件。
app/assets/javascripts/notes/components/issue_comment_form.vue
浏览文件 @
d24e47a9
...
...
@@ -7,23 +7,17 @@ import MarkdownField from '../../vue_shared/components/markdown/field.vue';
export
default
{
props
:
{},
data
()
{
const
{
create_note_path
,
state
}
=
window
.
gl
.
issueData
;
const
{
currentUserData
}
=
window
.
gl
;
return
{
note
:
''
,
markdownPreviewUrl
:
''
,
markdownDocsUrl
:
''
,
// FIXME: @fatihacet - Fix the mock data below.
noteType
:
'
comment
'
,
issueState
:
'
open
'
,
endpoint
:
'
/gitlab-org/gitlab-ce/notes
'
,
author
:
{
avatar_url
:
'
http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon
'
,
id
:
1
,
name
:
'
Administrator
'
,
path
:
'
/root
'
,
state
:
'
active
'
,
username
:
'
root
'
,
},
issueState
:
state
,
endpoint
:
create_note_path
,
author
:
currentUserData
,
};
},
components
:
{
...
...
@@ -47,13 +41,12 @@ export default {
methods
:
{
handleSave
()
{
const
data
=
{
endpoint
:
`
${
this
.
endpoint
}
?full_data=1`
,
endpoint
:
this
.
endpoint
,
noteData
:
{
target_type
:
'
issue
'
,
target_id
:
'
89
'
,
full_data
:
true
,
note
:
{
noteable_type
:
'
Issue
'
,
noteable_id
:
89
,
noteable_id
:
window
.
gl
.
issueData
.
id
,
note
:
this
.
note
,
}
},
...
...
@@ -64,12 +57,14 @@ export default {
}
this
.
$store
.
dispatch
(
'
createNewNote
'
,
data
)
.
then
(()
=>
{
.
then
((
res
)
=>
{
if
(
res
.
errors
)
{
return
this
.
handleError
();
}
this
.
discard
();
})
.
catch
(()
=>
{
new
Flash
(
'
Something went wrong while adding your comment. Please try again.
'
);
// eslint-disable-line
});
.
catch
(
this
.
handleError
);
},
discard
()
{
this
.
note
=
''
;
...
...
@@ -78,6 +73,9 @@ export default {
setNoteType
(
type
)
{
this
.
noteType
=
type
;
},
handleError
()
{
new
Flash
(
'
Something went wrong while adding your comment. Please try again.
'
);
// eslint-disable-line
},
},
mounted
()
{
const
issuableDataEl
=
document
.
getElementById
(
'
js-issuable-app-initial-data
'
);
...
...
app/assets/javascripts/notes/components/issue_discussion.vue
浏览文件 @
d24e47a9
...
...
@@ -19,7 +19,7 @@ export default {
return
{
registerLink
:
'
#
'
,
signInLink
:
'
#
'
,
newNotePath
:
''
,
newNotePath
:
window
.
gl
.
issueData
.
create_note_path
,
isReplying
:
false
,
};
},
...
...
@@ -30,6 +30,9 @@ export default {
author
()
{
return
this
.
discussion
.
author
;
},
canReply
()
{
return
window
.
gl
.
issueData
.
current_user
.
can_create_note
;
},
},
components
:
{
IssueNote
,
...
...
@@ -48,10 +51,6 @@ export default {
this
.
registerLink
=
registerLink
.
getAttribute
(
'
href
'
);
this
.
signInLink
=
signInLink
.
getAttribute
(
'
href
'
);
}
// TODO: @fatihacet - Reimplement this when we have data for it.
// const newNotePath = document.querySelector('.js-main-target-form').getAttribute('action');
// this.newNotePath = `${newNotePath}?full_data=1`;
},
methods
:
{
toggleDiscussion
()
{
...
...
@@ -73,6 +72,7 @@ export default {
target_type
:
'
issue
'
,
target_id
:
this
.
discussion
.
noteable_id
,
note
:
{
note
},
full_data
:
true
,
},
};
...
...
@@ -130,7 +130,7 @@ export default {
<div
class=
"flash-container"
></div>
<div
class=
"discussion-reply-holder"
>
<button
v-if=
"
note.can_r
eply && !isReplying"
v-if=
"
canR
eply && !isReplying"
@
click=
"showReplyForm"
type=
"button"
class=
"btn btn-text-field"
...
...
@@ -141,7 +141,7 @@ export default {
:updateHandler=
"saveReply"
:cancelHandler=
"cancelReplyForm"
/>
<div
v-if=
"!
note.can_r
eply"
v-if=
"!
canR
eply"
class=
"disabled-comment text-center"
>
Please
<a
:href=
"registerLink"
>
register
</a>
...
...
app/assets/javascripts/notes/components/issue_note.vue
浏览文件 @
d24e47a9
...
...
@@ -104,8 +104,8 @@ export default {
<issue-note-actions
:accessLevel=
"note.human_access"
:canAward=
"note.emoji_awardable"
:canEdit=
"note.can_edit"
:canDelete=
"note.can_edit"
:canEdit=
"note.c
urrent_user.c
an_edit"
:canDelete=
"note.c
urrent_user.c
an_edit"
:reportAbusePath=
"note.report_abuse_path"
:editHandler=
"editHandler"
:deleteHandler=
"deleteHandler"
/>
...
...
app/assets/javascripts/notes/components/issue_note_awards_list.vue
浏览文件 @
d24e47a9
<
script
>
import
{
glEmojiTag
}
from
'
~/behaviors/gl_
emoji
'
;
import
*
as
Emoji
from
'
../../
emoji
'
;
import
emojiSmiling
from
'
icons/_emoji_slightly_smiling_face.svg
'
;
import
emojiSmile
from
'
icons/_emoji_smile.svg
'
;
import
emojiSmiley
from
'
icons/_emoji_smiley.svg
'
;
...
...
@@ -66,7 +66,7 @@ export default {
},
methods
:
{
getAwardHTML
(
name
)
{
return
glEmojiTag
(
name
);
return
Emoji
.
glEmojiTag
(
name
);
},
getAwardClassBindings
(
awardList
,
awardName
)
{
return
{
...
...
app/assets/javascripts/notes/stores/issue_notes_store.js
浏览文件 @
d24e47a9
...
...
@@ -53,8 +53,16 @@ const mutations = {
}
},
addNewNote
(
storeState
,
note
)
{
// TODO: @fatihacet - When we get the correct data from server update the store
// storeState.notes.push(note);
const
{
discussion_id
,
type
}
=
note
;
const
noteData
=
{
expanded
:
true
,
id
:
discussion_id
,
individual_note
:
!
(
type
===
'
DiscussionNote
'
),
notes
:
[
note
],
reply_id
:
discussion_id
,
};
storeState
.
notes
.
push
(
noteData
);
},
};
...
...
@@ -100,7 +108,10 @@ const actions = {
.
createNewNote
(
endpoint
,
noteData
)
.
then
(
res
=>
res
.
json
())
.
then
((
res
)
=>
{
context
.
commit
(
'
addNewNote
'
,
res
);
if
(
!
res
.
errors
)
{
context
.
commit
(
'
addNewNote
'
,
res
);
}
return
res
;
});
},
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录