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:
		@ -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";
 | 
			
		||||
 | 
			
		||||
@ -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> {
 | 
			
		||||
 | 
			
		||||
@ -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`;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user