mirror of
https://github.com/nextcloud/server.git
synced 2026-03-09 01:40:53 -04:00
Update DAV availability vue component to standard
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
8d599c3410
commit
da7ebef8ef
3 changed files with 20 additions and 15 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: {
|
||||
CalendarAvailability,
|
||||
TimezonePicker,
|
||||
Button,
|
||||
CalendarAvailability,
|
||||
SettingsSection,
|
||||
TimezonePicker,
|
||||
},
|
||||
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
|
||||
}
|
||||
|
|
|
|||
4
dist/dav-settings-personal-availability.js
vendored
4
dist/dav-settings-personal-availability.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue