Commit e5037529 authored by Filipa Lacerda's avatar Filipa Lacerda

Loads SVGs into JS for environments

parent af5093ca
...@@ -35,9 +35,6 @@ module.exports = Vue.component('environment-component', { ...@@ -35,9 +35,6 @@ module.exports = Vue.component('environment-component', {
projectStoppedEnvironmentsPath: environmentsData.projectStoppedEnvironmentsPath, projectStoppedEnvironmentsPath: environmentsData.projectStoppedEnvironmentsPath,
newEnvironmentPath: environmentsData.newEnvironmentPath, newEnvironmentPath: environmentsData.newEnvironmentPath,
helpPagePath: environmentsData.helpPagePath, helpPagePath: environmentsData.helpPagePath,
commitIconSvg: environmentsData.commitIconSvg,
playIconSvg: environmentsData.playIconSvg,
terminalIconSvg: environmentsData.terminalIconSvg,
// Pagination Properties, // Pagination Properties,
paginationInformation: {}, paginationInformation: {},
...@@ -176,10 +173,7 @@ module.exports = Vue.component('environment-component', { ...@@ -176,10 +173,7 @@ module.exports = Vue.component('environment-component', {
<environment-table <environment-table
:environments="state.environments" :environments="state.environments"
:can-create-deployment="canCreateDeploymentParsed" :can-create-deployment="canCreateDeploymentParsed"
:can-read-environment="canReadEnvironmentParsed" :can-read-environment="canReadEnvironmentParsed">
:play-icon-svg="playIconSvg"
:terminal-icon-svg="terminalIconSvg"
:commit-icon-svg="commitIconSvg">
</environment-table> </environment-table>
<table-pagination v-if="state.paginationInformation && state.paginationInformation.totalPages > 1" <table-pagination v-if="state.paginationInformation && state.paginationInformation.totalPages > 1"
......
const Vue = require('vue'); const Vue = require('vue');
const playIconSvg = require('../../../../views/shared/icons/_icon_play.svg');
module.exports = Vue.component('actions-component', { module.exports = Vue.component('actions-component', {
props: { props: {
...@@ -7,11 +8,10 @@ module.exports = Vue.component('actions-component', { ...@@ -7,11 +8,10 @@ module.exports = Vue.component('actions-component', {
required: false, required: false,
default: () => [], default: () => [],
}, },
},
playIconSvg: { data() {
type: String, return { playIconSvg };
required: false,
},
}, },
template: ` template: `
......
...@@ -46,21 +46,6 @@ module.exports = Vue.component('environment-item', { ...@@ -46,21 +46,6 @@ module.exports = Vue.component('environment-item', {
required: false, required: false,
default: false, default: false,
}, },
commitIconSvg: {
type: String,
required: false,
},
playIconSvg: {
type: String,
required: false,
},
terminalIconSvg: {
type: String,
required: false,
},
}, },
computed: { computed: {
...@@ -507,7 +492,6 @@ module.exports = Vue.component('environment-item', { ...@@ -507,7 +492,6 @@ module.exports = Vue.component('environment-item', {
<div v-if="!model.isFolder"> <div v-if="!model.isFolder">
<div class="btn-group" role="group"> <div class="btn-group" role="group">
<actions-component v-if="hasManualActions && canCreateDeployment" <actions-component v-if="hasManualActions && canCreateDeployment"
:play-icon-svg="playIconSvg"
:actions="manualActions"> :actions="manualActions">
</actions-component> </actions-component>
...@@ -520,7 +504,6 @@ module.exports = Vue.component('environment-item', { ...@@ -520,7 +504,6 @@ module.exports = Vue.component('environment-item', {
</stop-component> </stop-component>
<terminal-button-component v-if="model && model.terminal_path" <terminal-button-component v-if="model && model.terminal_path"
:terminal-icon-svg="terminalIconSvg"
:terminal-path="model.terminal_path"> :terminal-path="model.terminal_path">
</terminal-button-component> </terminal-button-component>
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* Used in environments table. * Used in environments table.
*/ */
const Vue = require('vue'); const Vue = require('vue');
const terminalIconSvg = require('../../../../views/shared/icons/_icon_terminal.svg');
module.exports = Vue.component('terminal-button-component', { module.exports = Vue.component('terminal-button-component', {
props: { props: {
...@@ -10,10 +11,10 @@ module.exports = Vue.component('terminal-button-component', { ...@@ -10,10 +11,10 @@ module.exports = Vue.component('terminal-button-component', {
type: String, type: String,
default: '', default: '',
}, },
terminalIconSvg: { },
type: String,
default: '', data() {
}, return { terminalIconSvg };
}, },
template: ` template: `
......
...@@ -28,21 +28,6 @@ module.exports = Vue.component('environment-table-component', { ...@@ -28,21 +28,6 @@ module.exports = Vue.component('environment-table-component', {
required: false, required: false,
default: false, default: false,
}, },
commitIconSvg: {
type: String,
required: false,
},
playIconSvg: {
type: String,
required: false,
},
terminalIconSvg: {
type: String,
required: false,
},
}, },
template: ` template: `
...@@ -63,10 +48,7 @@ module.exports = Vue.component('environment-table-component', { ...@@ -63,10 +48,7 @@ module.exports = Vue.component('environment-table-component', {
<tr is="environment-item" <tr is="environment-item"
:model="model" :model="model"
:can-create-deployment="canCreateDeployment" :can-create-deployment="canCreateDeployment"
:can-read-environment="canReadEnvironment" :can-read-environment="canReadEnvironment"></tr>
:play-icon-svg="playIconSvg"
:terminal-icon-svg="terminalIconSvg"
:commit-icon-svg="commitIconSvg"></tr>
</template> </template>
</tbody> </tbody>
</table> </table>
......
/* global Vue */ /* global Vue */
window.Vue = require('vue'); window.Vue = require('vue');
const commitIconSvg = require('../../../../views/shared/icons/_icon_commit.svg');
(() => { (() => {
window.gl = window.gl || {}; window.gl = window.gl || {};
...@@ -69,11 +70,6 @@ window.Vue = require('vue'); ...@@ -69,11 +70,6 @@ window.Vue = require('vue');
required: false, required: false,
default: () => ({}), default: () => ({}),
}, },
commitIconSvg: {
type: String,
required: false,
},
}, },
computed: { computed: {
...@@ -116,6 +112,10 @@ window.Vue = require('vue'); ...@@ -116,6 +112,10 @@ window.Vue = require('vue');
}, },
}, },
data() {
return { commitIconSvg };
},
template: ` template: `
<div class="branch-commit"> <div class="branch-commit">
......
...@@ -13,7 +13,4 @@ ...@@ -13,7 +13,4 @@
"project-stopped-environments-path" => project_environments_path(@project, scope: :stopped), "project-stopped-environments-path" => project_environments_path(@project, scope: :stopped),
"new-environment-path" => new_namespace_project_environment_path(@project.namespace, @project), "new-environment-path" => new_namespace_project_environment_path(@project.namespace, @project),
"help-page-path" => help_page_path("ci/environments"), "help-page-path" => help_page_path("ci/environments"),
"css-class" => container_class, "css-class" => container_class } }
"commit-icon-svg" => custom_icon("icon_commit"),
"terminal-icon-svg" => custom_icon("icon_terminal"),
"play-icon-svg" => custom_icon("icon_play") } }
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