mirror of
https://github.com/hex248/sprint.git
synced 2026-02-07 18:23:03 +00:00
synchronised defaults for status and type once selectedOrganisation is loaded (or changed)
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
1
todo.md
1
todo.md
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user