From 515d9cbd65b9a2ceabed3abcaa7c0904e8b69031 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Fri, 6 Jan 2023 17:37:11 +0100 Subject: [PATCH] Dashboard widgets: Factor out a card component Signed-off-by: Marcel Klehr --- src/components/dashboard/Card.vue | 81 +++++++++++++++++++++++++++++++ src/views/DashboardToday.vue | 66 ++----------------------- src/views/DashboardTomorrow.vue | 66 ++----------------------- src/views/DashboardUpcoming.vue | 29 ++--------- 4 files changed, 90 insertions(+), 152 deletions(-) create mode 100644 src/components/dashboard/Card.vue diff --git a/src/components/dashboard/Card.vue b/src/components/dashboard/Card.vue new file mode 100644 index 000000000..4373c7edb --- /dev/null +++ b/src/components/dashboard/Card.vue @@ -0,0 +1,81 @@ + + + + + diff --git a/src/views/DashboardToday.vue b/src/views/DashboardToday.vue index e2c16c9ec..63a4d00be 100644 --- a/src/views/DashboardToday.vue +++ b/src/views/DashboardToday.vue @@ -30,21 +30,7 @@ @hide="() => {}" @markDone="() => {}"> @@ -52,17 +38,15 @@ diff --git a/src/views/DashboardTomorrow.vue b/src/views/DashboardTomorrow.vue index 7549456e1..8a002f259 100644 --- a/src/views/DashboardTomorrow.vue +++ b/src/views/DashboardTomorrow.vue @@ -30,21 +30,7 @@ @hide="() => {}" @markDone="() => {}"> @@ -52,17 +38,15 @@ diff --git a/src/views/DashboardUpcoming.vue b/src/views/DashboardUpcoming.vue index cb295326a..ab837fe1c 100644 --- a/src/views/DashboardUpcoming.vue +++ b/src/views/DashboardUpcoming.vue @@ -30,21 +30,7 @@ @hide="() => {}" @markDone="() => {}">
@@ -65,8 +51,7 @@ import PlusIcon from 'vue-material-design-icons/Plus.vue' import { NcButton, NcDashboardWidget, NcModal } from '@nextcloud/vue' import { mapGetters } from 'vuex' -import labelStyle from './../mixins/labelStyle.js' -import DueDate from '../components/cards/badges/DueDate.vue' +import Card from '../components/dashboard/Card.vue' import { generateUrl } from '@nextcloud/router' import CreateNewCardCustomPicker from './CreateNewCardCustomPicker.vue' @@ -75,12 +60,11 @@ export default { components: { CreateNewCardCustomPicker, NcModal, - DueDate, NcDashboardWidget, NcButton, PlusIcon, + Card, }, - mixins: [labelStyle], data() { return { loading: false, @@ -102,11 +86,6 @@ export default { }) return list.slice(0, 5) }, - cardLink() { - return (card) => { - return generateUrl('/apps/deck') + `#/board/${card.boardId}/card/${card.id}` - } - }, showMoreUrl() { return this.cards.length > 7 ? generateUrl('/apps/deck') : null }, @@ -126,8 +105,6 @@ export default {