feat(worker): 근로자 상세 딥링크 연결 (/workers/:workerId)#65
Merged
Conversation
죽은 라우트였던 /workers/:workerId를 PlaceholderPage 대신 WorkerListPage로 연결한다. URL의 workerId 파라미터로 초기 선택 근로자를 결정하고, 근로자 행 클릭 시 로컬 상태 대신 라우트 이동으로 선택을 반영해 뒤로가기/딥링크가 모두 가능하도록 한다. 잘못된 workerId는 첫 번째 근로자로 폴백한다. Closes #54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
/workers/:workerId가 실제로는 아무 곳에서도 연결되지 않은 죽은 라우트였다 (PlaceholderPage). PEOPLE-001(WorkerListPage)이 이미 마스터-디테일 레이아웃으로 근로자 상세를 보여주므로, 별도 화면 대신 WorkerListPage가 URL 파라미터를 읽어 딥링크를 지원하도록 연결한다.변경 사항
routes.tsx:/workers/:workerId를 PlaceholderPage 대신WorkerListPage로 연결WorkerListPage.tsx:useParams로workerId를 읽어 초기 선택 근로자 결정, 잘못된 id는 첫 번째 근로자로 폴백. 근로자 행 클릭 시 로컬useState대신navigate(/workers/:id)로 선택을 반영 (뒤로가기로 이전 선택 복귀 가능), 기존?demoState=쿼리는 유지한 채 이동WorkerListPage.test.tsx:Routes로 감싸 라우트 매칭 테스트, 딥링크 렌더링·잘못된 id 폴백 테스트 추가완료 조건
/workers/:workerId접속 시 해당 근로자가 선택된 상태로 렌더링/workers/:id로 바뀜 (뒤로가기로 이전 선택 복귀 가능)검증
npm run lintnpm run testnpm run buildCloses #54