mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-21 15:28:12 +00:00
feat: resolved frontend url changes and resolved ts error
This commit is contained in:
+2
-2
@@ -105,7 +105,7 @@ export const OrgAdminProjects = withPermission(
|
||||
<TBody>
|
||||
{isProjectsLoading && <TableSkeleton columns={4} innerKey="projects" />}
|
||||
{!isProjectsLoading &&
|
||||
projects?.map(({ name, slug, createdAt, id, defaultProduct }) => (
|
||||
projects?.map(({ name, slug, createdAt, id, type }) => (
|
||||
<Tr key={`project-${id}`} className="group w-full">
|
||||
<Td>{name}</Td>
|
||||
<Td>{slug}</Td>
|
||||
@@ -126,7 +126,7 @@ export const OrgAdminProjects = withPermission(
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
handleAccessProject(defaultProduct, id);
|
||||
handleAccessProject(type, id);
|
||||
}}
|
||||
icon={<FontAwesomeIcon icon={faSignIn} />}
|
||||
disabled={
|
||||
|
||||
@@ -300,10 +300,10 @@ export const LogsFilter = ({ presets, setFilter, filter }: Props) => {
|
||||
onChange(e);
|
||||
}}
|
||||
placeholder="All projects"
|
||||
options={workspacesInOrg.map(({ name, id, defaultProduct }) => ({
|
||||
options={workspacesInOrg.map(({ name, id, type }) => ({
|
||||
name,
|
||||
id,
|
||||
type: defaultProduct
|
||||
type
|
||||
}))}
|
||||
getOptionValue={(option) => option.id}
|
||||
getOptionLabel={(option) => option.name}
|
||||
|
||||
+4
-1
@@ -6,6 +6,8 @@ import { format } from "date-fns";
|
||||
|
||||
import { createNotification } from "@app/components/notifications";
|
||||
import { IconButton, Td, Tooltip, Tr } from "@app/components/v2";
|
||||
import { useWorkspace } from "@app/context";
|
||||
import { getProjectBaseURL } from "@app/helpers/project";
|
||||
import { formatProjectRoleName } from "@app/helpers/roles";
|
||||
import { useGetUserWorkspaces } from "@app/hooks/api";
|
||||
import { IdentityMembership } from "@app/hooks/api/identities/types";
|
||||
@@ -32,6 +34,7 @@ export const IdentityProjectRow = ({
|
||||
}: Props) => {
|
||||
const { data: workspaces } = useGetUserWorkspaces();
|
||||
const navigate = useNavigate();
|
||||
const { currentWorkspace } = useWorkspace();
|
||||
|
||||
const isAccessible = useMemo(() => {
|
||||
const workspaceIds = new Map();
|
||||
@@ -50,7 +53,7 @@ export const IdentityProjectRow = ({
|
||||
onClick={() => {
|
||||
if (isAccessible) {
|
||||
navigate({
|
||||
to: "/projects/$projectId/access-management",
|
||||
to: `${getProjectBaseURL(currentWorkspace.type)}/access-management` as const,
|
||||
params: {
|
||||
projectId: project.id
|
||||
},
|
||||
|
||||
@@ -222,7 +222,7 @@ export const AllProjectView = ({
|
||||
onKeyDown={(evt) => {
|
||||
if (evt.key === "Enter" && workspace.isMember) {
|
||||
navigate({
|
||||
to: getProjectHomePage(workspace.defaultProduct),
|
||||
to: getProjectHomePage(workspace.type),
|
||||
params: {
|
||||
projectId: workspace.id
|
||||
}
|
||||
@@ -232,7 +232,7 @@ export const AllProjectView = ({
|
||||
onClick={() => {
|
||||
if (workspace.isMember) {
|
||||
navigate({
|
||||
to: getProjectHomePage(workspace.defaultProduct),
|
||||
to: getProjectHomePage(workspace.type),
|
||||
params: {
|
||||
projectId: workspace.id
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ export const MyProjectView = ({
|
||||
<div
|
||||
onClick={() => {
|
||||
navigate({
|
||||
to: getProjectHomePage(workspace.defaultProduct),
|
||||
to: getProjectHomePage(workspace.type),
|
||||
params: {
|
||||
projectId: workspace.id
|
||||
}
|
||||
@@ -215,7 +215,7 @@ export const MyProjectView = ({
|
||||
<div
|
||||
onClick={() => {
|
||||
navigate({
|
||||
to: getProjectHomePage(workspace.defaultProduct),
|
||||
to: getProjectHomePage(workspace.type),
|
||||
params: {
|
||||
projectId: workspace.id
|
||||
}
|
||||
|
||||
+4
-1
@@ -10,6 +10,8 @@ import { useGetUserWorkspaces } from "@app/hooks/api";
|
||||
import { TWorkspaceUser } from "@app/hooks/api/types";
|
||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||
import { OrgAccessControlTabSections } from "@app/types/org";
|
||||
import { getProjectBaseURL } from "@app/helpers/project";
|
||||
import { useWorkspace } from "@app/context";
|
||||
|
||||
type Props = {
|
||||
membership: TWorkspaceUser;
|
||||
@@ -25,6 +27,7 @@ export const UserProjectRow = ({
|
||||
}: Props) => {
|
||||
const { data: workspaces = [] } = useGetUserWorkspaces();
|
||||
const navigate = useNavigate();
|
||||
const { currentWorkspace } = useWorkspace();
|
||||
|
||||
const isAccessible = useMemo(() => {
|
||||
const workspaceIds = new Map();
|
||||
@@ -43,7 +46,7 @@ export const UserProjectRow = ({
|
||||
onClick={() => {
|
||||
if (isAccessible) {
|
||||
navigate({
|
||||
to: "/projects/$projectId/access-management",
|
||||
to: `${getProjectBaseURL(currentWorkspace.type)}/access-management` as const,
|
||||
params: {
|
||||
projectId: project.id
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user