From f7f87a4e6a70b0d45a76e5b024d81b733b9359cc Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Wed, 4 Mar 2026 14:02:40 -0700 Subject: [PATCH] task fix and keyboard fix --- .../src/app/pages/keyboard.page.ts | 17 +---------------- .../src/app/pages/language.page.ts | 8 ++++++-- .../src/app/services/state.service.ts | 19 +++++++++++++++++++ .../services/components/task.component.ts | 3 +-- .../services/routes/actions.component.ts | 8 ++++---- 5 files changed, 31 insertions(+), 24 deletions(-) diff --git a/web/projects/setup-wizard/src/app/pages/keyboard.page.ts b/web/projects/setup-wizard/src/app/pages/keyboard.page.ts index fbd4e5c11..082edc3dc 100644 --- a/web/projects/setup-wizard/src/app/pages/keyboard.page.ts +++ b/web/projects/setup-wizard/src/app/pages/keyboard.page.ts @@ -1,5 +1,4 @@ import { Component, inject, signal } from '@angular/core' -import { Router } from '@angular/router' import { FormsModule } from '@angular/forms' import { getAllKeyboardsSorted, @@ -72,7 +71,6 @@ import { StateService } from '../services/state.service' ], }) export default class KeyboardPage { - private readonly router = inject(Router) private readonly api = inject(ApiService) private readonly stateService = inject(StateService) @@ -103,22 +101,9 @@ export default class KeyboardPage { }) this.stateService.keyboard = this.selected.layout - await this.navigateToNextStep() + await this.stateService.navigateAfterLocale() } finally { this.saving.set(false) } } - - private async navigateToNextStep() { - if (this.stateService.dataDriveGuid) { - if (this.stateService.attach) { - this.stateService.setupType = 'attach' - await this.router.navigate(['/password']) - } else { - await this.router.navigate(['/home']) - } - } else { - await this.router.navigate(['/drives']) - } - } } diff --git a/web/projects/setup-wizard/src/app/pages/language.page.ts b/web/projects/setup-wizard/src/app/pages/language.page.ts index f30953d1e..066a48787 100644 --- a/web/projects/setup-wizard/src/app/pages/language.page.ts +++ b/web/projects/setup-wizard/src/app/pages/language.page.ts @@ -141,8 +141,12 @@ export default class LanguagePage { try { await this.api.setLanguage({ language: this.selected.name }) - // Always go to keyboard selection - await this.router.navigate(['/keyboard']) + + if (this.stateService.kiosk) { + await this.router.navigate(['/keyboard']) + } else { + await this.stateService.navigateAfterLocale() + } } finally { this.saving.set(false) } diff --git a/web/projects/setup-wizard/src/app/services/state.service.ts b/web/projects/setup-wizard/src/app/services/state.service.ts index a36f08d3e..a3aba2c7b 100644 --- a/web/projects/setup-wizard/src/app/services/state.service.ts +++ b/web/projects/setup-wizard/src/app/services/state.service.ts @@ -1,4 +1,5 @@ import { inject, Injectable } from '@angular/core' +import { Router } from '@angular/router' import { T } from '@start9labs/start-sdk' import { ApiService } from './api.service' @@ -29,6 +30,7 @@ export type RecoverySource = }) export class StateService { private readonly api = inject(ApiService) + private readonly router = inject(Router) // Determined at app init kiosk = false @@ -45,6 +47,23 @@ export class StateService { setupType?: SetupType recoverySource?: RecoverySource + /** + * Navigate to the appropriate step after language/keyboard selection. + * Keyboard selection is only needed in kiosk mode. + */ + async navigateAfterLocale(): Promise { + if (this.dataDriveGuid) { + if (this.attach) { + this.setupType = 'attach' + await this.router.navigate(['/password']) + } else { + await this.router.navigate(['/home']) + } + } else { + await this.router.navigate(['/drives']) + } + } + /** * Called for attach flow (existing data drive) */ diff --git a/web/projects/ui/src/app/routes/portal/routes/services/components/task.component.ts b/web/projects/ui/src/app/routes/portal/routes/services/components/task.component.ts index 975f4de73..3f7b31009 100644 --- a/web/projects/ui/src/app/routes/portal/routes/services/components/task.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/services/components/task.component.ts @@ -23,7 +23,6 @@ import { ALLOWED_STATUSES, getInstalledBaseStatus, INACTIVE_STATUSES, - renderPkgStatus, } from 'src/app/services/pkg-status-rendering.service' import { getManifest } from 'src/app/utils/get-package-data' @@ -153,7 +152,7 @@ export class ServiceTaskComponent { const action = pkg.actions[this.task().actionId] if (!action) return this.i18n.transform('Action not found')! - const status = renderPkgStatus(pkg).primary + const status = getInstalledBaseStatus(pkg.statusInfo) if (INACTIVE_STATUSES.includes(status)) return status as string diff --git a/web/projects/ui/src/app/routes/portal/routes/services/routes/actions.component.ts b/web/projects/ui/src/app/routes/portal/routes/services/routes/actions.component.ts index 6b7316137..b4226c612 100644 --- a/web/projects/ui/src/app/routes/portal/routes/services/routes/actions.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/services/routes/actions.component.ts @@ -24,9 +24,9 @@ import { getManifest } from 'src/app/utils/get-package-data' import { ServiceActionComponent } from '../components/action.component' import { ALLOWED_STATUSES, + BaseStatus, + getInstalledBaseStatus, INACTIVE_STATUSES, - PrimaryStatus, - renderPkgStatus, } from 'src/app/services/pkg-status-rendering.service' import { FormDialogService } from 'src/app/services/form-dialog.service' import { FormComponent } from 'src/app/routes/portal/components/form.component' @@ -108,7 +108,7 @@ export default class ServiceActionsRoute { const specialGroup = Object.values(pkg.actions).some(a => !!a.group) ? 'Other' : 'General' - const status = renderPkgStatus(pkg).primary + const status = getInstalledBaseStatus(pkg.statusInfo) return { status, icon: pkg.icon, @@ -187,7 +187,7 @@ export default class ServiceActionsRoute { } handle( - status: PrimaryStatus, + status: BaseStatus, icon: string, { id, title }: T.Manifest, action: T.ActionMetadata & { id: string },