summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarah Akus <sakus@redhat.com>2022-10-14 14:54:39 +0200
committerGitHub <noreply@github.com>2022-10-14 14:54:39 +0200
commit25737ba7c61c4f9a492af6f6ad3142d8732bf2e3 (patch)
tree1e8298fbc2516cf61ae321fc3101b642b429975a
parentMerge pull request #13050 from vidyanambiar/template-playbook (diff)
parentFix pending state for health check button. (diff)
downloadawx-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.
-rw-r--r--awx/ui/src/components/HealthCheckButton/HealthCheckButton.js4
-rw-r--r--awx/ui/src/screens/InstanceGroup/Instances/InstanceList.js6
-rw-r--r--awx/ui/src/screens/Instances/InstanceList/InstanceList.js5
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,