refactor: 코드 정리 및 불필요한 로그 제거
- scheduleService.ts에서 스케줄 생성 로직을 간소화하고, 불필요한 줄바꿈을 제거하여 가독성을 향상시켰습니다. - v2-sales-order-modal-layout.json에서 JSON 포맷을 정리하여 일관성을 유지했습니다. - page.tsx, ScreenModal.tsx, ScreenDesigner.tsx, V2Input.tsx, V2Select.tsx, V2SelectConfigPanel.tsx, SimpleRepeaterTableComponent.tsx, ButtonPrimaryComponent.tsx, FileUploadComponent.tsx 등 여러 파일에서 디버깅 로그를 제거하여 코드의 깔끔함을 유지했습니다. - 전반적으로 코드의 가독성을 높이고, 불필요한 로그를 제거하여 유지보수성을 개선했습니다.
This commit is contained in:
@@ -1098,28 +1098,10 @@ export const ButtonPrimaryComponent: React.FC<ButtonPrimaryComponentProps> = ({
|
||||
const screenContextFormData = screenContext?.formData || {};
|
||||
const propsFormData = formData || {};
|
||||
|
||||
// 🔧 디버그: formData 소스 확인
|
||||
console.log("🔍 [v2-button-primary] formData 소스 확인:", {
|
||||
propsFormDataKeys: Object.keys(propsFormData),
|
||||
screenContextFormDataKeys: Object.keys(screenContextFormData),
|
||||
propsHasCompanyImage: "company_image" in propsFormData,
|
||||
propsHasCompanyLogo: "company_logo" in propsFormData,
|
||||
screenHasCompanyImage: "company_image" in screenContextFormData,
|
||||
screenHasCompanyLogo: "company_logo" in screenContextFormData,
|
||||
});
|
||||
|
||||
// 병합: splitPanelParentData를 기본으로, props.formData, screenContext.formData 순으로 오버라이드
|
||||
// (일반 폼 필드는 props.formData, RepeaterFieldGroup은 screenContext.formData에 있음)
|
||||
let effectiveFormData = { ...propsFormData, ...screenContextFormData };
|
||||
|
||||
console.log("🔍 [v2-button-primary] effectiveFormData 병합 결과:", {
|
||||
keys: Object.keys(effectiveFormData),
|
||||
hasCompanyImage: "company_image" in effectiveFormData,
|
||||
hasCompanyLogo: "company_logo" in effectiveFormData,
|
||||
companyImageValue: effectiveFormData.company_image,
|
||||
companyLogoValue: effectiveFormData.company_logo,
|
||||
});
|
||||
|
||||
// 분할 패널 우측이고 formData가 비어있으면 splitPanelParentData 사용
|
||||
if (splitPanelPosition === "right" && Object.keys(effectiveFormData).length === 0 && splitPanelParentData) {
|
||||
effectiveFormData = { ...splitPanelParentData };
|
||||
@@ -1289,20 +1271,18 @@ export const ButtonPrimaryComponent: React.FC<ButtonPrimaryComponentProps> = ({
|
||||
// 🔧 component.style에서 background/backgroundColor 충돌 방지 (width/height는 허용)
|
||||
const userStyle = component.style
|
||||
? Object.fromEntries(
|
||||
Object.entries(component.style).filter(
|
||||
([key]) => !["background", "backgroundColor"].includes(key),
|
||||
),
|
||||
Object.entries(component.style).filter(([key]) => !["background", "backgroundColor"].includes(key)),
|
||||
)
|
||||
: {};
|
||||
|
||||
// 🔧 사용자가 설정한 크기 우선 사용, 없으면 100%
|
||||
const buttonWidth = component.size?.width ? `${component.size.width}px` : (style?.width || "100%");
|
||||
const buttonHeight = component.size?.height ? `${component.size.height}px` : (style?.height || "100%");
|
||||
const buttonWidth = component.size?.width ? `${component.size.width}px` : style?.width || "100%";
|
||||
const buttonHeight = component.size?.height ? `${component.size.height}px` : style?.height || "100%";
|
||||
|
||||
const buttonElementStyle: React.CSSProperties = {
|
||||
width: buttonWidth,
|
||||
height: buttonHeight,
|
||||
minHeight: "32px", // 🔧 최소 높이를 32px로 줄임
|
||||
minHeight: "32px", // 🔧 최소 높이를 32px로 줄임
|
||||
border: "none",
|
||||
borderRadius: "0.5rem",
|
||||
backgroundColor: finalDisabled ? "#e5e7eb" : buttonColor,
|
||||
@@ -1328,26 +1308,26 @@ export const ButtonPrimaryComponent: React.FC<ButtonPrimaryComponentProps> = ({
|
||||
// 버튼 텍스트 결정 (다양한 소스에서 가져옴)
|
||||
// "기본 버튼"은 컴포넌트 생성 시 기본값이므로 무시
|
||||
const labelValue = component.label === "기본 버튼" ? undefined : component.label;
|
||||
|
||||
|
||||
// 액션 타입에 따른 기본 텍스트 (modal 액션과 동일하게)
|
||||
const actionType = processedConfig.action?.type || component.componentConfig?.action?.type;
|
||||
const actionDefaultText: Record<string, string> = {
|
||||
save: "저장",
|
||||
delete: "삭제",
|
||||
delete: "삭제",
|
||||
modal: "등록",
|
||||
edit: "수정",
|
||||
copy: "복사",
|
||||
close: "닫기",
|
||||
cancel: "취소",
|
||||
};
|
||||
|
||||
const buttonContent =
|
||||
processedConfig.text ||
|
||||
component.webTypeConfig?.text ||
|
||||
component.componentConfig?.text ||
|
||||
component.config?.text ||
|
||||
|
||||
const buttonContent =
|
||||
processedConfig.text ||
|
||||
component.webTypeConfig?.text ||
|
||||
component.componentConfig?.text ||
|
||||
component.config?.text ||
|
||||
component.style?.labelText ||
|
||||
labelValue ||
|
||||
labelValue ||
|
||||
actionDefaultText[actionType as string] ||
|
||||
"버튼";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user