Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
321 changes: 158 additions & 163 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 18 additions & 2 deletions src/components/AppNavigation/CalendarList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,18 @@
:calendar="calendar" />
</template>

<NcAppNavigationCaption v-if="sortedCalendars.delegated.length" :name="$t('calendar', 'Delegated')" />
<template v-if="!isPublic && sortedCalendars.delegated.length">
<CalendarListItem
v-for="calendar in sortedCalendars.delegated"
:key="calendar.id"
:calendar="calendar" />
</template>

<NcAppNavigationSpacer />

<!-- The header slot must be placed here, otherwise vuedraggable adds undefined as item to the array -->
<template>

Check warning on line 91 in src/components/AppNavigation/CalendarList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

`<template>` require directive
<CalendarListItemLoadingPlaceholder v-if="loadingCalendars" />
</template>
</div>
Expand All @@ -98,6 +106,7 @@
import CalendarListNew from './CalendarList/CalendarListNew.vue'
import PublicCalendarListItem from './CalendarList/PublicCalendarListItem.vue'
import useCalendarsStore from '../../store/calendars.js'
import useDelegationStore from '../../store/delegation.js'

const limit = pLimit(1)

Expand Down Expand Up @@ -129,12 +138,13 @@
return {
calendars: [],
/**
* Calendars sorted by personal, shared, and deck
* Calendars sorted by personal, shared, deck, and delegated
*/
sortedCalendars: {
personal: [],
shared: [],
deck: [],
delegated: [],
},

disableDragging: false,
Expand All @@ -143,7 +153,7 @@
},

computed: {
...mapStores(useCalendarsStore),
...mapStores(useCalendarsStore, useDelegationStore),
...mapState(useCalendarsStore, {
serverCalendars: 'sortedCalendarsSubscriptions',
}),
Expand Down Expand Up @@ -182,9 +192,15 @@
personal: [],
shared: [],
deck: [],
delegated: [],
}

this.calendars.forEach((calendar) => {
if (calendar.isDelegated) {
this.sortedCalendars.delegated.push(calendar)
return
}

if (calendar.isSharedWithMe) {
this.sortedCalendars.shared.push(calendar)
return
Expand Down
Loading
Loading