Commit e40383c2 authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'ps-formatted-stage-count-polish' into 'master'

Polish formatted_stage_count for analytics

See merge request gitlab-org/gitlab!64960
parents 49798237 035db94f
<script>
import { s__, n__, sprintf } from '~/locale';
import { s__, n__, sprintf, formatNumber } from '~/locale';
export default {
props: {
......@@ -14,10 +14,14 @@ export default {
if (!this.stageCount) {
return '-';
} else if (this.stageCount > 1000) {
return sprintf(s__('ValueStreamAnalytics|%{stageCount} items'), { stageCount: '1000+' });
return sprintf(s__('ValueStreamAnalytics|%{stageCount}+ items'), {
stageCount: formatNumber(1000),
});
}
return n__('%d item', '%d items', this.stageCount);
return sprintf(n__('%{count} item', '%{count} items', this.stageCount), {
count: formatNumber(this.stageCount),
});
},
},
};
......
......@@ -46,9 +46,6 @@ export default {
showPopover({ id }) {
return id && id !== OVERVIEW_STAGE_ID;
},
hasStageCount({ stageCount = null }) {
return stageCount !== null;
},
onSelectStage($event) {
this.$emit('selected', $event);
this.track('click_path_navigation', {
......
......@@ -267,11 +267,6 @@ msgid_plural "%d issues successfully imported with the label"
msgstr[0] ""
msgstr[1] ""
msgid "%d item"
msgid_plural "%d items"
msgstr[0] ""
msgstr[1] ""
msgid "%d layer"
msgid_plural "%d layers"
msgstr[0] ""
......@@ -482,6 +477,11 @@ msgstr ""
msgid "%{count} files touched"
msgstr ""
msgid "%{count} item"
msgid_plural "%{count} items"
msgstr[0] ""
msgstr[1] ""
msgid "%{count} items per page"
msgstr ""
......@@ -35658,7 +35658,7 @@ msgstr ""
msgid "ValueStreamAnalyticsStage|We don't have enough data to show this stage."
msgstr ""
msgid "ValueStreamAnalytics|%{stageCount} items"
msgid "ValueStreamAnalytics|%{stageCount}+ items"
msgstr ""
msgid "ValueStreamAnalytics|%{value}M"
......
......@@ -25,8 +25,8 @@ describe('Formatted Stage Count', () => {
${null} | ${'-'}
${1} | ${'1 item'}
${10} | ${'10 items'}
${1000} | ${'1000 items'}
${1001} | ${'1000+ items'}
${1000} | ${'1,000 items'}
${1001} | ${'1,000+ items'}
`('returns "$expectedOutput" for stageCount=$stageCount', ({ stageCount, expectedOutput }) => {
createComponent(stageCount);
expect(wrapper.text()).toContain(expectedOutput);
......
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