Skip to content

feat: update default audit log avatar (cherry-pick #16774) #16805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: update default audit log avatar (#16774)
  • Loading branch information
BrunoQuaresma authored Mar 4, 2025
commit dd69f3b85b38e3f6a4e4499c97a077f87d356145
1 change: 0 additions & 1 deletion site/src/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ const avatarVariants = cva(
export type AvatarProps = AvatarPrimitive.AvatarProps &
VariantProps<typeof avatarVariants> & {
src?: string;

fallback?: string;
};

Expand Down
19 changes: 15 additions & 4 deletions site/src/pages/AuditPage/AuditLogRow/AuditLogRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { DropdownArrow } from "components/DropdownArrow/DropdownArrow";
import { Pill } from "components/Pill/Pill";
import { Stack } from "components/Stack/Stack";
import { TimelineEntry } from "components/Timeline/TimelineEntry";
import { NetworkIcon } from "lucide-react";
import { type FC, useState } from "react";
import { Link as RouterLink } from "react-router-dom";
import type { ThemeRole } from "theme/roles";
Expand Down Expand Up @@ -101,10 +102,20 @@ export const AuditLogRow: FC<AuditLogRowProps> = ({
css={styles.auditLogHeaderInfo}
>
<Stack direction="row" alignItems="center" css={styles.fullWidth}>
<Avatar
fallback={auditLog.user?.username ?? "?"}
src={auditLog.user?.avatar_url}
/>
{/*
* Session logs don't have an associated user to the log,
* so when it happens we display a default icon to represent non user actions
*/}
{auditLog.user ? (
<Avatar
fallback={auditLog.user.username}
src={auditLog.user.avatar_url}
/>
) : (
<Avatar>
<NetworkIcon className="h-full w-full p-1" />
</Avatar>
)}

<Stack
alignItems="baseline"
Expand Down
Loading