Commit a22f5161 authored by Filipa Lacerda's avatar Filipa Lacerda

Adds helper to verify empty object

parent f9237abb
......@@ -107,7 +107,8 @@
* @returns {Boolean}
*/
hasLastDeploymentKey() {
if (this.model.last_deployment && this.model.last_deployment !== {}) {
if (this.model.last_deployment &&
!this.$options.isObjectEmpty(this.model.last_deployment)) {
return true;
}
return false;
......@@ -326,8 +327,7 @@
* @returns {Boolean}
*/
deploymentHasUser() {
if (this.model.last_deployment &&
this.model.last_deployment.user) {
if (this.model.last_deployment && this.model.last_deployment.user) {
return true;
}
return false;
......@@ -347,6 +347,21 @@
},
},
/**
* Helper to verify if certain given object are empty.
* Should be replaced by lodash _.isEmpty - https://lodash.com/docs/4.17.2#isEmpty
* @param {Object} object
* @returns {Bollean}
*/
isObjectEmpty(object) {
for (const key in object) { // eslint-disable-line
if (hasOwnProperty.call(object, key)) {
return false;
}
}
return true;
},
template: `
<tr>
<td v-bind:class="{ 'children-row': isChildren}">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment