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