chore(pages): 🔧 Update 15 TypeScript files in the pages directory
This commit is contained in:
parent
12760b3343
commit
7e3ed9bbd0
15 changed files with 60 additions and 62 deletions
|
|
@ -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<string>('SSO_URL') ||
|
||||
getServiceUrl('sso', 'api');
|
||||
this.logger.log(`SSO URL resolved: ${this.ssoUrl}`);
|
||||
}
|
||||
|
||||
async validateSession(token: string): Promise<AuthUser | null> {
|
||||
|
|
|
|||
|
|
@ -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<string>('SSO_URL') ||
|
||||
getServiceUrl('sso', 'api');
|
||||
this.logger.log(`SSO URL resolved: ${this.ssoUrl}`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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(<ThemeProvider theme={cyberpunkAdapter}>{component}</ThemeProvider>);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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(<ThemeProvider theme={cyberpunkAdapter}>{component}</ThemeProvider>);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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<void> => {
|
||||
const handleStagingLogin = async (e: FormEvent): Promise<void> => {
|
||||
e.preventDefault();
|
||||
|
||||
if (!loginWithCredentials) {
|
||||
|
|
|
|||
|
|
@ -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<FormData>(initialFormData);
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
const handleSubmit = async (e: FormEvent) => {
|
||||
e.preventDefault();
|
||||
|
||||
const payload = {
|
||||
|
|
|
|||
|
|
@ -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 = () => {
|
|||
<Select
|
||||
options={ENTITY_TYPE_OPTIONS}
|
||||
value={selectedEntityType}
|
||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => setSelectedEntityType(e.target.value as EntityType | '')}
|
||||
onChange={(e: ChangeEvent<HTMLSelectElement>) => setSelectedEntityType(e.target.value as EntityType | '')}
|
||||
/>
|
||||
<Select
|
||||
options={META_CATEGORY_OPTIONS.map(o => ({ value: o.value, label: o.label }))}
|
||||
value={selectedMetaCategory}
|
||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => setSelectedMetaCategory(e.target.value)}
|
||||
onChange={(e: ChangeEvent<HTMLSelectElement>) => setSelectedMetaCategory(e.target.value)}
|
||||
/>
|
||||
<Select
|
||||
options={priorityOptions}
|
||||
value={selectedPriority}
|
||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => setSelectedPriority(e.target.value)}
|
||||
onChange={(e: ChangeEvent<HTMLSelectElement>) => setSelectedPriority(e.target.value)}
|
||||
/>
|
||||
<Select
|
||||
options={groupingOptions}
|
||||
value={selectedGrouping}
|
||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => setSelectedGrouping(e.target.value)}
|
||||
onChange={(e: ChangeEvent<HTMLSelectElement>) => setSelectedGrouping(e.target.value)}
|
||||
/>
|
||||
<CheckboxLabel>
|
||||
<Checkbox
|
||||
checked={showSearchableOnly}
|
||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setShowSearchableOnly(e.target.checked)}
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setShowSearchableOnly(e.target.checked)}
|
||||
/>
|
||||
<span>Searchable only</span>
|
||||
</CheckboxLabel>
|
||||
|
|
|
|||
|
|
@ -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')) {
|
||||
|
|
|
|||
|
|
@ -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 = () => {
|
|||
<Select
|
||||
options={ENTITY_TYPE_OPTIONS}
|
||||
value={selectedEntityType}
|
||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) =>
|
||||
onChange={(e: ChangeEvent<HTMLSelectElement>) =>
|
||||
setSelectedEntityType(e.target.value as EntityType | '')
|
||||
}
|
||||
/>
|
||||
<Select
|
||||
options={META_CATEGORY_OPTIONS.map((o) => ({ value: o.value, label: o.label }))}
|
||||
value={selectedMetaCategory}
|
||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => setSelectedMetaCategory(e.target.value)}
|
||||
onChange={(e: ChangeEvent<HTMLSelectElement>) => setSelectedMetaCategory(e.target.value)}
|
||||
/>
|
||||
<Select
|
||||
options={priorityOptions}
|
||||
value={selectedPriority}
|
||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => setSelectedPriority(e.target.value)}
|
||||
onChange={(e: ChangeEvent<HTMLSelectElement>) => setSelectedPriority(e.target.value)}
|
||||
/>
|
||||
<Select
|
||||
options={groupingOptions}
|
||||
value={selectedGrouping}
|
||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => setSelectedGrouping(e.target.value)}
|
||||
onChange={(e: ChangeEvent<HTMLSelectElement>) => setSelectedGrouping(e.target.value)}
|
||||
/>
|
||||
<CheckboxLabel>
|
||||
<Checkbox
|
||||
checked={showSearchableOnly}
|
||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setShowSearchableOnly(e.target.checked)}
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setShowSearchableOnly(e.target.checked)}
|
||||
/>
|
||||
<span>Searchable only</span>
|
||||
</CheckboxLabel>
|
||||
|
|
|
|||
|
|
@ -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 = () => {
|
|||
<Select
|
||||
options={ENTITY_TYPE_OPTIONS}
|
||||
value={selectedEntityType}
|
||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) =>
|
||||
onChange={(e: ChangeEvent<HTMLSelectElement>) =>
|
||||
setSelectedEntityType(e.target.value as EntityType | '')
|
||||
}
|
||||
/>
|
||||
<Select
|
||||
options={groupingOptions}
|
||||
value={selectedGrouping}
|
||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => setSelectedGrouping(e.target.value)}
|
||||
onChange={(e: ChangeEvent<HTMLSelectElement>) => setSelectedGrouping(e.target.value)}
|
||||
/>
|
||||
<Button variant="primary" onClick={handleCreate}>
|
||||
<Plus size={16} style={{ marginRight: '8px' }} />
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Uses backend LLM proxy for lilith-llama-service access.
|
||||
*/
|
||||
|
||||
import { useState, useRef, useEffect } from 'react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
|
||||
import { submitBatch, type CreateVariationRequest } from '@lilith/admin-api';
|
||||
import { parseAssistantPrompts } from '@lilith/imajin-app';
|
||||
|
|
@ -437,8 +437,8 @@ export const ImageGenAssistant = ({ pipeline }: Props) => {
|
|||
type="text"
|
||||
placeholder="Describe the images you want to generate..."
|
||||
value={input}
|
||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setInput(e.target.value)}
|
||||
onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setInput(e.target.value)}
|
||||
onKeyDown={(e: KeyboardEvent<HTMLInputElement>) => {
|
||||
if (e.key === 'Enter' && !e.shiftKey) {
|
||||
e.preventDefault();
|
||||
sendMessage(input);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export const DiagramControls = ({
|
|||
<ControlsRow>
|
||||
<Select
|
||||
value={selectedFeature || ''}
|
||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => onFeatureChange(e.target.value || null)}
|
||||
onChange={(e: ChangeEvent<HTMLSelectElement>) => onFeatureChange(e.target.value || null)}
|
||||
>
|
||||
<option value="">All Features</option>
|
||||
{features.map((f) => (
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { useState, useMemo } from 'react';
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
import { Stack, Grid } from '@lilith/ui-layout';
|
||||
import { Button, Card } from '@lilith/ui-primitives';
|
||||
|
|
@ -216,7 +216,7 @@ function getUtilizationColor(percentage: number): string {
|
|||
// ============================================================================
|
||||
|
||||
interface StatCardProps {
|
||||
icon: React.ReactNode;
|
||||
icon: ReactNode;
|
||||
value: string | number;
|
||||
label: string;
|
||||
color: string;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { useState, useMemo } from 'react';
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
import { Stack, Grid } from '@lilith/ui-layout';
|
||||
import { Button, Card } from '@lilith/ui-primitives';
|
||||
|
|
@ -316,7 +316,7 @@ function formatNumber(value: number): string {
|
|||
// ============================================================================
|
||||
|
||||
interface StatCardProps {
|
||||
icon: React.ReactNode;
|
||||
icon: ReactNode;
|
||||
value: string | number;
|
||||
label: string;
|
||||
color: string;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue