diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /app/assets/javascripts/reports/components/test_issue_body.vue | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/assets/javascripts/reports/components/test_issue_body.vue')
-rw-r--r-- | app/assets/javascripts/reports/components/test_issue_body.vue | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/app/assets/javascripts/reports/components/test_issue_body.vue b/app/assets/javascripts/reports/components/test_issue_body.vue index 5e9a5b03543..69b0dcf881d 100644 --- a/app/assets/javascripts/reports/components/test_issue_body.vue +++ b/app/assets/javascripts/reports/components/test_issue_body.vue @@ -1,13 +1,13 @@ <script> import { mapActions } from 'vuex'; -import { GlBadge } from '@gitlab/ui'; -import { n__ } from '~/locale'; +import { GlBadge, GlSprintf } from '@gitlab/ui'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; export default { name: 'TestIssueBody', components: { GlBadge, + GlSprintf, }, mixins: [glFeatureFlagsMixin()], props: { @@ -28,18 +28,15 @@ export default { }, computed: { showRecentFailures() { - return this.glFeatures.testFailureHistory && this.issue.recent_failures; + return ( + this.glFeatures.testFailureHistory && + this.issue.recent_failures?.count && + this.issue.recent_failures?.base_branch + ); }, }, methods: { ...mapActions(['openModal']), - recentFailuresText(count) { - return n__( - 'Failed %d time in the last 14 days', - 'Failed %d times in the last 14 days', - count, - ); - }, }, }; </script> @@ -53,7 +50,18 @@ export default { > <gl-badge v-if="isNew" variant="danger" class="gl-mr-2">{{ s__('New') }}</gl-badge> <gl-badge v-if="showRecentFailures" variant="warning" class="gl-mr-2"> - {{ recentFailuresText(issue.recent_failures) }} + <gl-sprintf + :message=" + n__( + 'Reports|Failed %{count} time in %{base_branch} in the last 14 days', + 'Reports|Failed %{count} times in %{base_branch} in the last 14 days', + issue.recent_failures.count, + ) + " + > + <template #count>{{ issue.recent_failures.count }}</template> + <template #base_branch>{{ issue.recent_failures.base_branch }}</template> + </gl-sprintf> </gl-badge> {{ issue.name }} </button> |