Fix sidebar_details_block.vue and simplify build_metadata_entity.rb

This commit is contained in:
Tomasz Maczukin 2018-04-03 16:58:56 +02:00
parent 964933c963
commit 11204398fb
No known key found for this signature in database
GPG key ID: 7E9EB2E4B0F625CD
2 changed files with 2 additions and 5 deletions

View file

@ -45,7 +45,7 @@
return `#${this.job.runner.id}`;
},
hasTimeout() {
return this.job.metadata != null && this.job.metadata.timeout_human_readable !== '';
return this.job.metadata != null && this.job.metadata.timeout_human_readable !== null;
},
timeout() {
if (this.job.metadata == null) {

View file

@ -1,8 +1,5 @@
class BuildMetadataEntity < Grape::Entity
expose :timeout_human_readable do |metadata|
metadata.timeout_human_readable unless metadata.timeout.nil?
end
expose :timeout_human_readable
expose :timeout_source do |metadata|
metadata.present.timeout_source
end