Skip to content

Commit b854e27

Browse files
authored
Refactoring Status column (#4098)
1 parent 4dff204 commit b854e27

File tree

1 file changed

+3
-42
lines changed

1 file changed

+3
-42
lines changed

ui/components/FluxObjectsTable.tsx

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,14 @@ import { useLinkResolver } from "../contexts/LinkResolverContext";
55
import { Kind } from "../lib/api/core/types.pb";
66
import { formatURL, objectTypeToRoute } from "../lib/nav";
77
import { FluxObject } from "../lib/objects";
8-
import { makeImageString, statusSortHelper } from "../lib/utils";
8+
import { makeImageString } from "../lib/utils";
99
import DataTable from "./DataTable";
1010
import { DetailViewProps } from "./DetailModal";
1111
import HealthCheckStatusIndicator, {
1212
HealthStatusType,
1313
} from "./HealthCheckStatusIndicator";
1414
import ImageLink from "./ImageLink";
15-
import KubeStatusIndicator, {
16-
ReadyStatusValue,
17-
SpecialObject,
18-
computeMessage,
19-
createSyntheticCondition,
20-
} from "./KubeStatusIndicator";
15+
import { computeMessage } from "./KubeStatusIndicator";
2116
import Link from "./Link";
2217
import Text from "./Text";
2318

@@ -93,48 +88,14 @@ function FluxObjectsTable({
9388
sortValue: ({ namespace }) => namespace,
9489
},
9590
{
96-
label: "Health Check",
91+
label: "Status",
9792
value: ({ health }) => {
9893
return health.status !== HealthStatusType.Unknown ? (
9994
<HealthCheckStatusIndicator health={health} />
10095
) : null;
10196
},
10297
sortValue: ({ health }: FluxObject) => health.status,
10398
},
104-
{
105-
label: "Status",
106-
value: (u: FluxObject) => {
107-
const status = u.obj.status;
108-
109-
if (!status || !status.conditions) {
110-
const cond = createSyntheticCondition(
111-
u.type as SpecialObject,
112-
status
113-
);
114-
115-
if (cond.status === ReadyStatusValue.Unknown) {
116-
return null;
117-
}
118-
119-
return (
120-
<KubeStatusIndicator
121-
conditions={[cond]}
122-
suspended={u.suspended}
123-
short
124-
/>
125-
);
126-
}
127-
128-
return u.conditions.length > 0 ? (
129-
<KubeStatusIndicator
130-
conditions={u.conditions}
131-
suspended={u.suspended}
132-
short
133-
/>
134-
) : null;
135-
},
136-
sortValue: statusSortHelper,
137-
},
13899
{
139100
label: "Message",
140101
value: (u: FluxObject) => _.first(u.conditions)?.message,

0 commit comments

Comments
 (0)