File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444<script >
4545import Controls from ' ../Controls.vue'
4646import CardItem from ' ../cards/CardItem.vue'
47- import { mapGetters } from ' vuex'
4847import GlobalSearchResults from ' ../search/GlobalSearchResults.vue'
48+ import { useOverviewStore } from ' ../../stores/overview.js'
49+ import { mapActions , mapState } from ' pinia'
4950
5051const FILTER_UPCOMING = ' upcoming'
5152
@@ -112,7 +113,7 @@ export default {
112113 return ' '
113114 }
114115 },
115- ... mapGetters ([ ' assignedCardsDashboard ' ]),
116+ ... mapState (useOverviewStore, [ ' assignedCards ' ]),
116117 },
117118 watch: {
118119 ' $route.params.filter' () {
@@ -123,19 +124,20 @@ export default {
123124 this .getData ()
124125 },
125126 methods: {
127+ ... mapActions (useOverviewStore, [' loadUpcoming' ]),
126128 async getData () {
127129 this .loading = true
128130 try {
129131 if (this .filter === FILTER_UPCOMING ) {
130- await this .$store . dispatch ( ' loadUpcoming' )
132+ await this .loadUpcoming ( )
131133 }
132134 } catch (e) {
133135 console .error (e)
134136 }
135137 this .loading = false
136138 },
137139 filterCards (when ) {
138- return this .assignedCardsDashboard [when]
140+ return this .assignedCards [when]
139141 },
140142 sortCards (cards ) {
141143 if (! cards) {
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ import { BoardApi } from '../services/BoardApi.js'
1414import stackModuleFactory from './stack.js'
1515import cardModuleFactory from './card.js'
1616import attachment from './attachment.js'
17- import overview from './overview.js'
1817Vue . use ( Vuex )
1918
2019const apiClient = new BoardApi ( )
@@ -35,7 +34,6 @@ export default function storeFactory() {
3534 stack : stackModuleFactory ( ) ,
3635 card : cardModuleFactory ( ) ,
3736 attachment,
38- overview,
3937 } ,
4038 strict : debug ,
4139 state : {
Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ /**
2+ * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
3+ * SPDX-License-Identifier: AGPL-3.0-or-later
4+ */
5+
6+ import { defineStore } from 'pinia'
7+ import { OverviewApi } from '../services/OverviewApi.js'
8+
9+ const overviewApi = new OverviewApi ( )
10+
11+ export const useOverviewStore = defineStore ( 'overview' , {
12+ state : ( ) => ( {
13+ assignedCards : [ ] ,
14+ loading : false ,
15+ } ) ,
16+ actions : {
17+ async loadUpcoming ( ) {
18+ if ( this . loading ) {
19+ return this . loading
20+ }
21+ const promise = ( async ( ) => {
22+ this . $vuex . commit ( 'setCurrentBoard' , null )
23+ const assignedCards = await overviewApi . get ( 'upcoming' )
24+ const assignedCardsFlat = Object . values ( assignedCards ) . flat ( )
25+ for ( const i in assignedCardsFlat ) {
26+ this . $vuex . commit ( 'addCard' , assignedCardsFlat [ i ] )
27+ }
28+ this . assignedCards = assignedCards
29+ this . loading = false
30+ } ) ( )
31+ this . loading = promise
32+ return promise
33+ } ,
34+ } ,
35+ } )
You can’t perform that action at this time.
0 commit comments