Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
65d7bf20
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,发现更多精彩内容 >>
提交
65d7bf20
编写于
10月 03, 2018
作者:
J
Johann Hubert Sonntagbauer
提交者:
Phil Hughes
10月 03, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix props name casing in time time tracker vue component
上级
474231ea
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
44 addition
and
53 deletion
+44
-53
app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.vue
...idebar/components/time_tracking/sidebar_time_tracking.vue
+4
-4
app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue
...scripts/sidebar/components/time_tracking/time_tracker.vue
+16
-30
app/assets/javascripts/sidebar/mount_milestone_sidebar.js
app/assets/javascripts/sidebar/mount_milestone_sidebar.js
+6
-4
spec/javascripts/sidebar/components/time_tracking/time_tracker_spec.js
...pts/sidebar/components/time_tracking/time_tracker_spec.js
+18
-15
未找到文件。
app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.vue
浏览文件 @
65d7bf20
...
...
@@ -51,10 +51,10 @@ export default {
<
template
>
<div
class=
"block"
>
<issuable-time-tracker
:time
_
estimate=
"store.timeEstimate"
:time
_
spent=
"store.totalTimeSpent"
:human
_time_
estimate=
"store.humanTimeEstimate"
:human
_time_
spent=
"store.humanTotalTimeSpent"
:time
-
estimate=
"store.timeEstimate"
:time
-
spent=
"store.totalTimeSpent"
:human
-time-
estimate=
"store.humanTimeEstimate"
:human
-time-
spent=
"store.humanTotalTimeSpent"
:root-path=
"store.rootPath"
/>
</div>
...
...
app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue
浏览文件 @
65d7bf20
...
...
@@ -19,24 +19,20 @@ export default {
TimeTrackingHelpState
,
},
props
:
{
// eslint-disable-next-line vue/prop-name-casing
time_estimate
:
{
timeEstimate
:
{
type
:
Number
,
required
:
true
,
},
// eslint-disable-next-line vue/prop-name-casing
time_spent
:
{
timeSpent
:
{
type
:
Number
,
required
:
true
,
},
// eslint-disable-next-line vue/prop-name-casing
human_time_estimate
:
{
humanTimeEstimate
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
// eslint-disable-next-line vue/prop-name-casing
human_time_spent
:
{
humanTimeSpent
:
{
type
:
String
,
required
:
false
,
default
:
''
,
...
...
@@ -52,18 +48,6 @@ export default {
};
},
computed
:
{
timeSpent
()
{
return
this
.
time_spent
;
},
timeEstimate
()
{
return
this
.
time_estimate
;
},
timeEstimateHumanReadable
()
{
return
this
.
human_time_estimate
;
},
timeSpentHumanReadable
()
{
return
this
.
human_time_spent
;
},
hasTimeSpent
()
{
return
!!
this
.
timeSpent
;
},
...
...
@@ -94,10 +78,12 @@ export default {
this
.
showHelp
=
show
;
},
update
(
data
)
{
this
.
time_estimate
=
data
.
time_estimate
;
this
.
time_spent
=
data
.
time_spent
;
this
.
human_time_estimate
=
data
.
human_time_estimate
;
this
.
human_time_spent
=
data
.
human_time_spent
;
const
{
timeEstimate
,
timeSpent
,
humanTimeEstimate
,
humanTimeSpent
}
=
data
;
this
.
timeEstimate
=
timeEstimate
;
this
.
timeSpent
=
timeSpent
;
this
.
humanTimeEstimate
=
humanTimeEstimate
;
this
.
humanTimeSpent
=
humanTimeSpent
;
},
},
};
...
...
@@ -114,8 +100,8 @@ export default {
:show-help-state=
"showHelpState"
:show-spent-only-state=
"showSpentOnlyState"
:show-estimate-only-state=
"showEstimateOnlyState"
:time-spent-human-readable=
"
timeSpentHumanReadable
"
:time-estimate-human-readable=
"
timeEstimateHumanReadabl
e"
:time-spent-human-readable=
"
humanTimeSpent
"
:time-estimate-human-readable=
"
humanTimeEstimat
e"
/>
<div
class=
"title hide-collapsed"
>
{{
__
(
'
Time tracking
'
)
}}
...
...
@@ -145,11 +131,11 @@ export default {
<div
class=
"time-tracking-content hide-collapsed"
>
<time-tracking-estimate-only-pane
v-if=
"showEstimateOnlyState"
:time-estimate-human-readable=
"
timeEstimateHumanReadabl
e"
:time-estimate-human-readable=
"
humanTimeEstimat
e"
/>
<time-tracking-spent-only-pane
v-if=
"showSpentOnlyState"
:time-spent-human-readable=
"
timeSpentHumanReadable
"
:time-spent-human-readable=
"
humanTimeSpent
"
/>
<time-tracking-no-tracking-pane
v-if=
"showNoTimeTrackingState"
...
...
@@ -158,8 +144,8 @@ export default {
v-if=
"showComparisonState"
:time-estimate=
"timeEstimate"
:time-spent=
"timeSpent"
:time-spent-human-readable=
"
timeSpentHumanReadable
"
:time-estimate-human-readable=
"
timeEstimateHumanReadabl
e"
:time-spent-human-readable=
"
humanTimeSpent
"
:time-estimate-human-readable=
"
humanTimeEstimat
e"
/>
<transition
name=
"help-state-toggle"
>
<time-tracking-help-state
...
...
app/assets/javascripts/sidebar/mount_milestone_sidebar.js
浏览文件 @
65d7bf20
...
...
@@ -7,6 +7,8 @@ export default class SidebarMilestone {
if
(
!
el
)
return
;
const
{
timeEstimate
,
timeSpent
,
humanTimeEstimate
,
humanTimeSpent
}
=
el
.
dataset
;
// eslint-disable-next-line no-new
new
Vue
({
el
,
...
...
@@ -15,10 +17,10 @@ export default class SidebarMilestone {
},
render
:
createElement
=>
createElement
(
'
timeTracker
'
,
{
props
:
{
time
_estimate
:
parseInt
(
el
.
dataset
.
timeEstimate
,
10
),
time
_spent
:
parseInt
(
el
.
dataset
.
timeSpent
,
10
),
human
_time_estimate
:
el
.
dataset
.
human
TimeEstimate
,
human
_time_spent
:
el
.
dataset
.
human
TimeSpent
,
time
Estimate
:
parseInt
(
timeEstimate
,
10
),
time
Spent
:
parseInt
(
timeSpent
,
10
),
humanTimeEstimate
,
humanTimeSpent
,
rootPath
:
'
/
'
,
},
}),
...
...
spec/javascripts/sidebar/components/time_tracking/time_tracker_spec.js
浏览文件 @
65d7bf20
...
...
@@ -8,7 +8,10 @@ describe('Issuable Time Tracker', () => {
let
initialData
;
let
vm
;
const
initTimeTrackingComponent
=
opts
=>
{
const
initTimeTrackingComponent
=
({
timeEstimate
,
timeSpent
,
timeEstimateHumanReadable
,
timeSpentHumanReadable
})
=>
{
setFixtures
(
`
<div>
<div id="mock-container"></div>
...
...
@@ -16,10 +19,10 @@ describe('Issuable Time Tracker', () => {
`
);
initialData
=
{
time
_estimate
:
opts
.
time
Estimate
,
time
_spent
:
opts
.
time
Spent
,
human
_time_estimate
:
opts
.
timeEstimateHumanReadable
,
human
_time_spent
:
opts
.
timeSpentHumanReadable
,
timeEstimate
,
timeSpent
,
human
TimeEstimate
:
timeEstimateHumanReadable
,
human
TimeSpent
:
timeSpentHumanReadable
,
rootPath
:
'
/
'
,
};
...
...
@@ -43,8 +46,8 @@ describe('Issuable Time Tracker', () => {
describe
(
'
Initialization
'
,
()
=>
{
beforeEach
(()
=>
{
initTimeTrackingComponent
({
timeEstimate
:
10000
0
,
timeSpent
:
5000
,
timeEstimate
:
10000
,
// 2h 46m
timeSpent
:
5000
,
// 1h 23m
timeEstimateHumanReadable
:
'
2h 46m
'
,
timeSpentHumanReadable
:
'
1h 23m
'
,
});
...
...
@@ -56,14 +59,14 @@ describe('Issuable Time Tracker', () => {
it
(
'
should correctly set timeEstimate
'
,
done
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
timeEstimate
).
toBe
(
initialData
.
time
_e
stimate
);
expect
(
vm
.
timeEstimate
).
toBe
(
initialData
.
time
E
stimate
);
done
();
});
});
it
(
'
should correctly set time_spent
'
,
done
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
timeSpent
).
toBe
(
initialData
.
time
_s
pent
);
expect
(
vm
.
timeSpent
).
toBe
(
initialData
.
time
S
pent
);
done
();
});
});
...
...
@@ -74,8 +77,8 @@ describe('Issuable Time Tracker', () => {
describe
(
'
Comparison pane
'
,
()
=>
{
beforeEach
(()
=>
{
initTimeTrackingComponent
({
timeEstimate
:
100000
,
timeSpent
:
5000
,
timeEstimate
:
100000
,
// 1d 3h
timeSpent
:
5000
,
// 1h 23m
timeEstimateHumanReadable
:
''
,
timeSpentHumanReadable
:
''
,
});
...
...
@@ -106,8 +109,8 @@ describe('Issuable Time Tracker', () => {
});
it
(
'
should display the remaining meter with the correct background color when over estimate
'
,
done
=>
{
vm
.
time
_estimate
=
100000
;
vm
.
time
_spent
=
20000000
;
vm
.
time
Estimate
=
10000
;
// 2h 46m
vm
.
time
Spent
=
20000000
;
// 231 days
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.time-tracking-comparison-pane .progress[variant="danger"]
'
)).
not
.
toBeNull
();
done
();
...
...
@@ -119,7 +122,7 @@ describe('Issuable Time Tracker', () => {
describe
(
'
Estimate only pane
'
,
()
=>
{
beforeEach
(()
=>
{
initTimeTrackingComponent
({
timeEstimate
:
10000
0
,
timeEstimate
:
10000
,
// 2h 46m
timeSpent
:
0
,
timeEstimateHumanReadable
:
'
2h 46m
'
,
timeSpentHumanReadable
:
''
,
...
...
@@ -142,7 +145,7 @@ describe('Issuable Time Tracker', () => {
beforeEach
(()
=>
{
initTimeTrackingComponent
({
timeEstimate
:
0
,
timeSpent
:
5000
,
timeSpent
:
5000
,
// 1h 23m
timeEstimateHumanReadable
:
'
2h 46m
'
,
timeSpentHumanReadable
:
'
1h 23m
'
,
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录