feat(client): Sidebar organization switcher 추가 - #216
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a980d678b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const handleActiveOrganizationChanged = () => { | ||
| void loadData(); |
There was a problem hiding this comment.
대시보드 홈에서 조직 A의 초기 조회나 수동 새로고침이 아직 끝나기 전에 Sidebar에서 조직 B로 전환하면 이 이벤트가 B 조회를 추가로 시작하지만, 기존 A 조회를 취소하거나 request sequence로 폐기하지 않습니다. A의 /apps, 권한, 팀 조회가 B보다 늦게 끝나는 느린 네트워크/대량 데이터 상황에서는 loadData의 후속 setOrganization/setWorkflowRows/setTeams가 새 조직 화면을 다시 A 데이터로 덮어써서 전환 직후 잘못된 조직 홈이 표시될 수 있으니, 활성 조직 변경 시 이전 요청 결과를 무시하는 가드를 추가하는 것이 안전합니다.
Useful? React with 👍 / 👎.
| const [currentResponse, organizationsResponse] = await Promise.all([ | ||
| apiClient.get('/organizations/current'), | ||
| apiClient.get('/organizations'), | ||
| ]); |
There was a problem hiding this comment.
현재 조직 조회는 성공했지만 새로 추가한 /organizations 목록 조회만 일시적으로 실패하는 경우에도 Promise.all 전체가 reject되어 catch에서 조직명, manager 여부, 목록을 모두 비웁니다. 이러면 기존에는 표시되던 현재 조직 badge와 manager-only 관리 navigation이 숨겨져서 조직 전환 기능의 보조 데이터 실패가 핵심 navigation까지 깨뜨리므로, /organizations/current 결과는 유지하고 목록 조회 실패 시에만 switcher 목록을 비활성화하는 식으로 분리하는 것이 안전합니다.
Useful? React with 👍 / 👎.
| setOrganizationName(response.data.name); | ||
| const [currentResponse, organizationsResponse] = await Promise.all([ | ||
| apiClient.get('/organizations/current'), | ||
| apiClient.get('/organizations'), |
There was a problem hiding this comment.
Sidebar의 organization 목록은 mount와 active organization 변경 이벤트에서만 다시 가져오는데, 같은 Sidebar의 알림 overlay에서 조직 초대를 수락하면 backend는 membership을 active로 바꾸고 notifications.changed만 보내며 active organization 변경 이벤트는 발생하지 않습니다. 따라서 사용자가 초대를 수락한 직후 새 조직이 switcher dropdown에 나타나지 않아 페이지를 새로고침해야 전환할 수 있으니, 초대 수락 성공 후 이 목록도 재조회하도록 연결해야 합니다.
Useful? React with 👍 / 👎.
변경 사항
is_manager기준으로내 조직/멤버 조직구분 표시 추가/dashboard로 이동/dashboard가 active organization 변경 event 수신 시 데이터를 재조회하도록 수정관련 이슈
Closes #MBA-137
변경 유형
테스트
npm run test -- --run app/features/dashboard/components/Sidebar.test.tsx app/dashboard/page.test.tsx npm run lint git diff --check