diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2016-11-09 17:36:42 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2016-11-16 11:58:10 +0000 |
commit | 51e791868666cc7c5f196416f97605f968f69874 (patch) | |
tree | 502809755000e0d78bc9dc58f7daf34e04999236 /app/assets/javascripts/environments/components/environment_item.js.es6 | |
parent | 883f65ec998683ae224ab69eb59ee45569e56f44 (diff) | |
download | gitlab-ce-51e791868666cc7c5f196416f97605f968f69874.tar.gz |
Manual actions
Diffstat (limited to 'app/assets/javascripts/environments/components/environment_item.js.es6')
-rw-r--r-- | app/assets/javascripts/environments/components/environment_item.js.es6 | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/app/assets/javascripts/environments/components/environment_item.js.es6 b/app/assets/javascripts/environments/components/environment_item.js.es6 index c51ea8707dd..4476e7689cd 100644 --- a/app/assets/javascripts/environments/components/environment_item.js.es6 +++ b/app/assets/javascripts/environments/components/environment_item.js.es6 @@ -1,4 +1,5 @@ /*= require vue_common_component/commit +/*= require ./environment_actions /* globals Vue, timeago */ (() => { @@ -19,7 +20,8 @@ gl.environmentsList.EnvironmentItem = Vue.component('environment-item', { components: { - 'commit-component': window.gl.commitComponent, + 'commit-component': window.gl.CommitComponent, + 'actions-component': window.gl.environmentsList.ActionsComponent, }, props: { @@ -136,12 +138,23 @@ }, /** + * Verifies if the environment has any manual actions to be rendered. + * + * @returns {Boolean} + */ + hasManualActions() { + return this.model.last_deployment && + this.model.last_deployment.manual_actions && + this.model.last_deployment.manual_actions.length > 0; + }, + + /** * Returns the manual actions with the name parsed. * * @returns {Array.<Object>} */ manualActions() { - return this.model.manual_actions.map((action) => { + return this.model.last_deployment.manual_actions.map((action) => { const parsedAction = { name: gl.text.humanize(action.name), play_url: action.play_url, @@ -327,7 +340,9 @@ <td class="hidden-xs"> <div v-if="!isFolder"> - + <div v-if="hasManualActions"> + <actions-component :actions="manualActions"></actions-component> + </div> </div> </td> </tr> |