[Refactor/#208] 대시보드 - 플랫폼 변경(KAKAO -> META) - #217
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthrough이 PR은 광고 대시보드에서 지원하는 광고 플랫폼을 Kakao에서 Meta로 교체하는 변경입니다. 타입 정의, 데이터 조회 훅, UI 컴포넌트 전반에 걸쳐 일관되게 provider 상수와 매핑을 업데이트합니다. ChangesKakao에서 Meta로의 플랫폼 교체
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📚 Storybook 배포 완료
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/components/dashboard/platform/PlatformRoasTable.tsx (1)
11-15: ⚡ Quick win로고 매핑은 표시명 말고 provider 코드 기준으로 묶는 게 안전해요.
지금 구조는
displayName문자열이 바뀌면(Meta→메타같은 i18n) 로고 키 매칭이 같이 깨질 수 있습니다.GOOGLE | NAVER | META코드 기준으로 바로 매핑하면 안정성이 올라갑니다.제안 diff
+import type { TProviderType } from "`@/types/dashboard/overview`"; import type { IPlatformRankingItem } from "`@/types/dashboard/overview`"; -const platformLogoMap = { - Google: <GoogleLogo className="h-7 w-auto" />, +const platformLogoMap: Record<TProviderType, JSX.Element> = { + GOOGLE: <GoogleLogo className="h-7 w-auto" />, NAVER: <NaverLogo className="h-7 w-auto" />, - Meta: <MetaLogo className="h-7 w-auto" />, + META: <MetaLogo className="h-7 w-auto" />, }; - -type TPlatformName = keyof typeof platformLogoMap; const providerDisplayMap: Record<string, string> = { GOOGLE: "Google", NAVER: "NAVER", META: "Meta", }; function getPlatformLogo(provider: string) { - const name = getDisplayName(provider); - if (name in platformLogoMap) { - return platformLogoMap[name as TPlatformName]; + const normalized = provider.toUpperCase() as TProviderType; + if (normalized in platformLogoMap) { + return platformLogoMap[normalized]; } + const name = getDisplayName(provider); return ( <span className="flex h-7 w-7 items-center justify-center rounded-full bg-surface-300 font-caption text-text-muted"> {name[0]} </span> ); }As per coding guidelines,
src/**에서는 "타입 안정성: TypeScript 타입의 명확성 확인. any 사용 지양, 제네릭 활용 검토."를 우선 확인해야 합니다.Also applies to: 19-33
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/dashboard/platform/PlatformRoasTable.tsx` around lines 11 - 15, platformLogoMap currently keys off display names which breaks if i18n changes; update the mapping to use provider codes (e.g., GOOGLE, NAVER, META) and make it type-safe by introducing a ProviderCode union or enum and declaring platformLogoMap as Record<ProviderCode, JSX.Element>. Replace any access that used displayName (in PlatformRoasTable) to use the provider code field (e.g., row.provider or row.providerCode) when looking up the logo, and avoid any use of any by typing the provider field and the map explicitly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/hooks/dashboard/useOverviewRoasRankings.ts`:
- Around line 21-25: The call to getRoasRankings inside useOverviewRoasRankings
is using hardcoded dates ("2026-01-22" to "2026-03-22"), which breaks data
freshness; change it to use dynamic dates or passed-in query params instead:
update useOverviewRoasRankings to accept startDate/endDate (or compute them from
today and a configurable window), format them as YYYY-MM-DD, and pass those
values to getRoasRankings(orgId!, { startDate, endDate }) so the hook queries
the correct period rather than a fixed range.
In `@src/types/dashboard/overview.ts`:
- Line 2: TProviderType이 도메인 타입으로 정의됐지만 IBudgetsResponse.providerType와
IRoasRanking.provider가 여전히 string이라 타입 안전성이 약하니, 해당 필드들의 타입을 string에서
TProviderType으로 변경하세요; 파일 내에서 TProviderType을 임포트하거나 같은 파일에서 재사용하고,
IBudgetsResponse 및 IRoasRanking 타입 선언을 찾아 providerType / provider 필드의 타입을
TProviderType으로 교체한 뒤 전체 컴파일을 통과하는지 확인해 주세요.
---
Nitpick comments:
In `@src/components/dashboard/platform/PlatformRoasTable.tsx`:
- Around line 11-15: platformLogoMap currently keys off display names which
breaks if i18n changes; update the mapping to use provider codes (e.g., GOOGLE,
NAVER, META) and make it type-safe by introducing a ProviderCode union or enum
and declaring platformLogoMap as Record<ProviderCode, JSX.Element>. Replace any
access that used displayName (in PlatformRoasTable) to use the provider code
field (e.g., row.provider or row.providerCode) when looking up the logo, and
avoid any use of any by typing the provider field and the map explicitly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1616a3be-658a-425e-b32c-49f3db0235a8
📒 Files selected for processing (3)
src/components/dashboard/platform/PlatformRoasTable.tsxsrc/hooks/dashboard/useOverviewRoasRankings.tssrc/types/dashboard/overview.ts
YermIm
left a comment
There was a problem hiding this comment.
P4: 확인했습니다! 플랫폼 대시보드쪽도 같이 수정해주셔서 감사합니다!! :)
🚨 관련 이슈
#208
✨ 변경사항
✏️ 작업 내용
😅 미완성 작업
N/A
📢 논의 사항 및 참고 사항
N/A
Summary by CodeRabbit
변경사항