Fix Instance Detail StatusLabel to show node_state.

This commit is contained in:
Kia Lam 2022-09-02 12:39:54 -07:00 committed by Jeff Bradberry
parent 08c18d71bf
commit 03685e51b5
4 changed files with 8 additions and 5 deletions

View File

@ -115,7 +115,6 @@ function InstanceDetails({ setBreadcrumb, instanceGroup }) {
useEffect(() => {
fetchDetails();
}, [fetchDetails]);
const {
error: healthCheckError,
isLoading: isRunningHealthCheck,
@ -148,7 +147,6 @@ function InstanceDetails({ setBreadcrumb, instanceGroup }) {
[instance]
)
);
const debounceUpdateInstance = useDebounce(updateInstance, 200);
const handleChangeValue = (value) => {
@ -200,7 +198,9 @@ function InstanceDetails({ setBreadcrumb, instanceGroup }) {
<Detail
label={t`Status`}
value={
<StatusLabel status={healthCheck?.errors ? 'error' : 'healthy'} />
instance.node_state ? (
<StatusLabel status={instance.node_state} />
) : null
}
/>
<Detail

View File

@ -88,6 +88,7 @@ describe('<InstanceDetails/>', () => {
enabled: true,
managed_by_policy: true,
node_type: 'hybrid',
node_state: 'ready',
},
});
InstancesAPI.readHealthCheckDetail.mockResolvedValue({

View File

@ -113,7 +113,6 @@ function InstanceDetail({ setBreadcrumb, isK8s }) {
setBreadcrumb(instance);
}
}, [instance, setBreadcrumb]);
const {
error: healthCheckError,
isLoading: isRunningHealthCheck,
@ -186,7 +185,9 @@ function InstanceDetail({ setBreadcrumb, isK8s }) {
<Detail
label={t`Status`}
value={
<StatusLabel status={healthCheck?.errors ? 'error' : 'healthy'} />
instance.node_state ? (
<StatusLabel status={instance.node_state} />
) : null
}
/>
<Detail label={t`Node Type`} value={instance.node_type} />

View File

@ -50,6 +50,7 @@ describe('<InstanceDetail/>', () => {
enabled: true,
managed_by_policy: true,
node_type: 'hybrid',
node_state: 'ready',
},
});
InstancesAPI.readInstanceGroup.mockResolvedValue({