Add error to details panel (#17510)
This commit is contained in:
parent
39cf79dae1
commit
6b9dbc32e9
1 changed files with 28 additions and 0 deletions
|
@ -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>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue