From fb35980893f918f7dbad0f433447c6df13a1c757 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Thu, 9 Feb 2017 14:49:13 +0000 Subject: Verify `latest` key is present when needed --- .../environments/components/environment_item.js.es6 | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app') diff --git a/app/assets/javascripts/environments/components/environment_item.js.es6 b/app/assets/javascripts/environments/components/environment_item.js.es6 index 7805152b173..d3ca4cb8dde 100644 --- a/app/assets/javascripts/environments/components/environment_item.js.es6 +++ b/app/assets/javascripts/environments/components/environment_item.js.es6 @@ -355,6 +355,18 @@ module.exports = Vue.component('environment-item', { !this.$options.isObjectEmpty(this.model.latest.last_deployment.deployable); }, + buildPath(){ + return this.model.latest && + this.model.latest.last_deployment && + this.model.latest.last_deployment.deployable && + this.model.latest.last_deployment.deployable.build_path || + ''; + }, + + externalURL() { + return this.model.latest && this.model.latest.external_url || ''; + }, + /** * Verifies the presence of all the keys needed to render the buil_path. * -- cgit v1.2.1