From 8c2cc6cac1ea3d8bd03ed7e61d9e938feaf852cd Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Mon, 11 May 2020 00:32:54 +0300 Subject: [PATCH] Add numeral to normalize count --- src/views/statuses/index.vue | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/views/statuses/index.vue b/src/views/statuses/index.vue index c2193363..1cb184c3 100644 --- a/src/views/statuses/index.vue +++ b/src/views/statuses/index.vue @@ -8,10 +8,18 @@
- {{ $t('statuses.direct') }}: {{ statusVisibility.direct }} - {{ $t('statuses.private') }}: {{ statusVisibility.private }} - {{ $t('statuses.public') }}: {{ statusVisibility.public }} - {{ $t('statuses.unlisted') }}: {{ statusVisibility.unlisted }} + + {{ $t('statuses.direct') }}: {{ normalizedCount(990934093) }} + + + {{ $t('statuses.private') }}: {{ normalizedCount(statusVisibility.private) }} + + + {{ $t('statuses.public') }}: {{ normalizedCount(statusVisibility.public) }} + + + {{ $t('statuses.unlisted') }}: {{ normalizedCount(statusVisibility.unlisted) }} +
@@ -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') } } }