diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-14 15:07:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-14 15:07:59 +0300 |
commit | fd27e4f95b3ea8668e1e67f5a88dfb061909c893 (patch) | |
tree | 439bcc5417be41cd2290485292fe512f6cea8110 /app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue | |
parent | 6aa920eeb4ef61ea7e7c77b5e10595507874b927 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue')
-rw-r--r-- | app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue index cd4d9398899..bb25fa15626 100644 --- a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue +++ b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue @@ -46,6 +46,7 @@ import mergeRequestQueryVariablesMixin from './mixins/merge_request_query_variab import getStateQuery from './queries/get_state.query.graphql'; import terraformExtension from './extensions/terraform'; import accessibilityExtension from './extensions/accessibility'; +import testReportExtension from './extensions/test_report'; export default { // False positive i18n lint: https://gitlab.com/gitlab-org/frontend/eslint-plugin-i18n/issues/25 @@ -190,6 +191,9 @@ export default { shouldRenderTerraformPlans() { return Boolean(this.mr?.terraformReportsPath); }, + shouldRenderTestReport() { + return Boolean(this.mr?.testResultsPath); + }, mergeError() { let { mergeError } = this.mr; @@ -246,6 +250,11 @@ export default { this.registerAccessibilityExtension(); } }, + shouldRenderTestReport(newVal) { + if (newVal) { + this.registerTestReportExtension(); + } + }, }, mounted() { MRWidgetService.fetchInitialData() @@ -491,6 +500,11 @@ export default { registerExtension(accessibilityExtension); } }, + registerTestReportExtension() { + if (this.shouldRenderTestReport && this.shouldShowExtension) { + registerExtension(testReportExtension); + } + }, }, }; </script> @@ -563,7 +577,7 @@ export default { /> <grouped-test-reports-app - v-if="mr.testResultsPath" + v-if="mr.testResultsPath && !shouldShowExtension" class="js-reports-container" :endpoint="mr.testResultsPath" :head-blob-path="mr.headBlobPath" |