diff options
Diffstat (limited to 'app/assets/javascripts/boards/components/item_count.vue')
-rw-r--r-- | app/assets/javascripts/boards/components/item_count.vue | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/app/assets/javascripts/boards/components/item_count.vue b/app/assets/javascripts/boards/components/item_count.vue new file mode 100644 index 00000000000..9b1ff254766 --- /dev/null +++ b/app/assets/javascripts/boards/components/item_count.vue @@ -0,0 +1,36 @@ +<script> +export default { + name: 'IssueCount', + props: { + maxIssueCount: { + type: Number, + required: false, + default: 0, + }, + itemsSize: { + type: Number, + required: false, + default: 0, + }, + }, + computed: { + isMaxLimitSet() { + return this.maxIssueCount !== 0; + }, + issuesExceedMax() { + return this.isMaxLimitSet && this.itemsSize > this.maxIssueCount; + }, + }, +}; +</script> + +<template> + <div class="item-count text-nowrap"> + <span :class="{ 'text-danger': issuesExceedMax }" data-testid="board-items-count"> + {{ itemsSize }} + </span> + <span v-if="isMaxLimitSet" class="js-max-issue-size"> + {{ maxIssueCount }} + </span> + </div> +</template> |