2021-09-30 23:02:18 +05:30
|
|
|
import createFlash from '~/flash';
|
2018-03-27 19:54:05 +05:30
|
|
|
import { __ } from '~/locale';
|
2021-03-11 19:13:27 +05:30
|
|
|
import createDagApp from './pipeline_details_dag';
|
2021-04-29 21:17:54 +05:30
|
|
|
import { createPipelinesDetailApp } from './pipeline_details_graph';
|
|
|
|
import { createPipelineHeaderApp } from './pipeline_details_header';
|
2022-01-26 12:08:38 +05:30
|
|
|
import { createPipelineJobsApp } from './pipeline_details_jobs';
|
2021-04-29 21:17:54 +05:30
|
|
|
import { apolloProvider } from './pipeline_shared_client';
|
2021-11-11 11:23:49 +05:30
|
|
|
import { createTestDetails } from './pipeline_test_details';
|
2018-03-27 19:54:05 +05:30
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
const SELECTORS = {
|
|
|
|
PIPELINE_DETAILS: '.js-pipeline-details-vue',
|
|
|
|
PIPELINE_GRAPH: '#js-pipeline-graph-vue',
|
|
|
|
PIPELINE_HEADER: '#js-pipeline-header-vue',
|
|
|
|
PIPELINE_TESTS: '#js-pipeline-tests-detail',
|
2022-01-26 12:08:38 +05:30
|
|
|
PIPELINE_JOBS: '#js-pipeline-jobs-vue',
|
2020-11-24 15:15:51 +05:30
|
|
|
};
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
export default async function initPipelineDetailsBundle() {
|
|
|
|
const { dataset } = document.querySelector(SELECTORS.PIPELINE_DETAILS);
|
2020-05-24 23:13:21 +05:30
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
try {
|
|
|
|
createPipelineHeaderApp(SELECTORS.PIPELINE_HEADER, apolloProvider, dataset.graphqlResourceEtag);
|
|
|
|
} catch {
|
2021-09-30 23:02:18 +05:30
|
|
|
createFlash({
|
|
|
|
message: __('An error occurred while loading a section of this page.'),
|
|
|
|
});
|
2021-04-29 21:17:54 +05:30
|
|
|
}
|
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
try {
|
|
|
|
createPipelinesDetailApp(SELECTORS.PIPELINE_GRAPH, apolloProvider, dataset);
|
|
|
|
} catch {
|
|
|
|
createFlash({
|
|
|
|
message: __('An error occurred while loading the pipeline.'),
|
|
|
|
});
|
2021-01-29 00:20:46 +05:30
|
|
|
}
|
2021-01-03 14:25:43 +05:30
|
|
|
|
2021-11-11 11:23:49 +05:30
|
|
|
try {
|
|
|
|
createPipelineHeaderApp(SELECTORS.PIPELINE_HEADER, apolloProvider, dataset.graphqlResourceEtag);
|
|
|
|
} catch {
|
|
|
|
createFlash({
|
|
|
|
message: __('An error occurred while loading a section of this page.'),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
createDagApp(apolloProvider);
|
|
|
|
} catch {
|
|
|
|
createFlash({
|
|
|
|
message: __('An error occurred while loading the Needs tab.'),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
createTestDetails(SELECTORS.PIPELINE_TESTS);
|
|
|
|
} catch {
|
|
|
|
createFlash({
|
|
|
|
message: __('An error occurred while loading the Test Reports tab.'),
|
|
|
|
});
|
|
|
|
}
|
2022-01-26 12:08:38 +05:30
|
|
|
|
|
|
|
try {
|
|
|
|
if (gon.features?.jobsTabVue) {
|
|
|
|
createPipelineJobsApp(SELECTORS.PIPELINE_JOBS);
|
|
|
|
}
|
|
|
|
} catch {
|
|
|
|
createFlash({
|
|
|
|
message: __('An error occurred while loading the Jobs tab.'),
|
|
|
|
});
|
|
|
|
}
|
2021-01-29 00:20:46 +05:30
|
|
|
}
|