Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.17] [Security Solution] Disable Install All button when installati…
…on is in progress (#201731) (#201962) # Backport This will backport the following commits from `main` to `8.17`: - [[Security Solution] Disable Install All button when installation is in progress (#201731)](#201731) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jacek Kolezynski","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-27T12:13:58Z","message":"[Security Solution] Disable Install All button when installation is in progress (#201731)\n\n**Resolves: #180660**\r\n\r\n## Summary\r\n\r\nIn this PR I am fixing a problem of the `Install All` button being\r\nre-enabled when entering the page again.\r\nI am fixing only the UI problem here, only for the scenario described in\r\nthe ticket: single user interacting with single instance of Kibana.\r\nDuring investigation I discovered and discussed with the team other\r\nscenarios which may lead to race condition when installing rules, but\r\nthe team agreed to work on them separately.\r\n\r\nThe fix uses `useIsMutating` hook to check that the mutation is pending.\r\nSuch information is added to the `AddPrebuiltRulesTableContext` and then\r\nused to disable the `Install All` button in the component.\r\n\r\nRecording:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/777dd6a5-2441-4101-8368-04cdcede1409\r\n\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n\r\n- [X] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484","sha":"9ca719c2926c766a2a8623bab5814996a3e43833","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Feature:Prebuilt Detection Rules","backport:version","v8.17.0","v8.18.0","v8.16.2"],"title":"[Security Solution] Disable Install All button when installation is in progress","number":201731,"url":"https://github.com/elastic/kibana/pull/201731","mergeCommit":{"message":"[Security Solution] Disable Install All button when installation is in progress (#201731)\n\n**Resolves: #180660**\r\n\r\n## Summary\r\n\r\nIn this PR I am fixing a problem of the `Install All` button being\r\nre-enabled when entering the page again.\r\nI am fixing only the UI problem here, only for the scenario described in\r\nthe ticket: single user interacting with single instance of Kibana.\r\nDuring investigation I discovered and discussed with the team other\r\nscenarios which may lead to race condition when installing rules, but\r\nthe team agreed to work on them separately.\r\n\r\nThe fix uses `useIsMutating` hook to check that the mutation is pending.\r\nSuch information is added to the `AddPrebuiltRulesTableContext` and then\r\nused to disable the `Install All` button in the component.\r\n\r\nRecording:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/777dd6a5-2441-4101-8368-04cdcede1409\r\n\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n\r\n- [X] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484","sha":"9ca719c2926c766a2a8623bab5814996a3e43833"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201731","number":201731,"mergeCommit":{"message":"[Security Solution] Disable Install All button when installation is in progress (#201731)\n\n**Resolves: #180660**\r\n\r\n## Summary\r\n\r\nIn this PR I am fixing a problem of the `Install All` button being\r\nre-enabled when entering the page again.\r\nI am fixing only the UI problem here, only for the scenario described in\r\nthe ticket: single user interacting with single instance of Kibana.\r\nDuring investigation I discovered and discussed with the team other\r\nscenarios which may lead to race condition when installing rules, but\r\nthe team agreed to work on them separately.\r\n\r\nThe fix uses `useIsMutating` hook to check that the mutation is pending.\r\nSuch information is added to the `AddPrebuiltRulesTableContext` and then\r\nused to disable the `Install All` button in the component.\r\n\r\nRecording:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/777dd6a5-2441-4101-8368-04cdcede1409\r\n\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n\r\n- [X] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484","sha":"9ca719c2926c766a2a8623bab5814996a3e43833"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jacek Kolezynski <[email protected]>
- Loading branch information