@locusai/web 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/next.config.js +7 -0
- package/package.json +37 -0
- package/postcss.config.mjs +5 -0
- package/src/app/backlog/page.tsx +19 -0
- package/src/app/docs/page.tsx +7 -0
- package/src/app/globals.css +603 -0
- package/src/app/layout.tsx +43 -0
- package/src/app/page.tsx +16 -0
- package/src/app/providers.tsx +16 -0
- package/src/app/settings/page.tsx +194 -0
- package/src/components/BoardFilter.tsx +98 -0
- package/src/components/Header.tsx +21 -0
- package/src/components/PropertyItem.tsx +98 -0
- package/src/components/Sidebar.tsx +109 -0
- package/src/components/TaskCard.tsx +138 -0
- package/src/components/TaskCreateModal.tsx +243 -0
- package/src/components/TaskPanel.tsx +765 -0
- package/src/components/index.ts +7 -0
- package/src/components/ui/Badge.tsx +77 -0
- package/src/components/ui/Button.tsx +47 -0
- package/src/components/ui/Checkbox.tsx +52 -0
- package/src/components/ui/Dropdown.tsx +107 -0
- package/src/components/ui/Input.tsx +36 -0
- package/src/components/ui/Modal.tsx +79 -0
- package/src/components/ui/Textarea.tsx +21 -0
- package/src/components/ui/index.ts +7 -0
- package/src/hooks/useTasks.ts +119 -0
- package/src/lib/api-client.ts +24 -0
- package/src/lib/utils.ts +6 -0
- package/src/services/doc.service.ts +27 -0
- package/src/services/index.ts +3 -0
- package/src/services/sprint.service.ts +26 -0
- package/src/services/task.service.ts +75 -0
- package/src/views/Backlog.tsx +691 -0
- package/src/views/Board.tsx +306 -0
- package/src/views/Docs.tsx +625 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { AssigneeRole, Task, TaskPriority, TaskStatus } from "@locusai/shared";
|
|
2
|
+
import apiClient from "@/lib/api-client";
|
|
3
|
+
|
|
4
|
+
export interface CreateTaskDto {
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
status: TaskStatus;
|
|
8
|
+
priority: TaskPriority;
|
|
9
|
+
labels?: string[];
|
|
10
|
+
assigneeRole?: AssigneeRole;
|
|
11
|
+
sprintId?: number | null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface UpdateTaskDto {
|
|
15
|
+
title?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
status?: TaskStatus;
|
|
18
|
+
priority?: TaskPriority;
|
|
19
|
+
labels?: string[];
|
|
20
|
+
assigneeRole?: AssigneeRole;
|
|
21
|
+
acceptanceCriteria?: { id: string; text: string; done: boolean }[];
|
|
22
|
+
sprintId?: number | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const taskService = {
|
|
26
|
+
getAll: async () => {
|
|
27
|
+
const response = await apiClient.get<Task[]>("/tasks");
|
|
28
|
+
return response.data;
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
getById: async (id: number) => {
|
|
32
|
+
const response = await apiClient.get<Task>(`/tasks/${id}`);
|
|
33
|
+
return response.data;
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
create: async (data: CreateTaskDto) => {
|
|
37
|
+
const response = await apiClient.post<Task>("/tasks", data);
|
|
38
|
+
return response.data;
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
update: async (id: number, data: UpdateTaskDto) => {
|
|
42
|
+
const response = await apiClient.patch<Task>(`/tasks/${id}`, data);
|
|
43
|
+
return response.data;
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
delete: async (id: number) => {
|
|
47
|
+
await apiClient.delete(`/tasks/${id}`);
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
addComment: async (id: number, data: { author: string; text: string }) => {
|
|
51
|
+
const response = await apiClient.post<Task>(`/tasks/${id}/comment`, data);
|
|
52
|
+
return response.data;
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
runCi: async (id: number, preset: string) => {
|
|
56
|
+
const response = await apiClient.post<{ summary: string }>("/ci/run", {
|
|
57
|
+
taskId: id,
|
|
58
|
+
preset,
|
|
59
|
+
});
|
|
60
|
+
return response.data;
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
lock: async (id: number, agentId: string, ttlSeconds: number) => {
|
|
64
|
+
const response = await apiClient.post(`/tasks/${id}/lock`, {
|
|
65
|
+
agentId,
|
|
66
|
+
ttlSeconds,
|
|
67
|
+
});
|
|
68
|
+
return response.data;
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
unlock: async (id: number, agentId: string) => {
|
|
72
|
+
const response = await apiClient.post(`/tasks/${id}/unlock`, { agentId });
|
|
73
|
+
return response.data;
|
|
74
|
+
},
|
|
75
|
+
};
|