diff options
author | Sarah Akus <sakus@redhat.com> | 2022-10-14 14:54:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-14 14:54:39 +0200 |
commit | 25737ba7c61c4f9a492af6f6ad3142d8732bf2e3 (patch) | |
tree | 1e8298fbc2516cf61ae321fc3101b642b429975a | |
parent | Merge pull request #13050 from vidyanambiar/template-playbook (diff) | |
parent | Fix pending state for health check button. (diff) | |
download | awx-25737ba7c61c4f9a492af6f6ad3142d8732bf2e3.tar.xz awx-25737ba7c61c4f9a492af6f6ad3142d8732bf2e3.zip |
Merge pull request #13064 from kialam/fix-pending-health-check-button-setState
Fix pending state for health check button.
3 files changed, 9 insertions, 6 deletions
diff --git a/awx/ui/src/components/HealthCheckButton/HealthCheckButton.js b/awx/ui/src/components/HealthCheckButton/HealthCheckButton.js index 464521d68c..ee74883990 100644 --- a/awx/ui/src/components/HealthCheckButton/HealthCheckButton.js +++ b/awx/ui/src/components/HealthCheckButton/HealthCheckButton.js @@ -33,8 +33,10 @@ function HealthCheckButton({ component="button" onClick={onClick} ouiaId="health-check" + isLoading={healthCheckPending} + spinnerAriaLabel={t`Running health check`} > - {t`Run health check`} + {healthCheckPending ? t`Running health check` : t`Run health check`} </DropdownItem> </Tooltip> ); diff --git a/awx/ui/src/screens/InstanceGroup/Instances/InstanceList.js b/awx/ui/src/screens/InstanceGroup/Instances/InstanceList.js index 8479591673..cac7daa04d 100644 --- a/awx/ui/src/screens/InstanceGroup/Instances/InstanceList.js +++ b/awx/ui/src/screens/InstanceGroup/Instances/InstanceList.js @@ -58,10 +58,10 @@ function InstanceList({ instanceGroup }) { InstanceGroupsAPI.readInstances(instanceGroupId, params), InstanceGroupsAPI.readInstanceOptions(instanceGroupId), ]); - setPendingHealthCheck( - response?.data?.result?.some((i) => i.health_check_pending === true) + const isPending = response.data.results.some( + (i) => i.health_check_pending === true ); - + setPendingHealthCheck(isPending); return { instances: response.data.results, count: response.data.count, diff --git a/awx/ui/src/screens/Instances/InstanceList/InstanceList.js b/awx/ui/src/screens/Instances/InstanceList/InstanceList.js index ad7d13bb5c..c16ac3ffd4 100644 --- a/awx/ui/src/screens/Instances/InstanceList/InstanceList.js +++ b/awx/ui/src/screens/Instances/InstanceList/InstanceList.js @@ -53,9 +53,10 @@ function InstanceList() { InstancesAPI.readOptions(), SettingsAPI.readCategory('system'), ]); - setPendingHealthCheck( - response?.data?.result?.some((i) => i.health_check_pending === true) + const isPending = response.data.results.some( + (i) => i.health_check_pending === true ); + setPendingHealthCheck(isPending); return { instances: response.data.results, isK8s: sysSettings.data.IS_K8S, |