Commit Graph

45 Commits

Author SHA1 Message Date
kjs 28ef7e1226 fix: Enhance error handling and validation messages in form data operations
- Integrated `formatPgError` utility to provide user-friendly error messages based on PostgreSQL error codes during form data operations.
- Updated error responses in `saveFormData`, `saveFormDataEnhanced`, `updateFormData`, and `updateFormDataPartial` to include specific messages based on the company context.
- Improved error handling in the frontend components to display relevant error messages from the server response, ensuring users receive clear feedback on save operations.
- Enhanced the required field validation by incorporating NOT NULL metadata checks across various components, improving the accuracy of form submissions.

These changes improve the overall user experience by providing clearer error messages and ensuring that required fields are properly validated based on both manual settings and database constraints.
2026-03-10 14:47:05 +09:00
DDD1542 d686c385e0 feat: Implement edit mode detection in SelectedItemsDetailInputComponent
- Added logic to detect edit mode based on URL parameters and existing data IDs.
- Enhanced value retrieval for form fields to prioritize original data in edit mode, ensuring accurate updates.
- Removed redundant edit mode detection comments to streamline the code and improve clarity.
2026-02-27 11:57:21 +09:00
kmh 95c8148787 Merge branch 'feature/v2-renewal' of http://39.117.244.52:3000/kjs/ERP-node into jskim-node 2026-02-26 16:51:12 +09:00
DDD1542 43ead0e7f2 feat: Enhance SelectedItemsDetailInputComponent with sourceKeyField auto-detection and FK mapping
- Implemented automatic detection of sourceKeyField based on component configuration, improving flexibility in data handling.
- Enhanced the SelectedItemsDetailInputConfigPanel to support automatic FK detection and mapping, streamlining the configuration process.
- Updated the database connection logic to handle DATE types correctly, preventing timezone-related issues.
- Improved overall component performance by optimizing memoization and state management for better user experience.
2026-02-26 16:39:06 +09:00
SeongHyun Kim b8569c6641 Merge branch 'ksh-v2-work' 2026-02-24 16:41:29 +09:00
SeongHyun Kim df8cbb3e80 feat(pop): 액션 아키텍처 + 모달 시스템 구현 (STEP 0~7)
- executePopAction / usePopAction 훅 신규 생성
- pop-button을 usePopAction 기반으로 리팩토링
- PopModalDefinition 타입 + MODAL_SIZE_PRESETS 정의
- PopDesignerContext 신규 생성 (모달 탭 상태 공유)
- PopDesigner에 모달 탭 UI 추가 (메인 캔버스 / 모달 캔버스 전환)
- PopCanvas에 접이식 ModalSizeSettingsPanel + ModalThumbnailPreview 구현
- PopViewerWithModals 신규 생성 (뷰어 모달 렌더링 + 스택 관리)
- FULL 모달 전체화면 지원 (h-dvh, w-screen, rounded-none)
- pop-string-list 카드 버튼 액션 연동
- pop-icon / SelectedItemsDetailInput lucide import 최적화
- tsconfig skipLibCheck 설정 추가

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-23 13:54:49 +09:00
DDD1542 a466e523d9 refactor: Remove password masking functionality from data services
- Deleted the `maskPasswordColumns` function from `dataService.ts` and its usage in data responses, simplifying the data handling process.
- Removed password handling logic from `DynamicFormService`, ensuring that password management is streamlined and centralized.
- Updated related components to reflect the removal of password masking, improving code clarity and maintainability.
2026-02-13 11:51:59 +09:00
DDD1542 b1ec674fa9 feat: Implement password masking and encryption in data services
- Added a new function `maskPasswordColumns` to mask password fields in data responses, ensuring sensitive information is not exposed.
- Integrated password handling in `DynamicFormService` to encrypt new passwords and maintain existing ones when empty values are provided.
- Enhanced logging for better tracking of password field updates and masking failures, improving overall security and debugging capabilities.
2026-02-12 16:32:23 +09:00
DDD1542 df04afa5de feat: Refactor EditModal for improved INSERT/UPDATE handling
- Introduced a new state flag `isCreateModeFlag` to determine the mode (INSERT or UPDATE) directly from the event, enhancing clarity in the modal's behavior.
- Updated the logic for initializing `originalData` and determining the mode, ensuring that the modal correctly identifies whether to create or update based on the provided data.
- Refactored the update logic to send the entire `formData` without relying on `originalData`, streamlining the update process.
- Enhanced logging for better debugging and understanding of the modal's state during operations.
2026-02-12 16:20:26 +09:00
DDD1542 9e1a54c738 feat: Add savedIds to UPSERT response and update related components
- Enhanced the UPSERT process in DataService to include savedIds in the response, allowing tracking of newly saved record IDs.
- Updated the dataApi to reflect the new savedIds field in the Promise return type.
- Modified the SelectedItemsDetailInputComponent to handle and inject saved mapping IDs into detail records, improving data integrity and management during the save process.
- Added logging for savedIds to facilitate debugging and tracking of saved records.
2026-02-10 10:06:53 +09:00
DDD1542 7118a723f3 feat: Implement orphan record deletion logic based on edit mode
- Updated the DataService to conditionally delete orphan records only when in EDIT mode, controlled by the deleteOrphans flag.
- Enhanced the SelectedItemsDetailInputComponent to determine the mode (EDIT or CREATE) based on the presence of existing database IDs, ensuring that orphan records are only deleted when necessary.
- Improved data integrity by preventing unintended deletions during the CREATE process.
2026-02-09 15:50:53 +09:00
DDD1542 d7f900d8ae refactor: Remove debug logs and optimize toast animations
- Removed debug console logs from the UPSERT process in the DataService to clean up the code.
- Disabled animations for Sonner toast notifications to enhance performance and user experience.
- Simplified the alert and dialog components by removing unnecessary animation classes, ensuring a smoother transition.
- Updated the SelectedItemsDetailInputComponent to load all related table data in edit mode, improving data management and consistency.
2026-02-09 15:37:28 +09:00
DDD1542 2b035ce6e1 Merge branch 'jskim-node' of http://39.117.244.52:3000/kjs/ERP-node into gbpark-node 2026-02-09 15:03:29 +09:00
DDD1542 2e500f066f feat: Add close confirmation dialog to ScreenModal and enhance SelectedItemsDetailInputComponent
- Implemented a confirmation dialog in ScreenModal to prevent accidental closure, allowing users to confirm before exiting and potentially losing unsaved data.
- Enhanced SelectedItemsDetailInputComponent by ensuring that base records are created even when detail data is absent, maintaining item-client mapping.
- Improved logging for better traceability during the UPSERT process and refined the handling of parent data mappings for more robust data management.
2026-02-09 13:22:48 +09:00
DDD1542 bb4d90fd58 refactor: Improve label toggling functionality in ScreenDesigner and enhance SelectedItemsDetailInputComponent
- Updated the label toggling logic in ScreenDesigner to allow toggling of labels for selected components or all components based on the current selection.
- Enhanced the SelectedItemsDetailInputComponent by implementing a caching mechanism for table columns and refining the logic for loading category options based on field groups.
- Introduced a new helper function to convert category codes to labels, improving the clarity and maintainability of the price calculation logic.
- Added support for determining the source table for field groups, facilitating better data management and retrieval.
2026-02-09 10:07:07 +09:00
DDD1542 79d8f0b160 refactor: Update ComponentsPanel and SelectedItemsDetailInputComponent for improved functionality
- Updated ComponentsPanel to clarify the usage of the "selected-items-detail-input" component, indicating its application in the context of adding items for clients.
- Enhanced SelectedItemsDetailInputComponent by introducing independent editing states for group entries, allowing for better management of item edits within groups.
- Adjusted input field heights and styles for consistency and improved user experience.
- Added a new property `maxEntries` to the FieldGroup interface to support 1:1 relationships and automatic entry generation.
- Implemented overflow support for the component to handle cases with many items, ensuring a smoother user interface.
2026-02-07 17:45:44 +09:00
SeongHyun Kim f8fb7d687e fix: SelectedItemsDetailInput 수정 모드에서 다중 레코드 로드 오류 수정
DynamicComponentRenderer에 selected-items-detail-input groupedData 전달 추가
SelectedItemsDetailInput에서 groupedData 우선 사용하도록 변경
ScreenModal editData 배열 처리 시 formData/selectedData 분리 저장
TextInput 수정 모드에서 채번 규칙 스킵 로직 추가
2026-01-09 17:42:33 +09:00
hjjeong 8f4c95d20d fix: SelectedItemsDetailInput 저장 시 NULL 레코드 생성 버그 수정
- beforeFormSave 이벤트에 skipDefaultSave 플래그 추가
- UPSERT 처리 시 기본 저장 로직 건너뛰기
- 빈 엔트리 필터링으로 불필요한 레코드 생성 방지
2026-01-08 17:40:50 +09:00
hjjeong e08c50c771 거래처 품목정보 거래처품번/단가 입력 없이 저장되도록 2026-01-06 15:01:50 +09:00
kjs 13fe9c97fe 오류 수정 2025-11-26 14:44:49 +09:00
kjs 611fe9f788 선택박스 설정 2025-11-26 09:32:55 +09:00
kjs a1819e749c fix: 탭 컴포넌트 menuObjid 전달, 카테고리 필터 복원, 설정 초기화 문제 해결
주요 수정사항:

1. 탭 컴포넌트 내 자식 화면에 menuObjid와 tableName 전달
   - TabsWidget에 menuObjid prop 추가
   - InteractiveScreenViewerDynamic를 통해 자식 화면에 전달
   - 채번 규칙 생성 시 올바른 메뉴 스코프 및 테이블명 적용

2. 백엔드: 화면 레이아웃 API에 tableName 추가
   - screenManagementService.getLayout()에서 테이블명 반환
   - LayoutData 타입에 tableName 필드 추가
   - 채번 규칙 생성 시 tableName 검증 강화

3. 카테고리 필터링 기능 복원
   - DataFilterConfigPanel에 menuObjid 전달
   - getCategoryValues API 사용으로 메뉴 스코프 적용
   - 새로고침 후 카테고리 값 자동 재로드
   - SplitPanelLayoutConfigPanel에 menuObjid 전달

4. 선택항목 상세입력 설정 패널 포커스 문제 해결
   - 로컬 입력 상태 추가로 실시간 속성 편집 패턴 적용
   - 텍스트 및 라벨 입력 시 포커스 유지

5. 테이블 리스트 설정 초기화 문제 해결
   - handleChange 함수에서 기존 config와 병합하여 전달
   - 다른 속성 손실 방지 (columns, dataFilter 등)

버그 수정:
- 채번 규칙 생성 시 빈 문자열 대신 null 전달
- 필터 설정 변경 시 컬럼 설정 초기화 방지
- 카테고리 컬럼 선택 시 셀렉트박스 표시
2025-11-25 15:55:05 +09:00
kjs 6e5e3a04f3 fix: 기존 필드의 자동 채우기 테이블 컬럼 초기 로드 추가
- 초기 렌더링 시 기존 필드들의 autoFillFromTable이 설정되어 있으면 컬럼 자동 로드
- useEffect로 localFields 초기화 시점에 모든 필드 순회하며 컬럼 로드
- 사용자가 저장된 설정을 열었을 때 즉시 컬럼 목록 표시

문제: 품목정보 테이블을 선택했지만 컬럼이 표시되지 않음
원인: 기존에 설정된 autoFillFromTable에 대한 컬럼이 초기 로드되지 않음
해결: 초기화 useEffect 추가로 기존 설정 복원
2025-11-20 17:52:40 +09:00
kjs 86eb9f0425 feat: 자동 채우기 테이블 선택 드롭다운 및 동적 컬럼 로드 추가
- 추가 입력 필드에서 자동 채우기 테이블을 드롭다운으로 선택 가능
- 텍스트 입력 대신 allTables에서 선택하는 방식으로 개선
- 테이블 선택 시 해당 테이블의 컬럼을 자동으로 로드
- autoFillTableColumns 상태로 필드별 테이블 컬럼 관리
- 선택한 테이블에 따라 컬럼 드롭다운이 동적으로 변경됨

사용자 경험 개선:
- 테이블명을 직접 입력하는 대신 목록에서 선택
- 선택한 테이블의 컬럼만 표시되어 혼란 방지
- 원본 테이블(기본) 또는 다른 테이블 선택 가능
2025-11-20 17:44:33 +09:00
kjs 6e92d1855a fix: SelectedItemsDetailInput 설정 패널에서 컬럼 자동 로드 추가
- 원본 테이블(sourceTable) 변경 시 컬럼 자동 로드
- 대상 테이블(targetTable) 변경 시 컬럼 자동 로드
- props로 받은 컬럼은 백업으로 사용하고, 내부에서 로드한 컬럼 우선 사용
- tableManagementApi.getColumnList() 사용하여 동적 로드

이제 원본/대상 테이블 선택 시 해당 테이블의 컬럼 목록이 자동으로 나타남
2025-11-20 17:37:51 +09:00
kjs c51cd7bc87 fix: 컴포넌트 설정 패널 config 병합 및 props 전달 개선
- TableListConfigPanel: handleNestedChange에서 전체 config 병합 로직 추가
- TableListComponent: checkbox.enabled 및 position 기본값 처리 (undefined시 기본값 사용)
- SelectedItemsDetailInputConfigPanel: handleChange에서 전체 config 병합 로직 추가
- SelectedItemsDetailInputConfigPanel: 원본 데이터 테이블 선택 disabled 조건 제거
- UnifiedPropertiesPanel: allTables 로드 및 ConfigPanel에 전달 추가

문제:
1. table-list 컴포넌트 체크박스 설정 변경 시 다른 설정 초기화
2. selected-items-detail-input 설정 변경 시 컴포넌트 이름 등 다른 속성 손실
3. 원본 데이터 테이블 선택이 비활성화되어 있음

해결:
- 모든 설정 패널에서 부분 업데이트 시 기존 config와 병합하도록 수정
- checkbox 관련 기본값 처리로 기존 컴포넌트 호환성 보장
- allTables를 별도로 로드하여 전체 테이블 목록 제공
2025-11-20 17:31:42 +09:00
kjs 86313c5e89 fix: SelectedItemsDetailInput 수정 모드에서 null 레코드 삽입 방지
- buttonActions.ts: formData가 배열인 경우 일반 저장 건너뜀
- SelectedItemsDetailInput이 UPSERT를 완료한 후 일반 저장이 실행되어 null 레코드가 삽입되던 문제 해결
- ScreenModal에서 그룹 레코드를 배열로 전달하는 경우 감지하여 처리
- skipDefaultSave 플래그가 제대로 작동하지 않던 문제 근본 해결
2025-11-20 15:07:26 +09:00
kjs 640351d812 refactor: SelectedItemsDetailInput 하드코딩 제거
- 중복 표시 제거: 품번/품명 하드코딩 삭제 (displayColumns로 이미 표시 중)
- 동적 텍스트: '입력된 품번' → '입력된 항목'으로 일반화
- 이제 어떤 필드 조합이든 동적으로 작동
2025-11-20 12:21:48 +09:00
kjs e3b78309fa 우측 패널 일괄삭제 기능 2025-11-20 11:58:43 +09:00
kjs 34cd7ba9e3 feat: 수정 모드 UPSERT 기능 구현
- SelectedItemsDetailInput 컴포넌트 수정 모드 지원
- 그룹화된 데이터 UPSERT API 추가 (/api/data/upsert-grouped)
- 부모 키 기준으로 기존 레코드 조회 후 INSERT/UPDATE/DELETE
- 각 레코드의 모든 필드 조합을 고유 키로 사용
- created_date 보존 (UPDATE 시)
- 수정 모드에서 groupByColumns 기준으로 관련 레코드 조회
- 날짜 타입 ISO 형식 자동 감지 및 포맷팅 (YYYY.MM.DD)

주요 변경사항:
- backend: dataService.upsertGroupedRecords() 메서드 구현
- backend: dataRoutes POST /api/data/upsert-grouped 엔드포인트 추가
- frontend: ScreenModal에서 groupByColumns 파라미터 전달
- frontend: SelectedItemsDetailInput 수정 모드 로직 추가
- frontend: 날짜 필드 타임존 제거 및 포맷팅 개선
2025-11-20 10:23:54 +09:00
kjs f4e4ee13e2 feat: 부모 데이터 매핑 기능 구현 (선택항목 상세입력 컴포넌트)
- 여러 테이블(거래처, 품목 등)에서 데이터를 가져와 자동 매핑 가능
- 각 매핑마다 소스 테이블, 원본 필드, 저장 필드를 독립적으로 설정
- 검색 가능한 Combobox로 테이블 및 컬럼 선택 UX 개선
- 소스 테이블 선택 시 해당 테이블의 컬럼 자동 로드
- 라벨, 컬럼명, 데이터 타입으로 검색 가능
- 세로 레이아웃으로 가독성 향상

기술적 변경사항:
- ParentDataMapping 인터페이스 추가 (sourceTable, sourceField, targetField)
- buttonActions.ts의 handleBatchSave에서 소스 테이블 기반 데이터 소스 자동 판단
- tableManagementApi.getColumnList() 사용하여 테이블 컬럼 동적 로드
- Command + Popover 조합으로 검색 가능한 Select 구현
- 각 매핑별 독립적인 컬럼 상태 관리 (mappingSourceColumns)
2025-11-19 13:22:49 +09:00
kjs b74cb94191 화면 복사기능 수정 2025-11-19 10:03:38 +09:00
kjs e1a5befdf7 feat: 기간별 단가 설정 기능 구현 - 자동 계산 시스템
- 선택항목 상세입력 컴포넌트 확장
  - 실시간 가격 계산 기능 추가 (할인율/할인금액, 반올림 방식)
  - 카테고리 값 기반 연산 매핑 시스템
  - 3단계 드릴다운 방식 설정 UI (메뉴 → 카테고리 → 값 매핑)

- 설정 가능한 계산 로직
  - autoCalculation 설정으로 계산 필드명 동적 지정
  - valueMapping으로 카테고리 코드와 연산 타입 매핑
  - 할인 방식: none/rate/amount
  - 반올림 방식: none/round/floor/ceil
  - 반올림 단위: 1/10/100/1000

- UI 개선
  - 입력 필드 가로 배치 (반응형 Grid)
  - 카테고리 타입 필드 옵션 로딩 개선
  - 계산 결과 필드 자동 표시 및 읽기 전용 처리
  - 날짜 입력 필드 네이티브 피커 지원

- API 연동
  - 2레벨 메뉴 목록 조회
  - 메뉴별 카테고리 컬럼 조회
  - 카테고리별 값 목록 조회

- 문서화
  - 기간별 단가 설정 가이드 작성
2025-11-18 16:12:47 +09:00
kjs 967b76591b 플레이스홀더 변경 2025-11-18 11:08:05 +09:00
kjs 4cd27639e6 fix: Collapsible 레이아웃 구조 수정
- CardContent 내부에서 CollapsibleContent가 제대로 렌더링되도록 구조 수정
- mb-2, mt-2로 간격 조정
- 오른쪽으로 밀려나는 문제 해결
2025-11-18 10:30:04 +09:00
kjs 7bb26e0e30 fix: Collapsible 변수 참조 오류 수정
- isGroupExpanded 변수를 올바르게 사용하도록 수정
- 불필요한 주석 제거
- map 함수에 return 문 추가
2025-11-18 10:28:07 +09:00
kjs def94c41f4 refactor: 설정 패널 UI 개선 - Collapsible로 정리
- 필드 그룹을 Collapsible로 변경하여 펼침/접힘 가능
- 항목 표시 설정도 Collapsible로 분리하여 깔끔하게 정리
- 그룹 제목에 displayItems 개수 표시
- 기본적으로 그룹은 펼쳐진 상태, 표시 설정은 접힌 상태
- ChevronDown/ChevronRight 아이콘으로 펼침 상태 표시
- 복잡한 설정을 단계적으로 볼 수 있어 가독성 대폭 향상
2025-11-18 10:25:28 +09:00
kjs eef1451c5a fix: 항목 표시 설정을 그룹별로 분리
- FieldGroup에 displayItems 추가 (그룹별 독립적인 표시 설정)
- SelectedItemsDetailInputConfig에서 전역 displayItems 제거
- renderDisplayItems에 groupId 파라미터 추가하여 그룹별 설정 사용
- 설정 패널에서 그룹별로 displayItems 관리
- 각 그룹마다 다른 표시 형식 가능 (예: 거래처 정보 vs 단가 정보)
- 그룹의 필드만 선택 가능하도록 필터링
2025-11-18 10:21:36 +09:00
kjs e234f88577 feat: 항목 표시 설정 기능 추가 (기본값, 빈 값 처리 포함)
- DisplayItem 타입 추가 (icon, field, text, badge)
- 필드별 표시 형식 지원 (text, currency, number, date, badge)
- 빈 값 처리 옵션 추가 (hide, default, blank)
- 기본값 설정 기능 추가
- 스타일 옵션 추가 (굵게, 밑줄, 기울임, 색상)
- renderDisplayItems 헬퍼 함수로 유연한 표시 렌더링
- SelectedItemsDetailInputConfigPanel에 항목 표시 설정 UI 추가
- displayItems가 없으면 기존 방식(모든 필드 나열)으로 폴백
2025-11-18 10:14:31 +09:00
kjs cddce40f35 fix: 첫 글자 입력 시 포커스 유지 문제 해결
- handleAddGroupEntry: + 추가 버튼 클릭 시 미리 빈 entry를 배열에 추가
- handleFieldChange: 기존 entry 업데이트만 수행 (새로운 entry 추가 로직 제거)
- 이제 첫 글자 입력 시에도 배열 길이가 변하지 않아 포커스가 유지됨
2025-11-18 10:02:27 +09:00
kjs 3d74b9deb2 fix: 선택항목 상세입력 컴포넌트 입력 시 포커스 유지 개선
- 입력 중 onFormDataChange 호출 제거하여 불필요한 리렌더링 방지
- 저장 버튼 클릭 시에만 데이터 전달하도록 변경 (beforeFormSave 이벤트)
- handleSave에서 beforeFormSave 이벤트 발생 및 100ms 대기
- 원본 데이터 표시 버그 수정 (modalData 중첩 구조 처리)
- fieldGroups 구조 감지 로직 수정 (details → fieldGroups)

이제 사용자가 타이핑할 때 포커스가 유지됩니다.
2025-11-18 10:00:56 +09:00
kjs e9268b3f00 feat: 선택항목 상세입력 컴포넌트 그룹별 독립 입력 구조로 개선
- 데이터 구조 변경: ItemData.details → ItemData.fieldGroups (그룹별 관리)
- 각 필드 그룹마다 독립적으로 여러 항목 추가/수정/삭제 가능
- renderFieldsByGroup: 그룹별 입력 항목 목록 + 편집 + 추가 버튼 구현
- renderGridLayout/renderCardLayout: 품목별 그룹 카드 표시로 단순화
- handleFieldChange: groupId 파라미터 추가 (itemId, groupId, entryId, fieldName, value)
- handleAddGroupEntry, handleRemoveGroupEntry, handleEditGroupEntry 핸들러 추가
- buttonActions handleBatchSave: fieldGroups 구조 처리하도록 수정
- 원본 데이터 표시 버그 수정: modalData의 중첩 구조 처리

사용 예:
- 품목 1
  - 그룹 1 (거래처 정보): 3개 항목 입력 가능
  - 그룹 2 (단가 정보): 5개 항목 입력 가능
- 각 항목 클릭 → 수정 가능
- 저장 시 모든 입력 항목이 개별 레코드로 저장됨
2025-11-18 09:56:49 +09:00
kjs 289677a971 fix: SelectedItemsDetailInput Select 빈 값 에러 수정 및 inputType 디버깅 로그 추가
- Select 컴포넌트에서 빈 문자열 value를 가진 SelectItem 제거
- category/code 타입 필드의 옵션 로딩 디버깅 로그 추가
- 빈 값 필터링으로 'SelectItem must not have empty value' 에러 해결
- codeCategory 자동 감지 로직 디버깅 강화
2025-11-17 15:59:25 +09:00
kjs bc557c4074 상세입력 컴포넌트 테이블 선택 기능 추가 2025-11-17 15:25:08 +09:00
kjs a6e6a14fd1 선택항목 상게입력 컴포넌트 구현 2025-11-17 12:23:45 +09:00