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 ./environment_actions
/*= require ./environment_external_url
/* globals Vue, timeago */
(() => {
......@@ -22,6 +23,7 @@
components: {
'commit-component': window.gl.CommitComponent,
'actions-component': window.gl.environmentsList.ActionsComponent,
'external-url-component': window.gl.environmentsList.ExternalUrlComponent,
},
props: ['model', 'can-create-deployment', 'can-create-deployment', 'can-read-environment'],
......@@ -247,11 +249,11 @@
},
canReadEnvironmentParsed() {
return convertToBoolean(this.canReadEnvironment);
return this.$options.convertPermissionToBoolean(this.canReadEnvironment);
},
canCreateDeploymentParsed() {
return convertToBoolean(this.canCreateDeployment);
return this.$options.convertPermissionToBoolean(this.canCreateDeployment);
},
},
......@@ -291,10 +293,6 @@
},
},
ready() {
debugger;
},
template: `
<tr>
<td v-bind:class="rowClass">
......@@ -366,6 +364,12 @@
<div v-if="hasManualActions && canCreateDeploymentParsed">
<actions-component :actions="manualActions"></actions-component>
</div>
<div v-if="model.external_url && canReadEnvironmentParsed">
<external-url-component
:external_url="model.external_url">
</external_url-component>
</div>
</div>
</td>
</tr>
......
......@@ -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.
* Make sure it has this structure:
* .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