[agent-pipeline] pipe-20260317054958-cypk round-5
This commit is contained in:
parent
c55520f01c
commit
d8a542b253
|
|
@ -46,7 +46,7 @@ import { ColorPickerWithTransparent } from "../common/ColorPickerWithTransparent
|
|||
|
||||
// ComponentRegistry import (동적 ConfigPanel 가져오기용)
|
||||
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 StyleEditor from "../StyleEditor";
|
||||
import { Slider } from "@/components/ui/slider";
|
||||
|
|
@ -97,6 +97,24 @@ export const V2PropertiesPanel: React.FC<V2PropertiesPanelProps> = ({
|
|||
// 🆕 전체 테이블 목록 (selected-items-detail-input 등에서 사용)
|
||||
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(() => {
|
||||
const loadAllTables = async () => {
|
||||
|
|
|
|||
|
|
@ -30,9 +30,11 @@ 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 isStale = columnMetaTimestamp[tableName] && (now - columnMetaTimestamp[tableName] > CACHE_TTL_MS);
|
||||
const cachedAt = columnMetaTimestamp[tableName];
|
||||
const isStale =
|
||||
typeof cachedAt === "number" && now - cachedAt > CACHE_TTL_MS;
|
||||
|
||||
if (!forceReload && !isStale && columnMetaCache[tableName]) return;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue