Update URL structure#235
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the frontend routing to support the new form URL structure requested in #228, moving form navigation under /studies/[studyId]/[submissionId]/[slug] and introducing shared helpers for route params.
Changes:
- Add
/studies/[study_id]/[submission_id]/[slug]page and update form navigation URLs to includestudyId. - Introduce
useRouteParamscomposable for consistent route param coercion. - Add new
/startpage and update the navbar “New registration” link accordingly.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/pages/studies/[study_id]/index.vue | Uses useStudyId() and updates the study query wiring for the new route param handling. |
| frontend/pages/studies/[study_id]/[submission_id]/[slug].vue | Switches to useSubmissionId()/useStepSlug() and gates rendering on slug presence. |
| frontend/pages/start.vue | Adds new “start new registration” page that creates a study and routes to /studies/:id. |
| frontend/composables/useRouteParams.ts | Adds reusable helpers for route param normalization. |
| frontend/components/study_detail/AvailableActions.vue | Updates “Continue editing” URL to the new studies-based route and switches tiles to NuxtLink. |
| frontend/components/shared/FormWrapper.vue | Updates step navigation to the new studies-based URL format. |
| frontend/components/layout/NavBar.vue | Updates “New registration” nav link to /start. |
Comments suppressed due to low confidence (1)
frontend/pages/studies/[study_id]/index.vue:7
GetStudyQueryVariablesis imported but never used. This will typically trip lint/typecheck in this repo; either remove the import or use it as the second generic foruseQuery(e.g.,useQuery<GetStudyQuery, GetStudyQueryVariables>(...)) so the variables function is type-checked.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
EdoStorm96
left a comment
There was a problem hiding this comment.
While I think this is a good idea, I would prefer folder names to be camelCase i/o snake_case (even though I started doing it in snake_case ... It turns out this is not ideal ... Could you change it to this?
With AvailableActions, there will be some merge issues with #233, but we'll cross that bridge when we get there ...
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Closes #228
Moves the start page to
/startand the form pages to/studies/studyId/submissionId/slug.