diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/assets/javascripts/pipelines/pipeline_details_bundle.js | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/assets/javascripts/pipelines/pipeline_details_bundle.js')
-rw-r--r-- | app/assets/javascripts/pipelines/pipeline_details_bundle.js | 69 |
1 files changed, 5 insertions, 64 deletions
diff --git a/app/assets/javascripts/pipelines/pipeline_details_bundle.js b/app/assets/javascripts/pipelines/pipeline_details_bundle.js index f1102a9bddf..c57be7c75b0 100644 --- a/app/assets/javascripts/pipelines/pipeline_details_bundle.js +++ b/app/assets/javascripts/pipelines/pipeline_details_bundle.js @@ -1,10 +1,10 @@ import Vue from 'vue'; -import Flash from '~/flash'; +import { deprecatedCreateFlash as Flash } from '~/flash'; import Translate from '~/vue_shared/translate'; import { __ } from '~/locale'; import { setUrlFragment, redirectTo } from '~/lib/utils/url_utility'; import pipelineGraph from './components/graph/graph_component.vue'; -import Dag from './components/dag/dag.vue'; +import createDagApp from './pipeline_details_dag'; import GraphBundleMixin from './mixins/graph_pipeline_bundle_mixin'; import PipelinesMediator from './pipeline_details_mediator'; import pipelineHeader from './components/header_component.vue'; @@ -92,48 +92,15 @@ const createPipelineHeaderApp = mediator => { }); }; -const createPipelinesTabs = testReportsStore => { - const tabsElement = document.querySelector('.pipelines-tabs'); - - if (tabsElement) { - const fetchReportsAction = 'fetchFullReport'; - const isTestTabActive = Boolean( - document.querySelector('.pipelines-tabs > li > a.test-tab.active'), - ); - - if (isTestTabActive) { - testReportsStore.dispatch(fetchReportsAction); - } else { - const tabClickHandler = e => { - if (e.target.className === 'test-tab') { - testReportsStore.dispatch(fetchReportsAction); - tabsElement.removeEventListener('click', tabClickHandler); - } - }; - - tabsElement.addEventListener('click', tabClickHandler); - } - } -}; - const createTestDetails = () => { - if (!window.gon?.features?.junitPipelineView) { - return; - } - const el = document.querySelector('#js-pipeline-tests-detail'); - const { fullReportEndpoint, summaryEndpoint, countEndpoint } = el?.dataset || {}; + const { summaryEndpoint, suiteEndpoint } = el?.dataset || {}; const testReportsStore = createTestReportsStore({ - fullReportEndpoint, - summaryEndpoint: summaryEndpoint || countEndpoint, - useBuildSummaryReport: window.gon?.features?.buildReportSummary, + summaryEndpoint, + suiteEndpoint, }); - if (!window.gon?.features?.buildReportSummary) { - createPipelinesTabs(testReportsStore); - } - // eslint-disable-next-line no-new new Vue({ el, @@ -147,32 +114,6 @@ const createTestDetails = () => { }); }; -const createDagApp = () => { - if (!window.gon?.features?.dagPipelineTab) { - return; - } - - const el = document.querySelector('#js-pipeline-dag-vue'); - const { pipelineDataPath, emptySvgPath, dagDocPath } = el?.dataset; - - // eslint-disable-next-line no-new - new Vue({ - el, - components: { - Dag, - }, - render(createElement) { - return createElement('dag', { - props: { - graphUrl: pipelineDataPath, - emptySvgPath, - dagDocPath, - }, - }); - }, - }); -}; - export default () => { const { dataset } = document.querySelector('.js-pipeline-details-vue'); const mediator = new PipelinesMediator({ endpoint: dataset.endpoint }); |