Skip to content

Commit 0ebc53a

Browse files
committed
Adds event description for maintenance events
Updates the event model to include an optional description field. Enhances the EventCard component to display the description when the event type is maintenance. Improves user information accessibility for maintenance events.
1 parent e088a1c commit 0ebc53a

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

src/Components/Event/EventCard.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function EventCard({ Event }: { Event: Models.IEvent }) {
4747
Impact Type:
4848
</label>
4949

50-
<label className="text-xl font-medium text-slate-600">
50+
<label className="text-xl font-medium text-slate-600 whitespace-nowrap">
5151
Current Status:
5252
</label>
5353

@@ -60,6 +60,11 @@ export function EventCard({ Event }: { Event: Models.IEvent }) {
6060
Event.Status !== EventStatus.Completed &&
6161
"(Plan)"} End At:
6262
</label>
63+
64+
{Event.Type === EventType.Maintenance && Event.Description &&
65+
<label className="text-xl font-medium text-slate-600">
66+
Description:
67+
</label>}
6368
</div>
6469

6570
<div className="flex flex-col gap-y-2">
@@ -78,6 +83,11 @@ export function EventCard({ Event }: { Event: Models.IEvent }) {
7883
<label className="text-xl font-medium text-slate-700">
7984
{Event.End ? dayjs(Event.End).tz(Dic.TZ).format(Dic.TimeTZ) : "Still Ongoing"}
8085
</label>
86+
87+
{Event.Type === EventType.Maintenance && Event.Description &&
88+
<label className="text-xl font-medium text-slate-700 break-all">
89+
{Event.Description}
90+
</label>}
8191
</div>
8292
</div>
8393

src/Services/Status.Models.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export namespace Models {
5353
Start: Date;
5454
End?: Date;
5555
Status: EventStatus;
56+
Description?: string;
5657
RegionServices: Set<IRegionService>;
5758
Histories: Set<IHistory>;
5859
}

src/Services/Status.Trans.V2.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ export function TransformerV2({ Components, Events }: { Components: StatusEntity
180180
return EventStatus.Resolved;
181181

182182
case StatusEnum.Description:
183+
dbEvent.Description = update.text;
184+
break;
185+
183186
case StatusEnum.Scheduled:
184187
case StatusEnum.Modified:
185188
return EventStatus.Modified;

0 commit comments

Comments
 (0)