feat: audit logs on organization-level

This commit is contained in:
Daniel Hougaard
2024-09-08 19:19:55 +04:00
parent 8d66272ab2
commit ad644db512
4 changed files with 78 additions and 40 deletions
@@ -5,9 +5,10 @@ import { Actor, AuditLog, Event } from "@app/hooks/api/auditLogs/types";
type Props = {
auditLog: AuditLog;
isOrgAuditLogs?: boolean;
};
export const LogsTableRow = ({ auditLog }: Props) => {
export const LogsTableRow = ({ auditLog, isOrgAuditLogs }: Props) => {
const renderActor = (actor: Actor) => {
switch (actor.type) {
case ActorType.USER:
@@ -469,6 +470,7 @@ export const LogsTableRow = ({ auditLog }: Props) => {
<Tr className={`log-${auditLog.id} h-10 border-x-0 border-b border-t-0`}>
<Td>{formatDate(auditLog.createdAt)}</Td>
<Td>{`${eventToNameMap[auditLog.event.type]}`}</Td>
{isOrgAuditLogs && <Td>{auditLog.project.name}</Td>}
{renderActor(auditLog.actor)}
<Td>
<p>{userAgentTTypeoNameMap[auditLog.userAgentType]}</p>