Add error to details panel (#17510)

This commit is contained in:
Erik Jan de Wit 2023-03-21 11:36:42 +01:00 committed by GitHub
parent 39cf79dae1
commit 6b9dbc32e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,6 +68,28 @@ const defaultValues: UserEventSearchForm = {
type: [], type: [],
}; };
const UserDetailLink = (event: EventRepresentation) => {
const { t } = useTranslation("events");
const { realm } = useRealm();
return (
<>
{event.userId && (
<Link
key={`link-${event.time}-${event.type}`}
to={toUser({
realm,
id: event.userId,
tab: "settings",
})}
>
{event.userId}
</Link>
)}
{!event.userId && t("noUserDetails")}
</>
);
};
const StatusRow = (event: EventRepresentation) => const StatusRow = (event: EventRepresentation) =>
!event.error ? ( !event.error ? (
<span> <span>
@ -90,6 +112,12 @@ const DetailCell = (event: EventRepresentation) => (
<DescriptionListDescription>{value}</DescriptionListDescription> <DescriptionListDescription>{value}</DescriptionListDescription>
</DescriptionListGroup> </DescriptionListGroup>
))} ))}
{event.error && (
<DescriptionListGroup key="error">
<DescriptionListTerm>error</DescriptionListTerm>
<DescriptionListDescription>{event.error}</DescriptionListDescription>
</DescriptionListGroup>
)}
</DescriptionList> </DescriptionList>
); );