diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-02-15 20:53:19 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-02-16 10:45:17 +0000 |
commit | d1004b79764f60798701de1dd55dfc47f1864bb8 (patch) | |
tree | 3673e08efdfe99a123572e54e22d0fa46883ec98 /app/assets/javascripts/commit | |
parent | ace33c559e4790fe0027ba4e1047f58ec55339c8 (diff) | |
download | gitlab-ce-d1004b79764f60798701de1dd55dfc47f1864bb8.tar.gz |
Transforms startTimeAgoLoops into a static method so we can reuse it instead of have 2
Fix broken test
Diffstat (limited to 'app/assets/javascripts/commit')
-rw-r--r-- | app/assets/javascripts/commit/pipelines/pipelines_store.js.es6 | 6 | ||||
-rw-r--r-- | app/assets/javascripts/commit/pipelines/pipelines_table.js.es6 | 7 |
2 files changed, 5 insertions, 8 deletions
diff --git a/app/assets/javascripts/commit/pipelines/pipelines_store.js.es6 b/app/assets/javascripts/commit/pipelines/pipelines_store.js.es6 index c45808e5e0f..f1b80e45444 100644 --- a/app/assets/javascripts/commit/pipelines/pipelines_store.js.es6 +++ b/app/assets/javascripts/commit/pipelines/pipelines_store.js.es6 @@ -4,6 +4,7 @@ * * Used to store the Pipelines rendered in the commit view in the pipelines table. */ +require('../../vue_realtime_listener'); class PipelinesStore { constructor() { @@ -44,7 +45,4 @@ class PipelinesStore { } } -window.gl = window.gl || {}; -gl.commits = gl.commits || {}; -gl.commits.pipelines = gl.commits.pipelines || {}; -gl.commits.pipelines.PipelinesStore = PipelinesStore; +module.exports = PipelinesStore; diff --git a/app/assets/javascripts/commit/pipelines/pipelines_table.js.es6 b/app/assets/javascripts/commit/pipelines/pipelines_table.js.es6 index 1bb1f5429e5..e7c6c063413 100644 --- a/app/assets/javascripts/commit/pipelines/pipelines_table.js.es6 +++ b/app/assets/javascripts/commit/pipelines/pipelines_table.js.es6 @@ -6,9 +6,8 @@ window.Vue.use(require('vue-resource')); require('../../lib/utils/common_utils'); require('../../vue_shared/vue_resource_interceptor'); require('../../vue_shared/components/pipelines_table'); -require('../../vue_realtime_listener/index'); require('./pipelines_service'); -require('./pipelines_store'); +const PipelineStore = require('./pipelines_store'); /** * @@ -41,7 +40,7 @@ require('./pipelines_store'); data() { const pipelinesTableData = document.querySelector('#commit-pipeline-table-view').dataset; const svgsData = document.querySelector('.pipeline-svgs').dataset; - const store = new gl.commits.pipelines.PipelinesStore(); + const store = new PipelineStore(); // Transform svgs DOMStringMap to a plain Object. const svgsObject = gl.utils.DOMStringMapToObject(svgsData); @@ -81,7 +80,7 @@ require('./pipelines_store'); beforeUpdate() { if (this.state.pipelines.length && this.$children) { - this.store.startTimeAgoLoops.call(this, Vue); + PipelineStore.startTimeAgoLoops.call(this, Vue); } }, |