From d516bcd64eaa2f8372c9da4ee36bf179627279e8 Mon Sep 17 00:00:00 2001 From: "Jens L." Date: Sat, 9 May 2026 20:22:59 +0200 Subject: [PATCH] web/admin: User wizard label adjust and deactivate navigation when wizard is finished (#22133) * elements/wizard: deactivate side nav buttons if wizard is done Signed-off-by: Jens Langhammer * adjust labels for service account Signed-off-by: Jens Langhammer * Fix wizards to use consistent height. * remove justify Signed-off-by: Jens Langhammer --------- Signed-off-by: Jens Langhammer Co-authored-by: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com> --- web/src/admin/users/ak-user-wizard.ts | 8 +++++- web/src/components/ak-wizard/WizardStep.ts | 3 +- web/src/elements/wizard/Wizard.ts | 25 +++++------------ .../authentik/components/Modal/modal.css | 2 +- .../authentik/components/Wizard/wizard.css | 28 +++++++++++++++---- 5 files changed, 40 insertions(+), 26 deletions(-) diff --git a/web/src/admin/users/ak-user-wizard.ts b/web/src/admin/users/ak-user-wizard.ts index 0d62239d64e7..3d02a58052c2 100644 --- a/web/src/admin/users/ak-user-wizard.ts +++ b/web/src/admin/users/ak-user-wizard.ts @@ -11,6 +11,8 @@ import { CreateWizard } from "#elements/wizard/CreateWizard"; import { TypeCreateWizardPageLayouts } from "#elements/wizard/TypeCreateWizardPage"; import { WizardPage } from "#elements/wizard/WizardPage"; +import { ButtonKindLabelRecord } from "#components/ak-wizard/shared"; + import { UserForm } from "#admin/users/UserForm"; import { TypeCreate, UserServiceAccountResponse, UserTypeEnum } from "@goauthentik/api"; @@ -57,7 +59,7 @@ export interface UserWizardState { export class ServiceAccountResultPage extends WizardPage { public static styles: CSSResult[] = [PFForm, PFFormControl]; - public override headline = msg("Review Credentials"); + public override headline = msg("View Credentials"); @state() protected result: UserServiceAccountResponse | null = null; @@ -75,6 +77,10 @@ export class ServiceAccountResultPage extends WizardPage { this.host.cancelable = false; }; + public formatNextLabel(): SlottedTemplateResult | null { + return ButtonKindLabelRecord.close; + } + public override nextCallback = async (): Promise => true; protected override render(): SlottedTemplateResult { diff --git a/web/src/components/ak-wizard/WizardStep.ts b/web/src/components/ak-wizard/WizardStep.ts index 559956747b50..7c631eb0edbb 100644 --- a/web/src/components/ak-wizard/WizardStep.ts +++ b/web/src/components/ak-wizard/WizardStep.ts @@ -58,9 +58,10 @@ export abstract class WizardStep extends AKElement { .pf-c-wizard__main-body { display: flex; - flex-flow: row wrap; + flex-flow: column; & > * { + width: 100%; flex: 1 1 auto; } } diff --git a/web/src/elements/wizard/Wizard.ts b/web/src/elements/wizard/Wizard.ts index e92cab28eda7..d04f68bcdbbe 100644 --- a/web/src/elements/wizard/Wizard.ts +++ b/web/src/elements/wizard/Wizard.ts @@ -62,23 +62,6 @@ export class AKWizard> extends AKElement { display: block; height: min(var(--ak-c-dialog--AspectRatioHeight), var(--ak-c-dialog--MaxHeight)); } - - .pf-c-wizard__main { - overscroll-behavior: contain; - display: flex; - flex-flow: column; - } - - .pf-c-wizard__main, - .pf-c-wizard__main-body { - transform: translate3d(0, 0, 0); - will-change: transform; - } - - .pf-c-wizard__main-body { - display: flex; - flex: 1 1 auto; - } `, ]; @@ -521,6 +504,12 @@ export class AKWizard> extends AKElement { return html`

Unexpected missing step: ${step}

`; } + // By default, disable steps ahead of the current step + let disabled = activeStepIndex < idx; + // If this wizard is at the end, disable navigation back + if (activeStepIndex === this.steps.length - 1 && idx !== activeStepIndex) { + disabled = true; + } return html`