-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update URL paths and remove unused code #2118
Conversation
private static readonly JOB_ID_FRAGMENT_PARAM = 'job'; | ||
private static readonly LOI_ID_FRAGMENT_PARAM = 'site'; | ||
private static readonly SUBMISSION_ID_FRAGMENT_PARAM = 'submission'; | ||
private static readonly TASK_ID_FRAGMENT_PARAM = 'task'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @amysorto ! This will rename the fragments, but we also need the router to use the URI rather than URL fragment. The exact patterns are described in the issue descriptions. Please lmk if you have any questions!
@amysorto Gentle ping! |
f1ee798
to
eda4edc
Compare
I deleted everything inside |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some quick feedback, will do another pass tomorrow.
web/src/app/routing.module.ts
Outdated
@@ -95,6 +95,21 @@ const routes: Routes = [ | |||
component: TermsComponent, | |||
canActivate: [AuthGuard], | |||
}, | |||
{ | |||
path: `${NavigationService.SURVEY_SEGMENT}/:${NavigationService.SURVEY_ID}/${NavigationService.LOI_SEGMENT}/:${NavigationService.LOI_ID}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use destructuring assignment to make these constants more readable? ie somewhere above const {SURVEY_SEGMENT, LOI_SEGMENT, ...} = NavigationService;
?
this.setFragmentParams(new HttpParams({fromString: ''})); | ||
showSubmissionDetail(surveyId: string, loiId: string, submissionId: string) { | ||
this.router.navigateByUrl( | ||
`${NavigationService.SURVEY_SEGMENT}/${surveyId}/${NavigationService.LOI_SEGMENT}/${loiId}/${NavigationService.SUBMISSION_SEGMENT}/${submissionId}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Have you tests all routes manually?
@@ -186,7 +180,7 @@ export class NavigationService { | |||
taskId: string | |||
) { | |||
this.router.navigateByUrl( | |||
`${NavigationService.SURVEY_SEGMENT}/${surveyId}/${NavigationService.LOI_SEGMENT}/${loiId}/${NavigationService.SUBMISSION_SEGMENT}/${submissionId}/${NavigationService.TASK_SEGMENT}/${taskId}` | |||
`${SURVEY_SEGMENT}/${surveyId}/${LOI_SEGMENT}/${loiId}/${SUBMISSION_SEGMENT}/${submissionId}/${TASK_SEGMENT}/${taskId}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: Using taskId to identify the result will become problematic once we allow repeated tasks. That's out of scope for this PR, just wanted to call it out for future changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's good to know! Currently the taskId is used just to highlight the task
Fixes #1243
Also removed
LOI_JOB_ID_FRAGMENT_PARAM
since it not currently being used