Add a 'days with events' preference (default 3, range 1-7) that drives the upcoming events widget, and extend the fetch window to 8 days so the largest window can populate. Add a Calendar settings pane (moved under Integrations) that lists the connected CalDAV/ICS sources in a two-column grid with add/edit/remove, and remove calendars from Manage Integrations. Turn the modal service into a stack so add/edit forms open on top of the settings dialog, with one dialog per level, per-entry title ids, and a softened stacked backdrop. Move CALENDAR_ACTOR into its own config module to break the calendar/caldav/ics import cycle.
57 lines
1.7 KiB
Plaintext
57 lines
1.7 KiB
Plaintext
import Component from '@glimmer/component';
|
|
import { action } from '@ember/object';
|
|
import { service } from '@ember/service';
|
|
import { CALENDAR_VISIBLE_DAYS_OPTIONS } from '../../../../config/calendar';
|
|
import SettingsSelect from '../../integrations/select.gjs';
|
|
import CalendarList from './calendar-list.gjs';
|
|
|
|
// The Events settings section: how many days of events to show, and the
|
|
// calendars that feed the upcoming events widget.
|
|
export default class SettingsEventsSection extends Component {
|
|
@service calendar;
|
|
|
|
get dayOptions() {
|
|
return CALENDAR_VISIBLE_DAYS_OPTIONS;
|
|
}
|
|
|
|
@action
|
|
updateVisibleDays(value) {
|
|
this.calendar.setVisibleDays(Number(value));
|
|
}
|
|
|
|
<template>
|
|
<div class="min-h-0 flex-1 overflow-y-auto px-6 py-6">
|
|
<div class="max-w-prose">
|
|
<p class="text-sm text-gray-500">
|
|
Control the upcoming events widget and the calendars that feed it.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="mt-5 max-w-xs">
|
|
<SettingsSelect
|
|
@id="calendar-visible-days"
|
|
@name="calendar-visible-days"
|
|
@label="Days with events"
|
|
@options={{this.dayOptions}}
|
|
@value={{this.calendar.visibleDays}}
|
|
@onChange={{this.updateVisibleDays}}
|
|
/>
|
|
<p class="mt-2 text-sm text-gray-500">
|
|
How many days of upcoming events to show on the dashboard.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="mt-8 border-t border-gray-200 pt-6">
|
|
<h4 class="text-sm font-semibold text-gray-900">Calendars</h4>
|
|
<p class="mt-1 max-w-prose text-sm text-gray-500">
|
|
The calendars whose events appear on your dashboard.
|
|
</p>
|
|
|
|
<div class="mt-4">
|
|
<CalendarList />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
}
|