From 0e9b9fce3ef7ebf5d1bc1d018595c178d3517f15 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Sun, 24 Aug 2025 08:46:12 -0600 Subject: [PATCH 1/4] simple renaming --- .../components/dependencies.component.ts | 2 +- .../services/dashboard/status.component.ts | 6 +-- .../ui/src/app/services/api/api.types.ts | 44 ------------------- .../ui/src/app/services/dep-error.service.ts | 39 +++++++++++++++- .../services/pkg-status-rendering.service.ts | 6 +-- 5 files changed, 44 insertions(+), 53 deletions(-) diff --git a/web/projects/ui/src/app/routes/portal/routes/services/components/dependencies.component.ts b/web/projects/ui/src/app/routes/portal/routes/services/components/dependencies.component.ts index 66a4caa24..2729597a8 100644 --- a/web/projects/ui/src/app/routes/portal/routes/services/components/dependencies.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/services/components/dependencies.component.ts @@ -95,7 +95,7 @@ export class ServiceDependenciesComponent { return 'Incorrect version' case 'notRunning': return 'Not running' - case 'actionRequired': + case 'taskRequired': return 'Task Required' case 'healthChecksFailed': return 'Required health check not passing' diff --git a/web/projects/ui/src/app/routes/portal/routes/services/dashboard/status.component.ts b/web/projects/ui/src/app/routes/portal/routes/services/dashboard/status.component.ts index f6fbf26b3..d97e4736e 100644 --- a/web/projects/ui/src/app/routes/portal/routes/services/dashboard/status.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/services/dashboard/status.component.ts @@ -52,7 +52,7 @@ export class StatusComponent { const { primary, health } = this.getStatus(this.pkg) return ( !this.hasDepErrors && - primary !== 'actionRequired' && + primary !== 'taskRequired' && primary !== 'error' && health !== 'failure' ) @@ -77,7 +77,7 @@ export class StatusComponent { return 'Running' case 'stopped': return 'Stopped' - case 'actionRequired': + case 'taskRequired': return 'Task Required' case 'updating': return 'Updating' @@ -118,7 +118,7 @@ export class StatusComponent { switch (this.getStatus(this.pkg).primary) { case 'running': return 'var(--tui-status-positive)' - case 'actionRequired': + case 'taskRequired': return 'var(--tui-status-warning)' case 'error': return 'var(--tui-status-negative)' diff --git a/web/projects/ui/src/app/services/api/api.types.ts b/web/projects/ui/src/app/services/api/api.types.ts index d522f132b..34dc6082b 100644 --- a/web/projects/ui/src/app/services/api/api.types.ts +++ b/web/projects/ui/src/app/services/api/api.types.ts @@ -450,15 +450,6 @@ export namespace RR { export type GetRegistryPackagesRes = GetPackagesRes } -export type Breakages = { - [id: string]: TaggedDependencyError -} - -export type TaggedDependencyError = { - dependency: string - error: DependencyError -} - interface MetricData { value: string unit: string @@ -622,41 +613,6 @@ export type Encrypted = { encrypted: string } -export type DependencyError = - | DependencyErrorNotInstalled - | DependencyErrorNotRunning - | DependencyErrorIncorrectVersion - | DependencyErrorActionRequired - | DependencyErrorHealthChecksFailed - | DependencyErrorTransitive - -export type DependencyErrorNotInstalled = { - type: 'notInstalled' -} - -export type DependencyErrorNotRunning = { - type: 'notRunning' -} - -export type DependencyErrorIncorrectVersion = { - type: 'incorrectVersion' - expected: string // version range - received: string // version -} - -export interface DependencyErrorActionRequired { - type: 'actionRequired' -} - -export type DependencyErrorHealthChecksFailed = { - type: 'healthChecksFailed' - check: T.NamedHealthCheckResult -} - -export type DependencyErrorTransitive = { - type: 'transitive' -} - // @TODO 041 // export namespace RR041 { diff --git a/web/projects/ui/src/app/services/dep-error.service.ts b/web/projects/ui/src/app/services/dep-error.service.ts index b528375c6..b92712435 100644 --- a/web/projects/ui/src/app/services/dep-error.service.ts +++ b/web/projects/ui/src/app/services/dep-error.service.ts @@ -10,11 +10,46 @@ import { import deepEqual from 'fast-deep-equal' import { Observable } from 'rxjs' import { isInstalled } from 'src/app/utils/get-package-data' -import { DependencyError } from './api/api.types' +import { T } from '@start9labs/start-sdk' export type AllDependencyErrors = Record export type PkgDependencyErrors = Record +export type DependencyError = + | DependencyErrorNotInstalled + | DependencyErrorNotRunning + | DependencyErrorIncorrectVersion + | DependencyErrorTaskRequired + | DependencyErrorHealthChecksFailed + | DependencyErrorTransitive + +export type DependencyErrorNotInstalled = { + type: 'notInstalled' +} + +export type DependencyErrorNotRunning = { + type: 'notRunning' +} + +export type DependencyErrorIncorrectVersion = { + type: 'incorrectVersion' + expected: string // version range + received: string // version +} + +export interface DependencyErrorTaskRequired { + type: 'taskRequired' +} + +export type DependencyErrorHealthChecksFailed = { + type: 'healthChecksFailed' + check: T.NamedHealthCheckResult +} + +export type DependencyErrorTransitive = { + type: 'transitive' +} + @Injectable({ providedIn: 'root', }) @@ -113,7 +148,7 @@ export class DepErrorService { ) ) { return { - type: 'actionRequired', + type: 'taskRequired', } } diff --git a/web/projects/ui/src/app/services/pkg-status-rendering.service.ts b/web/projects/ui/src/app/services/pkg-status-rendering.service.ts index f7f7cf004..d2729622a 100644 --- a/web/projects/ui/src/app/services/pkg-status-rendering.service.ts +++ b/web/projects/ui/src/app/services/pkg-status-rendering.service.ts @@ -28,7 +28,7 @@ export function getInstalledPrimaryStatus({ return Object.values(tasks) .filter(t => !!t) .some(t => t.active && t.task.severity === 'critical') - ? 'actionRequired' + ? 'taskRequired' : status.main } @@ -71,7 +71,7 @@ export type PrimaryStatus = | 'restarting' | 'stopped' | 'backingUp' - | 'actionRequired' + | 'taskRequired' | 'error' export type DependencyStatus = 'warning' | 'satisfied' @@ -127,7 +127,7 @@ export const PrimaryRendering: Record = { color: 'success', showDots: false, }, - actionRequired: { + taskRequired: { display: 'Task Required', color: 'warning', showDots: false, From 611e19da265b0a8278e80989448e7aa4077bd4ee Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Sun, 24 Aug 2025 08:54:44 -0600 Subject: [PATCH 2/4] placeholder for empty service interfaces table --- web/projects/shared/src/i18n/dictionaries/de.ts | 1 + web/projects/shared/src/i18n/dictionaries/en.ts | 1 + web/projects/shared/src/i18n/dictionaries/es.ts | 1 + web/projects/shared/src/i18n/dictionaries/fr.ts | 1 + web/projects/shared/src/i18n/dictionaries/pl.ts | 1 + .../services/components/interfaces.component.ts | 12 +++++++++++- 6 files changed, 16 insertions(+), 1 deletion(-) diff --git a/web/projects/shared/src/i18n/dictionaries/de.ts b/web/projects/shared/src/i18n/dictionaries/de.ts index a898289ee..449be0c8f 100644 --- a/web/projects/shared/src/i18n/dictionaries/de.ts +++ b/web/projects/shared/src/i18n/dictionaries/de.ts @@ -575,4 +575,5 @@ export default { 608: 'Zweck', 609: 'Subdomains von', 610: 'Dynamisches DNS', + 611: 'Keine Service-Schnittstellen', } satisfies i18n diff --git a/web/projects/shared/src/i18n/dictionaries/en.ts b/web/projects/shared/src/i18n/dictionaries/en.ts index 0a40276d8..c74fd0963 100644 --- a/web/projects/shared/src/i18n/dictionaries/en.ts +++ b/web/projects/shared/src/i18n/dictionaries/en.ts @@ -574,4 +574,5 @@ export const ENGLISH = { 'Purpose': 608, // as in, the reason for a thing to exist 'subdomains of': 609, // this is a partial sentence. A domain name will be added after "of" to complete the sentence. 'Dynamic DNS': 610, + 'No service interfaces': 611, // as in, there are no available interfaces (API, UI, etc) for this software application } as const diff --git a/web/projects/shared/src/i18n/dictionaries/es.ts b/web/projects/shared/src/i18n/dictionaries/es.ts index 0d74d9aad..00d99c285 100644 --- a/web/projects/shared/src/i18n/dictionaries/es.ts +++ b/web/projects/shared/src/i18n/dictionaries/es.ts @@ -575,4 +575,5 @@ export default { 608: 'Propósito', 609: 'Subdominios de', 610: 'DNS dinámico', + 611: 'Sin interfaces de servicio', } satisfies i18n diff --git a/web/projects/shared/src/i18n/dictionaries/fr.ts b/web/projects/shared/src/i18n/dictionaries/fr.ts index 5886b99cf..3090dd757 100644 --- a/web/projects/shared/src/i18n/dictionaries/fr.ts +++ b/web/projects/shared/src/i18n/dictionaries/fr.ts @@ -575,4 +575,5 @@ export default { 608: 'But', 609: 'Sous-domaines de', 610: 'DNS dynamique', + 611: 'Aucune interface de service', } satisfies i18n diff --git a/web/projects/shared/src/i18n/dictionaries/pl.ts b/web/projects/shared/src/i18n/dictionaries/pl.ts index fe1d4f536..c3662b727 100644 --- a/web/projects/shared/src/i18n/dictionaries/pl.ts +++ b/web/projects/shared/src/i18n/dictionaries/pl.ts @@ -575,4 +575,5 @@ export default { 608: 'Cel', 609: 'Subdomeny', 610: 'Dynamiczny DNS', + 611: 'Brak interfejsów usług', } satisfies i18n diff --git a/web/projects/ui/src/app/routes/portal/routes/services/components/interfaces.component.ts b/web/projects/ui/src/app/routes/portal/routes/services/components/interfaces.component.ts index 74723546e..a89d10d45 100644 --- a/web/projects/ui/src/app/routes/portal/routes/services/components/interfaces.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/services/components/interfaces.component.ts @@ -9,6 +9,7 @@ import { tuiDefaultSort } from '@taiga-ui/cdk' import { PackageDataEntry } from 'src/app/services/patch-db/data-model' import { ServiceInterfaceItemComponent } from './interface-item.component' import { i18nPipe } from '@start9labs/shared' +import { PlaceholderComponent } from '../../../components/placeholder.component' @Component({ selector: 'service-interfaces', @@ -31,6 +32,10 @@ import { i18nPipe } from '@start9labs/shared' [pkg]="pkg()" [disabled]="disabled()" > + } @empty { + + {{ 'No service interfaces' | i18n }} + } @@ -42,7 +47,12 @@ import { i18nPipe } from '@start9labs/shared' `, host: { class: 'g-card' }, changeDetection: ChangeDetectionStrategy.OnPush, - imports: [ServiceInterfaceItemComponent, TuiTable, i18nPipe], + imports: [ + ServiceInterfaceItemComponent, + TuiTable, + i18nPipe, + PlaceholderComponent, + ], }) export class ServiceInterfacesComponent { readonly pkg = input.required() From 57bdc400b4444670975ea9785bf4fd1ff09a9a8d Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Sun, 24 Aug 2025 09:40:24 -0600 Subject: [PATCH 3/4] honor hidden form values --- web/projects/ui/src/app/services/form.service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/projects/ui/src/app/services/form.service.ts b/web/projects/ui/src/app/services/form.service.ts index 80381bf3f..005b07290 100644 --- a/web/projects/ui/src/app/services/form.service.ts +++ b/web/projects/ui/src/app/services/form.service.ts @@ -140,6 +140,8 @@ export class FormService { case 'multiselect': value = currentValue === undefined ? spec.default : currentValue return this.formBuilder.control(value, multiselectValidators(spec)) + case 'hidden': + return this.formBuilder.control(currentValue || null) case 'file': return this.formBuilder.control(null, fileValidators(spec)) default: From 701db35ca3b92c42af2e3db5d1450a51d6c22d54 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Sun, 24 Aug 2025 09:41:58 -0600 Subject: [PATCH 4/4] remove logs --- web/projects/ui/src/app/services/form.service.ts | 1 - web/projects/ui/src/app/services/marketplace.service.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/web/projects/ui/src/app/services/form.service.ts b/web/projects/ui/src/app/services/form.service.ts index 005b07290..5779533f2 100644 --- a/web/projects/ui/src/app/services/form.service.ts +++ b/web/projects/ui/src/app/services/form.service.ts @@ -84,7 +84,6 @@ export class FormService { currentValue?: any, ): UntypedFormGroup | UntypedFormArray | UntypedFormControl { let value: any - console.log(spec) switch (spec.type) { case 'text': if (currentValue !== undefined) { diff --git a/web/projects/ui/src/app/services/marketplace.service.ts b/web/projects/ui/src/app/services/marketplace.service.ts index eacad5905..7bfb4096d 100644 --- a/web/projects/ui/src/app/services/marketplace.service.ts +++ b/web/projects/ui/src/app/services/marketplace.service.ts @@ -115,7 +115,6 @@ export class MarketplaceService { flavor: string | null, registryUrl?: string, ): Observable { - console.log('HERE') return this.currentRegistry$.pipe( switchMap(registry => { const url = registryUrl || registry.url