mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 06:26:27 +00:00
requested changes
This commit is contained in:
@@ -23,6 +23,7 @@ import { useGetAuditLogActorFilterOpts, useGetUserWorkspaces } from "@app/hooks/
|
|||||||
import { eventToNameMap, userAgentTTypeoNameMap } from "@app/hooks/api/auditLogs/constants";
|
import { eventToNameMap, userAgentTTypeoNameMap } from "@app/hooks/api/auditLogs/constants";
|
||||||
import { ActorType, EventType } from "@app/hooks/api/auditLogs/enums";
|
import { ActorType, EventType } from "@app/hooks/api/auditLogs/enums";
|
||||||
import { Actor } from "@app/hooks/api/auditLogs/types";
|
import { Actor } from "@app/hooks/api/auditLogs/types";
|
||||||
|
import { ProjectType } from "@app/hooks/api/workspace/types";
|
||||||
|
|
||||||
import { AuditLogFilterFormData } from "./types";
|
import { AuditLogFilterFormData } from "./types";
|
||||||
|
|
||||||
@@ -103,7 +104,7 @@ export const LogsFilter = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const selectedEventTypes = watch("eventType") as EventType[] | undefined;
|
const selectedEventTypes = watch("eventType") as EventType[] | undefined;
|
||||||
const selectedProjectId = watch("project")?.id;
|
const selectedProject = watch("project");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -134,7 +135,7 @@ export const LogsFilter = ({
|
|||||||
onChange(e);
|
onChange(e);
|
||||||
}}
|
}}
|
||||||
placeholder="Select a project..."
|
placeholder="Select a project..."
|
||||||
options={workspacesInOrg.map(({ name, id }) => ({ name, id }))}
|
options={workspacesInOrg.map(({ name, id, type }) => ({ name, id, type }))}
|
||||||
getOptionValue={(option) => option.id}
|
getOptionValue={(option) => option.id}
|
||||||
getOptionLabel={(option) => option.name}
|
getOptionLabel={(option) => option.name}
|
||||||
/>
|
/>
|
||||||
@@ -142,7 +143,7 @@ export const LogsFilter = ({
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{selectedProjectId && (
|
{selectedProject?.type === ProjectType.SecretManager && (
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="secretPath"
|
name="secretPath"
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { EventType, UserAgentType } from "@app/hooks/api/auditLogs/enums";
|
import { EventType, UserAgentType } from "@app/hooks/api/auditLogs/enums";
|
||||||
|
import { ProjectType } from "@app/hooks/api/workspace/types";
|
||||||
|
|
||||||
export const auditLogFilterFormSchema = z
|
export const auditLogFilterFormSchema = z
|
||||||
.object({
|
.object({
|
||||||
eventMetadata: z.object({}).optional(),
|
eventMetadata: z.object({}).optional(),
|
||||||
project: z.object({ id: z.string(), name: z.string() }).optional().nullable(),
|
project: z
|
||||||
|
.object({ id: z.string(), name: z.string(), type: z.nativeEnum(ProjectType) })
|
||||||
|
.optional()
|
||||||
|
.nullable(),
|
||||||
eventType: z.nativeEnum(EventType).array(),
|
eventType: z.nativeEnum(EventType).array(),
|
||||||
actor: z.string().optional(),
|
actor: z.string().optional(),
|
||||||
userAgentType: z.nativeEnum(UserAgentType),
|
userAgentType: z.nativeEnum(UserAgentType),
|
||||||
|
|||||||
Reference in New Issue
Block a user