Skip to content

Commit d54b874

Browse files
authored
feat: add analytics script to index.html and include type property in IncidentEntityV2 (#180)
1 parent 9093dde commit d54b874

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
1818
<meta name="apple-mobile-web-app-title" content="OTC Status" />
1919
<link rel="manifest" href="/site.webmanifest" />
20+
21+
<script
22+
defer
23+
src="https://analytics.otc-service.com/script.js"
24+
data-website-id="70123d13-26d0-4f29-864c-6535801f8b50"
25+
></script>
2026
</head>
2127

2228
<body data-mode="light">

src/Services/Status.Entities.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export interface IncidentEntityV2 {
3434
impact: number;
3535
start_date: string;
3636
updates?: UpdateEntityV2[];
37+
type: string;
3738
}
3839

3940
interface UpdateEntityV2 {

src/Services/Status.Trans.V2.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import dayjs from "dayjs";
22
import { orderBy } from "lodash";
3-
import { EventStatus, GetEventType, IsIncident } from "~/Components/Event/Enums";
3+
import { EventStatus, EventType, GetEventType, IsIncident } from "~/Components/Event/Enums";
44
import { Logger } from "~/Helpers/Logger";
55
import { EmptyDB } from "./Status";
66
import { IncidentEntityV2, NameEnum, StatusEntityV2, StatusEnum } from "./Status.Entities";
@@ -126,7 +126,11 @@ export function TransformerV2({ Components, Events }: { Components: StatusEntity
126126
continue
127127
}
128128

129-
const type = GetEventType(event.impact);
129+
let type = GetEventType(event.impact);
130+
131+
if (event.type === "info") {
132+
type = EventType.Information;
133+
}
130134

131135
const dbEvent: Models.IEvent = {
132136
Id: event.id,

0 commit comments

Comments
 (0)