server: BOOKING
This commit is contained in:
@@ -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: () => {
|
||||
|
||||
@@ -1 +1,25 @@
|
||||
<p>single-event-booking-create works!</p>
|
||||
<!-- Generated by the CLI -->
|
||||
<div class="">
|
||||
<h2 class="card-title text-3xl">
|
||||
Foglalás
|
||||
</h2>
|
||||
<app-single-event-dashboard-event-details-view [event]="event()"></app-single-event-dashboard-event-details-view>
|
||||
<form [formGroup]="form" (ngSubmit)="onSubmit()" class="space-y-4 mt-4">
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Helyek száma</span></label>
|
||||
<input [class.input-error]="slotCount?.invalid && slotCount?.touched" type="number" formControlName="slotCount"
|
||||
class="input input-bordered w-full" />
|
||||
</div>
|
||||
|
||||
<div class="form-control"><label class="label"><span class="label-text">Megjegyzés</span></label>
|
||||
<input [class.input-error]="note?.invalid && note?.touched" type="text" formControlName="note"
|
||||
class="input input-bordered w-full" /></div>
|
||||
|
||||
<div class="card-actions justify-end mt-6">
|
||||
<a class="btn btn-ghost" (click)="doClose()">Mégse</a>
|
||||
<button type="submit" class="btn btn-primary" [disabled]="form.invalid">
|
||||
{{ 'Foglalás' }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -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<CalendarEventDto>();
|
||||
|
||||
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,'');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user