Fix polling ICSHWI-8983
Replaces API polling using setInterval
across the application with a hook useSafePolling
.
Replaces conditional API polling using setTimeout
with conditional polling using useSafePolling
and watcher components
Also updates NotificationProvider to
- fix bugs (like not being able to clear notifications)
- fix bug in Command job watching where we were using
awxJobId
property name instead ofawxCommandId
- make all context functions stateful (so notifications appear immediately in UI, not just at next poll)
Also fixes some state weirdness in IOCDetailsView -> IOCService
-
watchCommand
was being called in a weird place -
useOngoingCommand
was not memoizing the function causing bad rerenders - fixed
buttonDisabled
logic - fixed bug where UI was locked up with an ongoing command (now we watch and show status of ongoing command instead)
Please walk through the individual commits to see the changes grouped by topic
Jira issue: https://jira.esss.lu.se/browse/ICSHWI-8983
Edited by John Sparger