[agent-pipeline] pipe-20260317054958-cypk round-4
This commit is contained in:
parent
cc51ad71da
commit
c3fae741ae
|
|
@ -46,7 +46,7 @@ import { ColorPickerWithTransparent } from "../common/ColorPickerWithTransparent
|
||||||
|
|
||||||
// ComponentRegistry import (동적 ConfigPanel 가져오기용)
|
// ComponentRegistry import (동적 ConfigPanel 가져오기용)
|
||||||
import { ComponentRegistry } from "@/lib/registry/ComponentRegistry";
|
import { ComponentRegistry } from "@/lib/registry/ComponentRegistry";
|
||||||
import { columnMetaCache } from "@/lib/registry/DynamicComponentRenderer";
|
import { columnMetaCache, loadColumnMeta } from "@/lib/registry/DynamicComponentRenderer";
|
||||||
import { DynamicComponentConfigPanel, hasComponentConfigPanel } from "@/lib/utils/getComponentConfigPanel";
|
import { DynamicComponentConfigPanel, hasComponentConfigPanel } from "@/lib/utils/getComponentConfigPanel";
|
||||||
import StyleEditor from "../StyleEditor";
|
import StyleEditor from "../StyleEditor";
|
||||||
import { Slider } from "@/components/ui/slider";
|
import { Slider } from "@/components/ui/slider";
|
||||||
|
|
@ -97,6 +97,24 @@ export const V2PropertiesPanel: React.FC<V2PropertiesPanelProps> = ({
|
||||||
// 🆕 전체 테이블 목록 (selected-items-detail-input 등에서 사용)
|
// 🆕 전체 테이블 목록 (selected-items-detail-input 등에서 사용)
|
||||||
const [allTables, setAllTables] = useState<Array<{ tableName: string; displayName?: string }>>([]);
|
const [allTables, setAllTables] = useState<Array<{ tableName: string; displayName?: string }>>([]);
|
||||||
|
|
||||||
|
// 🆕 선택된 컴포넌트의 테이블에 대한 columnMeta 캐시가 비어 있으면 로드 후 재렌더
|
||||||
|
const [columnMetaVersion, setColumnMetaVersion] = useState(0);
|
||||||
|
useEffect(() => {
|
||||||
|
if (!selectedComponent) return;
|
||||||
|
const tblName =
|
||||||
|
(selectedComponent as any).tableName ||
|
||||||
|
currentTable?.tableName ||
|
||||||
|
tables?.[0]?.tableName;
|
||||||
|
if (!tblName) return;
|
||||||
|
if (columnMetaCache[tblName]) return;
|
||||||
|
loadColumnMeta(tblName).then(() => setColumnMetaVersion((v) => v + 1));
|
||||||
|
}, [
|
||||||
|
selectedComponent?.id,
|
||||||
|
(selectedComponent as any)?.tableName,
|
||||||
|
currentTable?.tableName,
|
||||||
|
tables?.[0]?.tableName,
|
||||||
|
]);
|
||||||
|
|
||||||
// 🆕 전체 테이블 목록 로드
|
// 🆕 전체 테이블 목록 로드
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const loadAllTables = async () => {
|
const loadAllTables = async () => {
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ export function invalidateColumnMetaCache(tableName?: string): void {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadColumnMeta(tableName: string, forceReload = false): Promise<void> {
|
export async function loadColumnMeta(tableName: string, forceReload = false): Promise<void> {
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const isStale = columnMetaTimestamp[tableName] && (now - columnMetaTimestamp[tableName] > CACHE_TTL_MS);
|
const isStale = columnMetaTimestamp[tableName] && (now - columnMetaTimestamp[tableName] > CACHE_TTL_MS);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue