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