diff options
author | jakeburden <jburden@gitlab.com> | 2019-08-21 14:58:04 -0400 |
---|---|---|
committer | jakeburden <jburden@gitlab.com> | 2019-08-28 08:48:14 -0400 |
commit | a3edfab1a9fcfdab56d2f2d29fa9f72ce0455ee4 (patch) | |
tree | d3eb7bbe85a789d72e2cb2296431ac0130f5be41 /app/assets/javascripts/environments | |
parent | ef0f1509dd2a2a3ba5798362e2be21108b705a85 (diff) | |
download | gitlab-ce-a3edfab1a9fcfdab56d2f2d29fa9f72ce0455ee4.tar.gz |
Show correct deployment date for a manual job56130-operations-environments-shows-incorrect-deployment-date-for-manual-deploy-jobs
Only display time if the job has deployed
Update JS tests for displaying job deployment time
Simplify boolean check in deployedDate
Diffstat (limited to 'app/assets/javascripts/environments')
-rw-r--r-- | app/assets/javascripts/environments/components/environment_item.vue | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/app/assets/javascripts/environments/components/environment_item.vue b/app/assets/javascripts/environments/components/environment_item.vue index 95e1e8af9b3..1d4a6e64f9d 100644 --- a/app/assets/javascripts/environments/components/environment_item.vue +++ b/app/assets/javascripts/environments/components/environment_item.vue @@ -111,12 +111,7 @@ export default { * @returns {Boolean|Undefined} */ canShowDate() { - return ( - this.model && - this.model.last_deployment && - this.model.last_deployment.deployable && - this.model.last_deployment.deployable !== undefined - ); + return this.model && this.model.last_deployment && this.model.last_deployment.deployed_at; }, /** @@ -124,14 +119,9 @@ export default { * * @returns {String} */ - createdDate() { - if ( - this.model && - this.model.last_deployment && - this.model.last_deployment.deployable && - this.model.last_deployment.deployable.created_at - ) { - return timeagoInstance.format(this.model.last_deployment.deployable.created_at); + deployedDate() { + if (this.canShowDate) { + return timeagoInstance.format(this.model.last_deployment.deployed_at); } return ''; }, @@ -547,7 +537,7 @@ export default { <div v-if="!model.isFolder" class="table-section section-10" role="gridcell"> <div role="rowheader" class="table-mobile-header">{{ s__('Environments|Updated') }}</div> <span v-if="canShowDate" class="environment-created-date-timeago table-mobile-content"> - {{ createdDate }} + {{ deployedDate }} </span> </div> |