Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix: show all board columns on public project link

Tinbe52d66ecee8
diff --git a/apps/web/src/components/public-project/kanban-view.tsx b/apps/web/src/components/public-project/kanban-view.tsx
index 5ea161060..2c4f37950 100644
--- a/apps/web/src/components/public-project/kanban-view.tsx
+++ b/apps/web/src/components/public-project/kanban-view.tsx
@@ -1,16 +1,8 @@
-import type { LucideIcon } from "lucide-react";
-import { DEFAULT_COLUMNS } from "@/constants/columns";
+import { getColumnIcon } from "@/lib/column";
import type { ProjectWithTasks } from "@/types/project";
import type Task from "@/types/task";
import { PublicTaskCard } from "./task-card";
-type Column = {
- id: string;
- name: string;
- icon: LucideIcon;
- tasks: Task[];
-};
-
type PublicKanbanViewProps = {
project: ProjectWithTasks;
onTaskClick: (task: Task) => void;
@@ -20,16 +12,12 @@ export function PublicKanbanView({
project,
onTaskClick,
}: PublicKanbanViewProps) {
- const columns: Column[] = DEFAULT_COLUMNS.map((column) => ({
- ...column,
- tasks: project.columns?.find((col) => col.id === column.id)?.tasks || [],
- }));
+ const columns = project.columns ?? [];
return (
<div className="flex-1 min-h-0 overflow-x-auto [-webkit-overflow-scrolling:touch]">
<div className="flex gap-3 p-3 h-full min-w-max transition-all duration-200 ease-out">
{columns.map((column) => {
- const IconComponent = column.icon;
return (
<div
key={column.id}
@@ -39,7 +27,7 @@ export function PublicKanbanView({
<div className="p-2 shrink-0">
<div className="flex items-center justify-between">
<div className="flex items-center gap-2">
- <IconComponent className="w-4 h-4 text-muted-foreground" />
+ {getColumnIcon(column.id, column.isFinal)}
<h3 className="font-medium text-foreground">
{column.name}
</h3>
@@ -65,7 +53,7 @@ export function PublicKanbanView({
{column.tasks.length === 0 && (
<div className="text-center text-sm text-muted-foreground py-12 px-4">
<div className="w-8 h-8 rounded-full bg-muted flex items-center justify-center mx-auto mb-2">
- <IconComponent className="w-4 h-4" />
+ {getColumnIcon(column.id, column.isFinal)}
</div>
No tasks in {column.name.toLowerCase()}
</div>
diff --git a/apps/web/src/components/public-project/list-view.tsx b/apps/web/src/components/public-project/list-view.tsx
index 6bbb88bf3..de9ab4b12 100644
--- a/apps/web/src/components/public-project/list-view.tsx
+++ b/apps/web/src/components/public-project/list-view.tsx
@@ -1,36 +1,26 @@
-import type { LucideIcon } from "lucide-react";
-import { DEFAULT_COLUMNS } from "@/constants/columns";
+import { getColumnIcon } from "@/lib/column";
import type { ProjectWithTasks } from "@/types/project";
import type Task from "@/types/task";
import { PublicTaskRow } from "./task-row";
-type Column = {
- id: string;
- name: string;
- icon: LucideIcon;
- tasks: Task[];
-};
-
type PublicListViewProps = {
project: ProjectWithTasks;
onTaskClick: (task: Task) => void;
};
export function PublicListView({ project, onTaskClick }: PublicListViewProps) {
- const columns: Column[] = DEFAULT_COLUMNS.map((column) => ({
- ...column,
- tasks: project.columns?.find((col) => col.id === column.id)?.tasks || [],
- }));
+ const columns = project.columns ?? [];
return (
<div className="flex-1 min-h-0 overflow-y-auto">
<div className="p-6 space-y-8 max-w-5xl mx-auto">
{columns.map((column) => {
- const IconComponent = column.icon;
return (
<div key={column.id} className="space-y-4">
<div className="flex items-center gap-3 px-2">
- <IconComponent className="w-5 h-5 text-muted-foreground" />
+ <span className="flex [&_svg]:!h-5 [&_svg]:!w-5">
+ {getColumnIcon(column.id, column.isFinal)}
+ </span>
<h3 className="font-semibold text-lg text-foreground">
{column.name}
</h3>
@@ -52,7 +42,7 @@ export function PublicListView({ project, onTaskClick }: PublicListViewProps) {
{column.tasks.length === 0 && (
<div className="text-center text-sm text-muted-foreground py-8 bg-muted/50 rounded-lg border border-dashed border-border">
<div className="w-8 h-8 rounded-full bg-muted flex items-center justify-center mx-auto mb-2">
- <IconComponent className="w-4 h-4" />
+ {getColumnIcon(column.id, column.isFinal)}
</div>
No tasks in {column.name.toLowerCase()}
</div>