Auto-assign toggle in ProjectSettings
Toggle switch with description. Saved with other project settings. Default: off. When enabled, new tasks auto-assigned by labels ↔ capabilities.
This commit is contained in:
parent
f3eeed5eb9
commit
aa7c45657b
@ -24,6 +24,7 @@ export default function ProjectSettings({ project, onUpdated }: Props) {
|
|||||||
const [description, setDescription] = useState(project.description || "");
|
const [description, setDescription] = useState(project.description || "");
|
||||||
const [repoUrls, setRepoUrls] = useState(project.repo_urls?.join("\n") || "");
|
const [repoUrls, setRepoUrls] = useState(project.repo_urls?.join("\n") || "");
|
||||||
const [status, setStatus] = useState(project.status);
|
const [status, setStatus] = useState(project.status);
|
||||||
|
const [autoAssign, setAutoAssign] = useState(project.auto_assign || false);
|
||||||
const [saving, setSaving] = useState(false);
|
const [saving, setSaving] = useState(false);
|
||||||
const [saved, setSaved] = useState(false);
|
const [saved, setSaved] = useState(false);
|
||||||
const [confirmDelete, setConfirmDelete] = useState(false);
|
const [confirmDelete, setConfirmDelete] = useState(false);
|
||||||
@ -96,6 +97,7 @@ export default function ProjectSettings({ project, onUpdated }: Props) {
|
|||||||
description: description.trim() || null,
|
description: description.trim() || null,
|
||||||
repo_urls: urls,
|
repo_urls: urls,
|
||||||
status,
|
status,
|
||||||
|
auto_assign: autoAssign,
|
||||||
});
|
});
|
||||||
onUpdated(updated);
|
onUpdated(updated);
|
||||||
setSaved(true);
|
setSaved(true);
|
||||||
@ -164,6 +166,24 @@ export default function ProjectSettings({ project, onUpdated }: Props) {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Auto-assign toggle */}
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<div className="text-sm">Авто-назначение</div>
|
||||||
|
<div className="text-xs text-[var(--muted)]">Назначать задачи агентам по лейблам ↔ capabilities</div>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
onClick={() => setAutoAssign(!autoAssign)}
|
||||||
|
className={`relative w-10 h-5 rounded-full transition-colors duration-200 ${
|
||||||
|
autoAssign ? "bg-[var(--accent)]" : "bg-[var(--border)]"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<span className={`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white transition-transform duration-200 ${
|
||||||
|
autoAssign ? "translate-x-5" : "translate-x-0"
|
||||||
|
}`} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<button
|
<button
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
|
|||||||
@ -86,6 +86,7 @@ export interface Project {
|
|||||||
status: string;
|
status: string;
|
||||||
task_counter: number;
|
task_counter: number;
|
||||||
chat_id: string | null;
|
chat_id: string | null;
|
||||||
|
auto_assign: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ProjectMember {
|
export interface ProjectMember {
|
||||||
@ -178,7 +179,7 @@ export async function createProject(data: { name: string; slug: string; descript
|
|||||||
return request("/api/v1/projects", { method: "POST", body: JSON.stringify(data) });
|
return request("/api/v1/projects", { method: "POST", body: JSON.stringify(data) });
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateProject(projectId: string, data: Partial<Pick<Project, "name" | "slug" | "description" | "repo_urls" | "status">>): Promise<Project> {
|
export async function updateProject(projectId: string, data: Partial<Pick<Project, "name" | "slug" | "description" | "repo_urls" | "status" | "auto_assign">>): Promise<Project> {
|
||||||
return request(`/api/v1/projects/${projectId}`, { method: "PATCH", body: JSON.stringify(data) });
|
return request(`/api/v1/projects/${projectId}`, { method: "PATCH", body: JSON.stringify(data) });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user