Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
7519a25a
Commit
7519a25a
authored
Jun 05, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `started` key to show the triggered date
parent
17e30a32
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
app/assets/javascripts/jobs/components/header.vue
app/assets/javascripts/jobs/components/header.vue
+4
-1
spec/javascripts/jobs/header_spec.js
spec/javascripts/jobs/header_spec.js
+5
-2
No files found.
app/assets/javascripts/jobs/components/header.vue
View file @
7519a25a
...
@@ -42,6 +42,9 @@ export default {
...
@@ -42,6 +42,9 @@ export default {
jobStarted
()
{
jobStarted
()
{
return
!
this
.
job
.
started
===
false
;
return
!
this
.
job
.
started
===
false
;
},
},
headerTime
()
{
return
this
.
jobStarted
?
this
.
job
.
started
:
this
.
job
.
created_at
;
},
},
},
watch
:
{
watch
:
{
job
()
{
job
()
{
...
@@ -73,7 +76,7 @@ export default {
...
@@ -73,7 +76,7 @@ export default {
:status=
"status"
:status=
"status"
item-name=
"Job"
item-name=
"Job"
:item-id=
"job.id"
:item-id=
"job.id"
:time=
"
job.created_at
"
:time=
"
headerTime
"
:user=
"job.user"
:user=
"job.user"
:actions=
"actions"
:actions=
"actions"
:has-sidebar-button=
"true"
:has-sidebar-button=
"true"
...
...
spec/javascripts/jobs/header_spec.js
View file @
7519a25a
...
@@ -13,6 +13,9 @@ describe('Job details header', () => {
...
@@ -13,6 +13,9 @@ describe('Job details header', () => {
const
threeWeeksAgo
=
new
Date
();
const
threeWeeksAgo
=
new
Date
();
threeWeeksAgo
.
setDate
(
threeWeeksAgo
.
getDate
()
-
21
);
threeWeeksAgo
.
setDate
(
threeWeeksAgo
.
getDate
()
-
21
);
const
twoDaysAgo
=
new
Date
();
twoDaysAgo
.
setDate
(
twoDaysAgo
.
getDate
()
-
2
);
props
=
{
props
=
{
job
:
{
job
:
{
status
:
{
status
:
{
...
@@ -31,7 +34,7 @@ describe('Job details header', () => {
...
@@ -31,7 +34,7 @@ describe('Job details header', () => {
email
:
'
foo@bar.com
'
,
email
:
'
foo@bar.com
'
,
avatar_url
:
'
link
'
,
avatar_url
:
'
link
'
,
},
},
started
:
'
2018-01-08T09:48:27.319Z
'
,
started
:
twoDaysAgo
.
toISOString
()
,
new_issue_path
:
'
path
'
,
new_issue_path
:
'
path
'
,
},
},
isLoading
:
false
,
isLoading
:
false
,
...
@@ -69,7 +72,7 @@ describe('Job details header', () => {
...
@@ -69,7 +72,7 @@ describe('Job details header', () => {
.
querySelector
(
'
.header-main-content
'
)
.
querySelector
(
'
.header-main-content
'
)
.
textContent
.
replace
(
/
\s
+/g
,
'
'
)
.
textContent
.
replace
(
/
\s
+/g
,
'
'
)
.
trim
(),
.
trim
(),
).
toEqual
(
'
failed Job #123 triggered
3 week
s ago by Foo
'
);
).
toEqual
(
'
failed Job #123 triggered
2 day
s ago by Foo
'
);
});
});
it
(
'
should render new issue link
'
,
()
=>
{
it
(
'
should render new issue link
'
,
()
=>
{
...
...
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