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.

feat: adding invites for users

Andrej6f509ea85c76
diff --git a/apps/api/drizzle/0000_broad_veda.sql b/apps/api/drizzle/0000_conscious_golden_guardian.sql
similarity index 68%
rename from apps/api/drizzle/0000_broad_veda.sql
rename to apps/api/drizzle/0000_conscious_golden_guardian.sql
index cfd9f4aca..b36ca9d06 100644
--- a/apps/api/drizzle/0000_broad_veda.sql
+++ b/apps/api/drizzle/0000_conscious_golden_guardian.sql
@@ -5,7 +5,7 @@ CREATE TABLE `project` (
`icon` text DEFAULT 'Layout',
`name` text NOT NULL,
`description` text,
- `created_at` integer DEFAULT '"2025-02-08T22:05:26.528Z"' NOT NULL,
+ `created_at` integer DEFAULT '"2025-02-09T21:03:20.815Z"' NOT NULL,
FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE cascade ON DELETE cascade
);
--> statement-breakpoint
@@ -20,15 +20,15 @@ CREATE TABLE `task` (
`id` text PRIMARY KEY NOT NULL,
`project_id` text NOT NULL,
`number` integer DEFAULT 1,
- `assignee_id` text NOT NULL,
+ `assignee_email` text NOT NULL,
`title` text NOT NULL,
`description` text,
`status` text DEFAULT 'to-do' NOT NULL,
`priority` text DEFAULT 'low',
`due_date` integer,
- `created_at` integer DEFAULT '"2025-02-08T22:05:26.528Z"' NOT NULL,
+ `created_at` integer DEFAULT '"2025-02-09T21:03:20.815Z"' NOT NULL,
FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON UPDATE cascade ON DELETE cascade,
- FOREIGN KEY (`assignee_id`) REFERENCES `user`(`id`) ON UPDATE cascade ON DELETE cascade
+ FOREIGN KEY (`assignee_email`) REFERENCES `user`(`email`) ON UPDATE cascade ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `user` (
@@ -36,7 +36,7 @@ CREATE TABLE `user` (
`name` text NOT NULL,
`password` text NOT NULL,
`email` text NOT NULL,
- `created_at` integer DEFAULT '"2025-02-08T22:05:26.528Z"' NOT NULL
+ `created_at` integer DEFAULT '"2025-02-09T21:03:20.814Z"' NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `user_email_unique` ON `user` (`email`);--> statement-breakpoint
@@ -44,17 +44,17 @@ CREATE TABLE `workspace` (
`id` text PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`description` text,
- `owner_id` text NOT NULL,
- `created_at` integer DEFAULT '"2025-02-08T22:05:26.528Z"' NOT NULL,
- FOREIGN KEY (`owner_id`) REFERENCES `user`(`id`) ON UPDATE cascade ON DELETE cascade
+ `owner_email` text NOT NULL,
+ `created_at` integer DEFAULT '"2025-02-09T21:03:20.815Z"' NOT NULL,
+ FOREIGN KEY (`owner_email`) REFERENCES `user`(`email`) ON UPDATE cascade ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `workspace_member` (
`id` text PRIMARY KEY NOT NULL,
`workspace_id` text NOT NULL,
- `user_id` text NOT NULL,
+ `user_email` text NOT NULL,
`role` text,
- `joined_at` integer DEFAULT '"2025-02-08T22:05:26.528Z"' NOT NULL,
+ `joined_at` integer DEFAULT '"2025-02-09T21:03:20.815Z"' NOT NULL,
FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE cascade ON DELETE cascade,
- FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE cascade ON DELETE cascade
+ FOREIGN KEY (`user_email`) REFERENCES `user`(`email`) ON UPDATE cascade ON DELETE cascade
);
diff --git a/apps/api/drizzle/meta/0000_snapshot.json b/apps/api/drizzle/meta/0000_snapshot.json
index d805cfec3..49595564f 100644
--- a/apps/api/drizzle/meta/0000_snapshot.json
+++ b/apps/api/drizzle/meta/0000_snapshot.json
@@ -1,7 +1,7 @@
{
"version": "6",
"dialect": "sqlite",
- "id": "6a9833af-80f3-46e9-a34a-f0cad5ddd6f1",
+ "id": "49787b32-4e2b-4274-a0e2-d2784a178329",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"project": {
@@ -56,7 +56,7 @@
"primaryKey": false,
"notNull": true,
"autoincrement": false,
- "default": "'\"2025-02-08T22:05:26.528Z\"'"
+ "default": "'\"2025-02-09T21:03:20.815Z\"'"
}
},
"indexes": {},
@@ -141,8 +141,8 @@
"autoincrement": false,
"default": 1
},
- "assignee_id": {
- "name": "assignee_id",
+ "assignee_email": {
+ "name": "assignee_email",
"type": "text",
"primaryKey": false,
"notNull": true,
@@ -191,7 +191,7 @@
"primaryKey": false,
"notNull": true,
"autoincrement": false,
- "default": "'\"2025-02-08T22:05:26.528Z\"'"
+ "default": "'\"2025-02-09T21:03:20.815Z\"'"
}
},
"indexes": {},
@@ -205,12 +205,12 @@
"onDelete": "cascade",
"onUpdate": "cascade"
},
- "task_assignee_id_user_id_fk": {
- "name": "task_assignee_id_user_id_fk",
+ "task_assignee_email_user_email_fk": {
+ "name": "task_assignee_email_user_email_fk",
"tableFrom": "task",
"tableTo": "user",
- "columnsFrom": ["assignee_id"],
- "columnsTo": ["id"],
+ "columnsFrom": ["assignee_email"],
+ "columnsTo": ["email"],
"onDelete": "cascade",
"onUpdate": "cascade"
}
@@ -256,7 +256,7 @@
"primaryKey": false,
"notNull": true,
"autoincrement": false,
- "default": "'\"2025-02-08T22:05:26.528Z\"'"
+ "default": "'\"2025-02-09T21:03:20.814Z\"'"
}
},
"indexes": {
@@ -295,8 +295,8 @@
"notNull": false,
"autoincrement": false
},
- "owner_id": {
- "name": "owner_id",
+ "owner_email": {
+ "name": "owner_email",
"type": "text",
"primaryKey": false,
"notNull": true,
@@ -308,17 +308,17 @@
"primaryKey": false,
"notNull": true,
"autoincrement": false,
- "default": "'\"2025-02-08T22:05:26.528Z\"'"
+ "default": "'\"2025-02-09T21:03:20.815Z\"'"
}
},
"indexes": {},
"foreignKeys": {
- "workspace_owner_id_user_id_fk": {
- "name": "workspace_owner_id_user_id_fk",
+ "workspace_owner_email_user_email_fk": {
+ "name": "workspace_owner_email_user_email_fk",
"tableFrom": "workspace",
"tableTo": "user",
- "columnsFrom": ["owner_id"],
- "columnsTo": ["id"],
+ "columnsFrom": ["owner_email"],
+ "columnsTo": ["email"],
"onDelete": "cascade",
"onUpdate": "cascade"
}
@@ -344,8 +344,8 @@
"notNull": true,
"autoincrement": false
},
- "user_id": {
- "name": "user_id",
+ "user_email": {
+ "name": "user_email",
"type": "text",
"primaryKey": false,
"notNull": true,
@@ -364,7 +364,7 @@
"primaryKey": false,
"notNull": true,
"autoincrement": false,
- "default": "'\"2025-02-08T22:05:26.528Z\"'"
+ "default": "'\"2025-02-09T21:03:20.815Z\"'"
}
},
"indexes": {},
@@ -378,12 +378,12 @@
"onDelete": "cascade",
"onUpdate": "cascade"
},
- "workspace_member_user_id_user_id_fk": {
- "name": "workspace_member_user_id_user_id_fk",
+ "workspace_member_user_email_user_email_fk": {
+ "name": "workspace_member_user_email_user_email_fk",
"tableFrom": "workspace_member",
"tableTo": "user",
- "columnsFrom": ["user_id"],
- "columnsTo": ["id"],
+ "columnsFrom": ["user_email"],
+ "columnsTo": ["email"],
"onDelete": "cascade",
"onUpdate": "cascade"
}
diff --git a/apps/api/drizzle/meta/_journal.json b/apps/api/drizzle/meta/_journal.json
index f11e09f6f..fe2414e5c 100644
--- a/apps/api/drizzle/meta/_journal.json
+++ b/apps/api/drizzle/meta/_journal.json
@@ -5,8 +5,8 @@
{
"idx": 0,
"version": "6",
- "when": 1739052326535,
- "tag": "0000_broad_veda",
+ "when": 1739135000822,
+ "tag": "0000_conscious_golden_guardian",
"breakpoints": true
}
]
diff --git a/apps/api/src/database/schema.ts b/apps/api/src/database/schema.ts
index 4d534768b..0da51f7b6 100644
--- a/apps/api/src/database/schema.ts
+++ b/apps/api/src/database/schema.ts
@@ -32,9 +32,9 @@ export const workspaceTable = sqliteTable("workspace", {
.primaryKey(),
name: text("name").notNull(),
description: text("description"),
- ownerId: text("owner_id")
+ ownerEmail: text("owner_email")
.notNull()
- .references(() => userTable.id, {
+ .references(() => userTable.email, {
onDelete: "cascade",
onUpdate: "cascade",
}),
@@ -53,9 +53,9 @@ export const workspaceUserTable = sqliteTable("workspace_member", {
onDelete: "cascade",
onUpdate: "cascade",
}),
- userId: text("user_id")
+ userEmail: text("user_email")
.notNull()
- .references(() => userTable.id, {
+ .references(() => userTable.email, {
onDelete: "cascade",
onUpdate: "cascade",
}),
@@ -95,9 +95,9 @@ export const taskTable = sqliteTable("task", {
onUpdate: "cascade",
}),
number: int().default(1),
- assigneeId: text("assignee_id")
+ userEmail: text("assignee_email")
.notNull()
- .references(() => userTable.id, {
+ .references(() => userTable.email, {
onDelete: "cascade",
onUpdate: "cascade",
}),
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
index 4553ed8ec..e071dbd24 100644
--- a/apps/api/src/index.ts
+++ b/apps/api/src/index.ts
@@ -9,7 +9,7 @@ import workspace from "./workspace";
import workspaceUser from "./workspace-user";
const app = new Elysia()
- .state("userId", "")
+ .state("userEmail", "")
.use(cors())
.use(logger())
.use(user)
@@ -27,7 +27,7 @@ const app = new Elysia()
return { user: null };
}
- store.userId = user.id;
+ store.userEmail = user.email;
},
})
.get("/me", async ({ cookie: { session } }) => {
diff --git a/apps/api/src/task/controllers/create-task.ts b/apps/api/src/task/controllers/create-task.ts
index 6e775cd48..5f95d029a 100644
--- a/apps/api/src/task/controllers/create-task.ts
+++ b/apps/api/src/task/controllers/create-task.ts
@@ -13,7 +13,7 @@ async function getNextTaskNumber(projectId: string) {
async function createTask(body: {
projectId: string;
- assigneeId: string;
+ userEmail: string;
title: string;
status: string;
dueDate: Date | null;
@@ -23,7 +23,7 @@ async function createTask(body: {
const [assignee] = await db
.select({ name: userTable.name })
.from(userTable)
- .where(eq(userTable.id, body.assigneeId));
+ .where(eq(userTable.email, body.userEmail));
if (!assignee) {
throw new Error("Assignee not found");
diff --git a/apps/api/src/task/controllers/get-tasks.ts b/apps/api/src/task/controllers/get-tasks.ts
index a0f476b16..4a0991a9e 100644
--- a/apps/api/src/task/controllers/get-tasks.ts
+++ b/apps/api/src/task/controllers/get-tasks.ts
@@ -28,12 +28,12 @@ async function getTasks(projectId: string) {
priority: taskTable.priority,
dueDate: taskTable.dueDate,
createdAt: taskTable.createdAt,
- assigneeId: taskTable.assigneeId,
+ userEmail: taskTable.userEmail,
assigneeName: userTable.name,
assigneeEmail: userTable.email,
})
.from(taskTable)
- .leftJoin(userTable, eq(taskTable.assigneeId, userTable.id))
+ .leftJoin(userTable, eq(taskTable.userEmail, userTable.id))
.where(eq(taskTable.projectId, projectId));
const columns = DEFAULT_COLUMNS.map((column) => ({
diff --git a/apps/api/src/task/index.ts b/apps/api/src/task/index.ts
index 2653c6eb9..791444556 100644
--- a/apps/api/src/task/index.ts
+++ b/apps/api/src/task/index.ts
@@ -17,7 +17,7 @@ const task = new Elysia({ prefix: "/task" })
{
body: t.Object({
projectId: t.String(),
- assigneeId: t.String(),
+ userEmail: t.String(),
title: t.String(),
status: t.String(),
dueDate: t.Date(),
diff --git a/apps/api/src/workspace-user/controllers/get-workspace-users.ts b/apps/api/src/workspace-user/controllers/get-workspace-users.ts
index f7e5a5bd1..fb3506b06 100644
--- a/apps/api/src/workspace-user/controllers/get-workspace-users.ts
+++ b/apps/api/src/workspace-user/controllers/get-workspace-users.ts
@@ -9,8 +9,9 @@ import {
function getWorkspaceUsers({ workspaceId }: { workspaceId: string }) {
return db
.select({
- userId: userTable.id,
+ userEmail: userTable.email,
userName: userTable.name,
+ joinedAt: userTable.createdAt,
})
.from(workspaceTable)
.where(eq(workspaceTable.id, workspaceId))
@@ -18,15 +19,16 @@ function getWorkspaceUsers({ workspaceId }: { workspaceId: string }) {
workspaceUserTable,
eq(workspaceTable.id, workspaceUserTable.workspaceId),
)
- .innerJoin(userTable, eq(workspaceUserTable.userId, userTable.id))
+ .innerJoin(userTable, eq(workspaceUserTable.userEmail, userTable.email))
.unionAll(
db
.select({
- userId: userTable.id,
+ userEmail: userTable.email,
userName: userTable.name,
+ joinedAt: userTable.createdAt,
})
.from(workspaceTable)
- .innerJoin(userTable, eq(workspaceTable.ownerId, userTable.id))
+ .innerJoin(userTable, eq(workspaceTable.ownerEmail, userTable.email))
.where(eq(workspaceTable.id, workspaceId)),
);
}
diff --git a/apps/api/src/workspace-user/controllers/invite-workspace-user.ts b/apps/api/src/workspace-user/controllers/invite-workspace-user.ts
new file mode 100644
index 000000000..257884f68
--- /dev/null
+++ b/apps/api/src/workspace-user/controllers/invite-workspace-user.ts
@@ -0,0 +1,19 @@
+import db from "../../database";
+import { workspaceUserTable } from "../../database/schema";
+
+async function inviteWorkspaceUser({
+ workspaceId,
+ userEmail,
+}: { workspaceId: string; userEmail: string }) {
+ const [invitedUser] = await db
+ .insert(workspaceUserTable)
+ .values({
+ userEmail,
+ workspaceId,
+ })
+ .returning();
+
+ return invitedUser;
+}
+
+export default inviteWorkspaceUser;
diff --git a/apps/api/src/workspace-user/index.ts b/apps/api/src/workspace-user/index.ts
index e84a1b602..5fedb6e80 100644
--- a/apps/api/src/workspace-user/index.ts
+++ b/apps/api/src/workspace-user/index.ts
@@ -1,13 +1,27 @@
-import Elysia from "elysia";
+import Elysia, { t } from "elysia";
import getWorkspaceUsers from "./controllers/get-workspace-users";
+import inviteWorkspaceUser from "./controllers/invite-workspace-user";
-const workspaceUser = new Elysia({ prefix: "/workspace-user" }).get(
- "/list/:workspaceId",
- async ({ params: { workspaceId } }) => {
+const workspaceUser = new Elysia({ prefix: "/workspace-user" })
+ .get("/list/:workspaceId", async ({ params: { workspaceId } }) => {
const workspaceUsersInWorkspace = await getWorkspaceUsers({ workspaceId });
+ console.log({ workspaceUsersInWorkspace });
return workspaceUsersInWorkspace;
- },
-);
+ })
+ .post(
+ "/:workspaceId/invite",
+ async ({ body }) => {
+ const invitedWorkspaceUser = await inviteWorkspaceUser(body);
+
+ return invitedWorkspaceUser;
+ },
+ {
+ body: t.Object({
+ userEmail: t.String(),
+ workspaceId: t.String(),
+ }),
+ },
+ );
export default workspaceUser;
diff --git a/apps/api/src/workspace/controllers/delete-workspace.ts b/apps/api/src/workspace/controllers/delete-workspace.ts
index 9b5f1f447..fab1301a4 100644
--- a/apps/api/src/workspace/controllers/delete-workspace.ts
+++ b/apps/api/src/workspace/controllers/delete-workspace.ts
@@ -4,19 +4,19 @@ import { workspaceTable } from "../../database/schema";
import type { DeleteWorkspacePayload } from "../db/queries";
async function deleteWorkspace({
- userId,
+ userEmail,
workspaceId,
}: DeleteWorkspacePayload) {
const [existingWorkspace] = await db
.select({
id: workspaceTable.id,
- ownerId: workspaceTable.ownerId,
+ ownerEmail: workspaceTable.ownerEmail,
})
.from(workspaceTable)
.where(
and(
eq(workspaceTable.id, workspaceId),
- eq(workspaceTable.ownerId, userId),
+ eq(workspaceTable.ownerEmail, userEmail),
),
)
.limit(1);
@@ -33,7 +33,7 @@ async function deleteWorkspace({
.returning({
id: workspaceTable.id,
name: workspaceTable.name,
- ownerId: workspaceTable.ownerId,
+ ownerEmail: workspaceTable.ownerEmail,
createdAt: workspaceTable.createdAt,
});
diff --git a/apps/api/src/workspace/controllers/get-workspace.ts b/apps/api/src/workspace/controllers/get-workspace.ts
index a85a0cce0..f0b4cf717 100644
--- a/apps/api/src/workspace/controllers/get-workspace.ts
+++ b/apps/api/src/workspace/controllers/get-workspace.ts
@@ -3,14 +3,14 @@ import db from "../../database";
import { workspaceTable, workspaceUserTable } from "../../database/schema";
async function getWorkspace({
- userId,
+ userEmail,
workspaceId,
-}: { userId: string; workspaceId: string }) {
+}: { userEmail: string; workspaceId: string }) {
const [existingWorkspace] = await db
.select({
id: workspaceTable.id,
name: workspaceTable.name,
- ownerId: workspaceTable.ownerId,
+ ownerEmail: workspaceTable.ownerEmail,
createdAt: workspaceTable.createdAt,
})
.from(workspaceTable)
@@ -22,8 +22,8 @@ async function getWorkspace({
and(
eq(workspaceTable.id, workspaceId),
or(
- eq(workspaceTable.ownerId, userId),
- eq(workspaceUserTable.userId, userId),
+ eq(workspaceTable.ownerEmail, userEmail),
+ eq(workspaceUserTable.userEmail, userEmail),
),
),
)
diff --git a/apps/api/src/workspace/controllers/get-workspaces.ts b/apps/api/src/workspace/controllers/get-workspaces.ts
index e4730a5f8..2dd35bd25 100644
--- a/apps/api/src/workspace/controllers/get-workspaces.ts
+++ b/apps/api/src/workspace/controllers/get-workspaces.ts
@@ -6,12 +6,12 @@ import {
workspaceUserTable,
} from "../../database/schema";
-async function getWorkspaces({ userId }: { userId: string }) {
+async function getWorkspaces({ userEmail }: { userEmail: string }) {
const workspaces = await db
.select({
id: workspaceTable.id,
name: workspaceTable.name,
- ownerId: workspaceTable.ownerId,
+ userEmail: workspaceTable.ownerEmail,
})
.from(workspaceTable)
.leftJoin(
@@ -20,11 +20,11 @@ async function getWorkspaces({ userId }: { userId: string }) {
)
.where(
or(
- eq(workspaceTable.ownerId, userId),
- eq(workspaceUserTable.userId, userId),
+ eq(workspaceTable.ownerEmail, userEmail),
+ eq(workspaceUserTable.userEmail, userEmail),
),
)
- .groupBy(workspaceTable.id, workspaceTable.name, workspaceTable.ownerId);
+ .groupBy(workspaceTable.id, workspaceTable.name, workspaceTable.ownerEmail);
const workspacesWithProjects = await Promise.all(
workspaces.map(async (workspace) => ({
diff --git a/apps/api/src/workspace/controllers/update-workspace.ts b/apps/api/src/workspace/controllers/update-workspace.ts
index 623fa9594..237fe92d3 100644
--- a/apps/api/src/workspace/controllers/update-workspace.ts
+++ b/apps/api/src/workspace/controllers/update-workspace.ts
@@ -4,20 +4,20 @@ import { workspaceTable } from "../../database/schema";
import type { UpdateWorkspacePayload } from "../db/queries";
async function updateWorkspace({
- userId,
+ userEmail,
workspaceId,
body,
-}: { userId: string; workspaceId: string; body: UpdateWorkspacePayload }) {
+}: { userEmail: string; workspaceId: string; body: UpdateWorkspacePayload }) {
const [existingWorkspace] = await db
.select({
id: workspaceTable.id,
- ownerId: workspaceTable.ownerId,
+ ownerEmail: workspaceTable.ownerEmail,
})
.from(workspaceTable)
.where(
and(
eq(workspaceTable.id, workspaceId),
- eq(workspaceTable.ownerId, userId),
+ eq(workspaceTable.ownerEmail, userEmail),
),
)
.limit(1);
@@ -37,7 +37,7 @@ async function updateWorkspace({
.returning({
id: workspaceTable.id,
name: workspaceTable.name,
- ownerId: workspaceTable.ownerId,
+ ownerEmail: workspaceTable.ownerEmail,
createdAt: workspaceTable.createdAt,
});
diff --git a/apps/api/src/workspace/db/queries.ts b/apps/api/src/workspace/db/queries.ts
index 83e0d71ea..3a63271bf 100644
--- a/apps/api/src/workspace/db/queries.ts
+++ b/apps/api/src/workspace/db/queries.ts
@@ -12,7 +12,7 @@ export const updateWorkspaceSchema = t.Object({
});
export const deleteWorkspaceSchema = t.Object({
- userId: t.String(),
+ userEmail: t.String(),
workspaceId: t.String(),
});
diff --git a/apps/api/src/workspace/index.ts b/apps/api/src/workspace/index.ts
index 390b9ae9a..5e40817a2 100644
--- a/apps/api/src/workspace/index.ts
+++ b/apps/api/src/workspace/index.ts
@@ -7,15 +7,15 @@ import updateWorkspace from "./controllers/update-workspace";
import { updateWorkspaceSchema } from "./db/queries";
const workspace = new Elysia({ prefix: "/workspace" })
- .state("userId", "")
+ .state("userEmail", "")
.post(
"/create",
async ({ body, store }) => {
- const userId = store.userId;
+ const userEmail = store.userEmail;
const createdWorkspace = await createWorkspace({
...body,
- ownerId: userId,
+ ownerEmail: userEmail,
});
return createdWorkspace;
@@ -27,28 +27,28 @@ const workspace = new Elysia({ prefix: "/workspace" })
},
)
.get("/list", async ({ store }) => {
- const userId = store.userId;
+ const userEmail = store.userEmail;
- const workspaces = await getWorkspaces({ userId });
+ const workspaces = await getWorkspaces({ userEmail });
return workspaces;
})
.get("/:id", async ({ store, params }) => {
- const userId = store.userId;
+ const userEmail = store.userEmail;
const workspaceId = params.id;
- const workspace = await getWorkspace({ userId, workspaceId });
+ const workspace = await getWorkspace({ userEmail, workspaceId });
return workspace;
})
.put(
"/:id",
async ({ store, params, body }) => {
- const userId = store.userId;
+ const userEmail = store.userEmail;
const workspaceId = params.id;
const updatedWorkspace = await updateWorkspace({
- userId,
+ userEmail,
workspaceId,
body,
});
@@ -58,10 +58,10 @@ const workspace = new Elysia({ prefix: "/workspace" })
{ body: updateWorkspaceSchema },
)
.delete("/:id", async ({ store, params }) => {
- const userId = store.userId;
+ const userEmail = store.userEmail;
const workspaceId = params.id;
- const deletedWorkspace = await deleteWorkspace({ userId, workspaceId });
+ const deletedWorkspace = await deleteWorkspace({ userEmail, workspaceId });
return deletedWorkspace;
});
diff --git a/apps/web/src/components/common/sidebar/sections/manage-teams/index.tsx b/apps/web/src/components/common/sidebar/sections/manage-teams/index.tsx
new file mode 100644
index 000000000..083185606
--- /dev/null
+++ b/apps/web/src/components/common/sidebar/sections/manage-teams/index.tsx
@@ -0,0 +1,52 @@
+import { cn } from "@/lib/cn";
+import { Route } from "@/routes/dashboard/workspace/$workspaceId";
+import { useUserPreferencesStore } from "@/store/user-preferences";
+import { useNavigate } from "@tanstack/react-router";
+import { Users } from "lucide-react";
+
+function ManageTeams() {
+ const { isSidebarOpened } = useUserPreferencesStore();
+ const navigate = useNavigate();
+ const { workspaceId } = Route.useParams();
+
+ return (
+ <div>
+ <h2
+ className={cn(
+ "text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider mb-2",
+ isSidebarOpened && "px-3",
+ )}
+ >
+ {isSidebarOpened && "Team"}
+ </h2>
+ <button
+ type="button"
+ className={cn(
+ "w-full text-left py-2 rounded-md flex items-center text-sm transition-all group",
+ isSidebarOpened && "px-3",
+ !isSidebarOpened && "justify-center px-2",
+ "text-zinc-600 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800",
+ )}
+ title={!isSidebarOpened ? "Manage Team" : undefined}
+ onClick={() =>
+ navigate({
+ to: "/dashboard/workspace/$workspaceId/team",
+ params: {
+ workspaceId,
+ },
+ })
+ }
+ >
+ <Users
+ className={cn(
+ "shrink-0",
+ !isSidebarOpened ? "w-6 h-6" : "w-4 h-4 mr-2",
+ )}
+ />
+ {isSidebarOpened && "Manage Team"}
+ </button>
+ </div>
+ );
+}
+
+export default ManageTeams;
diff --git a/apps/web/src/components/common/sidebar/sidebar-content.tsx b/apps/web/src/components/common/sidebar/sidebar-content.tsx
index f21ffd7fd..236271fd8 100644
--- a/apps/web/src/components/common/sidebar/sidebar-content.tsx
+++ b/apps/web/src/components/common/sidebar/sidebar-content.tsx
@@ -1,11 +1,16 @@
import { cn } from "@/lib/cn";
+import useWorkspaceStore from "@/store/workspace";
+import ManageTeams from "./sections/manage-teams";
import Workspaces from "./sections/workspaces";
export function SidebarContent() {
+ const { workspace } = useWorkspaceStore();
+
return (
<nav className="flex-1 overflow-y-auto p-3">
<div className={cn("space-y-4")}>
<Workspaces />
+ {workspace && <ManageTeams />}
</div>
</nav>
);
diff --git a/apps/web/src/components/task/create-task-modal.tsx b/apps/web/src/components/task/create-task-modal.tsx
index 8ba0107e6..d12975530 100644
--- a/apps/web/src/components/task/create-task-modal.tsx
+++ b/apps/web/src/components/task/create-task-modal.tsx
@@ -30,7 +30,7 @@ const taskSchema = z.object({
title: z.string().min(1, { message: "Title is required" }),
description: z.string().optional(),
priority: z.enum(["low", "medium", "high", "urgent"]),
- assigneeId: z.string(),
+ email: z.string(),
});
type TaskFormValues = z.infer<typeof taskSchema>;
@@ -52,7 +52,7 @@ export function CreateTaskModal({
title: "",
description: "",
priority: "low",
- assigneeId: "",
+ email: "",
},
});
const { mutateAsync } = useCreateTask();
@@ -63,23 +63,23 @@ export function CreateTaskModal({
const newTask = await mutateAsync({
title: data.title.trim(),
description: data.description?.trim() || "",
- assigneeId: data.assigneeId,
+ userEmail: data.email,
priority: data.priority,
projectId: project?.id,
dueDate: new Date(),
status: status ?? "to-do",
});
- setProject(
- produce(project, (draft) => {
- const targetColumn = draft.columns?.find(
- (col) => col.id === newTask.status,
- );
- if (targetColumn) {
- targetColumn.tasks.push(newTask);
- }
- }),
- );
+ const updatedProject = produce(project, (draft) => {
+ const targetColumn = draft.columns?.find(
+ (col) => col.id === newTask.status,
+ );
+ if (targetColumn) {
+ targetColumn.tasks.push(newTask);
+ }
+ });
+
+ setProject(updatedProject);
form.reset();
onClose();
@@ -146,7 +146,7 @@ export function CreateTaskModal({
<FormField
control={form.control}
- name="assigneeId"
+ name="email"
render={({ field }) => (
<FormItem>
<FormLabel className="block text-sm font-medium text-zinc-900 dark:text-zinc-300 mb-1">
@@ -164,7 +164,7 @@ export function CreateTaskModal({
),
},
...(users ?? []).map((user) => ({
- value: user.userId ?? "",
+ value: user.userEmail ?? "",
label: user.userName ?? "",
})),
]}
diff --git a/apps/web/src/components/team/invite-team-member-modal.tsx b/apps/web/src/components/team/invite-team-member-modal.tsx
new file mode 100644
index 000000000..f7f04795b
--- /dev/null
+++ b/apps/web/src/components/team/invite-team-member-modal.tsx
@@ -0,0 +1,149 @@
+import useInviteWorkspaceUser from "@/hooks/mutations/workspace-user/use-invite-workspace-user";
+import useGetWorkspaces from "@/hooks/queries/workspace/use-get-workspaces";
+import { zodResolver } from "@hookform/resolvers/zod";
+import * as Dialog from "@radix-ui/react-dialog";
+import { Building2, X } from "lucide-react";
+import { useForm } from "react-hook-form";
+import { z } from "zod";
+import { Button } from "../ui/button";
+import {
+ Form,
+ FormControl,
+ FormField,
+ FormItem,
+ FormLabel,
+ FormMessage,
+} from "../ui/form";
+import { Input } from "../ui/input";
+import { Select } from "../ui/select";
+
+type Props = {
+ open: boolean;
+ onClose: () => void;
+};
+
+const teamMemberSchema = z.object({
+ userEmail: z.string().email(),
+ workspaceId: z.string(),
+});
+
+type TeamMemberFormValues = z.infer<typeof teamMemberSchema>;
+
+function InviteTeamMemberModal({ open, onClose }: Props) {
+ const { data: workspaces } = useGetWorkspaces();
+ const { mutateAsync } = useInviteWorkspaceUser();
+
+ const form = useForm<TeamMemberFormValues>({
+ resolver: zodResolver(teamMemberSchema),
+ defaultValues: {
+ userEmail: "",
+ workspaceId: "",
+ },
+ });
+
+ const onSubmit = async ({ userEmail, workspaceId }: TeamMemberFormValues) => {
+ await mutateAsync({ userEmail, workspaceId });
+
+ form.reset();
+ onClose();
+ };
+
+ return (
+ <Dialog.Root open={open} onOpenChange={onClose}>
+ <Dialog.Portal>
+ <Dialog.Overlay className="fixed inset-0 bg-black/40 backdrop-blur-sm" />
+ <Dialog.Content className="fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-md">
+ <div className="bg-white dark:bg-zinc-900 rounded-lg shadow-xl">
+ <div className="flex items-center justify-between p-4 border-b border-zinc-200 dark:border-zinc-800">
+ <Dialog.Title className="text-lg font-semibold text-zinc-900 dark:text-zinc-100">
+ Invite Team Member
+ </Dialog.Title>
+ <Dialog.Close className="text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-300">
+ <X size={20} />
+ </Dialog.Close>
+ </div>
+
+ <Form {...form}>
+ <form onSubmit={form.handleSubmit(onSubmit)} className="p-4">
+ <div className="space-y-4">
+ <div>
+ <FormField
+ control={form.control}
+ name="userEmail"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel className="block text-sm font-medium text-zinc-900 dark:text-zinc-300 mb-1">
+ Email
+ </FormLabel>
+ <FormControl>
+ <Input
+ {...field}
+ placeholder="[email protected]"
+ className="bg-white dark:bg-zinc-800/50"
+ />
+ </FormControl>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+ </div>
+
+ <FormField
+ control={form.control}
+ name="workspaceId"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel className="block text-sm font-medium text-zinc-900 dark:text-zinc-300 mb-1">
+ Workspace
+ </FormLabel>
+ <FormControl>
+ <Select
+ {...field}
+ options={[
+ {
+ value: "",
+ label: "Select a workspace",
+ icon: (
+ <Building2 className="w-4 h-4 text-zinc-400" />
+ ),
+ },
+ ...(workspaces ?? []).map((workspace) => ({
+ value: workspace.id,
+ label: workspace.name,
+ })),
+ ]}
+ placeholder="Select workspace"
+ />
+ </FormControl>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+ </div>
+
+ <div className="flex justify-end gap-2 mt-6">
+ <Dialog.Close asChild>
+ <Button
+ type="button"
+ className="bg-zinc-100 text-zinc-900 hover:bg-zinc-200 dark:bg-zinc-800 dark:text-zinc-100 dark:hover:bg-zinc-700"
+ >
+ Cancel
+ </Button>
+ </Dialog.Close>
+ <Button
+ type="submit"
+ className="bg-indigo-600 text-white hover:bg-indigo-500 dark:bg-indigo-500 dark:hover:bg-indigo-400"
+ >
+ Send Invitation
+ </Button>
+ </div>
+ </form>
+ </Form>
+ </div>
+ </Dialog.Content>
+ </Dialog.Portal>
+ </Dialog.Root>
+ );
+}
+
+export default InviteTeamMemberModal;
diff --git a/apps/web/src/components/team/team-table.tsx b/apps/web/src/components/team/team-table.tsx
new file mode 100644
index 000000000..e0b9318e4
--- /dev/null
+++ b/apps/web/src/components/team/team-table.tsx
@@ -0,0 +1,70 @@
+import useGetWorkspaceUsers from "@/hooks/queries/workspace-users/use-get-workspace-users";
+import { Route } from "@/routes/dashboard/workspace/$workspaceId";
+import { MoreHorizontal } from "lucide-react";
+import { Avatar, AvatarFallback } from "../ui/avatar";
+
+function TeamTable() {
+ const { workspaceId } = Route.useParams();
+ const { data: users } = useGetWorkspaceUsers({ workspaceId });
+
+ return (
+ <table className="w-full">
+ <thead>
+ <tr className="border-b border-zinc-200 dark:border-zinc-800">
+ <th className="text-left py-3 px-4 text-sm font-medium text-zinc-500 dark:text-zinc-400">
+ Name
+ </th>
+ <th className="text-left py-3 px-4 text-sm font-medium text-zinc-500 dark:text-zinc-400">
+ Role
+ </th>
+ <th className="text-left py-3 px-4 text-sm font-medium text-zinc-500 dark:text-zinc-400">
+ Joined
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {users?.map((user) => (
+ <tr
+ key={user.userName}
+ className="border-b border-zinc-200 dark:border-zinc-800 last:border-0"
+ >
+ <td className="py-3 px-4">
+ <div className="flex items-center">
+ <Avatar className="h-8 w-8 mr-3">
+ <AvatarFallback>{user.userName.charAt(0)}</AvatarFallback>
+ </Avatar>
+ <div>
+ <div className="font-medium text-zinc-900 dark:text-zinc-100">
+ {user.userName}
+ </div>
+ </div>
+ </div>
+ </td>
+ <td className="py-3 px-4">
+ <span className="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-indigo-50 text-indigo-700 dark:bg-indigo-500/10 dark:text-indigo-400">
+ Admin
+ </span>
+ </td>
+ <td className="py-3 px-4 text-sm text-zinc-500 dark:text-zinc-400">
+ {new Date(user.joinedAt).toLocaleDateString("en-US", {
+ year: "numeric",
+ month: "short",
+ day: "numeric",
+ })}
+ </td>
+ <td className="py-3 px-4">
+ <button
+ type="button"
+ className="p-1 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded"
+ >
+ <MoreHorizontal className="w-4 h-4 text-zinc-500 dark:text-zinc-400" />
+ </button>
+ </td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ );
+}
+
+export default TeamTable;
diff --git a/apps/web/src/fetchers/task/create-task.ts b/apps/web/src/fetchers/task/create-task.ts
index 1940d9bc0..d4c456d0e 100644
--- a/apps/web/src/fetchers/task/create-task.ts
+++ b/apps/web/src/fetchers/task/create-task.ts
@@ -4,7 +4,7 @@ async function createProject(
title: string,
description: string,
projectId: string,
- assigneeId: string,
+ userEmail: string,
status: string,
dueDate: Date,
priority: string,
@@ -13,7 +13,7 @@ async function createProject(
title,
description,
projectId,
- assigneeId,
+ userEmail,
status,
dueDate,
priority,
diff --git a/apps/web/src/fetchers/workspace-user/invite-workspace-member.ts b/apps/web/src/fetchers/workspace-user/invite-workspace-member.ts
new file mode 100644
index 000000000..08758eb22
--- /dev/null
+++ b/apps/web/src/fetchers/workspace-user/invite-workspace-member.ts
@@ -0,0 +1,15 @@
+import { api } from "@kaneo/libs";
+
+const inviteWorkspaceMember = async ({
+ workspaceId,
+ userEmail,
+}: { workspaceId: string; userEmail: string }) => {
+ const response = await api["workspace-user"]({ workspaceId }).invite.post({
+ workspaceId,
+ userEmail,
+ });
+
+ return response.data;
+};
+
+export default inviteWorkspaceMember;
diff --git a/apps/web/src/hooks/mutations/task/use-create-task.ts b/apps/web/src/hooks/mutations/task/use-create-task.ts
index 07592ea7c..e37696555 100644
--- a/apps/web/src/hooks/mutations/task/use-create-task.ts
+++ b/apps/web/src/hooks/mutations/task/use-create-task.ts
@@ -4,7 +4,7 @@ import { useMutation } from "@tanstack/react-query";
type CreateTaskInput = {
title: string;
description: string;
- assigneeId: string;
+ userEmail: string;
projectId: string;
status: string;
dueDate: Date;
@@ -17,7 +17,7 @@ function useCreateTask() {
mutationFn: ({
title,
description,
- assigneeId,
+ userEmail,
projectId,
status,
dueDate,
@@ -27,7 +27,7 @@ function useCreateTask() {
title,
description,
projectId,
- assigneeId,
+ userEmail,
status,
dueDate,
priority,
diff --git a/apps/web/src/hooks/mutations/workspace-user/use-invite-workspace-user.ts b/apps/web/src/hooks/mutations/workspace-user/use-invite-workspace-user.ts
new file mode 100644
index 000000000..03bf221c8
--- /dev/null
+++ b/apps/web/src/hooks/mutations/workspace-user/use-invite-workspace-user.ts
@@ -0,0 +1,14 @@
+import inviteWorkspaceMember from "@/fetchers/workspace-user/invite-workspace-member";
+import { useMutation } from "@tanstack/react-query";
+
+function useInviteWorkspaceUser() {
+ return useMutation({
+ mutationFn: ({
+ workspaceId,
+ userEmail,
+ }: { workspaceId: string; userEmail: string }) =>
+ inviteWorkspaceMember({ workspaceId, userEmail }),
+ });
+}
+
+export default useInviteWorkspaceUser;
diff --git a/apps/web/src/routeTree.gen.ts b/apps/web/src/routeTree.gen.ts
index f35fbe8a2..09bb0d1ec 100644
--- a/apps/web/src/routeTree.gen.ts
+++ b/apps/web/src/routeTree.gen.ts
@@ -16,6 +16,7 @@ import { Route as IndexImport } from './routes/index'
import { Route as AuthSignUpImport } from './routes/auth/sign-up'
import { Route as AuthSignInImport } from './routes/auth/sign-in'
import { Route as DashboardWorkspaceWorkspaceIdImport } from './routes/dashboard/workspace/$workspaceId'
+import { Route as DashboardWorkspaceWorkspaceIdTeamImport } from './routes/dashboard/workspace/$workspaceId/team'
import { Route as DashboardWorkspaceWorkspaceIdProjectProjectIdImport } from './routes/dashboard/workspace/$workspaceId/project/$projectId'
// Create/Update Routes
@@ -51,6 +52,13 @@ const DashboardWorkspaceWorkspaceIdRoute =
getParentRoute: () => DashboardRoute,
} as any)
+const DashboardWorkspaceWorkspaceIdTeamRoute =
+ DashboardWorkspaceWorkspaceIdTeamImport.update({
+ id: '/team',
+ path: '/team',
+ getParentRoute: () => DashboardWorkspaceWorkspaceIdRoute,
+ } as any)
+
const DashboardWorkspaceWorkspaceIdProjectProjectIdRoute =
DashboardWorkspaceWorkspaceIdProjectProjectIdImport.update({
id: '/project/$projectId',
@@ -97,6 +105,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof DashboardWorkspaceWorkspaceIdImport
parentRoute: typeof DashboardImport
}
+ '/dashboard/workspace/$workspaceId/team': {
+ id: '/dashboard/workspace/$workspaceId/team'
+ path: '/team'
+ fullPath: '/dashboard/workspace/$workspaceId/team'
+ preLoaderRoute: typeof DashboardWorkspaceWorkspaceIdTeamImport
+ parentRoute: typeof DashboardWorkspaceWorkspaceIdImport
+ }
'/dashboard/workspace/$workspaceId/project/$projectId': {
id: '/dashboard/workspace/$workspaceId/project/$projectId'
path: '/project/$projectId'
@@ -110,11 +125,14 @@ declare module '@tanstack/react-router' {
// Create and export the route tree
interface DashboardWorkspaceWorkspaceIdRouteChildren {
+ DashboardWorkspaceWorkspaceIdTeamRoute: typeof DashboardWorkspaceWorkspaceIdTeamRoute
DashboardWorkspaceWorkspaceIdProjectProjectIdRoute: typeof DashboardWorkspaceWorkspaceIdProjectProjectIdRoute
}
const DashboardWorkspaceWorkspaceIdRouteChildren: DashboardWorkspaceWorkspaceIdRouteChildren =
{
+ DashboardWorkspaceWorkspaceIdTeamRoute:
+ DashboardWorkspaceWorkspaceIdTeamRoute,
DashboardWorkspaceWorkspaceIdProjectProjectIdRoute:
DashboardWorkspaceWorkspaceIdProjectProjectIdRoute,
}
@@ -143,6 +161,7 @@ export interface FileRoutesByFullPath {
'/auth/sign-in': typeof AuthSignInRoute
'/auth/sign-up': typeof AuthSignUpRoute
'/dashboard/workspace/$workspaceId': typeof DashboardWorkspaceWorkspaceIdRouteWithChildren
+ '/dashboard/workspace/$workspaceId/team': typeof DashboardWorkspaceWorkspaceIdTeamRoute
'/dashboard/workspace/$workspaceId/project/$projectId': typeof DashboardWorkspaceWorkspaceIdProjectProjectIdRoute
}
@@ -152,6 +171,7 @@ export interface FileRoutesByTo {
'/auth/sign-in': typeof AuthSignInRoute
'/auth/sign-up': typeof AuthSignUpRoute
'/dashboard/workspace/$workspaceId': typeof DashboardWorkspaceWorkspaceIdRouteWithChildren
+ '/dashboard/workspace/$workspaceId/team': typeof DashboardWorkspaceWorkspaceIdTeamRoute
'/dashboard/workspace/$workspaceId/project/$projectId': typeof DashboardWorkspaceWorkspaceIdProjectProjectIdRoute
}
@@ -162,6 +182,7 @@ export interface FileRoutesById {
'/auth/sign-in': typeof AuthSignInRoute
'/auth/sign-up': typeof AuthSignUpRoute
'/dashboard/workspace/$workspaceId': typeof DashboardWorkspaceWorkspaceIdRouteWithChildren
+ '/dashboard/workspace/$workspaceId/team': typeof DashboardWorkspaceWorkspaceIdTeamRoute
'/dashboard/workspace/$workspaceId/project/$projectId': typeof DashboardWorkspaceWorkspaceIdProjectProjectIdRoute
}
@@ -173,6 +194,7 @@ export interface FileRouteTypes {
| '/auth/sign-in'
| '/auth/sign-up'
| '/dashboard/workspace/$workspaceId'
+ | '/dashboard/workspace/$workspaceId/team'
| '/dashboard/workspace/$workspaceId/project/$projectId'
fileRoutesByTo: FileRoutesByTo
to:
@@ -181,6 +203,7 @@ export interface FileRouteTypes {
| '/auth/sign-in'
| '/auth/sign-up'
| '/dashboard/workspace/$workspaceId'
+ | '/dashboard/workspace/$workspaceId/team'
| '/dashboard/workspace/$workspaceId/project/$projectId'
id:
| '__root__'
@@ -189,6 +212,7 @@ export interface FileRouteTypes {
| '/auth/sign-in'
| '/auth/sign-up'
| '/dashboard/workspace/$workspaceId'
+ | '/dashboard/workspace/$workspaceId/team'
| '/dashboard/workspace/$workspaceId/project/$projectId'
fileRoutesById: FileRoutesById
}
@@ -242,9 +266,14 @@ export const routeTree = rootRoute
"filePath": "dashboard/workspace/$workspaceId.tsx",
"parent": "/dashboard",
"children": [
+ "/dashboard/workspace/$workspaceId/team",
"/dashboard/workspace/$workspaceId/project/$projectId"
]
},
+ "/dashboard/workspace/$workspaceId/team": {
+ "filePath": "dashboard/workspace/$workspaceId/team.tsx",
+ "parent": "/dashboard/workspace/$workspaceId"
+ },
"/dashboard/workspace/$workspaceId/project/$projectId": {
"filePath": "dashboard/workspace/$workspaceId/project/$projectId.tsx",
"parent": "/dashboard/workspace/$workspaceId"
diff --git a/apps/web/src/routes/dashboard/workspace/$workspaceId/team.tsx b/apps/web/src/routes/dashboard/workspace/$workspaceId/team.tsx
new file mode 100644
index 000000000..5bb4216cc
--- /dev/null
+++ b/apps/web/src/routes/dashboard/workspace/$workspaceId/team.tsx
@@ -0,0 +1,70 @@
+import InviteTeamMemberModal from "@/components/team/invite-team-member-modal";
+import TeamTable from "@/components/team/team-table";
+import { Button } from "@/components/ui/button";
+import { Link, createFileRoute } from "@tanstack/react-router";
+import { Shield, UserPlus, Users } from "lucide-react";
+import { useState } from "react";
+
+const menuItems = [
+ { icon: Users, label: "Members", path: "/team" },
+ { icon: UserPlus, label: "Invitations", path: "/team/invitations" },
+ { icon: Shield, label: "Roles", path: "/team/roles" },
+];
+
+export const Route = createFileRoute("/dashboard/workspace/$workspaceId/team")({
+ component: RouteComponent,
+});
+
+function RouteComponent() {
+ const [isInviteTeamMemberDialogOpened, setIsInviteTeamMemberDialogOpened] =
+ useState(false);
+
+ return (
+ <div className="flex-1 flex h-screen">
+ <aside className="w-64 border-r border-zinc-200 dark:border-zinc-800 p-6">
+ <h2 className="text-lg font-semibold text-zinc-900 dark:text-zinc-100 mb-4">
+ Team
+ </h2>
+ <nav className="space-y-1">
+ {menuItems.map(({ icon: Icon, label, path }) => (
+ <Link
+ key={path}
+ to={path}
+ className={`flex items-center px-3 py-2 rounded-lg text-sm ${
+ location.pathname === path
+ ? "bg-indigo-50 text-indigo-600 dark:bg-indigo-500/10 dark:text-indigo-400"
+ : "text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800"
+ }`}
+ >
+ <Icon className="w-4 h-4 mr-3" />
+ {label}
+ </Link>
+ ))}
+ </nav>
+ </aside>
+ <div className="flex-1 p-6">
+ <div className="w-full">
+ <div className="flex items-center justify-between mb-6">
+ <h1 className="text-2xl font-semibold text-zinc-900 dark:text-zinc-100">
+ Team Members
+ </h1>
+ <Button
+ onClick={() => setIsInviteTeamMemberDialogOpened(true)}
+ className="bg-indigo-600 text-white hover:bg-indigo-500 dark:bg-indigo-500 dark:hover:bg-indigo-400"
+ >
+ <UserPlus className="w-4 h-4 mr-2" />
+ Invite Member
+ </Button>
+ </div>
+ </div>
+ <div className="bg-white dark:bg-zinc-900 rounded-lg border border-zinc-200 dark:border-zinc-800 overflow-hidden">
+ <TeamTable />
+ </div>
+ </div>
+ <InviteTeamMemberModal
+ open={isInviteTeamMemberDialogOpened}
+ onClose={() => setIsInviteTeamMemberDialogOpened(false)}
+ />
+ </div>
+ );
+}
diff --git a/apps/web/src/types/project/index.ts b/apps/web/src/types/project/index.ts
index 1d4f684a6..1b1ae128d 100644
--- a/apps/web/src/types/project/index.ts
+++ b/apps/web/src/types/project/index.ts
@@ -19,7 +19,7 @@ export type Task = {
number: number | null;
description: string | null;
projectId: string;
- assigneeId: string;
+ userEmail: string;
title: string;
status: string;
dueDate: Date | null;
diff --git a/bun.lockb b/bun.lockb
index 8be6c823a..da79b0b1e 100755
Binary files a/bun.lockb and b/bun.lockb differ