Merge pull request #32559 from nextcloud/bugfix/noid/update-dav-availability

Update DAV availability vue component to standard
pull/32563/head
Joas Schilling 2022-05-23 17:03:41 +07:00 committed by GitHub
commit 41711988c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 14 deletions

@ -1,9 +1,6 @@
<template>
<div class="section">
<h2>{{ $t('dav', 'Availability') }}</h2>
<p>
{{ $t('dav', 'If you configure your working hours, other users will see when you are out of office when they book a meeting.') }}
</p>
<SettingsSection :title="$t('dav', 'Availability')"
:description="$t('dav', 'If you configure your working hours, other users will see when you are out of office when they book a meeting.')">
<div class="time-zone">
<strong>
{{ $t('dav', 'Time zone:') }}
@ -12,6 +9,7 @@
<TimezonePicker v-model="timezone" />
</span>
</div>
<CalendarAvailability :slots.sync="slots"
:loading="loading"
:l10n-to="$t('dav', 'to')"
@ -25,31 +23,38 @@
:l10n-friday="$t('dav', 'Friday')"
:l10n-saturday="$t('dav', 'Saturday')"
:l10n-sunday="$t('dav', 'Sunday')" />
<Button :disabled="loading || saving"
type="primary"
@click="save">
{{ $t('dav', 'Save') }}
</Button>
</div>
</SettingsSection>
</template>
<script>
import { CalendarAvailability } from '@nextcloud/calendar-availability-vue'
import {
showError,
showSuccess,
} from '@nextcloud/dialogs'
import {
findScheduleInboxAvailability,
getEmptySlots,
saveScheduleInboxAvailability,
} from '../service/CalendarService'
import jstz from 'jstimezonedetect'
import TimezonePicker from '@nextcloud/vue/dist/Components/TimezonePicker'
import Button from '@nextcloud/vue/dist/Components/Button'
import SettingsSection from '@nextcloud/vue/dist/Components/SettingsSection'
import TimezonePicker from '@nextcloud/vue/dist/Components/TimezonePicker'
export default {
name: 'Availability',
components: {
Button,
CalendarAvailability,
SettingsSection,
TimezonePicker,
Button,
},
data() {
// Try to determine the current timezone, and fall back to UTC otherwise
@ -80,7 +85,7 @@ export default {
} catch (e) {
console.error('could not load existing availability', e)
// TODO: show a nice toast
showError(t('dav', 'Failed to load availability'))
} finally {
this.loading = false
}
@ -92,11 +97,11 @@ export default {
await saveScheduleInboxAvailability(this.slots, this.timezone)
// TODO: show a nice toast
showSuccess(t('dav', 'Saved availability'))
} catch (e) {
console.error('could not save availability', e)
// TODO: show a nice toast
showError(t('dav', 'Failed to save availability'))
} finally {
this.saving = false
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long