refactor(slideshow): replace per-event-type preset with a picpeak-wide one

The slideshow display preset (transition / interval / speed / color filter) was
set PER EVENT TYPE in the Edit Event Type dialog. Replace it with a single
picpeak-wide default in Settings -> Slideshow ("Default style for new
slideshows"). New events seed their show_* columns from this global preset
(was: from the event type's slideshow_preset); the per-event override is
unchanged.

- Removed event_types.slideshow_preset usage everywhere (EventTypeModal section,
  eventTypes.service types, eventTypeService whitelist, adminEventTypes
  validators/POST). The DB column from migration 138 is left inert.
- Global preset stored in app_settings (slideshow_interval_ms/transition/
  transition_ms/colorfilter), saved via PUT /admin/settings/slideshow.
- adminEvents create-seeding now reads the global preset (getAppSetting) instead
  of the event type.
- en/de: presetTitle + presetHint.
This commit is contained in:
Luca
2026-06-20 12:20:48 +02:00
parent b5c73e05bd
commit 5f1f4c2b3d
10 changed files with 118 additions and 92 deletions
@@ -4,7 +4,6 @@
*/
import { api } from '../config/api';
import type { SlideshowStyle } from './slideshow.service';
export interface EventType {
id: number;
@@ -13,9 +12,6 @@ export interface EventType {
emoji: string;
theme_preset: string;
theme_config: string | null;
// Live Slideshow preset new events of this type inherit (migration 138).
// Stored as a JSON string by the API; null = no preset.
slideshow_preset: string | null;
display_order: number;
is_system: boolean;
is_active: boolean;
@@ -29,7 +25,6 @@ export interface CreateEventTypeData {
emoji?: string;
theme_preset?: string;
theme_config?: Record<string, unknown>;
slideshow_preset?: SlideshowStyle | null;
display_order?: number;
}
@@ -39,7 +34,6 @@ export interface UpdateEventTypeData {
emoji?: string;
theme_preset?: string;
theme_config?: Record<string, unknown>;
slideshow_preset?: SlideshowStyle | null;
display_order?: number;
is_active?: boolean;
}
+10 -5
View File
@@ -24,13 +24,13 @@ export const SLIDESHOW_COLORFILTERS: SlideshowColorFilter[] = ['none', 'bw', 'se
export const SLIDESHOW_WATERMARK_SOURCES: SlideshowWatermarkSource[] = ['logo', 'logo_dark', 'favicon', 'event'];
export const SLIDESHOW_WATERMARK_POSITIONS: SlideshowWatermarkPosition[] = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];
// Canonical editable style shape, shared by the per-event card and the
// per-event-type preset editor. The per-event-type `slideshow_preset` JSON
// uses exactly these keys; the per-event API maps them to `show_*` columns.
// Per-event editable style (the override). The picpeak-wide DEFAULT for these
// lives in the global Settings → Slideshow tab; new events inherit it and the
// per-event card maps these to `show_*` columns.
//
// NOTE: the watermark LOOK (logo/position/opacity/style/size) lives ONLY in the
// global Settings → Slideshow tab — it is not duplicated here. Per-event/type
// carry just the `watermark` MODE (inherit/on/off), i.e. the override structure.
// global tab — not duplicated here. Per-event carries just the `watermark` MODE
// (inherit/on/off), i.e. the override structure.
export interface SlideshowStyle {
interval_ms: number;
transition: SlideshowTransition;
@@ -53,6 +53,11 @@ export const DEFAULT_SLIDESHOW_STYLE: SlideshowStyle = {
export interface SlideshowGlobalDefaults {
// How slides fill the screen (fill+crop vs letterbox/black bars).
slideshow_fit: SlideshowFit;
// Picpeak-wide display preset (default style new events inherit).
slideshow_interval_ms: number;
slideshow_transition: SlideshowTransition;
slideshow_transition_ms: number;
slideshow_colorfilter: SlideshowColorFilter;
slideshow_watermark_enabled: boolean;
slideshow_watermark_source: SlideshowWatermarkSource;
slideshow_watermark_position: SlideshowWatermarkPosition;