diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-06-20 17:54:55 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-06-20 17:54:55 +0300 |
commit | 05cfba6f6d18dc04e1fda6177b3dfa36d9cdc9f2 (patch) | |
tree | eae8ee66efdbff4cf12a2355bc9c9d8a4eaf464c /app/assets/javascripts/merge_request_tabs.js | |
parent | 1d15ad02cb5c5a2b256e06537eea93974cab8f8c (diff) |
Uniformize code between both pipelines tables
Diffstat (limited to 'app/assets/javascripts/merge_request_tabs.js')
-rw-r--r-- | app/assets/javascripts/merge_request_tabs.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js index 894ed81b044..f503cd38c24 100644 --- a/app/assets/javascripts/merge_request_tabs.js +++ b/app/assets/javascripts/merge_request_tabs.js @@ -3,10 +3,12 @@ /* global Flash */ /* global notes */ +import Vue from 'vue'; import Cookies from 'js-cookie'; import './breakpoints'; import './flash'; import BlobForkSuggestion from './blob/blob_fork_suggestion'; +import commitPipelinesTable from './commit/pipelines/pipelines_table.vue'; /* eslint-disable max-len */ // MergeRequestTabs @@ -233,11 +235,18 @@ import BlobForkSuggestion from './blob/blob_fork_suggestion'; } mountPipelinesView() { - this.commitPipelinesTable = new gl.CommitPipelinesTable().$mount(); + const pipelineTableViewEl = document.querySelector('#commit-pipeline-table-view'); + const CommitPipelinesTable = Vue.extend(commitPipelinesTable); + this.commitPipelinesTable = new CommitPipelinesTable({ + propsData: { + endpoint: pipelineTableViewEl.dataset.endpoint, + helpPagePath: pipelineTableViewEl.dataset.helpPagePath, + }, + }).$mount(); + // $mount(el) replaces the el with the new rendered component. We need it in order to mount // it everytime this tab is clicked - https://vuejs.org/v2/api/#vm-mount - document.querySelector('#commit-pipeline-table-view') - .appendChild(this.commitPipelinesTable.$el); + pipelineTableViewEl.appendChild(this.commitPipelinesTable.$el); } loadDiff(source) { |