Skip to content

Commit

Permalink
feat: change iap url structure
Browse files Browse the repository at this point in the history
  • Loading branch information
deeonwuli committed Nov 7, 2024
1 parent bfd1f04 commit d1a6f6f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/webapp/components/layout/side-bar/SideBarContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export const SideBarContent: React.FC<SideBarContentProps> = React.memo(
component={NavLink}
to={
value === RouteName.EVENT_TRACKER ||
value === RouteName.IM_TEAM_BUILDER
value === RouteName.IM_TEAM_BUILDER ||
value === RouteName.INCIDENT_ACTION_PLAN
? routes[value].replace(
":id",
getCurrentEventTracker()?.id || ""
Expand Down
4 changes: 2 additions & 2 deletions src/webapp/hooks/useRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const routes: Record<RouteName, string> = {
[RouteName.EDIT_FORM]: `/edit/${formType}/:id`,
[RouteName.EVENT_TRACKER]: "/event-tracker/:id",
[RouteName.IM_TEAM_BUILDER]: "/incident-management-team-builder/:id",
[RouteName.INCIDENT_ACTION_PLAN]: "/incident-action-plan",
[RouteName.INCIDENT_ACTION_PLAN]: "/:id/incident-action-plan",
[RouteName.RESOURCES]: "/resources",
[RouteName.DASHBOARD]: "/",
} as const;
Expand All @@ -41,7 +41,7 @@ type RouteParams = {
[RouteName.EDIT_FORM]: { formType: FormType; id: string };
[RouteName.EVENT_TRACKER]: { id: string };
[RouteName.IM_TEAM_BUILDER]: { id: string };
[RouteName.INCIDENT_ACTION_PLAN]: undefined;
[RouteName.INCIDENT_ACTION_PLAN]: { id: string };
[RouteName.RESOURCES]: undefined;
[RouteName.DASHBOARD]: undefined;
};
Expand Down
5 changes: 4 additions & 1 deletion src/webapp/pages/form-page/useForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,10 @@ export function useForm(formType: FormType, id?: Id): State {
});
break;
case "incident-response-action":
if (currentEventTracker?.id) goTo(RouteName.INCIDENT_ACTION_PLAN);
if (currentEventTracker?.id)
goTo(RouteName.INCIDENT_ACTION_PLAN, {
id: currentEventTracker?.id,
});
setGlobalMessage({
text: i18n.t(`Incident Response Actions saved successfully`),
type: "success",
Expand Down

0 comments on commit d1a6f6f

Please sign in to comment.