fix(admin-v2): Restore complete admin-v2 application
The admin-v2 application was incomplete in the repository. This commit restores all missing components: - Admin pages (76 pages): dashboard, ai, compliance, dsgvo, education, infrastructure, communication, development, onboarding, rbac - SDK pages (45 pages): tom, dsfa, vvt, loeschfristen, einwilligungen, vendor-compliance, tom-generator, dsr, and more - Developer portal (25 pages): API docs, SDK guides, frameworks - All components, lib files, hooks, and types - Updated package.json with all dependencies The issue was caused by incomplete initial repository state - the full admin-v2 codebase existed in backend/admin-v2 and docs-src/admin-v2 but was never fully synced to the main admin-v2 directory. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
100
admin-v2/components/wizard/ArchitectureContext.tsx
Normal file
100
admin-v2/components/wizard/ArchitectureContext.tsx
Normal file
@@ -0,0 +1,100 @@
|
||||
'use client'
|
||||
|
||||
import type { ArchitectureContext as ArchitectureContextType } from './types'
|
||||
|
||||
interface ArchitectureContextProps {
|
||||
context: ArchitectureContextType
|
||||
currentStep?: string
|
||||
highlightedComponents?: string[]
|
||||
}
|
||||
|
||||
const LAYER_CONFIG = {
|
||||
frontend: { label: 'Frontend', color: 'blue', icon: '🖥️' },
|
||||
api: { label: 'API', color: 'purple', icon: '🔌' },
|
||||
service: { label: 'Service', color: 'green', icon: '⚙️' },
|
||||
database: { label: 'Datenbank', color: 'orange', icon: '🗄️' },
|
||||
}
|
||||
|
||||
export function ArchitectureContext({ context, currentStep, highlightedComponents = [] }: ArchitectureContextProps) {
|
||||
const layerConfig = LAYER_CONFIG[context.layer]
|
||||
|
||||
return (
|
||||
<div className="bg-slate-900 rounded-lg p-6 mb-6">
|
||||
<h4 className="text-white font-medium mb-4 flex items-center">
|
||||
<span className="mr-2">🏗️</span>
|
||||
Architektur-Kontext{currentStep && `: ${currentStep}`}
|
||||
</h4>
|
||||
|
||||
{/* Data Flow Visualization */}
|
||||
<div className="mb-6">
|
||||
<div className="flex items-center justify-center flex-wrap gap-2">
|
||||
{context.dataFlow.map((component, index) => {
|
||||
const isHighlighted = highlightedComponents.includes(component.toLowerCase())
|
||||
const isCurrentLayer = component.toLowerCase().includes(context.layer)
|
||||
|
||||
return (
|
||||
<div key={index} className="flex items-center">
|
||||
<div className={`px-3 py-2 rounded-lg text-sm font-medium transition-all ${
|
||||
isHighlighted || isCurrentLayer
|
||||
? 'bg-blue-500 text-white ring-2 ring-blue-300'
|
||||
: 'bg-slate-700 text-slate-300'
|
||||
}`}>
|
||||
{component}
|
||||
{isCurrentLayer && (
|
||||
<span className="ml-2 text-xs">← Sie sind hier</span>
|
||||
)}
|
||||
</div>
|
||||
{index < context.dataFlow.length - 1 && (
|
||||
<span className="mx-2 text-slate-500">→</span>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Layer Info */}
|
||||
<div className="grid grid-cols-2 gap-4 mb-4">
|
||||
<div className="bg-slate-800 rounded-lg p-4">
|
||||
<h5 className="text-slate-400 text-xs uppercase tracking-wide mb-2">Aktuelle Schicht</h5>
|
||||
<div className="flex items-center">
|
||||
<span className="text-xl mr-2">{layerConfig.icon}</span>
|
||||
<span className={`text-${layerConfig.color}-400 font-medium`}>
|
||||
{layerConfig.label}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="bg-slate-800 rounded-lg p-4">
|
||||
<h5 className="text-slate-400 text-xs uppercase tracking-wide mb-2">Beteiligte Services</h5>
|
||||
<div className="flex flex-wrap gap-1">
|
||||
{context.services.map((service) => (
|
||||
<span
|
||||
key={service}
|
||||
className="px-2 py-1 bg-slate-700 text-slate-300 text-xs rounded"
|
||||
>
|
||||
{service}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Dependencies */}
|
||||
{context.dependencies.length > 0 && (
|
||||
<div className="pt-4 border-t border-slate-700">
|
||||
<h5 className="text-slate-400 text-xs uppercase tracking-wide mb-2">Abhaengigkeiten</h5>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{context.dependencies.map((dep) => (
|
||||
<span
|
||||
key={dep}
|
||||
className="px-2 py-1 bg-amber-900/50 text-amber-300 text-xs rounded border border-amber-700"
|
||||
>
|
||||
{dep}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
28
admin-v2/components/wizard/EducationCard.tsx
Normal file
28
admin-v2/components/wizard/EducationCard.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
'use client'
|
||||
|
||||
import type { EducationContent } from './types'
|
||||
|
||||
interface EducationCardProps {
|
||||
content: EducationContent | undefined
|
||||
}
|
||||
|
||||
export function EducationCard({ content }: EducationCardProps) {
|
||||
if (!content) return null
|
||||
|
||||
return (
|
||||
<div className="bg-blue-50 border border-blue-200 rounded-lg p-6 mb-6">
|
||||
<h3 className="text-lg font-semibold text-blue-800 mb-4 flex items-center">
|
||||
<span className="mr-2">💡</span>
|
||||
Warum ist das wichtig?
|
||||
</h3>
|
||||
<h4 className="text-md font-medium text-blue-700 mb-3">{content.title}</h4>
|
||||
<div className="space-y-2 text-blue-900">
|
||||
{content.content.map((line, index) => (
|
||||
<p key={index} className={line.startsWith('•') ? 'ml-4' : ''}>
|
||||
{line}
|
||||
</p>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
57
admin-v2/components/wizard/TestResultCard.tsx
Normal file
57
admin-v2/components/wizard/TestResultCard.tsx
Normal file
@@ -0,0 +1,57 @@
|
||||
'use client'
|
||||
|
||||
import type { TestResult } from './types'
|
||||
|
||||
interface TestResultCardProps {
|
||||
result: TestResult
|
||||
}
|
||||
|
||||
export function TestResultCard({ result }: TestResultCardProps) {
|
||||
const statusColors = {
|
||||
passed: 'bg-green-100 border-green-300 text-green-800',
|
||||
failed: 'bg-red-100 border-red-300 text-red-800',
|
||||
pending: 'bg-yellow-100 border-yellow-300 text-yellow-800',
|
||||
skipped: 'bg-gray-100 border-gray-300 text-gray-600',
|
||||
}
|
||||
|
||||
const statusIcons = {
|
||||
passed: '✓',
|
||||
failed: '✗',
|
||||
pending: '○',
|
||||
skipped: '−',
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={`border rounded-lg p-4 mb-3 ${statusColors[result.status]}`}>
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="flex-1">
|
||||
<h4 className="font-medium flex items-center">
|
||||
<span className="mr-2">{statusIcons[result.status]}</span>
|
||||
{result.name}
|
||||
</h4>
|
||||
<p className="text-sm opacity-80 mt-1">{result.description}</p>
|
||||
</div>
|
||||
<span className="text-xs opacity-60">{result.duration_ms.toFixed(0)}ms</span>
|
||||
</div>
|
||||
<div className="mt-3 grid grid-cols-2 gap-4 text-sm">
|
||||
<div>
|
||||
<span className="font-medium">Erwartet:</span>
|
||||
<code className="block mt-1 bg-white bg-opacity-50 px-2 py-1 rounded text-xs">
|
||||
{result.expected}
|
||||
</code>
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-medium">Erhalten:</span>
|
||||
<code className="block mt-1 bg-white bg-opacity-50 px-2 py-1 rounded text-xs">
|
||||
{result.actual}
|
||||
</code>
|
||||
</div>
|
||||
</div>
|
||||
{result.error_message && (
|
||||
<div className="mt-2 text-xs text-red-700 bg-red-50 p-2 rounded">
|
||||
Fehler: {result.error_message}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
57
admin-v2/components/wizard/TestRunner.tsx
Normal file
57
admin-v2/components/wizard/TestRunner.tsx
Normal file
@@ -0,0 +1,57 @@
|
||||
'use client'
|
||||
|
||||
import { TestResultCard } from './TestResultCard'
|
||||
import type { TestCategoryResult } from './types'
|
||||
|
||||
interface TestRunnerProps {
|
||||
category: string
|
||||
categoryResult?: TestCategoryResult
|
||||
isLoading: boolean
|
||||
onRunTests: () => void
|
||||
runButtonLabel?: string
|
||||
rerunButtonLabel?: string
|
||||
}
|
||||
|
||||
export function TestRunner({
|
||||
categoryResult,
|
||||
isLoading,
|
||||
onRunTests,
|
||||
runButtonLabel = '▶️ Tests ausfuehren',
|
||||
rerunButtonLabel = '🔄 Erneut ausfuehren',
|
||||
}: TestRunnerProps) {
|
||||
if (!categoryResult) {
|
||||
return (
|
||||
<div className="text-center py-6">
|
||||
<button
|
||||
onClick={onRunTests}
|
||||
disabled={isLoading}
|
||||
className={`px-6 py-3 rounded-lg font-medium transition-colors ${
|
||||
isLoading
|
||||
? 'bg-gray-400 cursor-not-allowed'
|
||||
: 'bg-green-600 text-white hover:bg-green-700'
|
||||
}`}
|
||||
>
|
||||
{isLoading ? '⏳ Tests laufen...' : runButtonLabel}
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<h3 className="font-semibold text-gray-700">Testergebnisse</h3>
|
||||
<button
|
||||
onClick={onRunTests}
|
||||
disabled={isLoading}
|
||||
className="text-sm text-blue-600 hover:text-blue-800"
|
||||
>
|
||||
{rerunButtonLabel}
|
||||
</button>
|
||||
</div>
|
||||
{categoryResult.tests.map((test, index) => (
|
||||
<TestResultCard key={index} result={test} />
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
65
admin-v2/components/wizard/TestSummary.tsx
Normal file
65
admin-v2/components/wizard/TestSummary.tsx
Normal file
@@ -0,0 +1,65 @@
|
||||
'use client'
|
||||
|
||||
import type { FullTestResults } from './types'
|
||||
|
||||
interface TestSummaryProps {
|
||||
results: FullTestResults
|
||||
}
|
||||
|
||||
export function TestSummary({ results }: TestSummaryProps) {
|
||||
const passRate = results.total_tests > 0
|
||||
? ((results.total_passed / results.total_tests) * 100).toFixed(1)
|
||||
: '0'
|
||||
|
||||
return (
|
||||
<div className="bg-white rounded-lg shadow-lg p-6">
|
||||
<h3 className="text-xl font-bold mb-4">Test-Ergebnisse</h3>
|
||||
|
||||
{/* Summary Stats */}
|
||||
<div className="grid grid-cols-4 gap-4 mb-6">
|
||||
<div className="bg-gray-50 rounded-lg p-4 text-center">
|
||||
<div className="text-3xl font-bold text-gray-700">{results.total_tests}</div>
|
||||
<div className="text-sm text-gray-500">Gesamt</div>
|
||||
</div>
|
||||
<div className="bg-green-50 rounded-lg p-4 text-center">
|
||||
<div className="text-3xl font-bold text-green-600">{results.total_passed}</div>
|
||||
<div className="text-sm text-green-600">Bestanden</div>
|
||||
</div>
|
||||
<div className="bg-red-50 rounded-lg p-4 text-center">
|
||||
<div className="text-3xl font-bold text-red-600">{results.total_failed}</div>
|
||||
<div className="text-sm text-red-600">Fehlgeschlagen</div>
|
||||
</div>
|
||||
<div className={`rounded-lg p-4 text-center ${
|
||||
parseFloat(passRate) >= 80 ? 'bg-green-50' : parseFloat(passRate) >= 50 ? 'bg-yellow-50' : 'bg-red-50'
|
||||
}`}>
|
||||
<div className={`text-3xl font-bold ${
|
||||
parseFloat(passRate) >= 80 ? 'text-green-600' : parseFloat(passRate) >= 50 ? 'text-yellow-600' : 'text-red-600'
|
||||
}`}>{passRate}%</div>
|
||||
<div className="text-sm text-gray-500">Erfolgsrate</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Category Results */}
|
||||
<div className="space-y-4">
|
||||
{results.categories.map((category) => (
|
||||
<div key={category.category} className="border rounded-lg p-4">
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<h4 className="font-medium">{category.display_name}</h4>
|
||||
<span className={`text-sm px-2 py-1 rounded ${
|
||||
category.failed === 0 ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-700'
|
||||
}`}>
|
||||
{category.passed}/{category.total} bestanden
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-sm text-gray-600">{category.description}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Duration */}
|
||||
<div className="mt-6 text-sm text-gray-500 text-right">
|
||||
Gesamtdauer: {(results.duration_ms / 1000).toFixed(2)}s
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
31
admin-v2/components/wizard/WizardBanner.tsx
Normal file
31
admin-v2/components/wizard/WizardBanner.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
'use client'
|
||||
|
||||
interface WizardBannerProps {
|
||||
module: string
|
||||
title: string
|
||||
description?: string
|
||||
}
|
||||
|
||||
export function WizardBanner({ module, title, description }: WizardBannerProps) {
|
||||
return (
|
||||
<div className="bg-gradient-to-r from-blue-50 to-purple-50 border border-blue-200 rounded-lg p-4 mb-6">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center">
|
||||
<span className="text-2xl mr-3">🎓</span>
|
||||
<div>
|
||||
<h3 className="font-medium text-blue-800">Lern-Wizard: {title}</h3>
|
||||
<p className="text-sm text-blue-600">
|
||||
{description || 'Interaktives Onboarding mit Tests und Architektur-Erklaerungen'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<a
|
||||
href={`/admin/${module}/wizard`}
|
||||
className="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors"
|
||||
>
|
||||
Wizard starten →
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
53
admin-v2/components/wizard/WizardNavigation.tsx
Normal file
53
admin-v2/components/wizard/WizardNavigation.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
'use client'
|
||||
|
||||
interface WizardNavigationProps {
|
||||
currentStep: number
|
||||
totalSteps: number
|
||||
onPrev: () => void
|
||||
onNext: () => void
|
||||
showNext?: boolean
|
||||
isLoading?: boolean
|
||||
nextLabel?: string
|
||||
prevLabel?: string
|
||||
}
|
||||
|
||||
export function WizardNavigation({
|
||||
currentStep,
|
||||
totalSteps,
|
||||
onPrev,
|
||||
onNext,
|
||||
showNext = true,
|
||||
isLoading = false,
|
||||
nextLabel = 'Weiter →',
|
||||
prevLabel = '← Zurueck',
|
||||
}: WizardNavigationProps) {
|
||||
return (
|
||||
<div className="flex justify-between mt-8 pt-6 border-t">
|
||||
<button
|
||||
onClick={onPrev}
|
||||
disabled={currentStep === 0 || isLoading}
|
||||
className={`px-6 py-2 rounded-lg transition-colors ${
|
||||
currentStep === 0 || isLoading
|
||||
? 'bg-gray-200 text-gray-400 cursor-not-allowed'
|
||||
: 'bg-gray-200 text-gray-700 hover:bg-gray-300'
|
||||
}`}
|
||||
>
|
||||
{prevLabel}
|
||||
</button>
|
||||
|
||||
{showNext && currentStep < totalSteps - 1 && (
|
||||
<button
|
||||
onClick={onNext}
|
||||
disabled={isLoading}
|
||||
className={`px-6 py-2 rounded-lg transition-colors ${
|
||||
isLoading
|
||||
? 'bg-blue-400 cursor-not-allowed'
|
||||
: 'bg-blue-600 text-white hover:bg-blue-700'
|
||||
}`}
|
||||
>
|
||||
{isLoading ? 'Bitte warten...' : nextLabel}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
72
admin-v2/components/wizard/WizardProvider.tsx
Normal file
72
admin-v2/components/wizard/WizardProvider.tsx
Normal file
@@ -0,0 +1,72 @@
|
||||
'use client'
|
||||
|
||||
import { createContext, useContext, useState, ReactNode, useCallback } from 'react'
|
||||
import type { WizardStep, WizardContextValue, TestCategoryResult, FullTestResults } from './types'
|
||||
|
||||
const WizardContext = createContext<WizardContextValue | null>(null)
|
||||
|
||||
export function useWizard(): WizardContextValue {
|
||||
const context = useContext(WizardContext)
|
||||
if (!context) {
|
||||
throw new Error('useWizard must be used within a WizardProvider')
|
||||
}
|
||||
return context
|
||||
}
|
||||
|
||||
interface WizardProviderProps {
|
||||
children: ReactNode
|
||||
initialSteps: WizardStep[]
|
||||
module: string
|
||||
}
|
||||
|
||||
export function WizardProvider({ children, initialSteps, module }: WizardProviderProps) {
|
||||
const [currentStep, setCurrentStep] = useState(0)
|
||||
const [steps, setSteps] = useState<WizardStep[]>(initialSteps)
|
||||
const [categoryResults, setCategoryResults] = useState<Record<string, TestCategoryResult>>({})
|
||||
const [fullResults, setFullResults] = useState<FullTestResults | null>(null)
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
|
||||
const goToNext = useCallback(() => {
|
||||
if (currentStep < steps.length - 1) {
|
||||
setSteps((prev) =>
|
||||
prev.map((step, idx) =>
|
||||
idx === currentStep && step.status === 'pending'
|
||||
? { ...step, status: 'completed' }
|
||||
: step
|
||||
)
|
||||
)
|
||||
setCurrentStep((prev) => prev + 1)
|
||||
}
|
||||
}, [currentStep, steps.length])
|
||||
|
||||
const goToPrev = useCallback(() => {
|
||||
if (currentStep > 0) {
|
||||
setCurrentStep((prev) => prev - 1)
|
||||
}
|
||||
}, [currentStep])
|
||||
|
||||
const value: WizardContextValue = {
|
||||
currentStep,
|
||||
steps,
|
||||
setCurrentStep,
|
||||
setSteps,
|
||||
goToNext,
|
||||
goToPrev,
|
||||
module,
|
||||
categoryResults,
|
||||
setCategoryResults,
|
||||
fullResults,
|
||||
setFullResults,
|
||||
isLoading,
|
||||
setIsLoading,
|
||||
error,
|
||||
setError,
|
||||
}
|
||||
|
||||
return (
|
||||
<WizardContext.Provider value={value}>
|
||||
{children}
|
||||
</WizardContext.Provider>
|
||||
)
|
||||
}
|
||||
43
admin-v2/components/wizard/WizardStepper.tsx
Normal file
43
admin-v2/components/wizard/WizardStepper.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
'use client'
|
||||
|
||||
import type { WizardStep } from './types'
|
||||
|
||||
interface WizardStepperProps {
|
||||
steps: WizardStep[]
|
||||
currentStep: number
|
||||
onStepClick: (index: number) => void
|
||||
}
|
||||
|
||||
export function WizardStepper({ steps, currentStep, onStepClick }: WizardStepperProps) {
|
||||
return (
|
||||
<div className="flex items-center justify-between mb-8 overflow-x-auto pb-4">
|
||||
{steps.map((step, index) => (
|
||||
<div key={step.id} className="flex items-center">
|
||||
<button
|
||||
onClick={() => onStepClick(index)}
|
||||
className={`flex flex-col items-center min-w-[80px] p-2 rounded-lg transition-colors ${
|
||||
index === currentStep
|
||||
? 'bg-blue-100 text-blue-700'
|
||||
: step.status === 'completed'
|
||||
? 'bg-green-100 text-green-700 cursor-pointer hover:bg-green-200'
|
||||
: step.status === 'failed'
|
||||
? 'bg-red-100 text-red-700 cursor-pointer hover:bg-red-200'
|
||||
: 'text-gray-400'
|
||||
}`}
|
||||
disabled={index > currentStep && steps[index - 1]?.status === 'pending'}
|
||||
>
|
||||
<span className="text-2xl mb-1">{step.icon}</span>
|
||||
<span className="text-xs font-medium text-center">{step.name}</span>
|
||||
{step.status === 'completed' && <span className="text-xs text-green-600">✓</span>}
|
||||
{step.status === 'failed' && <span className="text-xs text-red-600">✗</span>}
|
||||
</button>
|
||||
{index < steps.length - 1 && (
|
||||
<div className={`h-0.5 w-8 mx-1 ${
|
||||
index < currentStep ? 'bg-green-400' : 'bg-gray-200'
|
||||
}`} />
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
34
admin-v2/components/wizard/index.ts
Normal file
34
admin-v2/components/wizard/index.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
// Wizard Framework Components
|
||||
// ============================
|
||||
// Wiederverwendbare Komponenten fuer Admin-Modul-Wizards
|
||||
|
||||
// Context & Provider
|
||||
export { WizardProvider, useWizard } from './WizardProvider'
|
||||
|
||||
// UI Components
|
||||
export { WizardStepper } from './WizardStepper'
|
||||
export { WizardNavigation } from './WizardNavigation'
|
||||
export { WizardBanner } from './WizardBanner'
|
||||
|
||||
// Education Components
|
||||
export { EducationCard } from './EducationCard'
|
||||
export { ArchitectureContext } from './ArchitectureContext'
|
||||
|
||||
// Test Components
|
||||
export { TestRunner } from './TestRunner'
|
||||
export { TestResultCard } from './TestResultCard'
|
||||
export { TestSummary } from './TestSummary'
|
||||
|
||||
// Types
|
||||
export type {
|
||||
WizardStep,
|
||||
StepStatus,
|
||||
TestResult,
|
||||
TestCategoryResult,
|
||||
FullTestResults,
|
||||
EducationContent,
|
||||
StepEducation,
|
||||
ModuleEducation,
|
||||
ArchitectureContext as ArchitectureContextType,
|
||||
WizardContextValue,
|
||||
} from './types'
|
||||
104
admin-v2/components/wizard/types.ts
Normal file
104
admin-v2/components/wizard/types.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
// ==============================================
|
||||
// Wizard Framework Types
|
||||
// ==============================================
|
||||
|
||||
export type StepStatus = 'pending' | 'active' | 'completed' | 'failed'
|
||||
|
||||
export interface WizardStep {
|
||||
id: string
|
||||
name: string
|
||||
icon: string
|
||||
status: StepStatus
|
||||
category?: string
|
||||
}
|
||||
|
||||
export interface TestResult {
|
||||
name: string
|
||||
description: string
|
||||
expected: string
|
||||
actual: string
|
||||
status: 'passed' | 'failed' | 'pending' | 'skipped'
|
||||
duration_ms: number
|
||||
error_message?: string
|
||||
}
|
||||
|
||||
export interface ArchitectureContext {
|
||||
layer: 'frontend' | 'api' | 'service' | 'database'
|
||||
services: string[]
|
||||
dependencies: string[]
|
||||
dataFlow: string[]
|
||||
}
|
||||
|
||||
export interface TestCategoryResult {
|
||||
category: string
|
||||
display_name: string
|
||||
description: string
|
||||
why_important: string
|
||||
architecture_context?: ArchitectureContext
|
||||
tests: TestResult[]
|
||||
passed: number
|
||||
failed: number
|
||||
total: number
|
||||
duration_ms: number
|
||||
}
|
||||
|
||||
export interface FullTestResults {
|
||||
timestamp: string
|
||||
categories: TestCategoryResult[]
|
||||
total_passed: number
|
||||
total_failed: number
|
||||
total_tests: number
|
||||
duration_ms: number
|
||||
}
|
||||
|
||||
export interface EducationContent {
|
||||
title: string
|
||||
content: string[]
|
||||
}
|
||||
|
||||
export interface StepEducation {
|
||||
stepId: string
|
||||
title: string
|
||||
whyImportant: string
|
||||
whatIsTested: string[]
|
||||
architectureHighlight?: {
|
||||
layer: string
|
||||
components: string[]
|
||||
dataFlow: string
|
||||
}
|
||||
learnMoreLinks?: {
|
||||
label: string
|
||||
url: string
|
||||
}[]
|
||||
commonMistakes?: string[]
|
||||
bestPractices?: string[]
|
||||
}
|
||||
|
||||
export interface ModuleEducation {
|
||||
module: string
|
||||
overview: {
|
||||
title: string
|
||||
description: string
|
||||
businessValue: string
|
||||
complianceContext: string
|
||||
}
|
||||
steps: StepEducation[]
|
||||
}
|
||||
|
||||
export interface WizardContextValue {
|
||||
currentStep: number
|
||||
steps: WizardStep[]
|
||||
setCurrentStep: (step: number) => void
|
||||
setSteps: React.Dispatch<React.SetStateAction<WizardStep[]>>
|
||||
goToNext: () => void
|
||||
goToPrev: () => void
|
||||
module: string
|
||||
categoryResults: Record<string, TestCategoryResult>
|
||||
setCategoryResults: React.Dispatch<React.SetStateAction<Record<string, TestCategoryResult>>>
|
||||
fullResults: FullTestResults | null
|
||||
setFullResults: React.Dispatch<React.SetStateAction<FullTestResults | null>>
|
||||
isLoading: boolean
|
||||
setIsLoading: React.Dispatch<React.SetStateAction<boolean>>
|
||||
error: string | null
|
||||
setError: React.Dispatch<React.SetStateAction<string | null>>
|
||||
}
|
||||
Reference in New Issue
Block a user