Skip to content

Commit

Permalink
chore: merge with iap
Browse files Browse the repository at this point in the history
  • Loading branch information
9sneha-n committed Oct 22, 2024
2 parents 8a23e17 + ad88b67 commit e3262b0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
3 changes: 1 addition & 2 deletions src/webapp/components/layout/side-bar/SideBarContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ export const SideBarContent: React.FC<SideBarContentProps> = React.memo(
component={NavLink}
to={
value === RouteName.EVENT_TRACKER ||
value === RouteName.IM_TEAM_BUILDER ||
value === RouteName.INCIDENT_ACTION_PLAN
value === RouteName.IM_TEAM_BUILDER
? 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/:id",
[RouteName.INCIDENT_ACTION_PLAN]: "/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]: { id: string };
[RouteName.INCIDENT_ACTION_PLAN]: undefined;
[RouteName.RESOURCES]: undefined;
[RouteName.DASHBOARD]: undefined;
};
Expand Down
10 changes: 2 additions & 8 deletions src/webapp/pages/form-page/useForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,7 @@ export function useForm(formType: FormType, id?: Id): State {
});
break;
case "incident-response-action":
if (currentEventTracker?.id)
goTo(RouteName.INCIDENT_ACTION_PLAN, {
id: currentEventTracker.id,
});
if (currentEventTracker?.id) goTo(RouteName.INCIDENT_ACTION_PLAN);
setGlobalMessage({
text: i18n.t(`Incident Response Actions saved successfully`),
type: "success",
Expand Down Expand Up @@ -325,12 +322,9 @@ export function useForm(formType: FormType, id?: Id): State {
id: currentEventTracker.id,
});
break;

case "incident-action-plan":
case "incident-response-action":
goTo(RouteName.INCIDENT_ACTION_PLAN, {
id: currentEventTracker.id,
});
goTo(RouteName.INCIDENT_ACTION_PLAN);
break;
default:
goTo(RouteName.EVENT_TRACKER, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useCallback } from "react";
import i18n from "../../../utils/i18n";
import { Layout } from "../../components/layout/Layout";
import { useParams } from "react-router-dom";
import { useCurrentEventTracker } from "../../contexts/current-event-tracker-context";
import { useIncidentActionPlan } from "./useIncidentActionPlan";
import { Box, Typography } from "@material-ui/core";
Expand All @@ -13,10 +12,9 @@ import { Loader } from "../../components/loader/Loader";
import { ResponseActionTable } from "./ResponseActionTable";

export const IncidentActionPlanPage: React.FC = React.memo(() => {
const { id } = useParams<{
id: string;
}>();
const { getCurrentEventTracker } = useCurrentEventTracker();
const currentEventTracker = getCurrentEventTracker();
const id = currentEventTracker?.id || "";

const {
actionPlanSummary,
Expand All @@ -42,7 +40,7 @@ export const IncidentActionPlanPage: React.FC = React.memo(() => {
return (
<Layout
title={i18n.t("Incident Action Plan")}
subtitle={i18n.t(getCurrentEventTracker()?.name || "")}
subtitle={i18n.t(currentEventTracker?.name || "")}
>
{!actionPlanSummary && responseActionRows.length === 0 && !summaryError && <Loader />}
{!incidentActionExists ? (
Expand Down

0 comments on commit e3262b0

Please sign in to comment.