feat: Enhance V2Repeater and configuration panel with source detail auto-fetching
- Added support for automatic fetching of detail rows from the master data in the V2Repeater component, improving data management. - Introduced a new configuration option in the V2RepeaterConfigPanel to enable source detail auto-fetching, allowing users to specify detail table and foreign key settings. - Enhanced the V2Repeater component to handle entity joins for loading data, optimizing data retrieval processes. - Updated the V2RepeaterProps and V2RepeaterConfig interfaces to include new properties for grouped data and source detail configuration, ensuring type safety and clarity in component usage. - Improved logging for data loading processes to provide better insights during development and debugging.
This commit is contained in:
@@ -47,14 +47,22 @@ export function UniversalFormModalConfigPanel({
|
||||
onChange,
|
||||
allComponents = [],
|
||||
}: UniversalFormModalConfigPanelProps) {
|
||||
// config가 불완전할 수 있으므로 defaultConfig와 병합하여 안전하게 사용
|
||||
// V2 레이아웃에서 overrides 전체가 componentConfig로 전달되는 경우
|
||||
// 실제 설정이 rawConfig.componentConfig에 이중 중첩되어 있을 수 있음
|
||||
// 평탄화된 구조(save 후)가 있으면 우선, 아니면 중첩 구조에서 추출
|
||||
const nestedConfig = rawConfig?.componentConfig;
|
||||
const hasFlatConfig = rawConfig?.modal !== undefined || rawConfig?.sections !== undefined;
|
||||
const effectiveConfig = hasFlatConfig
|
||||
? rawConfig
|
||||
: (nestedConfig?.modal ? nestedConfig : rawConfig);
|
||||
|
||||
const config: UniversalFormModalConfig = {
|
||||
...defaultConfig,
|
||||
...rawConfig,
|
||||
modal: { ...defaultConfig.modal, ...rawConfig?.modal },
|
||||
sections: rawConfig?.sections ?? defaultConfig.sections,
|
||||
saveConfig: { ...defaultConfig.saveConfig, ...rawConfig?.saveConfig },
|
||||
editMode: { ...defaultConfig.editMode, ...rawConfig?.editMode },
|
||||
...effectiveConfig,
|
||||
modal: { ...defaultConfig.modal, ...effectiveConfig?.modal },
|
||||
sections: effectiveConfig?.sections ?? defaultConfig.sections,
|
||||
saveConfig: { ...defaultConfig.saveConfig, ...effectiveConfig?.saveConfig },
|
||||
editMode: { ...defaultConfig.editMode, ...effectiveConfig?.editMode },
|
||||
};
|
||||
|
||||
// 테이블 목록
|
||||
|
||||
Reference in New Issue
Block a user