mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 22:34:56 +00:00
feat(JsonEditor): update types for value, onSave, and schema props to JsonValue
feat(TabContent): refine types for onSchemasChange, onWorkflowsChange, and onLuaScriptsChange props
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
DialogTitle,
|
||||
} from '@/components/ui'
|
||||
import { securityScanner, type SecurityScanResult } from '@/lib/security-scanner'
|
||||
import type { JsonValue } from '@/types/utility-types'
|
||||
|
||||
import { SchemaSection } from './json/SchemaSection'
|
||||
import { Toolbar } from './json/Toolbar'
|
||||
@@ -21,9 +22,9 @@ interface JsonEditorProps {
|
||||
open: boolean
|
||||
onClose: () => void
|
||||
title: string
|
||||
value: any
|
||||
onSave: (value: any) => void
|
||||
schema?: any
|
||||
value: JsonValue
|
||||
onSave: (value: JsonValue) => void
|
||||
schema?: JsonValue
|
||||
}
|
||||
|
||||
export function JsonEditor({ open, onClose, title, value, onSave, schema }: JsonEditorProps) {
|
||||
@@ -41,7 +42,7 @@ export function JsonEditor({ open, onClose, title, value, onSave, schema }: Json
|
||||
}
|
||||
}, [open, value])
|
||||
|
||||
const parseJson = () => JSON.parse(jsonText)
|
||||
const parseJson = (): JsonValue => JSON.parse(jsonText) as JsonValue
|
||||
|
||||
const handleSave = () => {
|
||||
try {
|
||||
|
||||
@@ -16,7 +16,8 @@ import { ThemeEditor } from '@/components/ThemeEditor'
|
||||
import { TabsContent } from '@/components/ui'
|
||||
import { UserManagement } from '@/components/UserManagement'
|
||||
import { WorkflowEditor } from '@/components/WorkflowEditor'
|
||||
import type { AppConfiguration, User } from '@/lib/level-types'
|
||||
import type { AppConfiguration, LuaScript, User, Workflow } from '@/lib/level-types'
|
||||
import type { ModelSchema } from '@/lib/types/schema-types'
|
||||
|
||||
import type { Level4TabConfig } from './config'
|
||||
|
||||
@@ -25,9 +26,9 @@ interface Level4TabContentProps {
|
||||
appConfig: AppConfiguration
|
||||
user: User
|
||||
nerdMode: boolean
|
||||
onSchemasChange: (schemas: any[]) => Promise<void>
|
||||
onWorkflowsChange: (workflows: any[]) => Promise<void>
|
||||
onLuaScriptsChange: (scripts: any[]) => Promise<void>
|
||||
onSchemasChange: (schemas: ModelSchema[]) => Promise<void>
|
||||
onWorkflowsChange: (workflows: Workflow[]) => Promise<void>
|
||||
onLuaScriptsChange: (scripts: LuaScript[]) => Promise<void>
|
||||
}
|
||||
|
||||
export function TabContent({
|
||||
|
||||
Reference in New Issue
Block a user