feat: fixed all ts url errors

This commit is contained in:
=
2025-07-02 01:16:49 +05:30
parent b0c1c9ce26
commit 48ac6b4aff
280 changed files with 2163 additions and 2460 deletions
@@ -1,51 +1,44 @@
import {
createFileRoute,
linkOptions,
stripSearchParams,
} from '@tanstack/react-router'
import { zodValidator } from '@tanstack/zod-adapter'
import { z } from 'zod'
import { createFileRoute, linkOptions, stripSearchParams } from "@tanstack/react-router";
import { zodValidator } from "@tanstack/zod-adapter";
import { z } from "zod";
import { SecretDashboardPathBreadcrumb } from '@app/components/navigation/SecretDashboardPathBreadcrumb'
import { BreadcrumbTypes } from '@app/components/v2'
import { SecretDashboardPathBreadcrumb } from "@app/components/navigation/SecretDashboardPathBreadcrumb";
import { BreadcrumbTypes } from "@app/components/v2";
import { SecretDashboardPage } from './SecretDashboardPage'
import { SecretDashboardPage } from "./SecretDashboardPage";
const SecretDashboardPageQueryParamsSchema = z.object({
secretPath: z.string().catch('/'),
search: z.string().catch(''),
tags: z.string().catch(''),
})
secretPath: z.string().catch("/"),
search: z.string().catch(""),
tags: z.string().catch("")
});
export const Route = createFileRoute(
'/_authenticate/_inject-org-details/_org-layout/projects/$projectId/_project-layout/secret-manager/_secret-manager-layout/secrets/$envSlug',
"/_authenticate/_inject-org-details/_org-layout/projects/$projectId/_project-layout/secret-manager/_secret-manager-layout/secrets/$envSlug"
)({
component: SecretDashboardPage,
validateSearch: zodValidator(SecretDashboardPageQueryParamsSchema),
search: {
middlewares: [stripSearchParams({ secretPath: '/', search: '', tags: '' })],
middlewares: [stripSearchParams({ secretPath: "/", search: "", tags: "" })]
},
beforeLoad: ({ context, params, search }) => {
const secretPathSegments = search.secretPath.split('/').filter(Boolean)
const secretPathSegments = search.secretPath.split("/").filter(Boolean);
return {
breadcrumbs: [
...context.breadcrumbs,
{
type: BreadcrumbTypes.Dropdown,
label:
context.project.environments.find(
(el) => el.slug === params.envSlug,
)?.name || '',
dropdownTitle: 'Environments',
label: context.project.environments.find((el) => el.slug === params.envSlug)?.name || "",
dropdownTitle: "Environments",
links: context.project.environments.map((el) => ({
label: el.name,
link: linkOptions({
to: '/secret-manager/$projectId/secrets/$envSlug',
to: "/projects/$projectId/secret-manager/secrets/$envSlug",
params: {
projectId: params.projectId,
envSlug: el.slug,
},
}),
})),
envSlug: el.slug
}
})
}))
},
...secretPathSegments.map((_, index) => ({
type: BreadcrumbTypes.Component,
@@ -56,9 +49,9 @@ export const Route = createFileRoute(
environmentSlug={params.envSlug}
projectId={params.projectId}
/>
),
})),
],
}
},
})
)
}))
]
};
}
});