Skip to content

Commit

Permalink
add color to severiyt value on incident detail page
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Kaupe <[email protected]>
  • Loading branch information
snkaupe committed Dec 3, 2024
1 parent a428775 commit a4a8496
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ <h2>Description</h2>
<p *ngIf="edit.view">
{{ incident.description }}
</p>
<textarea
<textarea
*ngIf="edit.editing"
rows="6"
#incidentDescription
id="incidentDescription"
rows="6"
#incidentDescription
id="incidentDescription"
name="incidentDescription"
(keydown.enter)="$event.stopPropagation()"
[(ngModel)]="incident.description"
Expand All @@ -51,7 +51,8 @@ <h2 style="display:inline-block">Affected components</h2>
<ul>
<li *ngFor="let impact of incident.affects!.concat(impactsToAdd)">
<span [class.struck]="impactsToDelete.has(impact.reference ?? '')">{{ componentName(impact) }}</span>
<span class="faint"> | Severity: {{ impactSeverity(impact) }}</span>
<span class="faint"> | Severity: </span>
<span class="faint" [style]="util.severityColorStyle(impact.severity ?? -1)">{{ impactSeverity(impact) }}</span>
<span class="faint"> | Category: {{ impactType(impact) }}</span>
<span *ngIf="edit.editing">
<button class="inline-button dangerous" type="button" (click)="markImpactForDeletion(impact.reference)" *ngIf="!impactsToDelete.has(impact.reference ?? '')" title="Delete this impact">
Expand Down
4 changes: 4 additions & 0 deletions src/app/services/util.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ export class UtilService {
return this.config.unknownColor;
}

severityColorStyle(severity: Severity): string {
return `color: ${this.severityColor(severity)}`;
}

currentDaySeverity(componentId: ComponentId): Severity {
return this.severityForDay(componentId, this.dataService.currentDay);
}
Expand Down

0 comments on commit a4a8496

Please sign in to comment.