Skip to content
Snippets Groups Projects
Commit f2a5bec3 authored by Planoetscher Daniel (Student Com20)'s avatar Planoetscher Daniel (Student Com20)
Browse files

bugfixes

parent 9208d83a
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ import Button from 'components/ui/Button'; ...@@ -13,7 +13,7 @@ import Button from 'components/ui/Button';
interface Props { interface Props {
task?: Task; task?: Task;
onSubmit: (name: string, text: string, icon: string, priority: Priority, dependencies: string[], requirements: TaskRequirement[], assignees: TaskAssignment[]) => void; onSubmit: (name: string, text: string, icon: string, priority: Priority, dependencies: string[], requirements: TaskRequirement[], assignees: TaskAssignment[], status?: Status) => void;
project: Project; project: Project;
} }
...@@ -111,11 +111,11 @@ export default function TaskForm({ task, onSubmit, project }: Props) { ...@@ -111,11 +111,11 @@ export default function TaskForm({ task, onSubmit, project }: Props) {
validateIcon(icon ?? '') === null && validateIcon(icon ?? '') === null &&
validatePriority(priority ?? '') === null validatePriority(priority ?? '') === null
) { ) {
onSubmit?.(name ?? '', text ?? '', icon ?? '', priority ?? Priority.LOW, tasks ?? [], requirements, assignees); onSubmit?.(name ?? '', text ?? '', icon ?? '', priority ?? Priority.LOW, tasks ?? [], requirements, assignees, status);
} else { } else {
setError('Please fill in the mandatory fields.'); setError('Please fill in the mandatory fields.');
} }
}, [onSubmit, setError, name, text, priority, icon, tasks, assignees, requirements]); }, [onSubmit, setError, name, text, priority, icon, tasks, assignees, requirements, status]);
return ( return (
<form className="task-form" onSubmit={handleSubmit}> <form className="task-form" onSubmit={handleSubmit}>
...@@ -152,7 +152,7 @@ export default function TaskForm({ task, onSubmit, project }: Props) { ...@@ -152,7 +152,7 @@ export default function TaskForm({ task, onSubmit, project }: Props) {
status && ( status && (
<select defaultValue={status} onChange={(e) => { <select defaultValue={status} onChange={(e) => {
let currentStatus = Object.values(Status).find(s => s === e.target.value) ?? undefined; let currentStatus = Object.values(Status).find(s => s === e.target.value) ?? undefined;
setStatus(currentStatus); setStatus(currentStatus);
}}> }}>
<option value={''}>Please choose a status</option> <option value={''}>Please choose a status</option>
{ {
......
...@@ -12,7 +12,6 @@ export default function TaskEdit() { ...@@ -12,7 +12,6 @@ export default function TaskEdit() {
const { taskId } = useParams<Params>(); const { taskId } = useParams<Params>();
const [task, setTask] = useState<Task>(); const [task, setTask] = useState<Task>();
const [project, setProject] = useState<Project>(); const [project, setProject] = useState<Project>();
const [error, setError] = useState('');
const history = useHistory(); const history = useHistory();
useEffect(() => { useEffect(() => {
...@@ -42,7 +41,7 @@ export default function TaskEdit() { ...@@ -42,7 +41,7 @@ export default function TaskEdit() {
let removedAssigneesTemp: TaskAssignment[] = task?.assigned ?? []; let removedAssigneesTemp: TaskAssignment[] = task?.assigned ?? [];
removedAssigneesTemp.filter((assignee) => assignees.indexOf(assignee) === -1); removedAssigneesTemp.filter((assignee) => assignees.indexOf(assignee) === -1);
let removedAssignees: string[] = removedAssigneesTemp.map((assignee) => assignee.user); let removedAssignees: string[] = removedAssigneesTemp.map((assignee) => assignee.user);
await updateTask(taskId, { await updateTask(taskId, {
name, name,
text, text,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment