Skip to content

Commit

Permalink
fix: revamp dashbord pathname to use singular noun
Browse files Browse the repository at this point in the history
  • Loading branch information
EiffelFly committed Jul 2, 2024
1 parent e78c94d commit 3256047
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apps/console/src/app/[entity]/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ type Props = {
};

export default async function Page({ params }: Props) {
redirect(`/${params.entity}/dashboard/pipelines`);
redirect(`/${params.entity}/dashboard/pipeline`);
}
2 changes: 1 addition & 1 deletion packages/toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@instill-ai/toolkit",
"version": "0.95.0-rc.19",
"version": "0.95.0-rc.22",
"description": "Instill AI's frontend toolkit",
"repository": "https://github.com/instill-ai/design-system.git",
"bugs": "https://github.com/instill-ai/design-system/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/src/components/top-bar/NavLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const navLinkItems: NavLinkProps[] = [
title: "Models",
},
{
pathname: "dashboard",
pathname: "dashboard/pipeline",
Icon: Icons.BarChartSquare02,
title: "Dashboard",
},
Expand Down
16 changes: 8 additions & 8 deletions packages/toolkit/src/view/dashboard/DashboardContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ToggleGroup } from "@instill-ai/design-system";

import { useRouteInfo } from "../../lib";

type DashboardType = "pipeline" | "credits";
type DashboardType = "pipeline" | "credit";

export const DashboardContainer = ({
children,
Expand All @@ -21,8 +21,8 @@ export const DashboardContainer = ({
const type = React.useMemo(() => {
if (pathname.includes("pipeline")) {
return "pipeline";
} else if (pathname.includes("credits")) {
return "credits";
} else if (pathname.includes("credit")) {
return "credit";
}
}, [pathname]);

Expand All @@ -34,9 +34,9 @@ export const DashboardContainer = ({
value={type}
onValueChange={(value: DashboardType) => {
if (value === "pipeline") {
router.push(`/${routeInfo.data.namespaceId}/dashboard/pipelines`);
router.push(`/${routeInfo.data.namespaceId}/dashboard/pipeline`);
} else {
router.push(`/${routeInfo.data.namespaceId}/dashboard/credits`);
router.push(`/${routeInfo.data.namespaceId}/dashboard/credit`);
}
}}
>
Expand All @@ -47,10 +47,10 @@ export const DashboardContainer = ({
Pipeline
</ToggleGroup.Item>
<ToggleGroup.Item
value="credits"
className={type === "credits" ? "pointer-events-none" : undefined}
value="credit"
className={type === "credit" ? "pointer-events-none" : undefined}
>
Credits
Credit
</ToggleGroup.Item>
</ToggleGroup.Root>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const DashboardPipelinesTable = (
className="h-5 w-5"
/> */}
<Link
href={`/${entity}/dashboard/pipelines/${row.getValue(
href={`/${entity}/dashboard/pipeline/${row.getValue(
"pipelineId",
)}${days ? "?days=" + days : ""}`}
>
Expand Down

0 comments on commit 3256047

Please sign in to comment.