2019-11-21 01:06:32 -05:00
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'IssueCount',
|
|
|
|
props: {
|
|
|
|
maxIssueCount: {
|
|
|
|
type: Number,
|
|
|
|
required: false,
|
|
|
|
default: 0,
|
|
|
|
},
|
2021-03-15 05:09:11 -04:00
|
|
|
itemsSize: {
|
2019-11-21 01:06:32 -05:00
|
|
|
type: Number,
|
|
|
|
required: false,
|
|
|
|
default: 0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
isMaxLimitSet() {
|
|
|
|
return this.maxIssueCount !== 0;
|
|
|
|
},
|
|
|
|
issuesExceedMax() {
|
2021-03-15 05:09:11 -04:00
|
|
|
return this.isMaxLimitSet && this.itemsSize > this.maxIssueCount;
|
2019-11-21 01:06:32 -05:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2021-03-15 05:09:11 -04:00
|
|
|
<div class="item-count text-nowrap">
|
|
|
|
<span :class="{ 'text-danger': issuesExceedMax }" data-testid="board-items-count">
|
|
|
|
{{ itemsSize }}
|
2019-11-21 01:06:32 -05:00
|
|
|
</span>
|
|
|
|
<span v-if="isMaxLimitSet" class="js-max-issue-size">
|
|
|
|
{{ maxIssueCount }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</template>
|