[agent-pipeline] pipe-20260317054958-cypk round-2

This commit is contained in:
DDD1542 2026-03-17 15:00:41 +09:00
parent 4db5d73817
commit 2b4500a999
1 changed files with 24 additions and 25 deletions

View File

@ -17,7 +17,6 @@ import {
GroupComponent, GroupComponent,
DataTableComponent, DataTableComponent,
TableInfo, TableInfo,
LayoutComponent,
FileComponent, FileComponent,
AreaComponent, AreaComponent,
} from "@/types/screen"; } from "@/types/screen";
@ -212,15 +211,15 @@ export const V2PropertiesPanel: React.FC<V2PropertiesPanelProps> = ({
const currentTableName = tables?.[0]?.tableName; const currentTableName = tables?.[0]?.tableName;
// DB input_type만 조회 (saved config와 분리하여 전달) // DB input_type만 조회 (saved config와 분리하여 전달)
const colName = selectedComponent.columnName || currentConfig.fieldKey || currentConfig.columnName; const colName = (selectedComponent as any).columnName || currentConfig.fieldKey || currentConfig.columnName;
const tblName = selectedComponent.tableName || currentTable?.tableName || currentTableName; const tblName = (selectedComponent as any).tableName || currentTable?.tableName || currentTableName;
const dbMeta = colName && tblName && !colName.includes(".") ? columnMetaCache[tblName]?.[colName] : undefined; const dbMeta = colName && tblName && !colName.includes(".") ? columnMetaCache[tblName]?.[colName] : undefined;
const dbInputType = dbMeta ? (() => { const raw = dbMeta.input_type || dbMeta.inputType; return raw === "direct" || raw === "auto" ? undefined : raw; })() : undefined; const dbInputType = dbMeta ? (() => { const raw = dbMeta.input_type || dbMeta.inputType; return raw === "direct" || raw === "auto" ? undefined : raw; })() : undefined;
// 컴포넌트별 추가 props // 컴포넌트별 추가 props
const extraProps: Record<string, any> = {}; const extraProps: Record<string, any> = {};
const resolvedTableName = selectedComponent.tableName || currentTable?.tableName || currentTableName; const resolvedTableName = (selectedComponent as any).tableName || currentTable?.tableName || currentTableName;
const resolvedColumnName = selectedComponent.columnName || currentConfig.fieldKey || currentConfig.columnName; const resolvedColumnName = (selectedComponent as any).columnName || currentConfig.fieldKey || currentConfig.columnName;
if (componentId === "v2-input" || componentId === "v2-select") { if (componentId === "v2-input" || componentId === "v2-select") {
extraProps.componentType = componentId; extraProps.componentType = componentId;
@ -256,7 +255,7 @@ export const V2PropertiesPanel: React.FC<V2PropertiesPanelProps> = ({
const currentConfig = selectedComponent.componentConfig || {}; const currentConfig = selectedComponent.componentConfig || {};
// 🔧 ConfigPanelWrapper를 인라인 함수 대신 직접 JSX 반환 (리마운트 방지) // 🔧 ConfigPanelWrapper를 인라인 함수 대신 직접 JSX 반환 (리마운트 방지)
const config = currentConfig || definition.defaultProps?.componentConfig || {}; const config = currentConfig || (definition as any).defaultProps?.componentConfig || {};
const handlePanelConfigChange = (newConfig: any) => { const handlePanelConfigChange = (newConfig: any) => {
// 🔧 Partial 업데이트: 기존 componentConfig를 유지하면서 새 설정만 병합 // 🔧 Partial 업데이트: 기존 componentConfig를 유지하면서 새 설정만 병합
@ -282,14 +281,14 @@ export const V2PropertiesPanel: React.FC<V2PropertiesPanelProps> = ({
onConfigChange={handlePanelConfigChange} onConfigChange={handlePanelConfigChange}
tables={tables} tables={tables}
allTables={allTables} allTables={allTables}
screenTableName={selectedComponent.tableName || currentTable?.tableName || currentTableName} screenTableName={(selectedComponent as any).tableName || currentTable?.tableName || currentTableName}
tableName={selectedComponent.tableName || currentTable?.tableName || currentTableName} tableName={(selectedComponent as any).tableName || currentTable?.tableName || currentTableName}
columnName={ columnName={
(selectedComponent as any).columnName || currentConfig?.columnName || currentConfig?.fieldName (selectedComponent as any).columnName || currentConfig?.columnName || currentConfig?.fieldName
} }
inputType={(selectedComponent as any).inputType || currentConfig?.inputType} inputType={(selectedComponent as any).inputType || currentConfig?.inputType}
componentType={componentType} componentType={componentType}
tableColumns={currentTable?.columns || []} tableColumns={(currentTable as any)?.columns || []}
allComponents={allComponents} allComponents={allComponents}
currentComponent={selectedComponent} currentComponent={selectedComponent}
menuObjid={menuObjid} menuObjid={menuObjid}
@ -323,8 +322,8 @@ export const V2PropertiesPanel: React.FC<V2PropertiesPanelProps> = ({
componentType={componentType} componentType={componentType}
config={selectedComponent.componentConfig || {}} config={selectedComponent.componentConfig || {}}
onChange={handleDynamicConfigChange} onChange={handleDynamicConfigChange}
screenTableName={selectedComponent.tableName || currentTable?.tableName || currentTableName} screenTableName={(selectedComponent as any).tableName || currentTable?.tableName || currentTableName}
tableColumns={currentTable?.columns || []} tableColumns={(currentTable as any)?.columns || []}
tables={tables} tables={tables}
menuObjid={menuObjid} menuObjid={menuObjid}
allComponents={allComponents} allComponents={allComponents}
@ -491,7 +490,7 @@ export const V2PropertiesPanel: React.FC<V2PropertiesPanelProps> = ({
<span className="text-muted-foreground text-xs"></span> <span className="text-muted-foreground text-xs"></span>
<div className="w-[160px]"> <div className="w-[160px]">
<Input <Input
value={group.title || area.title || ""} value={(group as any).title || (area as any).title || ""}
onChange={(e) => handleUpdate("title", e.target.value)} onChange={(e) => handleUpdate("title", e.target.value)}
placeholder="제목" placeholder="제목"
className="h-7 text-xs" className="h-7 text-xs"
@ -503,7 +502,7 @@ export const V2PropertiesPanel: React.FC<V2PropertiesPanelProps> = ({
<span className="text-muted-foreground text-xs"></span> <span className="text-muted-foreground text-xs"></span>
<div className="w-[160px]"> <div className="w-[160px]">
<Input <Input
value={area.description || ""} value={(area as any).description || ""}
onChange={(e) => handleUpdate("description", e.target.value)} onChange={(e) => handleUpdate("description", e.target.value)}
placeholder="설명" placeholder="설명"
className="h-7 text-xs" className="h-7 text-xs"
@ -519,9 +518,9 @@ export const V2PropertiesPanel: React.FC<V2PropertiesPanelProps> = ({
<h4 className="text-muted-foreground py-2 text-[10px] font-semibold tracking-wider uppercase">OPTIONS</h4> <h4 className="text-muted-foreground py-2 text-[10px] font-semibold tracking-wider uppercase">OPTIONS</h4>
{(isInputField || widget.required !== undefined) && {(isInputField || widget.required !== undefined) &&
(() => { (() => {
const colName = widget.columnName || selectedComponent?.columnName; const colName = widget.columnName || (selectedComponent as any)?.columnName;
const colMeta = colName const colMeta = colName
? currentTable?.columns?.find( ? (currentTable as any)?.columns?.find(
(c: any) => (c.columnName || c.column_name || "").toLowerCase() === colName.toLowerCase(), (c: any) => (c.columnName || c.column_name || "").toLowerCase() === colName.toLowerCase(),
) )
: null; : null;
@ -568,7 +567,7 @@ export const V2PropertiesPanel: React.FC<V2PropertiesPanelProps> = ({
<div className="flex items-center justify-between py-1.5"> <div className="flex items-center justify-between py-1.5">
<span className="text-muted-foreground text-xs"></span> <span className="text-muted-foreground text-xs"></span>
<Checkbox <Checkbox
checked={selectedComponent.hidden === true || selectedComponent.componentConfig?.hidden === true} checked={(selectedComponent as any).hidden === true || selectedComponent.componentConfig?.hidden === true}
onCheckedChange={(checked) => { onCheckedChange={(checked) => {
handleUpdate("hidden", checked); handleUpdate("hidden", checked);
handleUpdate("componentConfig.hidden", checked); handleUpdate("componentConfig.hidden", checked);
@ -689,7 +688,7 @@ export const V2PropertiesPanel: React.FC<V2PropertiesPanelProps> = ({
<div className="flex items-center justify-between py-1.5"> <div className="flex items-center justify-between py-1.5">
<span className="text-muted-foreground text-xs"></span> <span className="text-muted-foreground text-xs"></span>
<Checkbox <Checkbox
checked={selectedComponent.style?.labelDisplay === true || selectedComponent.labelDisplay === true} checked={selectedComponent.style?.labelDisplay === true || (selectedComponent as any).labelDisplay === true}
onCheckedChange={(checked) => { onCheckedChange={(checked) => {
const boolValue = checked === true; const boolValue = checked === true;
handleUpdate("style.labelDisplay", boolValue); handleUpdate("style.labelDisplay", boolValue);
@ -785,7 +784,7 @@ export const V2PropertiesPanel: React.FC<V2PropertiesPanelProps> = ({
const webType = selectedComponent.componentConfig?.webType; const webType = selectedComponent.componentConfig?.webType;
// 테이블 패널에서 드래그한 컴포넌트인지 확인 // 테이블 패널에서 드래그한 컴포넌트인지 확인
const isFromTablePanel = !!(selectedComponent.tableName && selectedComponent.columnName); const isFromTablePanel = !!((selectedComponent as any).tableName && (selectedComponent as any).columnName);
if (!componentId) { if (!componentId) {
return ( return (
@ -845,8 +844,8 @@ export const V2PropertiesPanel: React.FC<V2PropertiesPanelProps> = ({
<DynamicComponentConfigPanel <DynamicComponentConfigPanel
componentId={componentId} componentId={componentId}
config={selectedComponent.componentConfig || {}} config={selectedComponent.componentConfig || {}}
screenTableName={selectedComponent.tableName || currentTable?.tableName || currentTableName} screenTableName={(selectedComponent as any).tableName || currentTable?.tableName || currentTableName}
tableColumns={currentTable?.columns || []} tableColumns={(currentTable as any)?.columns || []}
tables={tables} tables={tables}
menuObjid={menuObjid} // 🆕 메뉴 OBJID 전달 menuObjid={menuObjid} // 🆕 메뉴 OBJID 전달
allComponents={allComponents} // 🆕 연쇄 드롭다운 부모 감지용 allComponents={allComponents} // 🆕 연쇄 드롭다운 부모 감지용
@ -1006,8 +1005,8 @@ export const V2PropertiesPanel: React.FC<V2PropertiesPanelProps> = ({
<DynamicComponentConfigPanel <DynamicComponentConfigPanel
componentId={widget.widgetType} componentId={widget.widgetType}
config={widget.componentConfig || {}} config={widget.componentConfig || {}}
screenTableName={widget.tableName || currentTable?.tableName || currentTableName} screenTableName={(widget as any).tableName || currentTable?.tableName || currentTableName}
tableColumns={currentTable?.columns || []} tableColumns={(currentTable as any)?.columns || []}
tables={tables} tables={tables}
menuObjid={menuObjid} // 🆕 메뉴 OBJID 전달 menuObjid={menuObjid} // 🆕 메뉴 OBJID 전달
allComponents={allComponents} // 🆕 연쇄 드롭다운 부모 감지용 allComponents={allComponents} // 🆕 연쇄 드롭다운 부모 감지용
@ -1023,17 +1022,17 @@ export const V2PropertiesPanel: React.FC<V2PropertiesPanelProps> = ({
return ( return (
<div className="space-y-4"> <div className="space-y-4">
{/* WebType 선택 (있는 경우만) */} {/* WebType 선택 (있는 경우만) */}
{widget.webType && ( {(widget as any).webType && (
<div> <div>
<Label> </Label> <Label> </Label>
<Select value={widget.webType} onValueChange={(value) => handleUpdate("webType", value)}> <Select value={(widget as any).webType} onValueChange={(value) => handleUpdate("webType", value)}>
<SelectTrigger className="h-6 w-full px-2 py-0 text-xs"> <SelectTrigger className="h-6 w-full px-2 py-0 text-xs">
<SelectValue /> <SelectValue />
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
{webTypes.map((wt) => ( {webTypes.map((wt) => (
<SelectItem key={wt.web_type} value={wt.web_type}> <SelectItem key={wt.web_type} value={wt.web_type}>
{wt.web_type_name_kor || wt.web_type} {(wt as any).web_type_name_kor || wt.web_type}
</SelectItem> </SelectItem>
))} ))}
</SelectContent> </SelectContent>