Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
f59b9778
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,发现更多精彩内容 >>
未验证
提交
f59b9778
编写于
5月 25, 2018
作者:
P
Phil Hughes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
moved the collapsing method into a store action
normalized the data into a nicer format
上级
aca0d610
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
41 addition
and
30 deletion
+41
-30
app/assets/javascripts/ide/components/jobs/item.vue
app/assets/javascripts/ide/components/jobs/item.vue
+1
-1
app/assets/javascripts/ide/components/jobs/stage.vue
app/assets/javascripts/ide/components/jobs/stage.vue
+2
-2
app/assets/javascripts/ide/stores/modules/pipelines/actions.js
...ssets/javascripts/ide/stores/modules/pipelines/actions.js
+4
-1
app/assets/javascripts/ide/stores/modules/pipelines/mutation_types.js
...avascripts/ide/stores/modules/pipelines/mutation_types.js
+2
-0
app/assets/javascripts/ide/stores/modules/pipelines/mutations.js
...ets/javascripts/ide/stores/modules/pipelines/mutations.js
+29
-26
app/assets/stylesheets/pages/repo.scss
app/assets/stylesheets/pages/repo.scss
+3
-0
未找到文件。
app/assets/javascripts/ide/components/jobs/item.vue
浏览文件 @
f59b9778
...
...
@@ -29,7 +29,7 @@ export default {
<span
class=
"prepend-left-8"
>
{{
job
.
name
}}
<a
:href=
"job.
build_
path"
:href=
"job.path"
target=
"_blank"
v-text=
"jobId"
>
...
...
app/assets/javascripts/ide/components/jobs/stage.vue
浏览文件 @
f59b9778
...
...
@@ -47,7 +47,7 @@ export default {
this
.
showTooltip
=
stageTitle
.
scrollWidth
>
stageTitle
.
offsetWidth
;
},
methods
:
{
...
mapActions
(
'
pipelines
'
,
[
'
fetchJobs
'
]),
...
mapActions
(
'
pipelines
'
,
[
'
fetchJobs
'
,
'
toggleStageCollapsed
'
]),
},
};
</
script
>
...
...
@@ -58,7 +58,7 @@ export default {
>
<div
class=
"panel-heading"
@
click=
"
() => stage.isCollapsed = !stage.isCollapsed
"
@
click=
"
toggleStageCollapsed(stage.id)
"
>
<ci-icon
:status=
"stage.status"
...
...
app/assets/javascripts/ide/stores/modules/pipelines/actions.js
浏览文件 @
f59b9778
...
...
@@ -65,9 +65,12 @@ export const fetchJobs = ({ dispatch }, stage) => {
dispatch
(
'
requestJobs
'
,
stage
.
id
);
axios
.
get
(
stage
.
dropdown
_p
ath
)
.
get
(
stage
.
dropdown
P
ath
)
.
then
(({
data
})
=>
dispatch
(
'
receiveJobsSuccess
'
,
{
id
:
stage
.
id
,
data
}))
.
catch
(()
=>
dispatch
(
'
receiveJobsError
'
,
stage
.
id
));
};
export
const
toggleStageCollapsed
=
({
commit
},
stageId
)
=>
commit
(
types
.
TOGGLE_STAGE_COLLAPSE
,
stageId
);
export
default
()
=>
{};
app/assets/javascripts/ide/stores/modules/pipelines/mutation_types.js
浏览文件 @
f59b9778
...
...
@@ -5,3 +5,5 @@ export const RECEIVE_LASTEST_PIPELINE_SUCCESS = 'RECEIVE_LASTEST_PIPELINE_SUCCES
export
const
REQUEST_JOBS
=
'
REQUEST_JOBS
'
;
export
const
RECEIVE_JOBS_ERROR
=
'
RECEIVE_JOBS_ERROR
'
;
export
const
RECEIVE_JOBS_SUCCESS
=
'
RECEIVE_JOBS_SUCCESS
'
;
export
const
TOGGLE_STAGE_COLLAPSE
=
'
TOGGLE_STAGE_COLLAPSE
'
;
app/assets/javascripts/ide/stores/modules/pipelines/mutations.js
浏览文件 @
f59b9778
...
...
@@ -23,8 +23,10 @@ export default {
state
.
stages
=
pipeline
.
details
.
stages
.
map
((
stage
,
i
)
=>
{
const
foundStage
=
state
.
stages
.
find
(
s
=>
s
.
id
===
i
);
return
{
...
stage
,
id
:
i
,
dropdownPath
:
stage
.
dropdown_path
,
name
:
stage
.
name
,
status
:
stage
.
status
,
isCollapsed
:
foundStage
?
foundStage
.
isCollapsed
:
false
,
isLoading
:
foundStage
?
foundStage
.
isLoading
:
false
,
jobs
:
foundStage
?
foundStage
.
jobs
:
[],
...
...
@@ -33,34 +35,35 @@ export default {
}
},
[
types
.
REQUEST_JOBS
](
state
,
id
)
{
state
.
stages
=
state
.
stages
.
reduce
(
(
acc
,
stage
)
=>
acc
.
concat
({
...
stage
,
isLoading
:
id
===
stage
.
id
?
true
:
stage
.
isLoading
,
}),
[],
);
state
.
stages
=
state
.
stages
.
map
(
stage
=>
({
...
stage
,
isLoading
:
id
===
stage
.
id
?
true
:
stage
.
isLoading
,
}));
},
[
types
.
RECEIVE_JOBS_ERROR
](
state
,
id
)
{
state
.
stages
=
state
.
stages
.
reduce
(
(
acc
,
stage
)
=>
acc
.
concat
({
...
stage
,
isLoading
:
id
===
stage
.
id
?
false
:
stage
.
isLoading
,
}),
[],
);
state
.
stages
=
state
.
stages
.
map
(
stage
=>
({
...
stage
,
isLoading
:
id
===
stage
.
id
?
true
:
stage
.
isLoading
,
}));
},
[
types
.
RECEIVE_JOBS_SUCCESS
](
state
,
{
id
,
data
})
{
state
.
stages
=
state
.
stages
.
reduce
(
(
acc
,
stage
)
=>
acc
.
concat
({
...
stage
,
isLoading
:
id
===
stage
.
id
?
false
:
stage
.
isLoading
,
jobs
:
id
===
stage
.
id
?
data
.
latest_statuses
:
stage
.
jobs
,
}),
[],
);
const
normalizeData
=
job
=>
({
id
:
job
.
id
,
name
:
job
.
name
,
status
:
job
.
status
,
path
:
job
.
build_path
,
});
state
.
stages
=
state
.
stages
.
map
(
stage
=>
({
...
stage
,
isLoading
:
id
===
stage
.
id
?
false
:
stage
.
isLoading
,
jobs
:
id
===
stage
.
id
?
data
.
latest_statuses
.
map
(
normalizeData
)
:
stage
.
jobs
,
}));
},
[
types
.
TOGGLE_STAGE_COLLAPSE
](
state
,
id
)
{
state
.
stages
=
state
.
stages
.
map
(
stage
=>
({
...
stage
,
isCollapsed
:
stage
.
id
===
id
?
!
stage
.
isCollapsed
:
stage
.
isCollapsed
,
}));
},
};
app/assets/stylesheets/pages/repo.scss
浏览文件 @
f59b9778
...
...
@@ -911,6 +911,9 @@
}
&
.is-right
{
padding-right
:
$gl-padding
;
padding-left
:
$gl-padding
+
1px
;
&
::after
{
right
:
auto
;
left
:
-1px
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录