Skip to content

feat(admin/fe): 슈퍼어드민 brand picker UI#203

Open
bat1120 wants to merge 1 commit into
IM3-superadmin-brand-pickerfrom
IM3-superadmin-brand-picker-fe
Open

feat(admin/fe): 슈퍼어드민 brand picker UI#203
bat1120 wants to merge 1 commit into
IM3-superadmin-brand-pickerfrom
IM3-superadmin-brand-picker-fe

Conversation

@bat1120

@bat1120 bat1120 commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

구성

  • frontend/src/auth/AuthContext.tsx: User.role literal에 'superadmin' 추가
  • frontend/src/types/admin.ts: AdminBrand / SupportedIndustry / AdminBrandsResponse
  • frontend/src/api/client.ts: listAdminBrands, listAdminIndustries
  • frontend/src/hooks/useAdminBrands.ts: debounce 300ms + AbortController + 403 처리
  • frontend/src/components/admin/AdminBrandPicker.tsx: 모달 (검색 + 업종칩 + 페이징, 가맹점수·매출 표시)
  • frontend/src/App.tsx (SimulatorDashboard):
    • role==='superadmin' 시만 [브랜드 선택] FormField 노출
    • 선택 시 brand_name 오버라이드 + businessType 자동 설정
    • 해제 버튼

Test plan

  • tsc --noEmit clean
  • vite build 성공
  • prettier / eslint 통과
  • 수동: superadmin 로그인 → SimulatorDashboard 에 [브랜드 선택] 표시 확인
  • 수동: 클릭 → 모달 → 검색·필터·페이징 동작 확인
  • 수동: 선택 후 시뮬 실행 → payload.brand_name 이 picker 값으로 전송 확인
  • 수동: master/manager 로그인 → 버튼 비노출 확인

의존

Base 전략

현재 base = IM3-superadmin-brand-picker (BE 브랜치). 향후:

  1. BE PR feat(admin): superadmin brand picker — /admin/brands 라우터 #202 → dev 머지
  2. 본 PR rebase → base 를 dev 로 변경
  3. dev 머지

🤖 Generated with Claude Code

슈퍼어드민이 시뮬 입력폼에서 14571개 brand 검색·선택 가능.

- frontend/src/auth/AuthContext.tsx: User.role 에 'superadmin' 추가
- frontend/src/types/admin.ts: AdminBrand, SupportedIndustry, AdminBrandsResponse 타입
- frontend/src/api/client.ts: listAdminBrands, listAdminIndustries 메서드
- frontend/src/hooks/useAdminBrands.ts: debounce 300ms + AbortController + 403 핸들링
- frontend/src/components/admin/AdminBrandPicker.tsx: 모달 (검색 + 업종 필터칩 + 페이징)
  - 가맹점 수 / 평균 매출 표시
  - source 라벨 (FTC / 회원사)
  - ESC/backdrop 클릭으로 닫기
- frontend/src/App.tsx (SimulatorDashboard):
  - role==='superadmin' 일 때만 [브랜드 선택] FormField 노출
  - adminBrand 선택 시 brand_name 오버라이드 + businessType 자동 설정
  - 해제 버튼으로 picker 비활성화 가능

검증: tsc --noEmit clean / vite build 성공 / prettier 통과.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant