Skip to content

Commit

Permalink
feat: add new incident view pages for Root Cause and Description; upd…
Browse files Browse the repository at this point in the history
…ate icon properties and breadcrumb links
  • Loading branch information
simlarsen committed Jan 14, 2025
1 parent 0375e8c commit da7860f
Show file tree
Hide file tree
Showing 12 changed files with 335 additions and 100 deletions.
1 change: 1 addition & 0 deletions Common/Types/Icon/IconProp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ enum IconProp {
Bold = "Bold",
Italic = "Italic",
Underline = "Underline",
WrenchScrewdriver = "WrenchScrewdriver",
Cube = "Cube",
Expand = "Expand",
Collapse = "Collapse",
Expand Down
6 changes: 6 additions & 0 deletions Common/UI/Components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,12 @@ const Icon: FunctionComponent<ComponentProps> = ({
d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"
/>,
);
} else if (icon === IconProp.WrenchScrewdriver) {
return getSvgWrapper(

<path strokeLinecap="round" strokeLinejoin="round" d="M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z" />

);
} else if (icon === IconProp.Text) {
return getSvgWrapper(
<path
Expand Down
2 changes: 1 addition & 1 deletion Dashboard/src/Components/Incident/IncidentFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const IncidentFeedElement: FunctionComponent<ComponentProps> = (
incidentFeed.incidentFeedEventType ===
IncidentFeedEventType.RemediationNotes
) {
icon = IconProp.Announcement;
icon = IconProp.Wrench;
}

if (
Expand Down
60 changes: 60 additions & 0 deletions Dashboard/src/Pages/Incidents/View/Description.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import PageMap from "../../../Utils/PageMap";
import RouteMap, { RouteUtil } from "../../../Utils/RouteMap";
import PageComponentProps from "../../PageComponentProps";
import Route from "Common/Types/API/Route";
import ObjectID from "Common/Types/ObjectID";
import ModelDelete from "Common/UI/Components/ModelDelete/ModelDelete";
import Navigation from "Common/UI/Utils/Navigation";
import Incident from "Common/Models/DatabaseModels/Incident";
import React, { FunctionComponent, ReactElement } from "react";
import CardModelDetail from "Common/UI/Components/ModelDetail/CardModelDetail";
import FormFieldSchemaType from "Common/UI/Components/Forms/Types/FormFieldSchemaType";
import FieldType from "Common/UI/Components/Types/FieldType";

const IncidentDelete: FunctionComponent<
PageComponentProps
> = (): ReactElement => {
const modelId: ObjectID = Navigation.getLastParamAsObjectID(1);

return (
<CardModelDetail
name="Incident Description"
cardProps={{
title: "Incident Description",
description:
"Description of this incident. This is visible on Status Page and is in markdown format.",
}}
editButtonText="Edit Incident Description"
isEditable={true}
formFields={[
{
field: {
description: true,
},
title: "Description",

fieldType: FormFieldSchemaType.Markdown,
required: false,
placeholder: "Description",
},
]}
modelDetailProps={{
showDetailsInNumberOfColumns: 1,
modelType: Incident,
id: "model-detail-incident-description",
fields: [
{
field: {
description: true,
},
title: "Description",
fieldType: FieldType.Markdown,
},
],
modelId: modelId,
}}
/>
);
};

export default IncidentDelete;
101 changes: 2 additions & 99 deletions Dashboard/src/Pages/Incidents/View/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -608,108 +608,11 @@ const IncidentView: FunctionComponent<
/>
</div>

<CardModelDetail
name="Incident Description"
cardProps={{
title: "Incident Description",
description:
"Description of this incident. This is visible on Status Page and is in markdown format.",
}}
editButtonText="Edit Incident Description"
isEditable={true}
formFields={[
{
field: {
description: true,
},
title: "Description",

fieldType: FormFieldSchemaType.Markdown,
required: false,
placeholder: "Description",
},
]}
modelDetailProps={{
showDetailsInNumberOfColumns: 1,
modelType: Incident,
id: "model-detail-incident-description",
fields: [
{
field: {
description: true,
},
title: "Description",
fieldType: FieldType.Markdown,
},
],
modelId: modelId,
}}
/>


<CardModelDetail
name="Root Cause"
cardProps={{
title: "Root Cause",
description:
"Why did this incident happen? Here is the root cause of this incident.",
}}
isEditable={false}
modelDetailProps={{
showDetailsInNumberOfColumns: 1,
modelType: Incident,
id: "model-detail-incident-root-cause",
fields: [
{
field: {
rootCause: true,
},
title: "",
placeholder: "No root cause identified for this incident.",
fieldType: FieldType.Markdown,
},
],
modelId: modelId,
}}
/>


<CardModelDetail
name="Remediation Notes"
cardProps={{
title: "Remediation Notes",
description:
"What steps should be taken to resolve this incident? Here are the remediation notes.",
}}
editButtonText="Edit Remediation Notes"
isEditable={true}
formFields={[
{
field: {
remediationNotes: true,
},
title: "Remediation Notes",

fieldType: FormFieldSchemaType.Markdown,
required: true,
placeholder: "Remediation Notes",
},
]}
modelDetailProps={{
showDetailsInNumberOfColumns: 1,
modelType: Incident,
id: "model-detail-incident-remediation-notes",
fields: [
{
field: {
remediationNotes: true,
},
title: "Remediation Notes",
placeholder: "No remediation notes added for this incident.",
fieldType: FieldType.Markdown,
},
],
modelId: modelId,
}}
/>

{telemetryQuery &&
telemetryQuery.telemetryType === TelemetryType.Log &&
Expand Down
61 changes: 61 additions & 0 deletions Dashboard/src/Pages/Incidents/View/Remediation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import PageMap from "../../../Utils/PageMap";
import RouteMap, { RouteUtil } from "../../../Utils/RouteMap";
import PageComponentProps from "../../PageComponentProps";
import Route from "Common/Types/API/Route";
import ObjectID from "Common/Types/ObjectID";
import ModelDelete from "Common/UI/Components/ModelDelete/ModelDelete";
import Navigation from "Common/UI/Utils/Navigation";
import Incident from "Common/Models/DatabaseModels/Incident";
import React, { FunctionComponent, ReactElement } from "react";
import CardModelDetail from "Common/UI/Components/ModelDetail/CardModelDetail";
import FormFieldSchemaType from "Common/UI/Components/Forms/Types/FormFieldSchemaType";
import FieldType from "Common/UI/Components/Types/FieldType";

const IncidentDelete: FunctionComponent<
PageComponentProps
> = (): ReactElement => {
const modelId: ObjectID = Navigation.getLastParamAsObjectID(1);

return (
<CardModelDetail
name="Remediation Notes"
cardProps={{
title: "Remediation Notes",
description:
"What steps should be taken to resolve this incident? Here are the remediation notes.",
}}
editButtonText="Edit Remediation Notes"
isEditable={true}
formFields={[
{
field: {
remediationNotes: true,
},
title: "Remediation Notes",

fieldType: FormFieldSchemaType.Markdown,
required: true,
placeholder: "Remediation Notes",
},
]}
modelDetailProps={{
showDetailsInNumberOfColumns: 1,
modelType: Incident,
id: "model-detail-incident-remediation-notes",
fields: [
{
field: {
remediationNotes: true,
},
title: "Remediation Notes",
placeholder: "No remediation notes added for this incident.",
fieldType: FieldType.Markdown,
},
],
modelId: modelId,
}}
/>
);
};

export default IncidentDelete;
47 changes: 47 additions & 0 deletions Dashboard/src/Pages/Incidents/View/RootCause.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import PageMap from "../../../Utils/PageMap";
import RouteMap, { RouteUtil } from "../../../Utils/RouteMap";
import PageComponentProps from "../../PageComponentProps";
import Route from "Common/Types/API/Route";
import ObjectID from "Common/Types/ObjectID";
import ModelDelete from "Common/UI/Components/ModelDelete/ModelDelete";
import Navigation from "Common/UI/Utils/Navigation";
import Incident from "Common/Models/DatabaseModels/Incident";
import React, { FunctionComponent, ReactElement } from "react";
import CardModelDetail from "Common/UI/Components/ModelDetail/CardModelDetail";
import FieldType from "Common/UI/Components/Types/FieldType";

const IncidentDelete: FunctionComponent<
PageComponentProps
> = (): ReactElement => {
const modelId: ObjectID = Navigation.getLastParamAsObjectID(1);

return (
<CardModelDetail
name="Root Cause"
cardProps={{
title: "Root Cause",
description:
"Why did this incident happen? Here is the root cause of this incident.",
}}
isEditable={false}
modelDetailProps={{
showDetailsInNumberOfColumns: 1,
modelType: Incident,
id: "model-detail-incident-root-cause",
fields: [
{
field: {
rootCause: true,
},
title: "",
placeholder: "No root cause identified for this incident.",
fieldType: FieldType.Markdown,
},
],
modelId: modelId,
}}
/>
);
};

export default IncidentDelete;
37 changes: 37 additions & 0 deletions Dashboard/src/Pages/Incidents/View/SideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,43 @@ const DashboardSideMenu: FunctionComponent<ComponentProps> = (
}}
icon={IconProp.Info}
/>


<SideMenuItem
link={{
title: "Description",
to: RouteUtil.populateRouteParams(
RouteMap[PageMap.INCIDENT_VIEW_DESCRIPTION] as Route,
{ modelId: props.modelId },
),
}}
icon={IconProp.Chat}
/>



<SideMenuItem
link={{
title: "Root Cause",
to: RouteUtil.populateRouteParams(
RouteMap[PageMap.INCIDENT_VIEW_ROOT_CAUSE] as Route,
{ modelId: props.modelId },
),
}}
icon={IconProp.Cube}
/>

<SideMenuItem
link={{
title: "Remediation",
to: RouteUtil.populateRouteParams(
RouteMap[PageMap.INCIDENT_VIEW_REMEDIATION] as Route,
{ modelId: props.modelId },
),
}}
icon={IconProp.Wrench}
/>

<SideMenuItem
link={{
title: "State Timeline",
Expand Down
Loading

0 comments on commit da7860f

Please sign in to comment.