Skip to content
Snippets Groups Projects
Commit 8c2cc6ca authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Add numeral to normalize count

parent fddc2060
No related branches found
No related tags found
1 merge request!129Update status count when an instance was selected
Pipeline #25599 passed
This commit is part of merge request !129. Comments created here will be created in the context of that merge request.
......@@ -8,10 +8,18 @@
</div>
<div class="statuses-header-container">
<el-button-group>
<el-button plain class="direct-button">{{ $t('statuses.direct') }}: {{ statusVisibility.direct }}</el-button>
<el-button plain class="private-button">{{ $t('statuses.private') }}: {{ statusVisibility.private }}</el-button>
<el-button plain class="public-button">{{ $t('statuses.public') }}: {{ statusVisibility.public }}</el-button>
<el-button plain class="unlisted-button">{{ $t('statuses.unlisted') }}: {{ statusVisibility.unlisted }}</el-button>
<el-button plain class="direct-button">
{{ $t('statuses.direct') }}: {{ normalizedCount(990934093) }}
</el-button>
<el-button plain class="private-button">
{{ $t('statuses.private') }}: {{ normalizedCount(statusVisibility.private) }}
</el-button>
<el-button plain class="public-button">
{{ $t('statuses.public') }}: {{ normalizedCount(statusVisibility.public) }}
</el-button>
<el-button plain class="unlisted-button">
{{ $t('statuses.unlisted') }}: {{ normalizedCount(statusVisibility.unlisted) }}
</el-button>
</el-button-group>
</div>
<div class="filter-container">
......@@ -61,6 +69,7 @@
import MultipleUsersMenu from '@/views/users/components/MultipleUsersMenu'
import Status from '@/components/Status'
import RebootButton from '@/components/RebootButton'
import numeral from 'numeral'
export default {
name: 'Statuses',
......@@ -146,6 +155,9 @@ export default {
this.$store.dispatch('ClearState')
},
methods: {
clearSelection() {
this.selectedUsers = []
},
handleFilterChange() {
this.$store.dispatch('HandlePageChange', 1)
this.$store.dispatch('FetchStatusesByInstance')
......@@ -155,14 +167,14 @@ export default {
this.$store.dispatch('FetchStatusesPageByInstance')
},
clearSelection() {
this.selectedUsers = []
},
handleStatusSelection(user) {
if (this.selectedUsers.find(selectedUser => user.id === selectedUser.id) !== undefined) {
return
}
this.selectedUsers = [...this.selectedUsers, user]
},
normalizedCount(count) {
return numeral(count).format('0a')
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment