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
edc97c9d
Commit
edc97c9d
authored
Nov 29, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use created date from last_deployment
Adds test Adds changelog entry
parent
43c8788e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
app/assets/javascripts/environments/components/environment_item.js.es6
...vascripts/environments/components/environment_item.js.es6
+8
-2
changelogs/unreleased/24844-environments-date.yml
changelogs/unreleased/24844-environments-date.yml
+4
-0
spec/javascripts/environments/environment_item_spec.js.es6
spec/javascripts/environments/environment_item_spec.js.es6
+14
-0
No files found.
app/assets/javascripts/environments/components/environment_item.js.es6
View file @
edc97c9d
...
@@ -147,6 +147,12 @@
...
@@ -147,6 +147,12 @@
this.model.last_deployment.deployable;
this.model.last_deployment.deployable;
},
},
canShowDate() {
return this.model.last_deployment &&
this.model.last_deployment.deployable &&
this.model.last_deployment.deployable.created_at;
},
/**
/**
* Human readable date.
* Human readable date.
*
*
...
@@ -155,7 +161,7 @@
...
@@ -155,7 +161,7 @@
createdDate() {
createdDate() {
const timeagoInstance = new timeago(); // eslint-disable-line
const timeagoInstance = new timeago(); // eslint-disable-line
return timeagoInstance.format(this.model.created_at);
return timeagoInstance.format(this.model.
last_deployment.deployable.
created_at);
},
},
/**
/**
...
@@ -453,7 +459,7 @@
...
@@ -453,7 +459,7 @@
<td>
<td>
<span
<span
v-if="!isFolder &&
model.last_deployment
"
v-if="!isFolder &&
canShowDate
"
class="environment-created-date-timeago">
class="environment-created-date-timeago">
{{createdDate}}
{{createdDate}}
</span>
</span>
...
...
changelogs/unreleased/24844-environments-date.yml
0 → 100644
View file @
edc97c9d
---
title
:
Fixes Environments displaying incorrect date since 8.14 upgrade
merge_request
:
author
:
spec/javascripts/environments/environment_item_spec.js.es6
View file @
edc97c9d
//= require vue
//= require vue
//= require timeago
//= require environments/components/environment_item
//= require environments/components/environment_item
describe('Environment item', () => {
describe('Environment item', () => {
...
@@ -109,6 +110,8 @@ describe('Environment item', () => {
...
@@ -109,6 +110,8 @@ describe('Environment item', () => {
name: 'deploy',
name: 'deploy',
build_path: '/root/ci-folders/builds/1279',
build_path: '/root/ci-folders/builds/1279',
retry_path: '/root/ci-folders/builds/1279/retry',
retry_path: '/root/ci-folders/builds/1279/retry',
created_at: '2016-11-29T18:11:58.430Z',
updated_at: '2016-11-29T18:11:58.430Z',
},
},
manual_actions: [
manual_actions: [
{
{
...
@@ -149,6 +152,17 @@ describe('Environment item', () => {
...
@@ -149,6 +152,17 @@ describe('Environment item', () => {
).toContain('#');
).toContain('#');
});
});
it('should render last deployment date', () => {
const timeagoInstance = new timeago(); // eslint-disable-line
const formatedDate = timeagoInstance.format(
environment.last_deployment.deployable.created_at
);
expect(
component.$el.querySelector('.environment-created-date-timeago').textContent
).toContain(formatedDate);
});
describe('With user information', () => {
describe('With user information', () => {
it('should render user avatar with link to profile', () => {
it('should render user avatar with link to profile', () => {
expect(
expect(
...
...
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