Skip to content

Commit 30c2d01

Browse files
committed
[feat] Update event status from 'Analysing' to 'Detected'
Replaces the 'Analysing' status with 'Detected' across multiple components to enhance clarity in event handling. Updates relevant functions and enums to reflect this change, ensuring consistent status representation throughout the application. Increases overall understanding of event states for better user experience.
1 parent 7ceb1f4 commit 30c2d01

6 files changed

Lines changed: 12 additions & 10 deletions

File tree

src/Components/Event/Enums.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ export function IsIncident(type: EventType): boolean {
6464
/**
6565
* @author Aloento
6666
* @since 1.0.0
67-
* @version 0.2.0
67+
* @version 0.2.1
6868
*/
6969
export enum EventStatus {
70-
Analysing = "Analysing",
70+
Detected = "Detected",
7171
Fixing = "Fixing",
7272
Observing = "Observing",
7373
Resolved = "Resolved",
@@ -115,8 +115,8 @@ export function IsOpenStatus(status: EventStatus): boolean {
115115
*/
116116
export function GetStatusString(status: EventStatus): string {
117117
switch (status) {
118-
case EventStatus.Analysing:
119-
return StatusEnum.Analysing;
118+
case EventStatus.Detected:
119+
return StatusEnum.Detected;
120120
case EventStatus.Fixing:
121121
return StatusEnum.Fixing;
122122
case EventStatus.Observing:

src/Components/Event/useEditForm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function useEditForm(event: Models.IEvent) {
6161
}
6262

6363
if (!IsIncident(type) && IsIncident(value)) {
64-
_setStatus(EventStatus.Analysing);
64+
_setStatus(EventStatus.Detected);
6565
}
6666

6767
if (IsIncident(type) && !IsIncident(value)) {

src/Components/History/EventItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function EventItem({ Prev, Curr }: IEventItem) {
6767
let color: any;
6868

6969
switch (Curr.Status) {
70-
case EventStatus.Analysing:
70+
case EventStatus.Detected:
7171
color = "red";
7272
break;
7373

src/Components/New/useNewForm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export function useNewForm() {
155155
}
156156

157157
const status = IsIncident(type)
158-
? EventStatus.Analysing : EventStatus.Planned
158+
? EventStatus.Detected : EventStatus.Planned
159159

160160
const event: Models.IEvent = {
161161
Id: Math.max(...DB.Events.map(event => event.Id), 0) + 1,

src/Services/Status.Entities.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ interface UpdateEntityV2 {
4848
/**
4949
* @author Aloento
5050
* @since 1.0.0
51-
* @version 0.2.0
51+
* @version 0.2.1
5252
*/
5353
export const enum StatusEnum {
5454
Analyzing = "analyzing",
5555
Analysing = "analysing",
56+
Detected = "detected",
5657
Changed = "changed",
5758
ImpactChanged = "impact changed",
5859
Completed = "completed",

src/Services/Status.Trans.V2.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export function TransformerV2({ Components, Events }: { Components: StatusEntity
137137
Title: event.title,
138138
Start: dayjs(event.start_date).toDate(),
139139
Type: type,
140-
Status: IsIncident(type) ? EventStatus.Analysing : EventStatus.Planned,
140+
Status: IsIncident(type) ? EventStatus.Detected : EventStatus.Planned,
141141
Histories: new Set(),
142142
RegionServices: new Set(),
143143
Description: event.description
@@ -176,7 +176,8 @@ export function TransformerV2({ Components, Events }: { Components: StatusEntity
176176

177177
case StatusEnum.Analyzing:
178178
case StatusEnum.Analysing:
179-
return EventStatus.Analysing;
179+
case StatusEnum.Detected:
180+
return EventStatus.Detected;
180181
case StatusEnum.Reopened:
181182
return EventStatus.Reopened;
182183
case StatusEnum.Fixing:

0 commit comments

Comments
 (0)