diff options
author | Raimund Schlüßler <raimund.schluessler@mailbox.org> | 2022-04-25 23:41:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-25 23:41:05 +0300 |
commit | 9793e41916a62ac8752f523d61654ba7ac2e0b2a (patch) | |
tree | ac395523e84304a7883acd01c36f336add9b1c58 /src | |
parent | 4237950c381fd3ac5af1c2de92ac09502e4432fc (diff) |
Don't use deprecated filters anymore (#1975)
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/AppNavigation/ListItemCalendar.vue | 30 | ||||
-rw-r--r-- | src/views/AppNavigation.vue | 29 |
2 files changed, 35 insertions, 24 deletions
diff --git a/src/components/AppNavigation/ListItemCalendar.vue b/src/components/AppNavigation/ListItemCalendar.vue index 5e781098..c9af6089 100644 --- a/src/components/AppNavigation/ListItemCalendar.vue +++ b/src/components/AppNavigation/ListItemCalendar.vue @@ -49,7 +49,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. <Avatar v-if="calendar.isSharedWithMe && loadedOwnerPrincipal" :user="ownerUserId" :display-name="ownerDisplayname" /> <div v-if="calendar.isSharedWithMe && !loadedOwnerPrincipal" class="icon icon-loading" /> <AppNavigationCounter v-if="calendarCount"> - {{ calendarCount | counterFormatter }} + {{ counterFormatter(calendarCount) }} </AppNavigationCounter> </template> @@ -186,18 +186,6 @@ export default { directives: { clickOutside: ClickOutside.directive, }, - filters: { - counterFormatter(count) { - switch (false) { - case count !== 0: - return '' - case count < 999: - return '999+' - default: - return count - } - }, - }, props: { calendar: { type: Object, @@ -309,6 +297,22 @@ export default { 'deleteCalendar', 'moveTask', ]), + + /** + * Format the task counter + * + * @param {number} count The number of tasks + */ + counterFormatter(count) { + switch (false) { + case count !== 0: + return '' + case count < 999: + return '999+' + default: + return count + } + }, /** * Handle the drag over * diff --git a/src/views/AppNavigation.vue b/src/views/AppNavigation.vue index 05711283..6880df7b 100644 --- a/src/views/AppNavigation.vue +++ b/src/views/AppNavigation.vue @@ -43,7 +43,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. </template> <template #counter> <AppNavigationCounter v-show="collectionCount(collection.id)"> - {{ collectionCount(collection.id) | counterFormatter }} + {{ counterFormatter(collectionCount(collection.id)) }} </AppNavigationCounter> </template> </AppNavigationItem> @@ -144,16 +144,7 @@ export default { clickOutside: ClickOutside.directive, }, filters: { - counterFormatter(count) { - switch (false) { - case count !== 0: - return '' - case count < 999: - return '999+' - default: - return count - } - }, + }, data() { return { @@ -196,6 +187,22 @@ export default { ]), /** + * Format the task counter + * + * @param {number} count The number of tasks + */ + counterFormatter(count) { + switch (false) { + case count !== 0: + return '' + case count < 999: + return '999+' + default: + return count + } + }, + + /** * Indicate that we drag a calendar item * * @param {object} dataTransfer The dataTransfer object |