Commit 9fb61c93 authored by Scott Hampton's avatar Scott Hampton

Move test report data attributes

The test report dataset attributes should be
located on the test tab, not the pipelines detail
page. This makes the bundle file more consistent.
parent 9937adfe
......@@ -116,17 +116,23 @@ const createPipelinesTabs = testReportsStore => {
}
};
const createTestDetails = (fullReportEndpoint, summaryEndpoint) => {
const createTestDetails = () => {
if (!window.gon?.features?.junitPipelineView) {
return;
}
const testReportsStore = createTestReportsStore({ fullReportEndpoint, summaryEndpoint });
const el = document.querySelector('#js-pipeline-tests-detail');
const { fullReportEndpoint, countEndpoint } = el?.dataset || {};
const testReportsStore = createTestReportsStore({
fullReportEndpoint,
summaryEndpoint: countEndpoint,
});
createPipelinesTabs(testReportsStore);
// eslint-disable-next-line no-new
new Vue({
el: '#js-pipeline-tests-detail',
el,
components: {
TestReports,
},
......@@ -170,6 +176,6 @@ export default () => {
createPipelinesDetailApp(mediator);
createPipelineHeaderApp(mediator);
createTestDetails(dataset.testReportEndpoint, dataset.testReportsCountEndpoint);
createTestDetails();
createDagApp();
};
......@@ -86,5 +86,5 @@
#js-pipeline-dag-vue{ data: { pipeline_data_path: dag_project_pipeline_path(@project, @pipeline), empty_svg_path: image_path('illustrations/empty-state/empty-dag-md.svg'), dag_doc_path: help_page_path('ci/yaml/README.md', anchor: 'needs')} }
#js-tab-tests.tab-pane
#js-pipeline-tests-detail
#js-pipeline-tests-detail{ data: { full_report_endpoint: test_report_project_pipeline_path(@project, @pipeline, format: :json), count_endpoint: test_reports_count_project_pipeline_path(@project, @pipeline, format: :json) } }
= render_if_exists "projects/pipelines/tabs_content", pipeline: @pipeline, project: @project
......@@ -20,6 +20,4 @@
- else
= render "projects/pipelines/with_tabs", pipeline: @pipeline
.js-pipeline-details-vue{ data: { endpoint: project_pipeline_path(@project, @pipeline, format: :json),
test_report_endpoint: test_report_project_pipeline_path(@project, @pipeline, format: :json),
test_reports_count_endpoint: test_reports_count_project_pipeline_path(@project, @pipeline, format: :json) } }
.js-pipeline-details-vue{ data: { endpoint: project_pipeline_path(@project, @pipeline, format: :json) } }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment