mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 22:27:48 +00:00
Moved audit logs to org-level entirely
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
|
import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
|
||||||
import { withPermission } from "@app/hoc";
|
import { withPermission } from "@app/hoc";
|
||||||
import { LogsSection } from "@app/views/Project/AuditLogsPage/components";
|
|
||||||
|
import { LogsSection } from "./components";
|
||||||
|
|
||||||
export const AuditLogsPage = withPermission(
|
export const AuditLogsPage = withPermission(
|
||||||
() => {
|
() => {
|
||||||
@@ -16,5 +17,5 @@ export const AuditLogsPage = withPermission(
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
{ action: OrgPermissionActions.Read, subject: OrgPermissionSubjects.Member } // TODO(Daniel): Create a permission for org audit logs
|
{ action: OrgPermissionActions.Read, subject: OrgPermissionSubjects.AuditLogs }
|
||||||
);
|
);
|
||||||
|
|||||||
+8
-8
@@ -199,7 +199,7 @@ export const LogsFilter = ({
|
|||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="userAgentType"
|
name="userAgentType"
|
||||||
render={({ field: { onChange, ...field }, fieldState: { error } }) => (
|
render={({ field: { onChange, value, ...field }, fieldState: { error } }) => (
|
||||||
<FormControl
|
<FormControl
|
||||||
label="Source"
|
label="Source"
|
||||||
errorText={error?.message}
|
errorText={error?.message}
|
||||||
@@ -207,7 +207,7 @@ export const LogsFilter = ({
|
|||||||
className="w-40"
|
className="w-40"
|
||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
{...(field.value ? { value: field.value } : { placeholder: "All sources" })}
|
value={value === undefined ? "all" : value}
|
||||||
{...field}
|
{...field}
|
||||||
onValueChange={(e) => {
|
onValueChange={(e) => {
|
||||||
if (e === "all") onChange(undefined);
|
if (e === "all") onChange(undefined);
|
||||||
@@ -215,14 +215,14 @@ export const LogsFilter = ({
|
|||||||
}}
|
}}
|
||||||
className={twMerge(
|
className={twMerge(
|
||||||
"w-full border border-mineshaft-500 bg-mineshaft-700 text-mineshaft-100",
|
"w-full border border-mineshaft-500 bg-mineshaft-700 text-mineshaft-100",
|
||||||
(field.value === "all" || field.value === undefined) && "text-mineshaft-400"
|
value === undefined && "text-mineshaft-400"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<SelectItem value="all" key="all">
|
<SelectItem value="all" key="all">
|
||||||
All sources
|
All sources
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
{userAgentTypes.map(({ label, value }) => (
|
{userAgentTypes.map(({ label, value: userAgent }) => (
|
||||||
<SelectItem value={String(value || "")} key={label}>
|
<SelectItem value={userAgent} key={label}>
|
||||||
{label}
|
{label}
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
))}
|
))}
|
||||||
@@ -235,7 +235,7 @@ export const LogsFilter = ({
|
|||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="projectId"
|
name="projectId"
|
||||||
render={({ field: { onChange, ...field }, fieldState: { error } }) => (
|
render={({ field: { onChange, value, ...field }, fieldState: { error } }) => (
|
||||||
<FormControl
|
<FormControl
|
||||||
label="Project"
|
label="Project"
|
||||||
errorText={error?.message}
|
errorText={error?.message}
|
||||||
@@ -243,7 +243,7 @@ export const LogsFilter = ({
|
|||||||
className="w-40"
|
className="w-40"
|
||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
{...(field.value ? { value: field.value } : { placeholder: "All projects" })}
|
value={value === undefined ? "all" : value}
|
||||||
{...field}
|
{...field}
|
||||||
onValueChange={(e) => {
|
onValueChange={(e) => {
|
||||||
if (e === "all") onChange(undefined);
|
if (e === "all") onChange(undefined);
|
||||||
@@ -251,7 +251,7 @@ export const LogsFilter = ({
|
|||||||
}}
|
}}
|
||||||
className={twMerge(
|
className={twMerge(
|
||||||
"w-full border border-mineshaft-500 bg-mineshaft-700 text-mineshaft-100",
|
"w-full border border-mineshaft-500 bg-mineshaft-700 text-mineshaft-100",
|
||||||
(field.value === "all" || field.value === undefined) && "text-mineshaft-400"
|
value === undefined && "text-mineshaft-400"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<SelectItem value="all" key="all">
|
<SelectItem value="all" key="all">
|
||||||
+1
@@ -47,6 +47,7 @@ export const LogsSection = ({
|
|||||||
const { control, reset, watch } = useForm<AuditLogFilterFormData>({
|
const { control, reset, watch } = useForm<AuditLogFilterFormData>({
|
||||||
resolver: yupResolver(auditLogFilterFormSchema),
|
resolver: yupResolver(auditLogFilterFormSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
|
projectId: undefined,
|
||||||
actor: presets?.actorId,
|
actor: presets?.actorId,
|
||||||
eventType: presets?.eventType || [],
|
eventType: presets?.eventType || [],
|
||||||
page: 1,
|
page: 1,
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
|
||||||
import { withProjectPermission } from "@app/hoc";
|
|
||||||
|
|
||||||
import { LogsSection } from "./components";
|
|
||||||
|
|
||||||
export const AuditLogsPage = withProjectPermission(
|
|
||||||
() => {
|
|
||||||
return (
|
|
||||||
<div className="flex h-full w-full justify-center bg-bunker-800 text-white">
|
|
||||||
<div className="w-full max-w-7xl px-6">
|
|
||||||
<div className="sticky top-0 z-10 bg-bunker-800 py-6">
|
|
||||||
<p className="text-3xl font-semibold text-gray-200">Audit Logs</p>
|
|
||||||
<div />
|
|
||||||
</div>
|
|
||||||
<LogsSection showFilters />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
{ action: ProjectPermissionActions.Read, subject: ProjectPermissionSub.AuditLogs }
|
|
||||||
);
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export { AuditLogsPage } from "./AuditLogsPage";
|
|
||||||
Reference in New Issue
Block a user