refactor(nexus): rewrite dangling dashboard hrefs to assistant (phase 7)
This commit is contained in:
parent
9329e5d9ad
commit
862b856d2b
11 changed files with 15 additions and 15 deletions
|
|
@ -28,7 +28,7 @@ function saveCompanyPath(companyId: string, path: string) {
|
|||
|
||||
/**
|
||||
* Remembers the last visited page per company and navigates to it on company switch.
|
||||
* Falls back to /dashboard if no page was previously visited for a company.
|
||||
* Falls back to /assistant if no page was previously visited for a company.
|
||||
*/
|
||||
export function useCompanyPageMemory() {
|
||||
const { companies, selectedCompanyId, selectedCompany, selectionSource } = useCompany();
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ export function sanitizeRememberedPathForCompany(params: {
|
|||
path: string | null | undefined;
|
||||
companyPrefix: string;
|
||||
}): string {
|
||||
const relativePath = params.path ? toCompanyRelativePath(params.path) : "/dashboard";
|
||||
const relativePath = params.path ? toCompanyRelativePath(params.path) : "/assistant";
|
||||
if (!isRememberableCompanyPath(relativePath)) {
|
||||
return "/dashboard";
|
||||
return "/assistant";
|
||||
}
|
||||
|
||||
const pathname = relativePath.split("?")[0] ?? "";
|
||||
|
|
@ -57,7 +57,7 @@ export function sanitizeRememberedPathForCompany(params: {
|
|||
identifierMatch &&
|
||||
normalizeCompanyPrefix(identifierMatch[1] ?? "") !== normalizeCompanyPrefix(params.companyPrefix)
|
||||
) {
|
||||
return "/dashboard";
|
||||
return "/assistant";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -867,7 +867,7 @@ export function CompanyImport() {
|
|||
body: `${result.company.name}: ${result.agents.length} agent${result.agents.length === 1 ? "" : "s"} processed.`,
|
||||
});
|
||||
// Force a fresh dashboard load so newly imported agents are immediately visible.
|
||||
window.location.assign(`/${importedCompany.issuePrefix}/dashboard`);
|
||||
window.location.assign(`/${importedCompany.issuePrefix}/assistant`);
|
||||
},
|
||||
onError: (err) => {
|
||||
pushToast({
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ export function CompanySettings() {
|
|||
|
||||
useEffect(() => {
|
||||
setBreadcrumbs([
|
||||
{ label: selectedCompany?.name ?? VOCAB.company, href: "/dashboard" },
|
||||
{ label: selectedCompany?.name ?? VOCAB.company, href: "/assistant" },
|
||||
{ label: "Settings" }
|
||||
]);
|
||||
}, [setBreadcrumbs, selectedCompany?.name]);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ export function NotFoundPage({ scope = "global", requestedPrefix }: NotFoundPage
|
|||
}, [setBreadcrumbs]);
|
||||
|
||||
const fallbackCompany = selectedCompany ?? companies[0] ?? null;
|
||||
const dashboardHref = fallbackCompany ? `/${fallbackCompany.issuePrefix}/dashboard` : "/";
|
||||
const assistantHref = fallbackCompany ? `/${fallbackCompany.issuePrefix}/assistant` : "/";
|
||||
const currentPath = `${location.pathname}${location.search}${location.hash}`;
|
||||
const normalizedPrefix = requestedPrefix?.toUpperCase();
|
||||
|
||||
|
|
@ -52,9 +52,9 @@ export function NotFoundPage({ scope = "global", requestedPrefix }: NotFoundPage
|
|||
|
||||
<div className="mt-5 flex flex-wrap gap-2">
|
||||
<Button asChild>
|
||||
<Link to={dashboardHref}>
|
||||
<Link to={assistantHref}>
|
||||
<Compass className="mr-1.5 h-4 w-4" />
|
||||
Open dashboard
|
||||
Open assistant
|
||||
</Link>
|
||||
</Button>
|
||||
<Button variant="outline" asChild>
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ export function PluginManager() {
|
|||
|
||||
useEffect(() => {
|
||||
setBreadcrumbs([
|
||||
{ label: selectedCompany?.name ?? VOCAB.company, href: "/dashboard" },
|
||||
{ label: selectedCompany?.name ?? VOCAB.company, href: "/assistant" },
|
||||
{ label: "Settings", href: "/instance/settings/heartbeats" },
|
||||
{ label: "Plugins" },
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ export function PluginPage() {
|
|||
<div className="space-y-4">
|
||||
<div className="flex items-center gap-2">
|
||||
<Button variant="ghost" size="sm" asChild>
|
||||
<Link to={companyPrefix ? `/${companyPrefix}/dashboard` : "/dashboard"}>
|
||||
<Link to={companyPrefix ? `/${companyPrefix}/assistant` : "/assistant"}>
|
||||
<ArrowLeft className="h-4 w-4 mr-1" />
|
||||
Back
|
||||
</Link>
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ export function PluginSettings() {
|
|||
|
||||
useEffect(() => {
|
||||
setBreadcrumbs([
|
||||
{ label: selectedCompany?.name ?? VOCAB.company, href: "/dashboard" },
|
||||
{ label: selectedCompany?.name ?? VOCAB.company, href: "/assistant" },
|
||||
{ label: "Settings", href: "/instance/settings/heartbeats" },
|
||||
{ label: "Plugins", href: "/instance/settings/plugins" },
|
||||
{ label: plugin?.manifestJson?.displayName ?? plugin?.packageName ?? "Plugin Details" },
|
||||
|
|
|
|||
|
|
@ -573,7 +573,7 @@ export function ProjectDetail() {
|
|||
const name = updatedProject?.name ?? project?.name ?? "Project";
|
||||
if (archived) {
|
||||
pushToast({ title: `"${name}" has been archived`, tone: "success" });
|
||||
navigate("/dashboard");
|
||||
navigate("/assistant");
|
||||
} else {
|
||||
pushToast({ title: `"${name}" has been unarchived`, tone: "success" });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ export function SkillBrowser() {
|
|||
|
||||
useEffect(() => {
|
||||
setBreadcrumbs([
|
||||
{ label: selectedCompany?.name ?? "Workspace", href: "/dashboard" },
|
||||
{ label: selectedCompany?.name ?? "Workspace", href: "/assistant" },
|
||||
{ label: "Skills" },
|
||||
]);
|
||||
}, [selectedCompany?.name, setBreadcrumbs]);
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ export function SkillDetail() {
|
|||
|
||||
useEffect(() => {
|
||||
setBreadcrumbs([
|
||||
{ label: selectedCompany?.name ?? "Workspace", href: "/dashboard" },
|
||||
{ label: selectedCompany?.name ?? "Workspace", href: "/assistant" },
|
||||
{ label: "Skills", href: "../skills" },
|
||||
{ label: skill?.name ?? "Skill" },
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue