34 lines
933 B
TypeScript
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;
|
|
}
|