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
@@ -24,7 +24,6 @@ import {
} from "@app/context/ProjectPermissionContext/types";
import { usePopUp } from "@app/hooks";
import { useCommitRollback, useGetRollbackPreview } from "@app/hooks/api/folderCommits/queries";
import { ProjectType } from "@app/hooks/api/workspace/types";
import { SecretVersionDiffView } from "../SecretVersionDiffView";
@@ -103,7 +102,7 @@ export const RollbackPreviewTab = (): JSX.Element => {
const goBackToHistory = () => {
navigate({
to: `/${ProjectType.SecretManager}/$projectId/commits/$environment/$folderId` as const,
to: "/projects/$projectId/secret-manager/commits/$environment/$folderId",
params: {
projectId: currentWorkspace.id,
folderId,
@@ -1,30 +1,26 @@
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 { RollbackPreviewTab } from './RollbackPreviewTab'
import { RollbackPreviewTab } from "./RollbackPreviewTab";
const RollbackPreviewTabQueryParamsSchema = z.object({
secretPath: z.string().catch('/'),
})
secretPath: z.string().catch("/")
});
export const Route = createFileRoute(
'/_authenticate/_inject-org-details/_org-layout/projects/$projectId/_project-layout/secret-manager/_secret-manager-layout/commits/$environment/$folderId/$commitId/restore',
"/_authenticate/_inject-org-details/_org-layout/projects/$projectId/_project-layout/secret-manager/_secret-manager-layout/commits/$environment/$folderId/$commitId/restore"
)({
component: RollbackPreviewTab,
validateSearch: zodValidator(RollbackPreviewTabQueryParamsSchema),
search: {
middlewares: [stripSearchParams({ secretPath: '/' })],
middlewares: [stripSearchParams({ secretPath: "/" })]
},
beforeLoad: ({ context, params, search }) => {
const secretPathSegments = search.secretPath.split('/').filter(Boolean)
const secretPathSegments = search.secretPath.split("/").filter(Boolean);
return {
breadcrumbs: [
@@ -32,20 +28,18 @@ export const Route = createFileRoute(
{
type: BreadcrumbTypes.Dropdown,
label:
context.project.environments.find(
(el) => el.slug === params.environment,
)?.name || '',
dropdownTitle: 'Environments',
context.project.environments.find((el) => el.slug === params.environment)?.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,
@@ -57,41 +51,41 @@ export const Route = createFileRoute(
projectId={params.projectId}
disableCopy
/>
),
)
})),
{
label: 'Commits',
label: "Commits",
link: linkOptions({
to: '/secret-manager/$projectId/commits/$environment/$folderId',
to: "/projects/$projectId/secret-manager/commits/$environment/$folderId",
params: {
projectId: params.projectId,
environment: params.environment,
folderId: params.folderId,
folderId: params.folderId
},
search: {
secretPath: search.secretPath,
},
}),
secretPath: search.secretPath
}
})
},
{
label: params.commitId,
link: linkOptions({
to: '/secret-manager/$projectId/commits/$environment/$folderId/$commitId',
to: "/projects/$projectId/secret-manager/commits/$environment/$folderId/$commitId",
params: {
projectId: params.projectId,
environment: params.environment,
folderId: params.folderId,
commitId: params.commitId,
commitId: params.commitId
},
search: {
secretPath: search.secretPath,
},
}),
secretPath: search.secretPath
}
})
},
{
label: 'Restore',
},
],
}
},
})
label: "Restore"
}
]
};
}
});