From e86b356baf24289867849760d5d70938c185f628 Mon Sep 17 00:00:00 2001 From: Roland Schneider Date: Sat, 13 Dec 2025 21:35:23 +0100 Subject: [PATCH] server: BOOKING --- .../components/calendar-view/calendar-view.ts | 4 -- .../single-event-booking-create.html | 26 +++++++++++- .../single-event-booking-create.ts | 40 ++++++++++++++++++- 3 files changed, 64 insertions(+), 6 deletions(-) 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 d67a91e..a9c0b68 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 @@ -156,7 +156,6 @@ export class CalendarView { { component: SingleEventDashboardEventEdit, isRendered: () => this.workflow() == 'event_edit', - // isRendered: () => true, closeClick: () => this.closeDialog(), modalBoxStyleClass: 'max-w-none w-2xl', componentInputs: () => { @@ -168,7 +167,6 @@ export class CalendarView { { component: SingleEventBookingCreate, isRendered: () => this.workflow() == 'booking_create', - // isRendered: () => true, closeClick: () => this.closeDialog(), modalBoxStyleClass: 'max-w-none w-2xl', componentInputs: () => { @@ -180,7 +178,6 @@ export class CalendarView { { component: SingleEventBookingList, isRendered: () => this.workflow() == 'booking_list', - // isRendered: () => true, closeClick: () => this.closeDialog(), modalBoxStyleClass: 'max-w-none w-2xl', componentInputs: () => { @@ -192,7 +189,6 @@ export class CalendarView { { component: SingleEventBookingList, isRendered: () => this.workflow() == 'booking_cancel', - // isRendered: () => true, closeClick: () => this.closeDialog(), modalBoxStyleClass: 'max-w-none w-2xl', componentInputs: () => { diff --git a/admin/src/app/features/calendar/components/calendar-view/single-event-booking-create/single-event-booking-create.html b/admin/src/app/features/calendar/components/calendar-view/single-event-booking-create/single-event-booking-create.html index f0a40a6..abd2c63 100644 --- a/admin/src/app/features/calendar/components/calendar-view/single-event-booking-create/single-event-booking-create.html +++ b/admin/src/app/features/calendar/components/calendar-view/single-event-booking-create/single-event-booking-create.html @@ -1 +1,25 @@ -

single-event-booking-create works!

+ +
+

+ Foglalás +

+ +
+ +
+ +
+ +
+
+ +
+ Mégse + +
+
+
diff --git a/admin/src/app/features/calendar/components/calendar-view/single-event-booking-create/single-event-booking-create.ts b/admin/src/app/features/calendar/components/calendar-view/single-event-booking-create/single-event-booking-create.ts index 9cf38a7..ab2eaea 100644 --- a/admin/src/app/features/calendar/components/calendar-view/single-event-booking-create/single-event-booking-create.ts +++ b/admin/src/app/features/calendar/components/calendar-view/single-event-booking-create/single-event-booking-create.ts @@ -1,15 +1,53 @@ import { Component, inject, input } from '@angular/core'; import { CalendarEventDto } from '../../../models/events-in-range-dto.model'; import { EventBusService } from '../../../../../services/event-bus.service'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; +import { EventType } from '../../../../../../types'; +import { + SingleEventDashboardEventDetailsView +} from '../single-event-dashboard-event-details-view/single-event-dashboard-event-details-view'; +import { CalendarService } from '../../../services/calendar.service'; @Component({ selector: 'app-single-event-booking-create', - imports: [], + imports: [ + FormsModule, + ReactiveFormsModule, + SingleEventDashboardEventDetailsView + ], templateUrl: './single-event-booking-create.html', styleUrl: './single-event-booking-create.css', }) export class SingleEventBookingCreate { + calendarService = inject(CalendarService); eventBus = inject(EventBusService); + fb = inject(FormBuilder); event = input(); + form: FormGroup; + constructor() { + this.form = this.fb.group({ + slotCount: [1, Validators.required], + note: [null], + }); + } + + protected onSubmit() { + // this.calendarService.b + this.eventBus.emit(EventType.CALENDAR_VIEW_EVENT_SAVED,''); + + } + + get slotCount() { + return this.form.get('slotCount'); + } + + get note() { + return this.form.get('note'); + } + + + protected doClose() { + this.eventBus.emit(EventType.CALENDAR_VIEW_DIALOG_CLOSED,''); + } }