fixed Form Selectors
This commit is contained in:
@@ -135,8 +135,9 @@ export const MissionForm = () => {
|
||||
<div className="form-control">
|
||||
<h2 className="text-lg font-bold mb-2">Rettungsmittel</h2>
|
||||
<Select
|
||||
name="rettungsmittel"
|
||||
name="Rettungsmittel"
|
||||
label={""}
|
||||
placeholder="Wähle ein oder mehrere Rettungsmittel aus"
|
||||
isMulti
|
||||
form={form}
|
||||
options={stations.map((s) => ({
|
||||
@@ -173,13 +174,13 @@ export const MissionForm = () => {
|
||||
e.target.value as string,
|
||||
);
|
||||
form.setValue("missionKeywordName", null);
|
||||
form.setValue("missionKeywordAbbreviation", null);
|
||||
form.setValue("hpgMissionString", null);
|
||||
form.setValue("missionKeywordAbbreviation", "");
|
||||
form.setValue("hpgMissionString", "");
|
||||
}}
|
||||
defaultValue="default"
|
||||
>
|
||||
<option disabled value="default">
|
||||
Einsatz Kathegorie auswählen...
|
||||
Einsatz Kategorie auswählen...
|
||||
</option>
|
||||
{Object.keys(KEYWORD_CATEGORY).map((use) => (
|
||||
<option key={use} value={use}>
|
||||
@@ -199,10 +200,11 @@ export const MissionForm = () => {
|
||||
"missionKeywordAbbreviation",
|
||||
keyword?.abreviation || null,
|
||||
);
|
||||
form.setValue("hpgMissionString", "default");
|
||||
}}
|
||||
defaultValue="default"
|
||||
>
|
||||
<option disabled value="default">
|
||||
<option disabled value={""}>
|
||||
Einsatzstichwort auswählen...
|
||||
</option>
|
||||
{keywords
|
||||
@@ -215,21 +217,19 @@ export const MissionForm = () => {
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{/* TODO: Nur anzeigen wenn eine Station mit HPG ausgewählt ist */}
|
||||
<select
|
||||
/* {...form.register("missionKeyword")} */
|
||||
{...form.register("hpgMissionString")}
|
||||
className="select select-primary select-bordered w-full mb-4"
|
||||
onChange={(e) =>
|
||||
form.setValue("hpgMissionString", e.target.value as string)
|
||||
}
|
||||
defaultValue="default"
|
||||
>
|
||||
<option disabled value="default">
|
||||
<option disabled value="">
|
||||
Einsatz Szenerie auswählen...
|
||||
</option>
|
||||
{keywords
|
||||
.find((k) => k.name === form.watch("missionKeywordName"))
|
||||
?.hpgMissionTypes?.map((missionString) => {
|
||||
const [name, code] = missionString.split(":");
|
||||
const [name] = missionString.split(":");
|
||||
return (
|
||||
<option key={missionString} value={missionString}>
|
||||
{name}
|
||||
|
||||
Reference in New Issue
Block a user