Commit 7b251c30 authored by Eric Eastwood's avatar Eric Eastwood

Use ... for badge text when actual count is unknown

See https://gitlab.com/gitlab-org/gitlab-ce/issues/34336
parent 3d5a4ce5
......@@ -76,8 +76,8 @@ export default {
hasBody() {
return this.isFormVisible || this.shouldShowTokenBody;
},
relatedIssueCount() {
return this.relatedIssues.length;
badgeLabel() {
return this.isFetching && this.relatedIssues.length === 0 ? '...' : this.relatedIssues.length;
},
hasHelpPath() {
return this.helpPath.length > 0;
......@@ -113,7 +113,7 @@ export default {
<span
class="issue-count-badge-count"
:class="{ 'has-btn': this.canAddRelatedIssues }">
{{ relatedIssueCount }}
{{ badgeLabel }}
</span>
<button
v-if="canAddRelatedIssues"
......
......@@ -64,6 +64,10 @@ describe('RelatedIssuesBlock', () => {
it('should show loading icon', () => {
expect(vm.$refs.loadingIcon).toBeDefined();
});
it('should show `...` badge count', () => {
expect(vm.badgeLabel).toBe('...');
});
});
describe('with canAddRelatedIssues=true', () => {
......
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