BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
cbc7d62c
Commit
cbc7d62c
authored
Oct 06, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fl-fix-ca-time-component' into 'master'
Fix typo in cycle analytics breaking time component See merge request gitlab-org/gitlab-ce!14723
parents
de035a0d
96944979
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
1 deletion
+64
-1
total_time_component.vue
...ripts/cycle_analytics/components/total_time_component.vue
+1
-1
fl-fix-ca-time-component.yml
changelogs/unreleased/fl-fix-ca-time-component.yml
+5
-0
total_time_component_spec.js
.../javascripts/cycle_analytics/total_time_component_spec.js
+58
-0
No files found.
app/assets/javascripts/cycle_analytics/components/total_time_component.vue
View file @
cbc7d62c
...
...
@@ -20,7 +20,7 @@
<template
v-if=
"time.days"
>
{{
time
.
days
}}
<span>
{{
n__
(
'day'
,
'days'
,
time
.
days
)
}}
</span></
template
>
<
template
v-if=
"time.hours"
>
{{
time
.
hours
}}
<span>
{{
n__
(
'Time|hr'
,
'Time|hrs'
,
time
.
hours
)
}}
</span></
template
>
<
template
v-if=
"time.mins && !time.days"
>
{{
time
.
mins
}}
<span>
{{
n__
(
'Time|min'
,
'Time|mins'
,
time
.
mins
)
}}
</span></
template
>
<
template
v-if=
"time.seconds && hasDa === 1 || time.seconds === 0"
>
{{
time
.
seconds
}}
<span>
{{
s__
(
'Time|s'
)
}}
</span></
template
>
<
template
v-if=
"time.seconds && hasDa
ta
=== 1 || time.seconds === 0"
>
{{
time
.
seconds
}}
<span>
{{
s__
(
'Time|s'
)
}}
</span></
template
>
</template>
<
template
v-else
>
--
...
...
changelogs/unreleased/fl-fix-ca-time-component.yml
0 → 100644
View file @
cbc7d62c
---
title
:
Fix typo in cycle analytics breaking time component
merge_request
:
author
:
type
:
fixed
spec/javascripts/cycle_analytics/total_time_component_spec.js
0 → 100644
View file @
cbc7d62c
import
Vue
from
'vue'
;
import
component
from
'~/cycle_analytics/components/total_time_component.vue'
;
import
mountComponent
from
'../helpers/vue_mount_component_helper'
;
describe
(
'Total time component'
,
()
=>
{
let
vm
;
let
Component
;
beforeEach
(()
=>
{
Component
=
Vue
.
extend
(
component
);
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'With data'
,
()
=>
{
it
(
'should render information for days and hours'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
time
:
{
days
:
3
,
hours
:
4
,
},
});
expect
(
vm
.
$el
.
textContent
.
trim
()).
toEqual
(
'3 days 4 hrs'
);
});
it
(
'should render information for hours and minutes'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
time
:
{
hours
:
4
,
mins
:
35
,
},
});
expect
(
vm
.
$el
.
textContent
.
trim
()).
toEqual
(
'4 hrs 35 mins'
);
});
it
(
'should render information for seconds'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
time
:
{
seconds
:
45
,
},
});
expect
(
vm
.
$el
.
textContent
.
trim
()).
toEqual
(
'45 s'
);
});
});
describe
(
'Without data'
,
()
=>
{
it
(
'should render no information'
,
()
=>
{
vm
=
mountComponent
(
Component
);
expect
(
vm
.
$el
.
textContent
.
trim
()).
toEqual
(
'--'
);
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment