refactor(dav): migrate UserAvailability to Typescript and script-setup

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2025-10-22 23:55:56 +02:00
parent 7bcb1b4a4c
commit b856adee88
No known key found for this signature in database
GPG key ID: 45FAE7268762B400

View file

@ -2,42 +2,31 @@
- SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
<script setup lang="ts">
import { loadState } from '@nextcloud/initial-state'
import { t } from '@nextcloud/l10n'
import NcSettingsSection from '@nextcloud/vue/components/NcSettingsSection'
import AbsenceForm from '../components/AbsenceForm.vue'
import AvailabilityForm from '../components/AvailabilityForm.vue'
const hideAbsenceSettings = loadState('dav', 'hide_absence_settings', true)
</script>
<template>
<div>
<NcSettingsSection
id="availability"
:name="$t('dav', 'Availability')"
:description="$t('dav', 'If you configure your working hours, other people will see when you are out of office when they book a meeting.')">
:name="t('dav', 'Availability')"
:description="t('dav', 'If you configure your working hours, other people will see when you are out of office when they book a meeting.')">
<AvailabilityForm />
</NcSettingsSection>
<NcSettingsSection
v-if="!hideAbsenceSettings"
id="absence"
:name="$t('dav', 'Absence')"
:description="$t('dav', 'Configure your next absence period.')">
:name="t('dav', 'Absence')"
:description="t('dav', 'Configure your next absence period.')">
<AbsenceForm />
</NcSettingsSection>
</div>
</template>
<script>
import { loadState } from '@nextcloud/initial-state'
import NcSettingsSection from '@nextcloud/vue/components/NcSettingsSection'
import AbsenceForm from '../components/AbsenceForm.vue'
import AvailabilityForm from '../components/AvailabilityForm.vue'
export default {
name: 'UserAvailability',
components: {
NcSettingsSection,
AbsenceForm,
AvailabilityForm,
},
data() {
return {
hideAbsenceSettings: loadState('dav', 'hide_absence_settings', true),
}
},
}
</script>