diff --git a/ts_web/elements/upl-statuspage-incidents.ts b/ts_web/elements/upl-statuspage-incidents.ts index 359f847..8d757b9 100644 --- a/ts_web/elements/upl-statuspage-incidents.ts +++ b/ts_web/elements/upl-statuspage-incidents.ts @@ -51,6 +51,12 @@ export class UplStatuspageIncidents extends DeesElement { }) public daysToShow = 90; + @property({ + type: Object, + state: true, + }) + private expandedIncidents: Set = new Set(); + constructor() { super(); } @@ -91,12 +97,10 @@ export class UplStatuspageIncidents extends DeesElement { box-shadow: ${unsafeCSS(shadows.sm)}; border: 1px solid ${colors.border.default}; transition: all 0.2s ease; - cursor: pointer; } - .incident-card:hover { + .incident-card.expanded { box-shadow: ${unsafeCSS(shadows.md)}; - transform: translateY(-2px); } .incident-header { @@ -106,6 +110,12 @@ export class UplStatuspageIncidents extends DeesElement { align-items: start; justify-content: space-between; gap: ${unsafeCSS(spacing.md)}; + cursor: pointer; + transition: background-color 0.2s ease; + } + + .incident-header:hover { + background: ${cssManager.bdTheme('rgba(0, 0, 0, 0.02)', 'rgba(255, 255, 255, 0.02)')}; } .incident-header.critical { @@ -303,15 +313,21 @@ export class UplStatuspageIncidents extends DeesElement { transform: translateY(0); } + .collapsed-hint { + font-size: 12px; + color: ${colors.text.secondary}; + text-align: center; + margin-top: ${unsafeCSS(spacing.md)}; + opacity: 0.8; + } + @media (max-width: 640px) { .container { padding: 0 ${unsafeCSS(spacing.md)} ${unsafeCSS(spacing.md)} ${unsafeCSS(spacing.md)}; } .incident-header { - flex-direction: column; - align-items: start; - gap: ${unsafeCSS(spacing.sm)}; + padding: ${unsafeCSS(spacing.md)}; } .incident-meta { @@ -328,8 +344,9 @@ export class UplStatuspageIncidents extends DeesElement { Current Incidents ${this.loading ? html`
- ` : this.currentIncidents.length ? - this.currentIncidents.map(incident => this.renderIncident(incident, true)) : + ` : this.currentIncidents.length ? html` + ${this.currentIncidents.map(incident => this.renderIncident(incident, true))} + ` : html`
No incidents ongoing.
` } @@ -360,8 +377,8 @@ export class UplStatuspageIncidents extends DeesElement { this.formatDuration(Date.now() - incident.startTime); return html` -
this.handleIncidentClick(incident)}> -
+
+
this.toggleIncident(incident.id)}>

${incident.title}

@@ -371,13 +388,56 @@ export class UplStatuspageIncidents extends DeesElement { Ended: ${this.formatDate(incident.endTime)} ` : ''}
+ ${!this.expandedIncidents.has(incident.id) ? html` +
+ ${incident.impact ? html` + ${incident.impact} + ` : ''} + + ${incident.updates.length} update${incident.updates.length !== 1 ? 's' : ''} + +
+ ` : ''}
-
- ${this.getStatusIcon(latestUpdate.status)} - ${latestUpdate.status.replace(/_/g, ' ')} +
+
+ ${this.getStatusIcon(latestUpdate.status)} + ${latestUpdate.status.replace(/_/g, ' ')} +
+
+ ▼ +
+ ${this.expandedIncidents.has(incident.id) ? html`
Impact: ${incident.impact} @@ -411,6 +471,7 @@ export class UplStatuspageIncidents extends DeesElement {
` : ''}
+ ` : ''}
`; } @@ -427,15 +488,18 @@ export class UplStatuspageIncidents extends DeesElement { `; } - private getStatusIcon(status: string): string { - const icons: Record = { - investigating: '🔍', - identified: '🎯', - monitoring: '👁️', - resolved: '✅', - postmortem: '📋' - }; - return icons[status] || '•'; + private getStatusIcon(status: string): TemplateResult { + return html``; } private formatDate(timestamp: number): string { @@ -483,6 +547,16 @@ export class UplStatuspageIncidents extends DeesElement { } } + private toggleIncident(incidentId: string) { + const newExpanded = new Set(this.expandedIncidents); + if (newExpanded.has(incidentId)) { + newExpanded.delete(incidentId); + } else { + newExpanded.add(incidentId); + } + this.expandedIncidents = newExpanded; + } + private handleIncidentClick(incident: IIncidentDetails) { this.dispatchEvent(new CustomEvent('incidentClick', { detail: { incident },