summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/vue_shared')
-rw-r--r--app/assets/javascripts/vue_shared/components/commit.js.es610
-rw-r--r--app/assets/javascripts/vue_shared/components/pipelines_table.js.es611
-rw-r--r--app/assets/javascripts/vue_shared/components/pipelines_table_row.js.es645
-rw-r--r--app/assets/javascripts/vue_shared/components/table_pagination.js.es61
4 files changed, 11 insertions, 56 deletions
diff --git a/app/assets/javascripts/vue_shared/components/commit.js.es6 b/app/assets/javascripts/vue_shared/components/commit.js.es6
index ff88e236829..4381487b79e 100644
--- a/app/assets/javascripts/vue_shared/components/commit.js.es6
+++ b/app/assets/javascripts/vue_shared/components/commit.js.es6
@@ -1,5 +1,6 @@
/* global Vue */
window.Vue = require('vue');
+const commitIconSvg = require('icons/_icon_commit.svg');
(() => {
window.gl = window.gl || {};
@@ -69,11 +70,6 @@ window.Vue = require('vue');
required: false,
default: () => ({}),
},
-
- commitIconSvg: {
- type: String,
- required: false,
- },
},
computed: {
@@ -116,6 +112,10 @@ window.Vue = require('vue');
},
},
+ data() {
+ return { commitIconSvg };
+ },
+
template: `
<div class="branch-commit">
diff --git a/app/assets/javascripts/vue_shared/components/pipelines_table.js.es6 b/app/assets/javascripts/vue_shared/components/pipelines_table.js.es6
index 34d3bbdd80d..0d8f85db965 100644
--- a/app/assets/javascripts/vue_shared/components/pipelines_table.js.es6
+++ b/app/assets/javascripts/vue_shared/components/pipelines_table.js.es6
@@ -21,14 +21,6 @@ require('./pipelines_table_row');
default: () => ([]),
},
- /**
- * TODO: Remove this when we have webpack.
- */
- svgs: {
- type: Object,
- required: true,
- default: () => ({}),
- },
},
components: {
@@ -51,8 +43,7 @@ require('./pipelines_table_row');
<template v-for="model in pipelines"
v-bind:model="model">
<tr is="pipelines-table-row-component"
- :pipeline="model"
- :svgs="svgs"></tr>
+ :pipeline="model"></tr>
</template>
</tbody>
</table>
diff --git a/app/assets/javascripts/vue_shared/components/pipelines_table_row.js.es6 b/app/assets/javascripts/vue_shared/components/pipelines_table_row.js.es6
index 61c1b72d9d2..e5e88186a85 100644
--- a/app/assets/javascripts/vue_shared/components/pipelines_table_row.js.es6
+++ b/app/assets/javascripts/vue_shared/components/pipelines_table_row.js.es6
@@ -25,14 +25,6 @@ require('./commit');
default: () => ({}),
},
- /**
- * TODO: Remove this when we have webpack;
- */
- svgs: {
- type: Object,
- required: true,
- default: () => ({}),
- },
},
components: {
@@ -174,30 +166,9 @@ require('./commit');
},
},
- methods: {
- /**
- * FIXME: This should not be in this component but in the components that
- * need this function.
- *
- * Used to render SVGs in the following components:
- * - status-scope
- * - dropdown-stage
- *
- * @param {String} string
- * @return {String}
- */
- match(string) {
- return string.replace(/_([a-z])/g, (m, w) => w.toUpperCase());
- },
- },
-
template: `
<tr class="commit">
- <status-scope
- :pipeline="pipeline"
- :svgs="svgs"
- :match="match">
- </status-scope>
+ <status-scope :pipeline="pipeline"/>
<pipeline-url :pipeline="pipeline"></pipeline-url>
@@ -208,26 +179,20 @@ require('./commit');
:commit-url="commitUrl"
:short-sha="commitShortSha"
:title="commitTitle"
- :author="commitAuthor"
- :commit-icon-svg="svgs.commitIconSvg">
- </commit-component>
+ :author="commitAuthor"/>
</td>
<td class="stage-cell">
<div class="stage-container dropdown js-mini-pipeline-graph"
v-if="pipeline.details.stages.length > 0"
v-for="stage in pipeline.details.stages">
- <dropdown-stage
- :stage="stage"
- :svgs="svgs"
- :match="match">
- </dropdown-stage>
+ <dropdown-stage :stage="stage"/>
</div>
</td>
- <time-ago :pipeline="pipeline" :svgs="svgs"></time-ago>
+ <time-ago :pipeline="pipeline"/>
- <pipeline-actions :pipeline="pipeline" :svgs="svgs"></pipeline-actions>
+ <pipeline-actions :pipeline="pipeline" />
</tr>
`,
});
diff --git a/app/assets/javascripts/vue_shared/components/table_pagination.js.es6 b/app/assets/javascripts/vue_shared/components/table_pagination.js.es6
index dd046405575..8943b850a72 100644
--- a/app/assets/javascripts/vue_shared/components/table_pagination.js.es6
+++ b/app/assets/javascripts/vue_shared/components/table_pagination.js.es6
@@ -19,7 +19,6 @@ window.Vue = require('vue');
/**
This function will take the information given by the pagination component
- And make a new Turbolinks call
Here is an example `change` method: