synchronised defaults for status and type once selectedOrganisation is loaded (or changed)

This commit is contained in:
2026-01-28 09:25:49 +00:00
parent 63db4f5a9c
commit 04bafca5f3
2 changed files with 5 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
import { ISSUE_DESCRIPTION_MAX_LENGTH, ISSUE_TITLE_MAX_LENGTH } from "@sprint/shared"; import { ISSUE_DESCRIPTION_MAX_LENGTH, ISSUE_TITLE_MAX_LENGTH } from "@sprint/shared";
import { type FormEvent, useMemo, useState } from "react"; import { type FormEvent, useEffect, useMemo, useState } from "react";
import { toast } from "sonner"; import { toast } from "sonner";
import { MultiAssigneeSelect } from "@/components/multi-assignee-select"; import { MultiAssigneeSelect } from "@/components/multi-assignee-select";
import { useAuthenticatedSession } from "@/components/session-provider"; import { useAuthenticatedSession } from "@/components/session-provider";
@@ -57,6 +57,10 @@ export function IssueForm({ trigger }: { trigger?: React.ReactNode }) {
const [assigneeIds, setAssigneeIds] = useState<string[]>(["unassigned"]); const [assigneeIds, setAssigneeIds] = useState<string[]>(["unassigned"]);
const [status, setStatus] = useState<string>(defaultStatus); const [status, setStatus] = useState<string>(defaultStatus);
const [type, setType] = useState<string>(defaultType); const [type, setType] = useState<string>(defaultType);
useEffect(() => {
if (!status && defaultStatus) setStatus(defaultStatus);
if (!type && defaultType) setType(defaultType);
}, [defaultStatus, defaultType, status, type]);
const [submitAttempted, setSubmitAttempted] = useState(false); const [submitAttempted, setSubmitAttempted] = useState(false);
const [submitting, setSubmitting] = useState(false); const [submitting, setSubmitting] = useState(false);
const [error, setError] = useState<string | null>(null); const [error, setError] = useState<string | null>(null);

View File

@@ -1,7 +1,6 @@
# HIGH PRIORITY # HIGH PRIORITY
- BUGS: - BUGS:
- on the first attempt since page load, pressing the create issue button the default type and status are not loaded
- FEATURES: - FEATURES:
- make login/register into a modal that appears atop the landing page - make login/register into a modal that appears atop the landing page
- user preferences - user preferences