web: improve truncation of strings

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer
2023-02-13 10:38:48 +01:00
parent 19d2fcb542
commit be42e5562d
3 changed files with 7 additions and 8 deletions

View File

@ -2,6 +2,7 @@ import "@goauthentik/admin/events/EventInfo";
import { ActionToLabel } from "@goauthentik/admin/events/utils";
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
import { EventWithContext } from "@goauthentik/common/events";
import { truncate } from "@goauthentik/common/utils";
import "@goauthentik/elements/Tabs";
import "@goauthentik/elements/buttons/Dropdown";
import "@goauthentik/elements/buttons/ModalButton";
@ -78,7 +79,7 @@ export class RecentEventsCard extends Table<Event> {
item.user?.username
? html`<div>
<a href="#/identity/users/${item.user.pk}"
>${item.user?.username.substring(0, 15)}</a
>${truncate(item.user?.username, 15)}</a
>
</div>
${item.user.on_behalf_of