Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client";

import { useCallback } from "react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
Expand Down Expand Up @@ -38,7 +37,7 @@ import {
} from "@/utils/cookies";
import { prefixPath } from "@/utils/path";

const NEXT_URL = "/automation/onboarding/draft-replies";
const NEXT_URL = "/assistant/onboarding/draft-replies";

export function CategoriesSetup({
emailAccountId,
Expand Down Expand Up @@ -148,7 +147,7 @@ export function CategoriesSetup({
variant="outline"
onClick={() => {
markOnboardingAsCompleted(ASSISTANT_ONBOARDING_COOKIE);
router.push(prefixPath(emailAccountId, "/automation"));
router.push(prefixPath(emailAccountId, "/assistant"));
}}
>
Skip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function CompletedPage(props: {

<div className="mt-8 flex flex-col gap-4">
<Button size="lg" asChild>
<Link href={prefixPath(emailAccountId, "/automation")}>
<Link href={prefixPath(emailAccountId, "/assistant")}>
Go to AI Assistant
</Link>
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function DraftRepliesPage() {
markOnboardingAsCompleted(ASSISTANT_ONBOARDING_COOKIE);

router.push(
prefixPath(emailAccountId, "/automation/onboarding/completed"),
prefixPath(emailAccountId, "/assistant/onboarding/completed"),
);
},
[router, emailAccountId],
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/(app)/[emailAccountId]/assistant/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default async function AssistantPage({
});

if (!hasRule) {
redirect(prefixPath(emailAccountId, "/automation/onboarding"));
redirect(prefixPath(emailAccountId, "/assistant?onboarding=true"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function AssistantTabs() {
<Link
href={prefixPath(
emailAccountId,
"/automation/onboarding",
"/assistant/onboarding",
)}
>
Set Up
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ function FinalStepReady({
Back
</Button>
<Button asChild onClick={next}>
<Link href={prefixPath(emailAccountId, "/automation?tab=test")}>
<Link href={prefixPath(emailAccountId, "/assistant?tab=test")}>
Try them out!
</Link>
</Button>
Expand Down
6 changes: 3 additions & 3 deletions apps/web/app/(app)/[emailAccountId]/automation/RuleForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export function RuleForm({ rule }: { rule: CreateRuleBody & { id?: string } }) {
automate: data.automate,
runOnThreads: data.runOnThreads,
});
router.push(prefixPath(emailAccountId, "/automation?tab=rules"));
router.push(prefixPath(emailAccountId, "/assistant?tab=rules"));
}
} else {
const res = await createRuleAction(emailAccountId, data);
Expand All @@ -210,7 +210,7 @@ export function RuleForm({ rule }: { rule: CreateRuleBody & { id?: string } }) {
router.replace(
prefixPath(emailAccountId, `/automation/rule/${res.data.rule.id}`),
);
router.push(prefixPath(emailAccountId, "/automation?tab=rules"));
router.push(prefixPath(emailAccountId, "/assistant?tab=rules"));
}
}
},
Expand Down Expand Up @@ -735,7 +735,7 @@ export function RuleForm({ rule }: { rule: CreateRuleBody & { id?: string } }) {
description: "The rule has been deleted.",
});
router.push(
prefixPath(emailAccountId, "/automation?tab=rules"),
prefixPath(emailAccountId, "/assistant?tab=rules"),
);
}
} catch (error) {
Expand Down
6 changes: 3 additions & 3 deletions apps/web/app/(app)/[emailAccountId]/automation/Rules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export function Rules({ size = "md" }: { size?: "sm" | "md" }) {
)
: prefixPath(
emailAccountId,
`/automation?tab=history&ruleId=${rule.id}`,
`/assistant?tab=history&ruleId=${rule.id}`,
)
}
target={
Expand Down Expand Up @@ -396,13 +396,13 @@ export function Rules({ size = "md" }: { size?: "sm" | "md" }) {
{hasRules && (
<div className="my-2 flex justify-end gap-2">
{/* <Button asChild variant="outline">
<Link href={prefixPath(emailAccountId, "/automation?tab=prompt")}>
<Link href={prefixPath(emailAccountId, "/assistant?tab=prompt")}>
<PenIcon className="mr-2 hidden size-4 md:block" />
Add Rule via Prompt
</Link>
</Button> */}
<Button asChild variant="outline">
<Link href={prefixPath(emailAccountId, "/automation/onboarding")}>
<Link href={prefixPath(emailAccountId, "/assistant/onboarding")}>
<SlidersIcon className="mr-2 hidden size-4 md:block" />
View Setup
</Link>
Expand Down
Loading