fix: Bug fixed für alle Seiten und das Profil und label
This commit is contained in:
1 parent
133edcd5ba
commit
0a52b29c57
52 files changed
+1290
-129
No files matched your search
@@ -7,6 +7,7 @@ import { toast } from "sonner";
|
||||
import { ListTodo } from "lucide-react";
|
||||
import { createTask } from "@/lib/tasks/api";
|
||||
import { TaskPriority } from "@/lib/tasks/types";
|
||||
import { TASK_PRIORITIES, TASK_PRIORITY_LABELS } from "@/lib/tasks/labels";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
@@ -21,8 +22,6 @@ import {
|
||||
import { PageHeader } from "@/components/page-header";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
|
||||
const PRIORITY_OPTIONS: TaskPriority[] = ["LOW", "NORMAL", "HIGH", "URGENT"];
|
||||
|
||||
export default function NewTaskPage() {
|
||||
const router = useRouter();
|
||||
const queryClient = useQueryClient();
|
||||
@@ -82,12 +81,12 @@ export default function NewTaskPage() {
|
||||
onValueChange={(value) => setPriority((value ?? "NORMAL") as TaskPriority)}
|
||||
>
|
||||
<SelectTrigger id="task-priority">
|
||||
<SelectValue />
|
||||
<SelectValue>{TASK_PRIORITY_LABELS[priority]}</SelectValue>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{PRIORITY_OPTIONS.map((option) => (
|
||||
{TASK_PRIORITIES.map((option) => (
|
||||
<SelectItem key={option} value={option}>
|
||||
{option}
|
||||
{TASK_PRIORITY_LABELS[option]}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
|
||||
@@ -6,6 +6,7 @@ import { ListTodo } from "lucide-react";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { completeTask, fetchTasks } from "@/lib/tasks/api";
|
||||
import { TaskPriority, TaskStatus } from "@/lib/tasks/types";
|
||||
import { TASK_PRIORITIES, TASK_PRIORITY_LABELS, TASK_STATUS_LABELS } from "@/lib/tasks/labels";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { PageHeader } from "@/components/page-header";
|
||||
@@ -21,7 +22,6 @@ import {
|
||||
} from "@/components/ui/select";
|
||||
import { TaskEditDialog } from "./task-edit-dialog";
|
||||
|
||||
const PRIORITY_OPTIONS: TaskPriority[] = ["LOW", "NORMAL", "HIGH", "URGENT"];
|
||||
const HISTORY_STATUSES: TaskStatus[] = ["DONE", "CANCELLED"];
|
||||
|
||||
export default function TasksPage() {
|
||||
@@ -79,13 +79,15 @@ export default function TasksPage() {
|
||||
}
|
||||
>
|
||||
<SelectTrigger className="w-40">
|
||||
<SelectValue placeholder="Priorität">{priority || "Alle Prioritäten"}</SelectValue>
|
||||
<SelectValue placeholder="Priorität">
|
||||
{priority ? TASK_PRIORITY_LABELS[priority] : "Alle Prioritäten"}
|
||||
</SelectValue>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="ALL">Alle Prioritäten</SelectItem>
|
||||
{PRIORITY_OPTIONS.map((option) => (
|
||||
{TASK_PRIORITIES.map((option) => (
|
||||
<SelectItem key={option} value={option}>
|
||||
{option}
|
||||
{TASK_PRIORITY_LABELS[option]}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
@@ -133,11 +135,11 @@ export default function TasksPage() {
|
||||
title={task.title}
|
||||
badge={
|
||||
<Badge variant={task.status === "DONE" ? "secondary" : "default"}>
|
||||
{task.status}
|
||||
{TASK_STATUS_LABELS[task.status]}
|
||||
</Badge>
|
||||
}
|
||||
fields={[
|
||||
{ label: "Priorität", value: task.priority },
|
||||
{ label: "Priorität", value: TASK_PRIORITY_LABELS[task.priority] },
|
||||
{
|
||||
label: "Fällig",
|
||||
value: task.dueDate ? new Date(task.dueDate).toLocaleDateString("de-DE") : "—",
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Pencil } from "lucide-react";
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { updateTask } from "@/lib/tasks/api";
|
||||
import { Task, TaskPriority } from "@/lib/tasks/types";
|
||||
import { TASK_PRIORITIES, TASK_PRIORITY_LABELS } from "@/lib/tasks/labels";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
@@ -24,8 +25,6 @@ import {
|
||||
DialogTrigger,
|
||||
} from "@/components/ui/dialog";
|
||||
|
||||
const PRIORITY_OPTIONS: TaskPriority[] = ["LOW", "NORMAL", "HIGH", "URGENT"];
|
||||
|
||||
export function TaskEditDialog({ task }: { task: Task }) {
|
||||
const queryClient = useQueryClient();
|
||||
const [open, setOpen] = useState(false);
|
||||
@@ -84,12 +83,12 @@ export function TaskEditDialog({ task }: { task: Task }) {
|
||||
onValueChange={(value) => setPriority((value ?? priority) as TaskPriority)}
|
||||
>
|
||||
<SelectTrigger id="task-edit-priority" className="w-full">
|
||||
<SelectValue />
|
||||
<SelectValue>{TASK_PRIORITY_LABELS[priority]}</SelectValue>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{PRIORITY_OPTIONS.map((option) => (
|
||||
{TASK_PRIORITIES.map((option) => (
|
||||
<SelectItem key={option} value={option}>
|
||||
{option}
|
||||
{TASK_PRIORITY_LABELS[option]}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
|
||||
Reference in new issue
Block a user