fix(ui): 모니터링/디자인시스템 런타임 에러 해소 #88
No reviewers
레이블
레이블 없음
마일스톤 없음
담당자 없음
참여자 2명
알림
마감일
마감일이 설정되지 않았습니다.
의존성
No dependencies set.
Reference: gc/kcg-ai-monitoring#88
불러오는 중...
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/runtime-errors-monitoring-designsystem"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
변경 사항
브라우저 콘솔에 찍힌 2건 런타임 에러 해소
1.
/monitoring—SystemStatusPanelTypeErrorUncaught TypeError: Cannot read properties of undefined (reading 'toLocaleString') at SystemStatusPanel (SystemStatusPanel.tsx:104:48)stats ? \${stats.total.toLocaleString()}건` : '-'.stats객체 자체는 존재하나total필드가undefined` 인 경우 (백엔드 응답이 기대 shape 와 다를 때) 가 있음.stats?.total != null ? ${stats.total.toLocaleString()}건 : '-'/ 각 필드 동일stats.critical ?? 0식 fallback2.
/design-system.html—CatalogBadges렌더 실패Each child in a list should have a unique "key" prop(Warning)Uncaught Error: Objects are not valid as a React child (found: object with keys {ko, en})(Throw — 페이지 렌더 중단)shared/constants/performanceStatus.ts의PERFORMANCE_STATUS_META의 meta 는{intent, hex, label: {ko, en}}형식. 즉code필드가 없음 →Object.values(items)순회 +<Trk key={meta.code}>는 undefined 중복 keylabel이{ko, en}객체 →getKoLabel이 이 객체를 그대로 반환 →<Badge>{label}</Badge>에서 React child 가 객체 → throwfallback: {ko, en}패턴이라 무사.performanceStatus만label객체를 쓴다. 이는 admin 페이지들(PerformanceMonitoring,DataRetentionPolicy,DataModelVerification) 이meta.label.ko/meta.label.en을 직접 참조하므로 기존 카탈로그 자체는 건드리지 않고CatalogSection렌더러만 두 포맷 수용하도록 확장.design-system/sections/CatalogSection.tsx):Object.values()→Object.entries()로 순회해 Record key 를 안정적 식별자로 사용AnyMeta.label타입을string | {ko, en}로 확장getKoLabel우선순위:fallback.ko→label.ko→label(문자열) →code→ keygetEnLabel우선순위:fallback.en→label.en→ undefined<Trk key={key}>+displayCode = meta.code ?? key테스트
npx tsc --noEmit통과 (0 에러)/monitoring접속 → 콘솔 TypeError 재현 안 됨 확인/design-system.html카탈로그 섹션 PERFORMANCE_STATUS 배지 10개 정상 렌더 + 콘솔 경고 없음 확인영향
fallback: {ko, en}패턴 유지, 동작 영향 없음관련
### SystemStatusPanel TypeError - 증상: /monitoring 에서 Uncaught TypeError: Cannot read properties of undefined (reading 'toLocaleString') - 원인: stats 객체는 존재하나 total 필드가 undefined 인 경우 (백엔드 응답이 기대 shape 와 다를 때) 크래시 - 수정: stats?.total != null ? ... / stats.critical ?? 0 식 null-safe 전환 (total/clusterCount/gearGroups/critical/high/medium/low 전부) ### CatalogBadges 렌더링 오류 - 증상: /design-system.html 에서 (1) Each child in a list should have a unique "key" prop (2) Objects are not valid as a React child (found: object with keys {ko, en}) - 원인: PERFORMANCE_STATUS_META 의 meta 는 {intent, hex, label: {ko, en}} 형식. code 필드 없고 label 이 객체. - Object.values() + <Trk key={meta.code}> 로 undefined key 중복 - getKoLabel 이 meta.label (객체) 그대로 반환해 Badge children 에 객체 주입 다른 카탈로그는 fallback: {ko, en} 패턴이라 문제 없음 (performanceStatus 만 label 객체) - 수정: - Object.entries() 로 순회해 Record key 를 안정적 식별자로 사용 - AnyMeta.label 타입을 string | {ko,en} 확장 - getKoLabel/getEnLabel 우선순위: fallback.ko → label.ko → label(문자열) → code → key - PERFORMANCE_STATUS_META 자체는 변경 안 함 (admin 페이지들이 label.ko/label.en 직접 참조 중) ### 검증 - npx tsc --noEmit 통과 - pre-commit tsc+ESLint 통과Hotfix 승인: SystemStatusPanel null-safe + CatalogBadges label 객체 렌더링