From a54fa7c9b1e508f2b229cbd9c2bc1068df52afd6 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 17 Mar 2021 22:19:31 +0100 Subject: [PATCH] web: fix display issues with challenges using pending_user_avatar Signed-off-by: Jens Langhammer --- web/src/flows/FormStatic.ts | 20 +++++++++++++++---- .../AuthenticatorStaticStage.ts | 9 ++++----- .../AuthenticatorTOTPStage.ts | 9 ++++----- .../AuthenticatorValidateStageCode.ts | 9 ++++----- web/src/flows/stages/captcha/CaptchaStage.ts | 9 ++++----- web/src/flows/stages/consent/ConsentStage.ts | 10 ++++------ .../flows/stages/password/PasswordStage.ts | 10 ++++------ 7 files changed, 40 insertions(+), 36 deletions(-) diff --git a/web/src/flows/FormStatic.ts b/web/src/flows/FormStatic.ts index 44c222817..ae52f6434 100644 --- a/web/src/flows/FormStatic.ts +++ b/web/src/flows/FormStatic.ts @@ -1,10 +1,19 @@ -import { css, CSSResult, customElement, html, LitElement, TemplateResult } from "lit-element"; +import { gettext } from "django"; +import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element"; +import PFAvatar from "@patternfly/patternfly/components/Avatar/avatar.css"; +import { ifDefined } from "lit-html/directives/if-defined"; @customElement("ak-form-static") export class FormStatic extends LitElement { + @property() + userAvatar?: string; + + @property() + user = ""; + static get styles(): CSSResult[] { - return [css` + return [PFAvatar, css` /* Form with user */ .form-control-static { margin-top: var(--pf-global--spacer--sm); @@ -12,7 +21,7 @@ export class FormStatic extends LitElement { align-items: center; justify-content: space-between; } - .form-control-static slot[name=avatar] { + .form-control-static .avatar { display: flex; align-items: center; } @@ -30,7 +39,10 @@ export class FormStatic extends LitElement { render(): TemplateResult { return html`
- +
+ ${gettext( + ${this.user} +
`; diff --git a/web/src/flows/stages/authenticator_static/AuthenticatorStaticStage.ts b/web/src/flows/stages/authenticator_static/AuthenticatorStaticStage.ts index 55b5ac2f4..deeee208d 100644 --- a/web/src/flows/stages/authenticator_static/AuthenticatorStaticStage.ts +++ b/web/src/flows/stages/authenticator_static/AuthenticatorStaticStage.ts @@ -54,11 +54,10 @@ export class AuthenticatorStaticStage extends BaseStage {