2021-06-20 23:10:27 -04:00
|
|
|
import createFlash from '~/flash';
|
2018-02-16 07:07:04 -05:00
|
|
|
import { __ } from '~/locale';
|
2021-02-14 13:09:20 -05:00
|
|
|
import createDagApp from './pipeline_details_dag';
|
2021-04-13 05:11:10 -04:00
|
|
|
import { createPipelinesDetailApp } from './pipeline_details_graph';
|
|
|
|
import { createPipelineHeaderApp } from './pipeline_details_header';
|
2021-03-16 05:11:17 -04:00
|
|
|
import { apolloProvider } from './pipeline_shared_client';
|
2021-08-23 14:11:07 -04:00
|
|
|
import { createTestDetails } from './pipeline_test_details';
|
2018-02-16 07:07:04 -05:00
|
|
|
|
2020-09-07 08:08:27 -04:00
|
|
|
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',
|
|
|
|
};
|
|
|
|
|
2021-02-05 07:09:31 -05:00
|
|
|
export default async function initPipelineDetailsBundle() {
|
2020-09-07 08:08:27 -04:00
|
|
|
const { dataset } = document.querySelector(SELECTORS.PIPELINE_DETAILS);
|
2020-05-19 14:08:11 -04:00
|
|
|
|
2021-04-13 05:11:10 -04:00
|
|
|
try {
|
|
|
|
createPipelineHeaderApp(SELECTORS.PIPELINE_HEADER, apolloProvider, dataset.graphqlResourceEtag);
|
|
|
|
} catch {
|
2021-06-20 23:10:27 -04:00
|
|
|
createFlash({
|
|
|
|
message: __('An error occurred while loading a section of this page.'),
|
|
|
|
});
|
2021-04-13 05:11:10 -04:00
|
|
|
}
|
|
|
|
|
2021-08-17 14:10:35 -04:00
|
|
|
try {
|
|
|
|
createPipelinesDetailApp(SELECTORS.PIPELINE_GRAPH, apolloProvider, dataset);
|
|
|
|
} catch {
|
|
|
|
createFlash({
|
|
|
|
message: __('An error occurred while loading the pipeline.'),
|
|
|
|
});
|
2020-11-12 13:09:26 -05:00
|
|
|
}
|
2020-09-23 14:10:15 -04:00
|
|
|
|
2021-08-23 14:11:07 -04:00
|
|
|
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.'),
|
|
|
|
});
|
|
|
|
}
|
2020-11-12 13:09:26 -05:00
|
|
|
}
|