diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-03-10 16:05:09 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-03-10 16:05:09 +0000 |
commit | fc47c35429cda8d5ccb48bde02150f2c8107fe98 (patch) | |
tree | 5be0f87557fb3a43d6e80a5d98cf0167a8389a51 | |
parent | b98949b08e274e316242a13b8f00676c8d6e7d1f (diff) | |
parent | d4bd73e5db72001b62fa836ffe08a49da35b4178 (diff) | |
download | gitlab-ce-fc47c35429cda8d5ccb48bde02150f2c8107fe98.tar.gz |
Merge branch '20450-fix-ujs-actions-part-3-step1' into 20450-fix-ujs-actions-part-3-step2
* 20450-fix-ujs-actions-part-3-step1:
Changes after review
-rw-r--r-- | app/assets/javascripts/vue_pipelines_index/index.js | 8 | ||||
-rw-r--r-- | app/assets/javascripts/vue_pipelines_index/pipelines.js | 11 |
2 files changed, 13 insertions, 6 deletions
diff --git a/app/assets/javascripts/vue_pipelines_index/index.js b/app/assets/javascripts/vue_pipelines_index/index.js index 79541765891..bf0ad7a4a7a 100644 --- a/app/assets/javascripts/vue_pipelines_index/index.js +++ b/app/assets/javascripts/vue_pipelines_index/index.js @@ -1,4 +1,6 @@ /* global Vue, VueResource, gl */ +import PipelinesStore from './stores/pipelines_store'; + window.Vue = require('vue'); window.Vue.use(require('vue-resource')); require('../vue_shared/vue_resource_interceptor'); @@ -9,8 +11,10 @@ $(() => new Vue({ data() { const project = document.querySelector('.pipelines'); + const store = new PipelinesStore(); return { + store, endpoint: project.dataset.url, }; }, @@ -18,6 +22,8 @@ $(() => new Vue({ 'vue-pipelines': gl.VuePipelines, }, template: ` - <vue-pipelines :endpoint="endpoint" /> + <vue-pipelines + :endpoint="endpoint" + :store="store" /> `, })); diff --git a/app/assets/javascripts/vue_pipelines_index/pipelines.js b/app/assets/javascripts/vue_pipelines_index/pipelines.js index 2286ee25062..57d35f19840 100644 --- a/app/assets/javascripts/vue_pipelines_index/pipelines.js +++ b/app/assets/javascripts/vue_pipelines_index/pipelines.js @@ -3,7 +3,6 @@ import '~/flash'; import CommitPipelinesStoreWithTimeAgo from '../commit/pipelines/pipelines_store'; import PipelinesService from './services/pipelines_service'; -import PipelinesStore from './stores/pipelines_store'; window.Vue = require('vue'); require('../vue_shared/components/table_pagination'); @@ -17,6 +16,11 @@ require('../vue_shared/components/pipelines_table'); type: String, required: true, }, + + store: { + type: Object, + required: true, + }, }, components: { @@ -25,11 +29,8 @@ require('../vue_shared/components/pipelines_table'); }, data() { - const store = new PipelinesStore(); - return { - store, - state: store.state, + state: this.store.state, apiScope: 'all', pagenum: 1, pageRequest: false, |