mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 21:51:56 +00:00
feat: resolved frontend url changes and resolved ts error
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
|
||||
import { SettingsPage } from "./SettingsPage";
|
||||
import { SettingsPage } from './SettingsPage'
|
||||
|
||||
export const Route = createFileRoute(
|
||||
"/_authenticate/_inject-org-details/_org-layout/projects/$projectId/_project-layout/ssh/_ssh-layout/settings"
|
||||
'/_authenticate/_inject-org-details/_org-layout/projects/ssh/$projectId/_ssh-layout/settings',
|
||||
)({
|
||||
component: SettingsPage,
|
||||
beforeLoad: ({ context }) => {
|
||||
@@ -11,9 +11,9 @@ export const Route = createFileRoute(
|
||||
breadcrumbs: [
|
||||
...context.breadcrumbs,
|
||||
{
|
||||
label: "Settings"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
});
|
||||
label: 'Settings',
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -17,7 +17,6 @@ import {
|
||||
import { ROUTE_PATHS } from "@app/const/routes";
|
||||
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||
import { useDeleteSshCa, useGetSshCaById } from "@app/hooks/api";
|
||||
import { ProjectType } from "@app/hooks/api/workspace/types";
|
||||
import { usePopUp } from "@app/hooks/usePopUp";
|
||||
|
||||
import { SshCaModal } from "../SshCasPage/components/SshCaModal";
|
||||
@@ -53,7 +52,7 @@ const Page = () => {
|
||||
|
||||
handlePopUpClose("deleteSshCa");
|
||||
navigate({
|
||||
to: `/projects/$projectId/${ProjectType.SSH}/overview` as const,
|
||||
to: "/projects/ssh/$projectId/overview",
|
||||
params: {
|
||||
projectId
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { createFileRoute, linkOptions } from "@tanstack/react-router";
|
||||
import { SshCaByIDPage } from "./SshCaByIDPage";
|
||||
|
||||
export const Route = createFileRoute(
|
||||
"/_authenticate/_inject-org-details/_org-layout/projects/$projectId/_project-layout/ssh/_ssh-layout/ca/$caId"
|
||||
"/_authenticate/_inject-org-details/_org-layout/projects/ssh/$projectId/_ssh-layout/ca/$caId"
|
||||
)({
|
||||
component: SshCaByIDPage,
|
||||
beforeLoad: ({ context, params }) => {
|
||||
@@ -13,7 +13,7 @@ export const Route = createFileRoute(
|
||||
{
|
||||
label: "Certificate Authorities",
|
||||
link: linkOptions({
|
||||
to: "/projects/$projectId/ssh/cas",
|
||||
to: "/projects/ssh/$projectId/cas",
|
||||
params
|
||||
})
|
||||
},
|
||||
|
||||
@@ -22,7 +22,6 @@ import {
|
||||
SshCertKeyAlgorithm,
|
||||
sshCertKeyAlgorithms
|
||||
} from "@app/hooks/api/sshCa/constants";
|
||||
import { ProjectType } from "@app/hooks/api/workspace/types";
|
||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||
|
||||
type Props = {
|
||||
@@ -126,7 +125,7 @@ export const SshCaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
||||
});
|
||||
|
||||
navigate({
|
||||
to: `/projects/$projectId/${ProjectType.SSH}/ca/$caId` as const,
|
||||
to: "/projects/ssh/$projectId/ca/$caId",
|
||||
params: {
|
||||
projectId,
|
||||
caId: newCaId
|
||||
|
||||
@@ -24,7 +24,6 @@ import {
|
||||
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||
import { SshCaStatus, useListWorkspaceSshCas } from "@app/hooks/api";
|
||||
import { caStatusToNameMap, getCaStatusBadgeVariant } from "@app/hooks/api/ca/constants";
|
||||
import { ProjectType } from "@app/hooks/api/workspace/types";
|
||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||
|
||||
type Props = {
|
||||
@@ -62,7 +61,7 @@ export const SshCaTable = ({ handlePopUpOpen }: Props) => {
|
||||
key={`ca-${ca.id}`}
|
||||
onClick={() =>
|
||||
navigate({
|
||||
to: `/projects/$projectId/${ProjectType.SSH}/ca/$caId` as const,
|
||||
to: "/projects/ssh/$projectId/ca/$caId",
|
||||
params: {
|
||||
projectId: currentWorkspace.id,
|
||||
caId: ca.id
|
||||
|
||||
@@ -3,7 +3,7 @@ import { createFileRoute, linkOptions } from "@tanstack/react-router";
|
||||
import { SshCasPage } from "./SshCasPage";
|
||||
|
||||
export const Route = createFileRoute(
|
||||
"/_authenticate/_inject-org-details/_org-layout/projects/$projectId/_project-layout/ssh/_ssh-layout/cas"
|
||||
"/_authenticate/_inject-org-details/_org-layout/projects/ssh/$projectId/_ssh-layout/cas"
|
||||
)({
|
||||
component: SshCasPage,
|
||||
beforeLoad: ({ context, params }) => {
|
||||
@@ -13,7 +13,7 @@ export const Route = createFileRoute(
|
||||
{
|
||||
label: "Certificate Authorities",
|
||||
link: linkOptions({
|
||||
to: "/projects/$projectId/ssh/cas",
|
||||
to: "/projects/ssh/$projectId/cas",
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
|
||||
import { SshCertsPage } from "./SshCertsPage";
|
||||
import { SshCertsPage } from './SshCertsPage'
|
||||
|
||||
export const Route = createFileRoute(
|
||||
"/_authenticate/_inject-org-details/_org-layout/projects/$projectId/_project-layout/ssh/_ssh-layout/certificates"
|
||||
'/_authenticate/_inject-org-details/_org-layout/projects/ssh/$projectId/_ssh-layout/certificates',
|
||||
)({
|
||||
component: SshCertsPage
|
||||
});
|
||||
component: SshCertsPage,
|
||||
})
|
||||
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
import { ROUTE_PATHS } from "@app/const/routes";
|
||||
import { ProjectPermissionActions, ProjectPermissionSub, useWorkspace } from "@app/context";
|
||||
import { useDeleteSshHostGroup, useGetSshHostGroupById } from "@app/hooks/api";
|
||||
import { ProjectType } from "@app/hooks/api/workspace/types";
|
||||
import { usePopUp } from "@app/hooks/usePopUp";
|
||||
|
||||
import { SshHostGroupModal } from "../SshHostsPage/components/SshHostGroupModal";
|
||||
@@ -54,7 +53,7 @@ const Page = () => {
|
||||
|
||||
handlePopUpClose("deleteSshHostGroup");
|
||||
navigate({
|
||||
to: `/projects/$projectId/${ProjectType.SSH}/overview` as const,
|
||||
to: "/projects/ssh/$projectId/overview",
|
||||
params: {
|
||||
projectId
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { createFileRoute, linkOptions } from "@tanstack/react-router";
|
||||
import { SshHostGroupDetailsByIDPage } from "./SshHostGroupDetailsByIDPage";
|
||||
|
||||
export const Route = createFileRoute(
|
||||
"/_authenticate/_inject-org-details/_org-layout/projects/$projectId/_project-layout/ssh/_ssh-layout/ssh-host-groups/$sshHostGroupId"
|
||||
"/_authenticate/_inject-org-details/_org-layout/projects/ssh/$projectId/_ssh-layout/ssh-host-groups/$sshHostGroupId"
|
||||
)({
|
||||
component: SshHostGroupDetailsByIDPage,
|
||||
beforeLoad: ({ context, params }) => {
|
||||
@@ -13,7 +13,7 @@ export const Route = createFileRoute(
|
||||
{
|
||||
label: "Hosts",
|
||||
link: linkOptions({
|
||||
to: "/projects/$projectId/ssh/overview",
|
||||
to: "/projects/ssh/$projectId/overview",
|
||||
params
|
||||
})
|
||||
},
|
||||
|
||||
@@ -67,7 +67,7 @@ export const SshHostGroupsTable = ({ handlePopUpOpen }: Props) => {
|
||||
key={`ssh-host-group-${group.id}`}
|
||||
onClick={() =>
|
||||
navigate({
|
||||
to: "/projects/$projectId/ssh/ssh-host-groups/$sshHostGroupId",
|
||||
to: "/projects/ssh/$projectId/ssh-host-groups/$sshHostGroupId",
|
||||
params: {
|
||||
projectId: currentWorkspace.id,
|
||||
sshHostGroupId: group.id
|
||||
@@ -168,7 +168,7 @@ export const SshHostGroupsTable = ({ handlePopUpOpen }: Props) => {
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
navigate({
|
||||
to: "/projects/$projectId/ssh/ssh-host-groups/$sshHostGroupId",
|
||||
to: "/projects/ssh/$projectId/ssh-host-groups/$sshHostGroupId",
|
||||
params: {
|
||||
projectId: currentWorkspace.id,
|
||||
sshHostGroupId: group.id
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
|
||||
import { SshHostsPage } from "./SshHostsPage";
|
||||
import { SshHostsPage } from './SshHostsPage'
|
||||
|
||||
export const Route = createFileRoute(
|
||||
"/_authenticate/_inject-org-details/_org-layout/projects/$projectId/_project-layout/ssh/_ssh-layout/overview"
|
||||
'/_authenticate/_inject-org-details/_org-layout/projects/ssh/$projectId/_ssh-layout/overview',
|
||||
)({
|
||||
component: SshHostsPage,
|
||||
beforeLoad: ({ context }) => {
|
||||
@@ -11,9 +11,9 @@ export const Route = createFileRoute(
|
||||
breadcrumbs: [
|
||||
...context.breadcrumbs,
|
||||
{
|
||||
label: "Hosts"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
});
|
||||
label: 'Hosts',
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,9 +1,37 @@
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
import { BreadcrumbTypes } from "@app/components/v2";
|
||||
import { workspaceKeys } from "@app/hooks/api";
|
||||
import { fetchUserProjectPermissions, roleQueryKeys } from "@app/hooks/api/roles/queries";
|
||||
import { fetchWorkspaceById } from "@app/hooks/api/workspace/queries";
|
||||
import { ProjectSelect } from "@app/layouts/ProjectLayout/components/ProjectSelect";
|
||||
import { SshLayout } from "@app/layouts/SshLayout";
|
||||
|
||||
export const Route = createFileRoute(
|
||||
"/_authenticate/_inject-org-details/_org-layout/projects/$projectId/_project-layout/ssh/_ssh-layout"
|
||||
"/_authenticate/_inject-org-details/_org-layout/projects/ssh/$projectId/_ssh-layout"
|
||||
)({
|
||||
component: SshLayout
|
||||
component: SshLayout,
|
||||
beforeLoad: async ({ params, context }) => {
|
||||
const project = await context.queryClient.ensureQueryData({
|
||||
queryKey: workspaceKeys.getWorkspaceById(params.projectId),
|
||||
queryFn: () => fetchWorkspaceById(params.projectId)
|
||||
});
|
||||
|
||||
await context.queryClient.ensureQueryData({
|
||||
queryKey: roleQueryKeys.getUserProjectPermissions({
|
||||
workspaceId: params.projectId
|
||||
}),
|
||||
queryFn: () => fetchUserProjectPermissions({ workspaceId: params.projectId })
|
||||
});
|
||||
|
||||
return {
|
||||
project,
|
||||
breadcrumbs: [
|
||||
{
|
||||
type: BreadcrumbTypes.Component,
|
||||
component: ProjectSelect
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user