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
@@ -33,6 +33,7 @@ import { withPermission } from "@app/hoc";
import { useDebounce } from "@app/hooks";
import { useOrgAdminAccessProject, useOrgAdminGetProjects } from "@app/hooks/api";
import { ProjectType } from "@app/hooks/api/workspace/types";
import { getProjectHomePage } from "@app/helpers/project";
export const OrgAdminProjects = withPermission(
() => {
@@ -58,26 +59,8 @@ export const OrgAdminProjects = withPermission(
await orgAdminAccessProject.mutateAsync({
projectId
});
if (type === ProjectType.CertificateManager) {
await navigate({
to: "/cert-manager/$projectId/subscribers" as const,
params: {
projectId
}
});
return;
}
if (type === ProjectType.SecretScanning) {
await navigate({
to: "/secret-scanning/$projectId/data-sources" as const,
params: {
projectId
}
});
return;
}
await navigate({
to: `/${type}/$projectId/overview` as const,
to: getProjectHomePage(type),
params: {
projectId
}
@@ -122,7 +105,7 @@ export const OrgAdminProjects = withPermission(
<TBody>
{isProjectsLoading && <TableSkeleton columns={4} innerKey="projects" />}
{!isProjectsLoading &&
projects?.map(({ name, slug, createdAt, type, id }) => (
projects?.map(({ name, slug, createdAt, id, defaultType }) => (
<Tr key={`project-${id}`} className="group w-full">
<Td>{name}</Td>
<Td>{slug}</Td>
@@ -143,7 +126,7 @@ export const OrgAdminProjects = withPermission(
onClick={(e) => {
e.stopPropagation();
e.preventDefault();
handleAccessProject(type, id);
handleAccessProject(defaultType, id);
}}
icon={<FontAwesomeIcon icon={faSignIn} />}
disabled={
@@ -418,10 +418,10 @@ export const LogsFilter = ({
onChange(e);
}}
placeholder="All projects"
options={workspacesInOrg.map(({ name, id, type }) => ({
options={workspacesInOrg.map(({ name, id, defaultType }) => ({
name,
id,
type
type: defaultType
}))}
getOptionValue={(option) => option.id}
getOptionLabel={(option) => option.name}
@@ -2,10 +2,10 @@ import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
import { OrgPermissionCan } from "@app/components/permissions";
import { PageHeader } from "@app/components/v2";
import { OrgPermissionBillingActions, OrgPermissionSubjects } from "@app/context";
import { BillingTabGroup } from "./components";
import { PageHeader } from "@app/components/v2";
export const BillingPage = () => {
const { t } = useTranslation();
@@ -5,7 +5,7 @@ import { useNavigate } from "@tanstack/react-router";
import { format } from "date-fns";
import { createNotification } from "@app/components/notifications";
import { IconButton, Tag, Td, Tooltip, Tr } from "@app/components/v2";
import { IconButton, Td, Tooltip, Tr } from "@app/components/v2";
import { formatProjectRoleName } from "@app/helpers/roles";
import { useGetUserWorkspaces } from "@app/hooks/api";
import { IdentityMembership } from "@app/hooks/api/identities/types";
@@ -50,7 +50,7 @@ export const IdentityProjectRow = ({
onClick={() => {
if (isAccessible) {
navigate({
to: `/${project?.type}/$projectId/access-management` as const,
to: "/projects/$projectId/access-management",
params: {
projectId: project.id
},
@@ -68,9 +68,6 @@ export const IdentityProjectRow = ({
}}
>
<Td className="max-w-0 truncate">{project.name}</Td>
<Td>
<Tag size="xs">{project.type}</Tag>
</Td>
<Td>{`${formatProjectRoleName(roles[0].role, roles[0].customRoleName)}${
roles.length > 1 ? ` (+${roles.length - 1})` : ""
}`}</Td>
@@ -222,7 +222,7 @@ export const AllProjectView = ({
onKeyDown={(evt) => {
if (evt.key === "Enter" && workspace.isMember) {
navigate({
to: getProjectHomePage(workspace),
to: getProjectHomePage(workspace.defaultType),
params: {
projectId: workspace.id
}
@@ -232,7 +232,7 @@ export const AllProjectView = ({
onClick={() => {
if (workspace.isMember) {
navigate({
to: getProjectHomePage(workspace),
to: getProjectHomePage(workspace.defaultType),
params: {
projectId: workspace.id
}
@@ -215,7 +215,7 @@ export const MyProjectView = ({
<div
onClick={() => {
navigate({
to: getProjectHomePage(workspace),
to: getProjectHomePage(workspace.defaultType),
params: {
projectId: workspace.id
}
@@ -10,7 +10,7 @@ export const Route = createFileRoute(
breadcrumbs: [
{
label: "Secret Management",
link: linkOptions({ to: "/organization/secret-manager/overview" })
link: linkOptions({ to: "/organization/projects" })
},
{
label: "Settings"
@@ -43,7 +43,7 @@ export const UserProjectRow = ({
onClick={() => {
if (isAccessible) {
navigate({
to: `/${project.type}/$projectId/access-management` as const,
to: "/projects/$projectId/access-management",
params: {
projectId: project.id
},