Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
一杯枸杞茶ya
csdn-workflow
提交
62b82080
C
csdn-workflow
项目概览
一杯枸杞茶ya
/
csdn-workflow
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
csdn-workflow
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
62b82080
编写于
12月 10, 2018
作者:
F
Fatih Acet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Implement discussions component.
上级
fc3d33ca
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
150 addition
and
31 deletion
+150
-31
src/webview/src/App.vue
src/webview/src/App.vue
+21
-2
src/webview/src/assets/.gitkeep
src/webview/src/assets/.gitkeep
+0
-0
src/webview/src/assets/logo.png
src/webview/src/assets/logo.png
+0
-0
src/webview/src/components/Discussion.vue
src/webview/src/components/Discussion.vue
+98
-0
src/webview/src/components/IssuableDetails.vue
src/webview/src/components/IssuableDetails.vue
+10
-2
src/webview/src/components/IssuableDiscussions.vue
src/webview/src/components/IssuableDiscussions.vue
+12
-1
src/webview/src/components/Note.vue
src/webview/src/components/Note.vue
+3
-6
src/webview/src/components/NoteBody.vue
src/webview/src/components/NoteBody.vue
+1
-0
src/webview/src/components/SystemNote.vue
src/webview/src/components/SystemNote.vue
+3
-6
src/webview/tests/unit/example.spec.js
src/webview/tests/unit/example.spec.js
+0
-13
src/webview_controller.js
src/webview_controller.js
+2
-1
未找到文件。
src/webview/src/App.vue
浏览文件 @
62b82080
...
...
@@ -54,7 +54,12 @@ export default {
<
template
>
<div
id=
"app"
>
<h2
v-if=
"isLoading"
>
Loading...
</h2>
<p
v-if=
"isLoading"
class=
"loading"
>
Fetching issuable details and discussions. This may take a while.
<br
/>
If it doesn't work, please
<a
href=
"https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/new"
>
create an issue.
</a>
</p>
<template
v-else
>
<issuable-details
:issuable=
"issuable"
/>
<issuable-discussions
:discussions=
"discussions"
/>
...
...
@@ -65,7 +70,11 @@ export default {
<
style
lang=
"scss"
>
body
.vscode-light
{
*
{
border-color
:
#333
;
border-color
:
#333
!
important
;
&
::before
{
border-color
:
#333
!
important
;
}
}
.idiff.deletion
{
...
...
@@ -75,6 +84,10 @@ body.vscode-light {
.idiff.addition
{
background
:
#c7f0d2
;
}
.issuable-details
.state
{
color
:
#fff
;
}
}
.capitalize
{
text-transform
:
capitalize
;
...
...
@@ -94,4 +107,10 @@ code {
.idiff.addition
{
background
:
#7cba8d
;
}
#app
.loading
{
text-align
:
center
;
font-size
:
14px
;
line-height
:
30px
;
}
</
style
>
src/webview/src/assets/.gitkeep
0 → 100644
浏览文件 @
62b82080
src/webview/src/assets/logo.png
已删除
100644 → 0
浏览文件 @
fc3d33ca
6.7 KB
src/webview/src/components/Discussion.vue
0 → 100644
浏览文件 @
62b82080
<
script
>
import
Note
from
'
./Note
'
;
export
default
{
name
:
'
Discussion
'
,
props
:
{
noteable
:
{
type
:
Object
,
required
:
true
,
},
},
data
()
{
return
{
isRepliesVisible
:
true
,
};
},
components
:
{
Note
,
},
computed
:
{
initialDiscussion
()
{
return
this
.
noteable
.
notes
[
0
];
},
replies
()
{
return
this
.
noteable
.
notes
.
slice
(
1
);
},
hasReplies
()
{
return
this
.
replies
.
length
>
0
;
},
toggleRepliesText
()
{
return
this
.
isRepliesVisible
?
'
Collapse replies
'
:
'
Expand replies
'
;
},
toggleRepliesIcon
()
{
const
chevronDown
=
'
<svg aria-hidden="true" data-prefix="fas" data-icon="chevron-down" class="svg-inline--fa fa-chevron-down fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"></path></svg>
'
;
const
chevronRight
=
'
<svg aria-hidden="true" data-prefix="fas" data-icon="chevron-right" class="svg-inline--fa fa-chevron-right fa-w-10" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg>
'
;
return
this
.
isRepliesVisible
?
chevronDown
:
chevronRight
;
},
},
methods
:
{
toggleReplies
()
{
this
.
isRepliesVisible
=
!
this
.
isRepliesVisible
;
},
},
};
</
script
>
<
template
>
<div
:class=
"
{ collapsed: !isRepliesVisible }"
class="discussion"
>
<note
:noteable=
"initialDiscussion"
/>
<div
@
click=
"toggleReplies"
class=
"toggle-widget"
>
<span
class=
"chevron"
v-html=
"toggleRepliesIcon"
></span>
{{
toggleRepliesText
}}
</div>
<template
v-if=
"isRepliesVisible"
>
<note
v-for=
"note in replies"
:key=
"note.id"
:noteable=
"note"
/>
</
template
>
</div>
</template>
<
style
lang=
"scss"
>
.discussion
{
border
:
1px
solid
#919191
;
border-radius
:
4px
;
background
:
var
(
--
background-color
);
&
.collapsed
{
.toggle-widget
{
border-radius
:
0
0
4px
4px
;
}
}
>
.note
{
border
:
none
;
margin
:
0
;
}
.toggle-widget
{
background
:
var
(
--
vscode-activityBar-dropBackground
);
padding
:
8px
16px
;
cursor
:
pointer
;
user-select
:
none
;
}
.chevron
svg
{
width
:
10px
;
height
:
10px
;
}
}
</
style
>
src/webview/src/components/IssuableDetails.vue
浏览文件 @
62b82080
...
...
@@ -29,7 +29,6 @@ export default {
}
const
description
=
this
.
issuable
.
description
||
''
;
const
path
=
`
${
this
.
issuable
.
web_url
.
split
(
'
/issues/
'
)[
0
]}
/uploads/`
;
const
normalized
=
description
.
replace
(
/
\/
uploads/gm
,
path
);
...
...
@@ -80,6 +79,7 @@ export default {
<
style
lang=
"scss"
>
.issuable-details
{
border-bottom
:
1px
solid
#919191
;
line-height
:
21px
;
.header
{
padding
:
10px
0
6px
;
...
...
@@ -95,9 +95,17 @@ export default {
.state
{
border-radius
:
4px
;
background-color
:
#2A9D3F
;
padding
:
2px
9px
;
margin-right
:
5px
;
font-size
:
12px
;
&
.opened
{
background-color
:
#2A9D3F
;
}
&
.closed
{
background-color
:
#1D64C9
;
}
}
}
...
...
src/webview/src/components/IssuableDiscussions.vue
浏览文件 @
62b82080
<
script
>
import
Note
from
'
./Note
'
;
import
Discussion
from
'
./Discussion
'
;
import
SystemNote
from
'
./SystemNote
'
;
export
default
{
...
...
@@ -9,6 +10,11 @@ export default {
required
:
true
,
},
},
components
:
{
Note
,
Discussion
,
SystemNote
,
},
methods
:
{
getComponentName
(
discussion
)
{
if
(
discussion
.
individual_note
)
{
...
...
@@ -18,6 +24,11 @@ export default {
return
Note
;
}
return
Discussion
;
},
getComponentData
(
discussion
)
{
return
discussion
.
individual_note
?
discussion
.
notes
[
0
]
:
discussion
;
},
},
};
...
...
@@ -29,7 +40,7 @@ export default {
v-for=
"discussion in discussions"
:key=
"discussion.id"
:is=
"getComponentName(discussion)"
:noteable=
"
discussion
"
:noteable=
"
getComponentData(discussion)
"
/>
</div>
</
template
>
...
...
src/webview/src/components/Note.vue
浏览文件 @
62b82080
...
...
@@ -17,14 +17,11 @@ export default {
NoteBody
,
},
computed
:
{
note
()
{
return
this
.
noteable
.
notes
[
0
];
},
author
()
{
return
this
.
note
.
author
;
return
this
.
note
able
.
author
;
},
createdAgo
()
{
return
moment
(
this
.
note
.
created_at
).
fromNow
();
return
moment
(
this
.
note
able
.
created_at
).
fromNow
();
},
},
};
...
...
@@ -35,7 +32,7 @@ export default {
<div
class=
"note-header"
>
<user-avatar
:user=
"author"
:size=
"40"
/>
·
{{
createdAgo
}}
</div>
<note-body
:note=
"note"
/>
<note-body
:note=
"note
able
"
/>
</div>
</
template
>
...
...
src/webview/src/components/NoteBody.vue
浏览文件 @
62b82080
...
...
@@ -34,6 +34,7 @@ export default {
<
style
lang=
"scss"
>
.note-body
{
margin-left
:
56px
;
line-height
:
21px
;
.badge
{
padding
:
0
8px
;
...
...
src/webview/src/components/SystemNote.vue
浏览文件 @
62b82080
...
...
@@ -16,14 +16,11 @@ export default {
UserAvatar
,
},
computed
:
{
note
()
{
return
this
.
noteable
.
notes
[
0
];
},
author
()
{
return
this
.
note
.
author
;
return
this
.
note
able
.
author
;
},
createdAgo
()
{
return
moment
(
this
.
note
.
created_at
).
fromNow
();
return
moment
(
this
.
note
able
.
created_at
).
fromNow
();
},
},
};
...
...
@@ -49,7 +46,7 @@ export default {
</span>
<div
class=
"note-body-wrapper"
>
<user-avatar
:user=
"author"
:show-avatar=
"false"
/>
<note-body
:note=
"note"
/>
<note-body
:note=
"note
able
"
/>
·
{{
createdAgo
}}
</div>
</div>
...
...
src/webview/tests/unit/example.spec.js
已删除
100644 → 0
浏览文件 @
fc3d33ca
import
{
expect
}
from
'
chai
'
import
{
shallowMount
}
from
'
@vue/test-utils
'
import
HelloWorld
from
'
@/components/HelloWorld.vue
'
describe
(
'
HelloWorld.vue
'
,
()
=>
{
it
(
'
renders props.msg when passed
'
,
()
=>
{
const
msg
=
'
new message
'
const
wrapper
=
shallowMount
(
HelloWorld
,
{
propsData
:
{
msg
}
})
expect
(
wrapper
.
text
()).
to
.
include
(
msg
)
})
})
src/webview_controller.js
浏览文件 @
62b82080
...
...
@@ -44,7 +44,8 @@ const getIndexPath = () => {
}
async
function
create
(
issuable
)
{
const
panel
=
vscode
.
window
.
createWebviewPanel
(
'
glWorkflow
'
,
'
GL Workflow
'
,
vscode
.
ViewColumn
.
One
,
{
const
title
=
`
${
issuable
.
title
.
slice
(
0
,
20
)}
...`
;
const
panel
=
vscode
.
window
.
createWebviewPanel
(
'
glWorkflow
'
,
title
,
vscode
.
ViewColumn
.
One
,
{
enableScripts
:
true
,
localResourceRoots
:
[
vscode
.
Uri
.
file
(
path
.
join
(
context
.
extensionPath
,
'
src
'
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录