Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/app/frontend/assets/ts/features/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class StatusService {
isActive: false,
style: "",
incidents: undefined,
date: undefined,
};
return;
}
Expand All @@ -87,6 +88,7 @@ export class StatusService {
isActive: true,
incidents: day?.incidents,
style: style,
date: day.date,
};
}
public stop(): void {
Expand Down
10 changes: 9 additions & 1 deletion src/app/frontend/assets/ts/shared/services/status.processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,16 @@ export class StatusProcessor {
const dayStart = startOfDay(day);
const dayEnd = endOfDay(day);

const formattedDate = day.toLocaleDateString(LOCALE, {
month: "short",
day: "numeric",
year: "numeric",
});

const hasActiveMonitor = this.hasActiveMonitorOnDay(monitors, dayEnd);

if (!hasActiveMonitor) {
return { color: "bg-empty", index: dayIndex };
return { color: "bg-empty", index: dayIndex, date: formattedDate };
}

const dayIncidents = this.filterIncidentsByDateRange(
Expand All @@ -179,6 +185,7 @@ export class StatusProcessor {
return {
color: "bg-operational",
index: dayIndex,
date: formattedDate,
incidents: [],
};
}
Expand All @@ -191,6 +198,7 @@ export class StatusProcessor {
return {
index: dayIndex,
color: prioritizedIncidents[0].color,
date: formattedDate,
incidents: this.sortIncidentsByLatest(prioritizedIncidents, false),
};
});
Expand Down
2 changes: 2 additions & 0 deletions src/app/frontend/assets/ts/shared/types/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface Tooltip {
isActive: boolean;
incidents?: EnrichedIncident[];
style: string;
date?: string;
}

export interface IncidentConfig {
Expand All @@ -26,6 +27,7 @@ export interface EnrichedIncident extends IncidentForStatus, IncidentConfig {
export interface Days {
color: string;
index: number;
date: string;
incidents?: EnrichedIncident[];
}

Expand Down
7 changes: 7 additions & 0 deletions src/app/frontend/templates/status/tooltip.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
class="hidden sm:block fixed max-h-96 overflow-y-auto bg-form border border-form-border rounded-form shadow-form p-2 z-50 max-w-xs"
>
<div>
<div class="mb-2 pb-2 border-b border-form-border">
<p
class="text-sm font-semibold text-title text-center"
x-text="tooltip.date"
></p>
</div>

{%
set variants = [
{
Expand Down
Loading