Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .woodpecker.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# The version of OpenCloud to use in pipelines
OPENCLOUD_COMMITID=cca5d1af043531dc84cb0aa3e67f9795b1a1caa3
OPENCLOUD_COMMITID=a496b6f46b6a37e58bb57e4bfc212ace9428b744
OPENCLOUD_BRANCH=main
1 change: 1 addition & 0 deletions packages/web-client/src/ocs/capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export interface Capabilities {
}
'check-for-updates'?: boolean
'support-sse'?: boolean
'support-radicale'?: boolean
'support-url-signing'?: boolean
'webdav-root'?: string
}
Expand Down
2 changes: 2 additions & 0 deletions packages/web-pkg/src/composables/piniaStores/capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const useCapabilityStore = defineStore('capabilities', () => {
/** @deprecated the server always supports this */
const supportUrlSigning = computed(() => unref(capabilities).core['support-url-signing'])
const supportSSE = computed(() => unref(capabilities).core['support-sse'])
const supportRadicale = computed(() => unref(capabilities).core['support-radicale'])
const personalDataExport = computed(() => unref(capabilities).graph['personal-data-export'])
const status = computed(() => unref(capabilities).core.status)

Expand Down Expand Up @@ -151,6 +152,7 @@ export const useCapabilityStore = defineStore('capabilities', () => {
status,
supportUrlSigning,
supportSSE,
supportRadicale,
personalDataExport,
davReports,
davTrashbin,
Expand Down
30 changes: 20 additions & 10 deletions packages/web-runtime/src/extensions.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { computed, markRaw } from 'vue'
import { computed, markRaw, unref } from 'vue'
import { preferencesPanelExtensionPoint, progressBarExtensionPoint } from './extensionPoints'
import AppTokens from './components/Account/AppTokens.vue'
import {
AccountExtension,
AppMenuItemExtension,
CustomComponentExtension,
LoadingIndicator
LoadingIndicator,
useCapabilityStore
} from '@opencloud-eu/web-pkg'
import { storeToRefs } from 'pinia'

const $gettext = (str: string) => str

export const extensions = () => {
const capabilityStore = useCapabilityStore()
const { supportRadicale } = storeToRefs(capabilityStore)

return computed(() => [
{
id: 'com.github.opencloud-eu.web.runtime.preferences-panels.app-tokens',
Expand All @@ -28,13 +34,17 @@ export const extensions = () => {
optionLabel: $gettext('Default progress bar')
}
} as CustomComponentExtension,
{
id: 'com.github.opencloud-eu.web.runtime.app-menu-item.Calendar',
type: 'appMenuItem',
label: () => $gettext('Calendar'),
color: '#0478d4',
icon: 'calendar',
path: '/account/calendar'
} as AppMenuItemExtension
...(unref(supportRadicale)
? [
{
id: 'com.github.opencloud-eu.web.runtime.app-menu-item.Calendar',
type: 'appMenuItem',
label: () => $gettext('Calendar'),
color: '#0478d4',
icon: 'calendar',
path: '/account/calendar'
} as AppMenuItemExtension
]
: [])
])
}
20 changes: 14 additions & 6 deletions packages/web-runtime/src/pages/account/accountLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@ import {
routeToContextQuery,
useActiveLocation,
useAuthStore,
useCapabilityStore,
useExtensionRegistry
} from '@opencloud-eu/web-pkg/src'
import { computed, nextTick, onBeforeUnmount, onMounted, ref, unref } from 'vue'
import { preferencesPanelExtensionPoint } from '../../extensionPoints'
import { useRoute } from 'vue-router'
import { storeToRefs } from 'pinia'

const { $gettext } = useGettext()
const extensionRegistry = useExtensionRegistry()
const route = useRoute()
const authStore = useAuthStore()
const capabilityStore = useCapabilityStore()
const { supportRadicale } = storeToRefs(capabilityStore)

const navBarClosed = ref<boolean>(false)

Expand Down Expand Up @@ -73,12 +77,16 @@ const navItems = computed(() => {
icon: 'brush-2',
active: unref(isAccountExtensionsActive)
},
{
name: $gettext('Calendar'),
route: { name: 'account-calendar' },
icon: 'calendar',
active: unref(isAccountCalendarActive)
},
...(unref(supportRadicale)
? [
{
name: $gettext('Calendar'),
route: { name: 'account-calendar' },
icon: 'calendar',
active: unref(isAccountCalendarActive)
}
]
: []),
{
name: $gettext('GDPR'),
route: { name: 'account-gdpr' },
Expand Down