Delay onboarding starter task creation until launch
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -494,23 +494,41 @@ export function OnboardingWizard() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function handleStep3Next() {
|
async function handleStep3Next() {
|
||||||
|
if (!createdCompanyId || !createdAgentId) return;
|
||||||
|
setError(null);
|
||||||
|
setStep(4);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleLaunch() {
|
||||||
if (!createdCompanyId || !createdAgentId) return;
|
if (!createdCompanyId || !createdAgentId) return;
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
try {
|
try {
|
||||||
const issue = await issuesApi.create(createdCompanyId, {
|
let issueRef = createdIssueRef;
|
||||||
title: taskTitle.trim(),
|
if (!issueRef) {
|
||||||
...(taskDescription.trim()
|
const issue = await issuesApi.create(createdCompanyId, {
|
||||||
? { description: taskDescription.trim() }
|
title: taskTitle.trim(),
|
||||||
: {}),
|
...(taskDescription.trim()
|
||||||
assigneeAgentId: createdAgentId,
|
? { description: taskDescription.trim() }
|
||||||
status: "todo"
|
: {}),
|
||||||
});
|
assigneeAgentId: createdAgentId,
|
||||||
setCreatedIssueRef(issue.identifier ?? issue.id);
|
status: "todo"
|
||||||
queryClient.invalidateQueries({
|
});
|
||||||
queryKey: queryKeys.issues.list(createdCompanyId)
|
issueRef = issue.identifier ?? issue.id;
|
||||||
});
|
setCreatedIssueRef(issueRef);
|
||||||
setStep(4);
|
queryClient.invalidateQueries({
|
||||||
|
queryKey: queryKeys.issues.list(createdCompanyId)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
setSelectedCompanyId(createdCompanyId);
|
||||||
|
reset();
|
||||||
|
closeOnboarding();
|
||||||
|
navigate(
|
||||||
|
createdCompanyPrefix
|
||||||
|
? `/${createdCompanyPrefix}/issues/${issueRef}`
|
||||||
|
: `/issues/${issueRef}`
|
||||||
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(err instanceof Error ? err.message : "Failed to create task");
|
setError(err instanceof Error ? err.message : "Failed to create task");
|
||||||
} finally {
|
} finally {
|
||||||
@@ -518,20 +536,6 @@ export function OnboardingWizard() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleLaunch() {
|
|
||||||
if (!createdAgentId) return;
|
|
||||||
setLoading(true);
|
|
||||||
setError(null);
|
|
||||||
setLoading(false);
|
|
||||||
reset();
|
|
||||||
closeOnboarding();
|
|
||||||
if (createdCompanyPrefix) {
|
|
||||||
navigate(`/${createdCompanyPrefix}/dashboard`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
navigate("/dashboard");
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleKeyDown(e: React.KeyboardEvent) {
|
function handleKeyDown(e: React.KeyboardEvent) {
|
||||||
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -1175,8 +1179,8 @@ export function OnboardingWizard() {
|
|||||||
<div>
|
<div>
|
||||||
<h3 className="font-medium">Ready to launch</h3>
|
<h3 className="font-medium">Ready to launch</h3>
|
||||||
<p className="text-xs text-muted-foreground">
|
<p className="text-xs text-muted-foreground">
|
||||||
Everything is set up. Your assigned task already woke
|
Everything is set up. Launching now will create the
|
||||||
the agent, so you can jump straight to the issue.
|
starter task, wake the agent, and open the issue.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1291,7 +1295,7 @@ export function OnboardingWizard() {
|
|||||||
) : (
|
) : (
|
||||||
<ArrowRight className="h-3.5 w-3.5 mr-1" />
|
<ArrowRight className="h-3.5 w-3.5 mr-1" />
|
||||||
)}
|
)}
|
||||||
{loading ? "Opening..." : "Open Issue"}
|
{loading ? "Creating..." : "Create & Open Issue"}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user