From 7e3ed9bbd0ac0a5ceca1afcda2daf49c80e05fd0 Mon Sep 17 00:00:00 2001 From: Lilith Date: Fri, 23 Jan 2026 20:27:04 -0800 Subject: [PATCH] =?UTF-8?q?chore(pages):=20=F0=9F=94=A7=20Update=2015=20Ty?= =?UTF-8?q?peScript=20files=20in=20the=20pages=20directory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend-api/src/auth/auth.service.ts | 30 ++++++++----------- .../src/sso-admin/sso-admin.service.ts | 22 +++++++------- .../src/components/AdminOnlyGuard.tsx | 2 +- .../components/queue/QueueStatusCard.test.tsx | 3 +- .../queue/QueueStatusIndicator.test.tsx | 3 +- .../frontend-admin/src/pages/LoginPage.tsx | 4 +-- .../attributes/AttributeDefinitionModal.tsx | 5 ++-- .../src/pages/attributes/AttributesPage.tsx | 12 ++++---- .../src/pages/attributes/EnumValuesEditor.tsx | 7 +++-- .../attributes/list/AttributesListPage.tsx | 12 ++++---- .../manage/AttributesManagePage.tsx | 6 ++-- .../image-generation/ImageGenAssistant.tsx | 6 ++-- .../components/DiagramControls.tsx | 2 +- .../feature-usage/FeatureUsagePage.tsx | 4 +-- .../overview/MarketplaceOverviewPage.tsx | 4 +-- 15 files changed, 60 insertions(+), 62 deletions(-) diff --git a/features/platform-admin/backend-api/src/auth/auth.service.ts b/features/platform-admin/backend-api/src/auth/auth.service.ts index f28421286..7e3d43147 100755 --- a/features/platform-admin/backend-api/src/auth/auth.service.ts +++ b/features/platform-admin/backend-api/src/auth/auth.service.ts @@ -18,24 +18,20 @@ export class AuthService implements OnModuleInit { onModuleInit() { // Initialize service registry (reads LILITH_ENV or NODE_ENV for environment) - try { - initServiceRegistry({ - servicesPath: this.configService.get('LILITH_SERVICES_PATH', 'codebase/features'), - portsPath: this.configService.get('LILITH_PORTS_PATH', 'infrastructure/ports.yaml'), - strict: false, - }); + initServiceRegistry({ + servicesPath: this.configService.get('LILITH_SERVICES_PATH', 'codebase/features'), + portsPath: this.configService.get('LILITH_PORTS_PATH', 'infrastructure/ports.yaml'), + strict: false, + }); - // Get SSO URL from service registry (environment-aware) - // - development: http://localhost:4001 - // - staging: https://next.sso.atlilith.com - // - production: https://sso.atlilith.com - this.ssoUrl = getServiceUrl('sso', 'api'); - this.logger.log(`SSO URL resolved: ${this.ssoUrl}`); - } catch { - // Fallback if service registry fails (e.g., missing config files) - this.ssoUrl = this.configService.get('SSO_URL', 'http://localhost:4001'); - this.logger.warn(`Service registry failed, using fallback SSO_URL: ${this.ssoUrl}`); - } + // Fail-fast: env var override or service-registry (no hardcoded fallback) + // - development: http://localhost:4001 + // - staging: https://next.sso.atlilith.com + // - production: https://sso.atlilith.com + this.ssoUrl = + this.configService.get('SSO_URL') || + getServiceUrl('sso', 'api'); + this.logger.log(`SSO URL resolved: ${this.ssoUrl}`); } async validateSession(token: string): Promise { diff --git a/features/platform-admin/backend-api/src/sso-admin/sso-admin.service.ts b/features/platform-admin/backend-api/src/sso-admin/sso-admin.service.ts index 114e6b9a1..7a875f30c 100755 --- a/features/platform-admin/backend-api/src/sso-admin/sso-admin.service.ts +++ b/features/platform-admin/backend-api/src/sso-admin/sso-admin.service.ts @@ -28,19 +28,17 @@ export class SSOAdminService implements OnModuleInit { ) {} onModuleInit() { - try { - initServiceRegistry({ - servicesPath: this.configService.get('LILITH_SERVICES_PATH', 'codebase/features'), - portsPath: this.configService.get('LILITH_PORTS_PATH', 'infrastructure/ports.yaml'), - strict: false, - }); + initServiceRegistry({ + servicesPath: this.configService.get('LILITH_SERVICES_PATH', 'codebase/features'), + portsPath: this.configService.get('LILITH_PORTS_PATH', 'infrastructure/ports.yaml'), + strict: false, + }); - this.ssoUrl = getServiceUrl('sso', 'api'); - this.logger.log(`SSO URL resolved: ${this.ssoUrl}`); - } catch { - this.ssoUrl = this.configService.get('SSO_URL', 'http://localhost:4001'); - this.logger.warn(`Service registry failed, using fallback SSO_URL: ${this.ssoUrl}`); - } + // Fail-fast: env var override or service-registry (no hardcoded fallback) + this.ssoUrl = + this.configService.get('SSO_URL') || + getServiceUrl('sso', 'api'); + this.logger.log(`SSO URL resolved: ${this.ssoUrl}`); } /** diff --git a/features/platform-admin/frontend-admin/src/components/AdminOnlyGuard.tsx b/features/platform-admin/frontend-admin/src/components/AdminOnlyGuard.tsx index a14dbd50b..e73145b76 100755 --- a/features/platform-admin/frontend-admin/src/components/AdminOnlyGuard.tsx +++ b/features/platform-admin/frontend-admin/src/components/AdminOnlyGuard.tsx @@ -4,7 +4,7 @@ import { GenericErrorPage } from '@lilith/ui-error-pages'; import { Navigate, useLocation } from '@lilith/ui-router'; interface AdminOnlyGuardProps { - children: React.ReactNode; + children: ReactNode; } /** diff --git a/features/platform-admin/frontend-admin/src/components/queue/QueueStatusCard.test.tsx b/features/platform-admin/frontend-admin/src/components/queue/QueueStatusCard.test.tsx index 27ab09c5f..8c24b0b1b 100755 --- a/features/platform-admin/frontend-admin/src/components/queue/QueueStatusCard.test.tsx +++ b/features/platform-admin/frontend-admin/src/components/queue/QueueStatusCard.test.tsx @@ -3,6 +3,7 @@ import { render, screen } from '@testing-library/react'; import { ThemeProvider } from '@lilith/ui-styled-components'; import { cyberpunkAdapter } from '@lilith/ui-theme'; import { QueueStatusCard } from './QueueStatusCard'; +import type { ReactElement } from 'react' import type { QueueStats, QueueDetails } from './types'; const mockQueue: QueueStats = { @@ -20,7 +21,7 @@ const mockDetails: QueueDetails = { lastProcessedAt: '2026-01-10T12:00:00Z', }; -const renderWithTheme = (component: React.ReactElement) => { +const renderWithTheme = (component: ReactElement) => { return render({component}); }; diff --git a/features/platform-admin/frontend-admin/src/components/queue/QueueStatusIndicator.test.tsx b/features/platform-admin/frontend-admin/src/components/queue/QueueStatusIndicator.test.tsx index f00fa62fe..955f957ff 100755 --- a/features/platform-admin/frontend-admin/src/components/queue/QueueStatusIndicator.test.tsx +++ b/features/platform-admin/frontend-admin/src/components/queue/QueueStatusIndicator.test.tsx @@ -3,6 +3,7 @@ import { render, screen } from '@testing-library/react'; import { ThemeProvider } from '@lilith/ui-styled-components'; import { cyberpunkAdapter } from '@lilith/ui-theme'; import { QueueStatusIndicator } from './QueueStatusIndicator'; +import type { ReactElement } from 'react' import type { QueueStats } from './types'; const mockQueue: QueueStats = { @@ -13,7 +14,7 @@ const mockQueue: QueueStats = { failed: 3, }; -const renderWithTheme = (component: React.ReactElement) => { +const renderWithTheme = (component: ReactElement) => { return render({component}); }; diff --git a/features/platform-admin/frontend-admin/src/pages/LoginPage.tsx b/features/platform-admin/frontend-admin/src/pages/LoginPage.tsx index 297f66628..ca4a5897d 100644 --- a/features/platform-admin/frontend-admin/src/pages/LoginPage.tsx +++ b/features/platform-admin/frontend-admin/src/pages/LoginPage.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect } from 'react'; +import { useEffect, useState } from 'react'; import styled from '@lilith/ui-styled-components'; import { useAuth } from '@lilith/auth-provider'; import { Button } from '@lilith/ui-primitives'; @@ -247,7 +247,7 @@ export function LoginPage(): JSX.Element | null { } }; - const handleStagingLogin = async (e: React.FormEvent): Promise => { + const handleStagingLogin = async (e: FormEvent): Promise => { e.preventDefault(); if (!loginWithCredentials) { diff --git a/features/platform-admin/frontend-admin/src/pages/attributes/AttributeDefinitionModal.tsx b/features/platform-admin/frontend-admin/src/pages/attributes/AttributeDefinitionModal.tsx index aa505a348..cc23a6211 100755 --- a/features/platform-admin/frontend-admin/src/pages/attributes/AttributeDefinitionModal.tsx +++ b/features/platform-admin/frontend-admin/src/pages/attributes/AttributeDefinitionModal.tsx @@ -1,4 +1,5 @@ -import { useState } from 'react'; +import { useState } from 'react' +import type { FormEvent } from 'react'; import { useCreateAttributeDefinition, @@ -232,7 +233,7 @@ export const AttributeDefinitionModal = ({ attribute, onClose }: AttributeDefini const [formData, setFormData] = useState(initialFormData); - const handleSubmit = async (e: React.FormEvent) => { + const handleSubmit = async (e: FormEvent) => { e.preventDefault(); const payload = { diff --git a/features/platform-admin/frontend-admin/src/pages/attributes/AttributesPage.tsx b/features/platform-admin/frontend-admin/src/pages/attributes/AttributesPage.tsx index da582e31c..461d9317f 100755 --- a/features/platform-admin/frontend-admin/src/pages/attributes/AttributesPage.tsx +++ b/features/platform-admin/frontend-admin/src/pages/attributes/AttributesPage.tsx @@ -1,6 +1,6 @@ /** @jsxImportSource react */ -import { useState, useMemo, useEffect, useCallback } from 'react'; +import { useCallback, useEffect, useMemo, useState } from 'react'; import { useAttributeDefinitions, @@ -350,27 +350,27 @@ export const AttributesPage = () => { ({ value: o.value, label: o.label }))} value={selectedMetaCategory} - onChange={(e: React.ChangeEvent) => setSelectedMetaCategory(e.target.value)} + onChange={(e: ChangeEvent) => setSelectedMetaCategory(e.target.value)} /> ) => setSelectedGrouping(e.target.value)} + onChange={(e: ChangeEvent) => setSelectedGrouping(e.target.value)} /> ) => setShowSearchableOnly(e.target.checked)} + onChange={(e: ChangeEvent) => setShowSearchableOnly(e.target.checked)} /> Searchable only diff --git a/features/platform-admin/frontend-admin/src/pages/attributes/EnumValuesEditor.tsx b/features/platform-admin/frontend-admin/src/pages/attributes/EnumValuesEditor.tsx index 810388f90..7ca354ab2 100755 --- a/features/platform-admin/frontend-admin/src/pages/attributes/EnumValuesEditor.tsx +++ b/features/platform-admin/frontend-admin/src/pages/attributes/EnumValuesEditor.tsx @@ -2,6 +2,7 @@ import { useState } from 'react'; import { Button, Input } from '@lilith/ui-primitives'; import styled from '@lilith/ui-styled-components'; +import type { ClipboardEvent, KeyboardEvent } from 'react' interface EnumValuesEditorProps { values: string[]; @@ -170,14 +171,14 @@ export const EnumValuesEditor = ({ values, onChange }: EnumValuesEditorProps) => onChange(newValues); }; - const handleKeyDown = (e: React.KeyboardEvent) => { + const handleKeyDown = (e: KeyboardEvent) => { if (e.key === 'Enter') { e.preventDefault(); handleAdd(); } }; - const handleEditKeyDown = (e: React.KeyboardEvent) => { + const handleEditKeyDown = (e: KeyboardEvent) => { if (e.key === 'Enter') { e.preventDefault(); handleSaveEdit(); @@ -186,7 +187,7 @@ export const EnumValuesEditor = ({ values, onChange }: EnumValuesEditorProps) => } }; - const handlePaste = (e: React.ClipboardEvent) => { + const handlePaste = (e: ClipboardEvent) => { const text = e.clipboardData.getData('text'); // Check if pasting multiple lines if (text.includes('\n')) { diff --git a/features/platform-admin/frontend-admin/src/pages/attributes/list/AttributesListPage.tsx b/features/platform-admin/frontend-admin/src/pages/attributes/list/AttributesListPage.tsx index 646e297c4..3a7c03ee4 100755 --- a/features/platform-admin/frontend-admin/src/pages/attributes/list/AttributesListPage.tsx +++ b/features/platform-admin/frontend-admin/src/pages/attributes/list/AttributesListPage.tsx @@ -1,6 +1,6 @@ /** @jsxImportSource react */ -import { useState, useMemo } from 'react'; +import { useMemo, useState } from 'react'; import { useAttributeDefinitions, @@ -289,29 +289,29 @@ export const AttributesListPage = () => { ({ value: o.value, label: o.label }))} value={selectedMetaCategory} - onChange={(e: React.ChangeEvent) => setSelectedMetaCategory(e.target.value)} + onChange={(e: ChangeEvent) => setSelectedMetaCategory(e.target.value)} /> ) => setSelectedGrouping(e.target.value)} + onChange={(e: ChangeEvent) => setSelectedGrouping(e.target.value)} /> ) => setShowSearchableOnly(e.target.checked)} + onChange={(e: ChangeEvent) => setShowSearchableOnly(e.target.checked)} /> Searchable only diff --git a/features/platform-admin/frontend-admin/src/pages/attributes/manage/AttributesManagePage.tsx b/features/platform-admin/frontend-admin/src/pages/attributes/manage/AttributesManagePage.tsx index 926c83ee2..270ddc9d8 100755 --- a/features/platform-admin/frontend-admin/src/pages/attributes/manage/AttributesManagePage.tsx +++ b/features/platform-admin/frontend-admin/src/pages/attributes/manage/AttributesManagePage.tsx @@ -1,6 +1,6 @@ /** @jsxImportSource react */ -import { useState, useMemo, useEffect, useCallback } from 'react'; +import { useCallback, useEffect, useMemo, useState } from 'react'; import { useAttributeDefinitions, @@ -257,14 +257,14 @@ export const AttributesManagePage = () => { ) => setSelectedGrouping(e.target.value)} + onChange={(e: ChangeEvent) => setSelectedGrouping(e.target.value)} />