Calendar_Frontend/src/app/components/event-move-popup/event-move-popup.component.ts
Patrick Müller dfa00a85ad
All checks were successful
Jenkins Production Deployment
Forgot to add files of new component *facepalm*
2024-06-04 16:43:52 +02:00

34 lines
933 B
TypeScript

import {Component, Inject} from '@angular/core';
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
import {Event} from "../../models/event";
import {log} from "@angular-devkit/build-angular/src/builders/ssr-dev-server";
@Component({
selector: 'app-event-move-popup',
templateUrl: './event-move-popup.component.html',
styleUrls: ['./event-move-popup.component.css']
})
export class EventMovePopupComponent {
selectedCalendar = 'public';
calendars = ['', 'public', 'members', 'management', 'choir'];
constructor(
public dialogRef: MatDialogRef<EventMovePopupComponent>,
@Inject(MAT_DIALOG_DATA) public data: DialogData
) {
this.selectedCalendar = this.calendars[data.event.calendarId];
}
onNoClick(): void {
this.dialogRef.close();
}
handleCalendarChange() {
this.data.event.calendarId = this.calendars.indexOf(this.selectedCalendar);
}
}
export interface DialogData {
event: Event;
}