added chron to hub server, removed starterEvent

This commit is contained in:
PxlLoewe
2025-02-28 07:21:07 +01:00
parent bbcde2eb4a
commit a477b65c2f
20 changed files with 584 additions and 281 deletions

View File

@@ -8,7 +8,7 @@ import {
ParticipantOptionalDefaultsSchema,
} from "@repo/db/zod";
import { set, useForm } from "react-hook-form";
import { BADGES, Event, EventAppointment, User } from "@repo/db";
import { BADGES, Event, EVENT_TYPE, PERMISSION } from "@repo/db";
import { Bot, Calendar, FileText, UserIcon } from "lucide-react";
import { Input } from "../../../../_components/ui/Input";
import { useRef, useState } from "react";
@@ -60,7 +60,6 @@ export const Form = ({ event }: { event?: Event }) => {
eventId: event?.id,
presenterId: values.presenterId,
});
console.log(createdAppointment);
addParticipantModal.current?.close();
appointmentsTableRef.current?.refresh();
})}
@@ -83,6 +82,7 @@ export const Form = ({ event }: { event?: Event }) => {
<form
onSubmit={form.handleSubmit(async (values) => {
setLoading(true);
const createdEvent = await upsertEvent(values, event?.id);
setLoading(false);
if (!event) redirect(`/admin/event`);
@@ -105,6 +105,15 @@ export const Form = ({ event }: { event?: Event }) => {
})}
/>
<Switch form={form} name="hidden" label="Versteckt" />
<Select
form={form}
name="type"
label="Typ"
options={Object.entries(EVENT_TYPE).map(([key, value]) => ({
label: key,
value: value,
}))}
/>
</div>
</div>
<div className="card bg-base-200 shadow-xl col-span-3 max-xl:col-span-6">
@@ -112,12 +121,6 @@ export const Form = ({ event }: { event?: Event }) => {
<h2 className="card-title">
<Bot className="w-5 h-5" /> Automation
</h2>
<Input
form={form}
name="starterMoodleCourseId"
label="Moodle Anmelde Kurs ID"
className="input-sm"
/>
<Input
name="finisherMoodleCourseId"
form={form}
@@ -144,6 +147,16 @@ export const Form = ({ event }: { event?: Event }) => {
value: key,
}))}
/>
<Select
isMulti
form={form}
name="finishedPermissions"
label="Berechtigungen bei Abschluss"
options={Object.entries(PERMISSION).map(([key, value]) => ({
label: value,
value: key,
}))}
/>
<Switch
form={form}
name="hasPresenceEvents"