diff --git a/app/assets/javascripts/reports/codequality_report/grouped_codequality_reports_app.vue b/app/assets/javascripts/reports/codequality_report/grouped_codequality_reports_app.vue index 0e18d0992cd..599e8d35708 100644 --- a/app/assets/javascripts/reports/codequality_report/grouped_codequality_reports_app.vue +++ b/app/assets/javascripts/reports/codequality_report/grouped_codequality_reports_app.vue @@ -55,10 +55,12 @@ export default { ...mapActions(['fetchReports', 'setPaths']), }, loadingText: sprintf(s__('ciReport|Loading %{reportName} report'), { - reportName: 'codeclimate', + // eslint-disable-next-line @gitlab/require-i18n-strings + reportName: 'Code quality', }), errorText: sprintf(s__('ciReport|Failed to load %{reportName} report'), { - reportName: 'codeclimate', + // eslint-disable-next-line @gitlab/require-i18n-strings + reportName: 'Code quality', }), }; diff --git a/app/assets/javascripts/reports/codequality_report/store/getters.js b/app/assets/javascripts/reports/codequality_report/store/getters.js index 3fb8c5be351..4712f8cbefe 100644 --- a/app/assets/javascripts/reports/codequality_report/store/getters.js +++ b/app/assets/javascripts/reports/codequality_report/store/getters.js @@ -1,5 +1,5 @@ import { spriteIcon } from '~/lib/utils/common_utils'; -import { sprintf, __, s__, n__ } from '~/locale'; +import { sprintf, s__ } from '~/locale'; import { LOADING, ERROR, SUCCESS, STATUS_NOT_FOUND } from '../../constants'; export const hasCodequalityIssues = (state) => @@ -18,27 +18,23 @@ export const codequalityStatus = (state) => { export const codequalityText = (state) => { const { newIssues, resolvedIssues } = state; - const text = []; - + let text; if (!newIssues.length && !resolvedIssues.length) { - text.push(s__('ciReport|No changes to code quality')); - } else { - text.push(s__('ciReport|Code quality')); - - if (resolvedIssues.length) { - text.push(n__(' improved on %d point', ' improved on %d points', resolvedIssues.length)); - } - - if (newIssues.length && resolvedIssues.length) { - text.push(__(' and')); - } - - if (newIssues.length) { - text.push(n__(' degraded on %d point', ' degraded on %d points', newIssues.length)); - } + text = s__('ciReport|No changes to code quality'); + } else if (newIssues.length && resolvedIssues.length) { + text = sprintf( + s__(`ciReport|Code quality scanning detected %{issueCount} changes in merged results`), + { + issueCount: newIssues.length + resolvedIssues.length, + }, + ); + } else if (resolvedIssues.length) { + text = s__(`ciReport|Code quality improved`); + } else if (newIssues.length) { + text = s__(`ciReport|Code quality degraded`); } - return text.join(''); + return text; }; export const codequalityPopover = (state) => { diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue index e57f9938011..3ca193514f1 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue @@ -1,5 +1,4 @@