[8.x] [Entity Analytics] Fix flickering "Enable risk engine" button (#204486) (#204534)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Entity Analytics] Fix flickering "Enable risk engine"
button (#204486)](https://github.com/elastic/kibana/pull/204486)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Mark
Hopkin","email":"mark.hopkin@elastic.co"},"sourceCommit":{"committedDate":"2024-12-17T10:22:29Z","message":"[Entity
Analytics] Fix flickering \"Enable risk engine\" button (#204486)\n\n##
Summary\n\nWhen we refetch the engine status, the enable component was
flickering,\nI have changed it so we only load on the first request,
after that we\nkeep displaying the \"stale\" value while the request is
fetching.\n\nHere is the flicker, blink and you'll miss
it!\n\n\n\nhttps://github.com/user-attachments/assets/5271674c-1534-470a-996f-058afd5ed76f","sha":"c4cf9fe8a53174fd61eedf4a7cd3e1b3988decab","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Team:Entity
Analytics","backport:version","v8.18.0"],"title":"[Entity Analytics] Fix
flickering \"Enable risk engine\"
button","number":204486,"url":"https://github.com/elastic/kibana/pull/204486","mergeCommit":{"message":"[Entity
Analytics] Fix flickering \"Enable risk engine\" button (#204486)\n\n##
Summary\n\nWhen we refetch the engine status, the enable component was
flickering,\nI have changed it so we only load on the first request,
after that we\nkeep displaying the \"stale\" value while the request is
fetching.\n\nHere is the flicker, blink and you'll miss
it!\n\n\n\nhttps://github.com/user-attachments/assets/5271674c-1534-470a-996f-058afd5ed76f","sha":"c4cf9fe8a53174fd61eedf4a7cd3e1b3988decab"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204486","number":204486,"mergeCommit":{"message":"[Entity
Analytics] Fix flickering \"Enable risk engine\" button (#204486)\n\n##
Summary\n\nWhen we refetch the engine status, the enable component was
flickering,\nI have changed it so we only load on the first request,
after that we\nkeep displaying the \"stale\" value while the request is
fetching.\n\nHere is the flicker, blink and you'll miss
it!\n\n\n\nhttps://github.com/user-attachments/assets/5271674c-1534-470a-996f-058afd5ed76f","sha":"c4cf9fe8a53174fd61eedf4a7cd3e1b3988decab"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
This commit is contained in:
Kibana Machine 2024-12-17 23:11:27 +11:00 committed by GitHub
parent 217eb98360
commit 40d7004ec0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -304,7 +304,7 @@ export const RiskScoreEnableSection: React.FC<{
<RiskEngineStatusRow
currentRiskEngineStatus={currentRiskEngineStatus}
onSwitchClick={onSwitchClick}
isLoading={isLoading}
isLoading={isLoading && !currentRiskEngineStatus}
privileges={privileges}
/>
)}