Skip to content

Commit

Permalink
Merge pull request #2293 from flanksource/fix-use-topology-health
Browse files Browse the repository at this point in the history
fix: use topology.health instead of status
  • Loading branch information
mainawycliffe authored Sep 17, 2024
2 parents c41fd16 + a1491cb commit cde4de9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/api/types/topology.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface Topology extends Component, CostsData, Agent {
labels?: Record<string, string>;
path?: string;
text?: string;
health?: string;
status?: string;
status_reason?: string;
hidden?: boolean;
Expand Down
10 changes: 5 additions & 5 deletions src/components/Topology/TopologyCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { PropertyDisplay } from "./Property";
import { TopologyConfigAnalysisLine } from "./TopologyConfigAnalysisLine";
import { TopologyDropdownMenu } from "./TopologyDropdownMenu";

export enum ComponentStatus {
export enum ComponentHealth {
unhealthy = "unhealthy",
warning = "warning"
}
Expand All @@ -29,9 +29,9 @@ export const CardWidth: Record<keyof typeof Size, string> = {
[Size.extra_large]: "554px"
};

export const StatusStyles: Record<keyof typeof ComponentStatus, string> = {
[ComponentStatus.unhealthy]: "border-red-300",
[ComponentStatus.warning]: "border-orange-300"
export const StatusStyles: Record<keyof typeof ComponentHealth, string> = {
[ComponentHealth.unhealthy]: "border-red-300",
[ComponentHealth.warning]: "border-orange-300"
} as const;

interface IProps {
Expand Down Expand Up @@ -159,7 +159,7 @@ export function TopologyCard({
style={{ width: CardWidth[size as Size] || size }}
className={clsx(
"card relative mb-3 mr-3 rounded-8px border-0 border-t-8 bg-lightest-gray shadow-card",
StatusStyles[topology.status as ComponentStatus] || "border-white",
StatusStyles[topology.health as ComponentHealth] || "border-white",
selectionMode ? "cursor-pointer" : ""
)}
{...selectionModeRootProps}
Expand Down

0 comments on commit cde4de9

Please sign in to comment.