Commit 32784d21 authored by Filipa Lacerda's avatar Filipa Lacerda

Adds external url component for environment

parent 8068d977
/*= require vue
/* global Vue */
(() => {
window.gl = window.gl || {};
window.gl.environmentsList = window.gl.environmentsList || {};
window.gl.environmentsList.ExternalUrlComponent = Vue.component('external-url-component', {
props: {
external_url: {
type: String,
default: '',
},
},
template: `
<a class="btn external_url":href="external_url" :target="_blank">
<i class="fa fa-external-link"></i>
</a>
`,
});
})();
/*= require vue_common_component/commit /*= require vue_common_component/commit
/*= require ./environment_actions /*= require ./environment_actions
/*= require ./environment_external_url
/* globals Vue, timeago */ /* globals Vue, timeago */
(() => { (() => {
...@@ -22,6 +23,7 @@ ...@@ -22,6 +23,7 @@
components: { components: {
'commit-component': window.gl.CommitComponent, 'commit-component': window.gl.CommitComponent,
'actions-component': window.gl.environmentsList.ActionsComponent, 'actions-component': window.gl.environmentsList.ActionsComponent,
'external-url-component': window.gl.environmentsList.ExternalUrlComponent,
}, },
props: ['model', 'can-create-deployment', 'can-create-deployment', 'can-read-environment'], props: ['model', 'can-create-deployment', 'can-create-deployment', 'can-read-environment'],
...@@ -247,11 +249,11 @@ ...@@ -247,11 +249,11 @@
}, },
canReadEnvironmentParsed() { canReadEnvironmentParsed() {
return convertToBoolean(this.canReadEnvironment); return this.$options.convertPermissionToBoolean(this.canReadEnvironment);
}, },
canCreateDeploymentParsed() { canCreateDeploymentParsed() {
return convertToBoolean(this.canCreateDeployment); return this.$options.convertPermissionToBoolean(this.canCreateDeployment);
}, },
}, },
...@@ -291,10 +293,6 @@ ...@@ -291,10 +293,6 @@
}, },
}, },
ready() {
debugger;
},
template: ` template: `
<tr> <tr>
<td v-bind:class="rowClass"> <td v-bind:class="rowClass">
...@@ -366,6 +364,12 @@ ...@@ -366,6 +364,12 @@
<div v-if="hasManualActions && canCreateDeploymentParsed"> <div v-if="hasManualActions && canCreateDeploymentParsed">
<actions-component :actions="manualActions"></actions-component> <actions-component :actions="manualActions"></actions-component>
</div> </div>
<div v-if="model.external_url && canReadEnvironmentParsed">
<external-url-component
:external_url="model.external_url">
</external_url-component>
</div>
</div> </div>
</td> </td>
</tr> </tr>
......
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
}, },
/** /**
* In order to reuse the svg instead of copy and paste in this template the html_safe * In order to reuse the svg instead of copy and paste in this template
* we need to render it outside this component using =custom_icon partial. * we need to render it outside this component using =custom_icon partial.
* Make sure it has this structure: * Make sure it has this structure:
* .commit-icon-svg.hidden * .commit-icon-svg.hidden
......
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