From aec1fd5ad1de51126a2cc416e74e42b512e00a65 Mon Sep 17 00:00:00 2001 From: Schneider Roland Date: Fri, 28 Nov 2025 08:03:33 +0100 Subject: [PATCH] basic single event dashboard --- .../app/components/detail-view/detail-view.ts | 8 +- .../calendar-view/calendar-view.html | 27 +++++- .../components/calendar-view/calendar-view.ts | 46 +++++++++- .../single-event-dashboard-card.html | 2 +- .../single-event-dashboard-card.ts | 15 ++- .../single-event-dashboard-event-delete.css | 0 .../single-event-dashboard-event-delete.html | 5 + .../single-event-dashboard-event-delete.ts | 50 ++++++++++ .../single-event-dashboard.html | 1 + .../single-event-dashboard.ts | 92 ++++++++++++------- admin/src/app/svg-icons.ts | 4 + 11 files changed, 202 insertions(+), 48 deletions(-) create mode 100644 admin/src/app/features/calendar/components/calendar-view/single-event-dashboard-event-delete/single-event-dashboard-event-delete.css create mode 100644 admin/src/app/features/calendar/components/calendar-view/single-event-dashboard-event-delete/single-event-dashboard-event-delete.html create mode 100644 admin/src/app/features/calendar/components/calendar-view/single-event-dashboard-event-delete/single-event-dashboard-event-delete.ts diff --git a/admin/src/app/components/detail-view/detail-view.ts b/admin/src/app/components/detail-view/detail-view.ts index 7c45859..dc7c57f 100644 --- a/admin/src/app/components/detail-view/detail-view.ts +++ b/admin/src/app/components/detail-view/detail-view.ts @@ -34,7 +34,13 @@ export class DetailView { config = input.required>(); getFormattedValue(row: DetailViewRow, data: T): string { - const value = row.getValue ? row.getValue(data) : data[row.attribute]; + let value : any; + try { + value = row.getValue ? row.getValue(data) : data[row.attribute]; + }catch (e) { + value = ''; + + } if (row.component) { return ''; diff --git a/admin/src/app/features/calendar/components/calendar-view/calendar-view.html b/admin/src/app/features/calendar/components/calendar-view/calendar-view.html index 890b3cc..1e25d8a 100644 --- a/admin/src/app/features/calendar/components/calendar-view/calendar-view.html +++ b/admin/src/app/features/calendar/components/calendar-view/calendar-view.html @@ -6,7 +6,7 @@ -{{"workflow:"+workflow()}} + @if (workflow() == 'create') { - - @if (workflow() == 'event-dashboard' && selectedEvent()) { - + } + +@if (workflow() == 'event-cancel' && selectedEvent()) { + + cancel + +} + +@for (dialogDefinition of dialogs; track dialogDefinition) { + + @if (dialogDefinition.isRendered()) { + + + + } +} diff --git a/admin/src/app/features/calendar/components/calendar-view/calendar-view.ts b/admin/src/app/features/calendar/components/calendar-view/calendar-view.ts index 9187ee3..909c216 100644 --- a/admin/src/app/features/calendar/components/calendar-view/calendar-view.ts +++ b/admin/src/app/features/calendar/components/calendar-view/calendar-view.ts @@ -1,4 +1,4 @@ -import { AfterViewInit, Component, effect, ElementRef, inject, OnInit, signal, ViewChild } from '@angular/core'; +import { AfterViewInit, Component, effect, ElementRef, inject, OnInit, signal, Type, ViewChild } from '@angular/core'; import { FullCalendarComponent, FullCalendarModule } from '@fullcalendar/angular'; import { CalendarOptions, EventInput } from '@fullcalendar/core'; @@ -6,17 +6,20 @@ import dayGridPlugin from '@fullcalendar/daygrid'; import timeGridPlugin from '@fullcalendar/timegrid'; import listPlugin from '@fullcalendar/list'; import interactionPlugin from '@fullcalendar/interaction'; -import { Modal } from '@rschneider/ng-daisyui'; +import { Button, Modal } from '@rschneider/ng-daisyui'; import { CreateEventForm } from '../create-event-form/create-event-form'; import { CalendarService } from '../../services/calendar.service'; import { CalendarEventDto, EventsInRangeDTO } from '../../models/events-in-range-dto.model'; import { map } from 'rxjs'; import { SingleEventDashboard } from './single-event-dashboard/single-event-dashboard'; -import { JsonPipe } from '@angular/common'; +import { JsonPipe, NgComponentOutlet } from '@angular/common'; +import { + SingleEventDashboardEventDelete +} from './single-event-dashboard-event-delete/single-event-dashboard-event-delete'; @Component({ selector: 'app-calendar-view', - imports: [FullCalendarModule, Modal, CreateEventForm, SingleEventDashboard, JsonPipe], + imports: [FullCalendarModule, Modal,NgComponentOutlet, CreateEventForm, SingleEventDashboard, JsonPipe], templateUrl: './calendar-view.html', styleUrl: './calendar-view.css', }) @@ -32,6 +35,7 @@ export class CalendarView implements OnInit, AfterViewInit { selectedEvent = signal(undefined) calendarOptions: CalendarOptions; + dialogs: DialogConfig[] = []; constructor() { @@ -62,6 +66,21 @@ export class CalendarView implements OnInit, AfterViewInit { }; + this.dialogs = [ + { + component: SingleEventDashboardEventDelete, + isRendered: () => this.workflow() == 'event-delete', + // isRendered: () => true, + closeClick: () => this.closeDialog(), + modalBoxStyleClass: 'max-w-none w-2xl', + componentInputs: () => { + return { + + } + } + + } + ] } fetchEvents(fetchInfo: any, successCallback: (events: EventInput[]) => void, failureCallback: (error: any) => void): void { @@ -139,4 +158,23 @@ export class CalendarView implements OnInit, AfterViewInit { closeDialog() { this.workflow.set(''); } + + onDashboardAction(action: string){ + console.info("dashboard event", action); + switch (action) { + case 'event_delete': + this.workflow.set('event-delete'); + break; + + } + } + +} + +export interface DialogConfig{ + component: Type; + componentInputs?: () => { [key: string]: any }; + closeClick: () => void, + modalBoxStyleClass: string + isRendered: () => boolean; } diff --git a/admin/src/app/features/calendar/components/calendar-view/single-event-dashboard-card/single-event-dashboard-card.html b/admin/src/app/features/calendar/components/calendar-view/single-event-dashboard-card/single-event-dashboard-card.html index 4e4284e..d48a610 100644 --- a/admin/src/app/features/calendar/components/calendar-view/single-event-dashboard-card/single-event-dashboard-card.html +++ b/admin/src/app/features/calendar/components/calendar-view/single-event-dashboard-card/single-event-dashboard-card.html @@ -3,7 +3,7 @@

{{ title() }}

{{ description() }}

-