diff --git a/web/src/flow/FormStatic.ts b/web/src/flow/FormStatic.ts index 95ed5b2f5632..5aca84bc19af 100644 --- a/web/src/flow/FormStatic.ts +++ b/web/src/flow/FormStatic.ts @@ -1,22 +1,39 @@ import { AKElement } from "#elements/Base"; +import { LitFC } from "#elements/types"; +import { ifPresent } from "#elements/utils/attributes"; import { isDefaultAvatar } from "#elements/utils/images"; +import { + AccessDeniedChallenge, + AuthenticatorDuoChallenge, + AuthenticatorEmailChallenge, + AuthenticatorStaticChallenge, + AuthenticatorTOTPChallenge, + AuthenticatorWebAuthnChallenge, + CaptchaChallenge, + ConsentChallenge, + PasswordChallenge, + SessionEndChallenge, + UserLoginChallenge, +} from "@goauthentik/api"; + import { msg, str } from "@lit/localize"; import { css, CSSResult, html, nothing } from "lit"; import { customElement, property } from "lit/decorators.js"; +import { guard } from "lit/directives/guard.js"; import PFAvatar from "@patternfly/patternfly/components/Avatar/avatar.css"; @customElement("ak-form-static") -export class FormStatic extends AKElement { +export class AKFormStatic extends AKElement { public override role = "banner"; public override ariaLabel = msg("User information"); - @property() - userAvatar?: string; + @property({ type: String }) + public avatar: string = ""; - @property() - user?: string; + @property({ type: String }) + public username: string = ""; static styles: CSSResult[] = [ PFAvatar, @@ -64,21 +81,27 @@ export class FormStatic extends AKElement { `, ]; - render() { - if (!this.user) { + protected override render() { + if (!this.username) { return nothing; } return html`
- ${this.userAvatar && !isDefaultAvatar(this.userAvatar) + ${this.avatar && !isDefaultAvatar(this.avatar) ? html`${this.user` : nothing} -
${this.user}
+
${this.username}