Skip to content

Commit

Permalink
refactor: clean up unnecessary whitespace and improve code formatting…
Browse files Browse the repository at this point in the history
… across multiple files
  • Loading branch information
simlarsen committed Jan 14, 2025
1 parent da7860f commit 29565bc
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 138 deletions.
8 changes: 5 additions & 3 deletions Common/UI/Components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1077,9 +1077,11 @@ const Icon: FunctionComponent<ComponentProps> = ({
);
} 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" />

<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(
Expand Down
64 changes: 30 additions & 34 deletions Dashboard/src/Pages/Incidents/View/Description.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
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";
Expand All @@ -18,42 +14,42 @@ const IncidentDelete: FunctionComponent<

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: [
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: FieldType.Markdown,

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

Expand Down
6 changes: 0 additions & 6 deletions Dashboard/src/Pages/Incidents/View/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -608,12 +608,6 @@ const IncidentView: FunctionComponent<
/>
</div>







{telemetryQuery &&
telemetryQuery.telemetryType === TelemetryType.Log &&
telemetryQuery.telemetryQuery && (
Expand Down
64 changes: 30 additions & 34 deletions Dashboard/src/Pages/Incidents/View/Remediation.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
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";
Expand All @@ -18,43 +14,43 @@ const IncidentDelete: FunctionComponent<

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,
},
name="Remediation Notes"
cardProps={{
title: "Remediation Notes",

fieldType: FormFieldSchemaType.Markdown,
required: true,
placeholder: "Remediation Notes",
},
]}
modelDetailProps={{
showDetailsInNumberOfColumns: 1,
modelType: Incident,
id: "model-detail-incident-remediation-notes",
fields: [
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",
placeholder: "No remediation notes added for this incident.",
fieldType: FieldType.Markdown,

fieldType: FormFieldSchemaType.Markdown,
required: true,
placeholder: "Remediation Notes",
},
],
modelId: modelId,
}}
/>
]}
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,
}}
/>
);
};

Expand Down
50 changes: 23 additions & 27 deletions Dashboard/src/Pages/Incidents/View/RootCause.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
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";
Expand All @@ -17,30 +13,30 @@ const IncidentDelete: FunctionComponent<

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,
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,
},
],
modelId: modelId,
}}
/>
title: "",
placeholder: "No root cause identified for this incident.",
fieldType: FieldType.Markdown,
},
],
modelId: modelId,
}}
/>
);
};

Expand Down
3 changes: 0 additions & 3 deletions Dashboard/src/Pages/Incidents/View/SideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const DashboardSideMenu: FunctionComponent<ComponentProps> = (
icon={IconProp.Info}
/>


<SideMenuItem
link={{
title: "Description",
Expand All @@ -41,8 +40,6 @@ const DashboardSideMenu: FunctionComponent<ComponentProps> = (
icon={IconProp.Chat}
/>



<SideMenuItem
link={{
title: "Root Cause",
Expand Down
37 changes: 9 additions & 28 deletions Dashboard/src/Routes/IncidentsRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ const IncidentViewRemediation: LazyExoticComponent<
return import("../Pages/Incidents/View/Remediation");
});


const IncidentViewRootCause: LazyExoticComponent<
FunctionComponent<ComponentProps>
> = lazy(() => {
Expand Down Expand Up @@ -152,60 +151,42 @@ const IncidentsRoutes: FunctionComponent<ComponentProps> = (
}
/>


<PageRoute
path={RouteUtil.getLastPathForKey(
PageMap.INCIDENT_VIEW_REMEDIATION,
)}
<PageRoute
path={RouteUtil.getLastPathForKey(PageMap.INCIDENT_VIEW_REMEDIATION)}
element={
<Suspense fallback={Loader}>
<IncidentViewRemediation
{...props}
pageRoute={
RouteMap[PageMap.INCIDENT_VIEW_REMEDIATION] as Route
}
pageRoute={RouteMap[PageMap.INCIDENT_VIEW_REMEDIATION] as Route}
/>
</Suspense>
}
/>


<PageRoute
path={RouteUtil.getLastPathForKey(
PageMap.INCIDENT_VIEW_ROOT_CAUSE,
)}
<PageRoute
path={RouteUtil.getLastPathForKey(PageMap.INCIDENT_VIEW_ROOT_CAUSE)}
element={
<Suspense fallback={Loader}>
<IncidentViewRootCause
{...props}
pageRoute={
RouteMap[PageMap.INCIDENT_VIEW_ROOT_CAUSE] as Route
}
pageRoute={RouteMap[PageMap.INCIDENT_VIEW_ROOT_CAUSE] as Route}
/>
</Suspense>
}
/>


<PageRoute
path={RouteUtil.getLastPathForKey(
PageMap.INCIDENT_VIEW_DESCRIPTION,
)}
<PageRoute
path={RouteUtil.getLastPathForKey(PageMap.INCIDENT_VIEW_DESCRIPTION)}
element={
<Suspense fallback={Loader}>
<IncidentViewDescription
{...props}
pageRoute={
RouteMap[PageMap.INCIDENT_VIEW_DESCRIPTION] as Route
}
pageRoute={RouteMap[PageMap.INCIDENT_VIEW_DESCRIPTION] as Route}
/>
</Suspense>
}
/>




<PageRoute
path={RouteUtil.getLastPathForKey(PageMap.INCIDENT_INTERNAL_NOTE)}
element={
Expand Down
1 change: 0 additions & 1 deletion Dashboard/src/Utils/Breadcrumbs/IncidentBreadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export function getIncidentsBreadcrumbs(path: string): Array<Link> | undefined {
"Description",
]),


...BuildBreadcrumbLinksByTitles(PageMap.INCIDENT_VIEW_OWNERS, [
"Project",
"Incidents",
Expand Down
2 changes: 0 additions & 2 deletions Dashboard/src/Utils/RouteMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,6 @@ const RouteMap: Dictionary<Route> = {
}`,
),


[PageMap.INCIDENT_VIEW_REMEDIATION]: new Route(
`/dashboard/${RouteParams.ProjectID}/incidents/${
IncidentsRoutePath[PageMap.INCIDENT_VIEW_REMEDIATION]
Expand All @@ -502,7 +501,6 @@ const RouteMap: Dictionary<Route> = {
IncidentsRoutePath[PageMap.INCIDENT_VIEW_DESCRIPTION]
}`,
),


[PageMap.INCIDENT_VIEW_OWNERS]: new Route(
`/dashboard/${RouteParams.ProjectID}/incidents/${
Expand Down

0 comments on commit 29565bc

Please sign in to comment.