web/admin: small fixes (#7292)

* show user type better on admin interface

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix rendering for backchannel in app form

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix missing trailing slash in admin redirect

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2023-10-25 18:25:37 +02:00
committed by GitHub
parent add873ca9b
commit 7673e5a297
15 changed files with 231 additions and 109 deletions

View File

@ -1,6 +1,6 @@
import { msg } from "@lit/localize";
import { Device, EventActions, IntentEnum, SeverityEnum } from "@goauthentik/api";
import { Device, EventActions, IntentEnum, SeverityEnum, UserTypeEnum } from "@goauthentik/api";
/* Various tables in the API for which we need to supply labels */
@ -65,3 +65,13 @@ export const deviceTypeToLabel = new Map<string, string>([
export const deviceTypeName = (device: Device) =>
deviceTypeToLabel.get(device.type) ?? device?.verboseName ?? "";
const _userTypeToLabel = new Map<UserTypeEnum | undefined, string>([
[UserTypeEnum.Internal, msg("Internal")],
[UserTypeEnum.External, msg("External")],
[UserTypeEnum.ServiceAccount, msg("Service account")],
[UserTypeEnum.InternalServiceAccount, msg("Service account (internal)")],
]);
export const userTypeToLabel = (type?: UserTypeEnum): string =>
_userTypeToLabel.get(type) ?? type ?? "";