stages/identification: auto-redirect to source when no user fields are selected (#5583)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2023-05-11 16:52:30 +02:00
committed by GitHub
parent 7265a56f05
commit 61434c807d
8 changed files with 81 additions and 30 deletions

View File

@ -1,4 +1,4 @@
import { SeverityToLabel } from "@goauthentik/admin/events/RuleListPage";
import { SeverityToLabel } from "@goauthentik/admin/events/utils";
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
import "@goauthentik/elements/forms/HorizontalFormElement";
import { ModelForm } from "@goauthentik/elements/forms/ModelForm";

View File

@ -1,4 +1,5 @@
import "@goauthentik/admin/events/RuleForm";
import { SeverityToLabel } from "@goauthentik/admin/events/utils";
import "@goauthentik/admin/policies/BoundPoliciesList";
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
import { uiConfig } from "@goauthentik/common/ui/config";
@ -14,20 +15,7 @@ import { t } from "@lingui/macro";
import { TemplateResult, html } from "lit";
import { customElement, property } from "lit/decorators.js";
import { EventsApi, NotificationRule, SeverityEnum } from "@goauthentik/api";
export function SeverityToLabel(severity: SeverityEnum | null | undefined): string {
if (!severity) return t`Unknown severity`;
switch (severity) {
case SeverityEnum.Alert:
return t`Alert`;
case SeverityEnum.Notice:
return t`Notice`;
case SeverityEnum.Warning:
return t`Warning`;
}
return t`Unknown severity`;
}
import { EventsApi, NotificationRule } from "@goauthentik/api";
@customElement("ak-event-rule-list")
export class RuleListPage extends TablePage<NotificationRule> {

View File

@ -5,7 +5,7 @@ import { t } from "@lingui/macro";
import { TemplateResult, html } from "lit";
import { EventActions } from "@goauthentik/api";
import { EventActions, SeverityEnum } from "@goauthentik/api";
export function EventGeo(event: EventWithContext): TemplateResult {
let geo: KeyUnknown | undefined = undefined;
@ -78,3 +78,16 @@ export function ActionToLabel(action?: EventActions): string {
return action;
}
}
export function SeverityToLabel(severity: SeverityEnum | null | undefined): string {
if (!severity) return t`Unknown severity`;
switch (severity) {
case SeverityEnum.Alert:
return t`Alert`;
case SeverityEnum.Notice:
return t`Notice`;
case SeverityEnum.Warning:
return t`Warning`;
}
return t`Unknown severity`;
}