kaneo (minimalist kanban) fork to experiment adding a tangled integration github.com/usekaneo/kaneo
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(task): load sidebar status metadata from columns and restore default status i18n

Tin 7d65de72 436a14e4

+29 -6
+4 -1
apps/web/src/components/task/subtask-status-popover.tsx
··· 12 12 import { useGetColumns } from "@/hooks/queries/column/use-get-columns"; 13 13 import { useNumberedShortcuts } from "@/hooks/use-numbered-shortcuts"; 14 14 import { getColumnIcon } from "@/lib/column"; 15 + import { getStatusDisplayLabel } from "@/lib/i18n/domain"; 15 16 import { toast } from "@/lib/toast"; 16 17 import type Task from "@/types/task"; 17 18 ··· 87 88 onClick={() => handleStatusChange(status.value)} 88 89 > 89 90 {getColumnIcon(status.value, status.isFinal)} 90 - <span className="text-sm">{status.label}</span> 91 + <span className="text-sm"> 92 + {getStatusDisplayLabel(status.value, status.label)} 93 + </span> 91 94 {currentStatus === status.value ? ( 92 95 <Check className="ml-auto h-4 w-4" /> 93 96 ) : (
+6 -4
apps/web/src/components/task/task-properties-sidebar.tsx
··· 22 22 import useGetGiteaIntegration from "@/hooks/queries/gitea-integration/use-get-gitea-integration"; 23 23 import useGetGithubIntegration from "@/hooks/queries/github-integration/use-get-github-integration"; 24 24 import useGetLabelsByTask from "@/hooks/queries/label/use-get-labels-by-task"; 25 + import { useGetColumns } from "@/hooks/queries/column/use-get-columns"; 25 26 import useGetProject from "@/hooks/queries/project/use-get-project"; 26 27 import useGetProjects from "@/hooks/queries/project/use-get-projects"; 27 28 import useGetTask from "@/hooks/queries/task/use-get-task"; ··· 30 31 import { getColumnIcon } from "@/lib/column"; 31 32 import { dueDateStatusColors, getDueDateStatus } from "@/lib/due-date-status"; 32 33 import { formatDateShort } from "@/lib/format"; 33 - import { getPriorityLabel, getStatusLabel } from "@/lib/i18n/domain"; 34 + import { getPriorityLabel, getStatusDisplayLabel } from "@/lib/i18n/domain"; 34 35 import { getPriorityIcon } from "@/lib/priority"; 35 36 import { toast } from "@/lib/toast"; 36 37 import TaskAssigneePopover from "./task-assignee-popover"; ··· 81 82 const { t } = useTranslation(); 82 83 const { data: task } = useGetTask(taskId ?? ""); 83 84 const { data: project } = useGetProject({ id: projectId, workspaceId }); 85 + const { data: columns = [] } = useGetColumns(projectId); 84 86 const { data: workspaceUsers } = useGetActiveWorkspaceUsers(workspaceId); 85 87 const { data: taskLabels = [] } = useGetLabelsByTask(taskId ?? ""); 86 88 const { data: githubIntegration } = useGetGithubIntegration(projectId); ··· 88 90 const { data: workspaceProjects = [] } = useGetProjects({ workspaceId }); 89 91 const canMoveTask = 90 92 Boolean(task) && workspaceProjects.some((p) => p.id !== task?.projectId); 91 - const statusColumn = project?.columns?.find( 92 - (column) => column.id === task?.status, 93 + const statusColumn = columns.find( 94 + (column) => column.slug === task?.status || column.id === task?.status, 93 95 ); 94 - const statusLabel = statusColumn?.name || getStatusLabel(task?.status ?? ""); 96 + const statusLabel = getStatusDisplayLabel(task?.status ?? "", statusColumn?.name); 95 97 const statusIsFinal = statusColumn?.isFinal ?? false; 96 98 97 99 const projectSlug = project?.slug;
+4 -1
apps/web/src/components/task/task-status-popover.tsx
··· 11 11 import { useUpdateTaskStatus } from "@/hooks/mutations/task/use-update-task-status"; 12 12 import { useNumberedShortcuts } from "@/hooks/use-numbered-shortcuts"; 13 13 import { getColumnIcon } from "@/lib/column"; 14 + import { getStatusDisplayLabel } from "@/lib/i18n/domain"; 14 15 import { toast } from "@/lib/toast"; 15 16 import useProjectStore from "@/store/project"; 16 17 import type Task from "@/types/task"; ··· 78 79 onClick={() => handleStatusChange(status.value)} 79 80 > 80 81 {getColumnIcon(status.value, status.isFinal)} 81 - <span className="text-sm">{status.label}</span> 82 + <span className="text-sm"> 83 + {getStatusDisplayLabel(status.value, status.label)} 84 + </span> 82 85 {task.status === status.value ? ( 83 86 <Check className="ml-auto h-4 w-4" /> 84 87 ) : (
+15
apps/web/src/lib/i18n/domain.ts
··· 1 1 import i18n from "i18next"; 2 + import { DEFAULT_COLUMNS } from "@/constants/columns"; 2 3 3 4 export function getStatusLabel(status: string) { 4 5 return i18n.t(`tasks:status.${status}`, { 5 6 defaultValue: toDisplayCase(status), 6 7 }); 8 + } 9 + 10 + export function getStatusDisplayLabel(status: string, columnName?: string) { 11 + const defaultName = DEFAULT_COLUMNS.find((column) => column.id === status)?.name; 12 + 13 + if (columnName) { 14 + if (defaultName && columnName === defaultName) { 15 + return getStatusLabel(status); 16 + } 17 + 18 + return columnName; 19 + } 20 + 21 + return getStatusLabel(status); 7 22 } 8 23 9 24 export function getPriorityLabel(priority: string) {