[Security Solution] Implement refactoring remark from PR #201731#204022
[Security Solution] Implement refactoring remark from PR #201731#204022jkelas merged 16 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
|
Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management) |
|
@elasticmachine merge upstream |
nikitaindik
left a comment
There was a problem hiding this comment.
If I understand Georgii's comment correctly, he's suggesting moving the computation of isRuleInstalling and isDisabled into the context and then using these computed values in components.
After discussing this with @xcrzx, we concluded that isRuleInstalling from add_prebuilt_rules_header_buttons.tsx can be renamed to isAnyRuleInstalling, moved to AddPrebuiltRulesTableContextProvider, and exposed as state.isAnyRuleInstalling. Since it represents a generic business logic state, it makes sense to move it to the context.
However, we think that isRuleInstalling in add_prebuilt_rules_install_button.tsx and isDisabled in use_add_prebuilt_rules_table_columns.tsx should remain as they are. Ideally, the context should provide generic data without being tied to specific usage scenarios, but if we move these into context, it'll know too much.
Feel free to reach out if you have questions about this.
b8869fb to
b343667
Compare
nikitaindik
left a comment
There was a problem hiding this comment.
Thanks for the PR, @jkelas! Nicely done! 👍
I've tested the changes locally and can confirm that it works as expected.
💚 Build Succeeded
Metrics [docs]Async chunks
History
cc @jkelas |
|
Starting backport for target branches: 8.16, 8.17, 8.x |
… (elastic#204022) ## Summary In the PR elastic#201731 for ticket elastic#180660 @banderror advised to refactor code in that PR to better separate the concerns (business logic from components). This is the implementation of that review [remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191). Recording: https://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47 --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Nikita Indik <nikita.indik@elastic.co> (cherry picked from commit 20eb87d)
… (elastic#204022) ## Summary In the PR elastic#201731 for ticket elastic#180660 @banderror advised to refactor code in that PR to better separate the concerns (business logic from components). This is the implementation of that review [remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191). Recording: https://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47 --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Nikita Indik <nikita.indik@elastic.co> (cherry picked from commit 20eb87d)
… (elastic#204022) ## Summary In the PR elastic#201731 for ticket elastic#180660 @banderror advised to refactor code in that PR to better separate the concerns (business logic from components). This is the implementation of that review [remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191). Recording: https://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47 --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Nikita Indik <nikita.indik@elastic.co> (cherry picked from commit 20eb87d)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… (#204022) (#205903) # Backport This will backport the following commits from `main` to `8.16`: - [[Security Solution] Implement refactoring remark from PR #201731 (#204022)](#204022) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jacek Kolezynski","email":"jacek.kolezynski@elastic.co"},"sourceCommit":{"committedDate":"2025-01-08T14:01:47Z","message":"[Security Solution] Implement refactoring remark from PR #201731 (#204022)\n\n## Summary\n\nIn the PR #201731 for ticket #180660 @banderror advised to refactor code\nin that PR to better separate the concerns (business logic from\ncomponents). This is the implementation of that review\n[remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191).\n\nRecording:\n\n\nhttps://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>\nCo-authored-by: Nikita Indik <nikita.indik@elastic.co>","sha":"20eb87d778a69b6b0d7132732cbea9cce44e895c","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["refactoring","release_note:skip","v9.0.0","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Feature:Prebuilt Detection Rules","ci:cloud-deploy","ci:project-deploy-security","backport:version","v8.18.0","v8.16.3","v8.17.1"],"title":"[Security Solution] Implement refactoring remark from PR #201731","number":204022,"url":"https://github.com/elastic/kibana/pull/204022","mergeCommit":{"message":"[Security Solution] Implement refactoring remark from PR #201731 (#204022)\n\n## Summary\n\nIn the PR #201731 for ticket #180660 @banderror advised to refactor code\nin that PR to better separate the concerns (business logic from\ncomponents). This is the implementation of that review\n[remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191).\n\nRecording:\n\n\nhttps://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>\nCo-authored-by: Nikita Indik <nikita.indik@elastic.co>","sha":"20eb87d778a69b6b0d7132732cbea9cce44e895c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16","8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204022","number":204022,"mergeCommit":{"message":"[Security Solution] Implement refactoring remark from PR #201731 (#204022)\n\n## Summary\n\nIn the PR #201731 for ticket #180660 @banderror advised to refactor code\nin that PR to better separate the concerns (business logic from\ncomponents). This is the implementation of that review\n[remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191).\n\nRecording:\n\n\nhttps://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>\nCo-authored-by: Nikita Indik <nikita.indik@elastic.co>","sha":"20eb87d778a69b6b0d7132732cbea9cce44e895c"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jacek Kolezynski <jacek.kolezynski@elastic.co>
… (#204022) (#205904) # Backport This will backport the following commits from `main` to `8.17`: - [[Security Solution] Implement refactoring remark from PR #201731 (#204022)](#204022) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jacek Kolezynski","email":"jacek.kolezynski@elastic.co"},"sourceCommit":{"committedDate":"2025-01-08T14:01:47Z","message":"[Security Solution] Implement refactoring remark from PR #201731 (#204022)\n\n## Summary\n\nIn the PR #201731 for ticket #180660 @banderror advised to refactor code\nin that PR to better separate the concerns (business logic from\ncomponents). This is the implementation of that review\n[remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191).\n\nRecording:\n\n\nhttps://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>\nCo-authored-by: Nikita Indik <nikita.indik@elastic.co>","sha":"20eb87d778a69b6b0d7132732cbea9cce44e895c","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["refactoring","release_note:skip","v9.0.0","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Feature:Prebuilt Detection Rules","ci:cloud-deploy","ci:project-deploy-security","backport:version","v8.18.0","v8.16.3","v8.17.1"],"title":"[Security Solution] Implement refactoring remark from PR #201731","number":204022,"url":"https://github.com/elastic/kibana/pull/204022","mergeCommit":{"message":"[Security Solution] Implement refactoring remark from PR #201731 (#204022)\n\n## Summary\n\nIn the PR #201731 for ticket #180660 @banderror advised to refactor code\nin that PR to better separate the concerns (business logic from\ncomponents). This is the implementation of that review\n[remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191).\n\nRecording:\n\n\nhttps://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>\nCo-authored-by: Nikita Indik <nikita.indik@elastic.co>","sha":"20eb87d778a69b6b0d7132732cbea9cce44e895c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16","8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204022","number":204022,"mergeCommit":{"message":"[Security Solution] Implement refactoring remark from PR #201731 (#204022)\n\n## Summary\n\nIn the PR #201731 for ticket #180660 @banderror advised to refactor code\nin that PR to better separate the concerns (business logic from\ncomponents). This is the implementation of that review\n[remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191).\n\nRecording:\n\n\nhttps://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>\nCo-authored-by: Nikita Indik <nikita.indik@elastic.co>","sha":"20eb87d778a69b6b0d7132732cbea9cce44e895c"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jacek Kolezynski <jacek.kolezynski@elastic.co>
#204022) (#205905) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] Implement refactoring remark from PR #201731 (#204022)](#204022) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jacek Kolezynski","email":"jacek.kolezynski@elastic.co"},"sourceCommit":{"committedDate":"2025-01-08T14:01:47Z","message":"[Security Solution] Implement refactoring remark from PR #201731 (#204022)\n\n## Summary\n\nIn the PR #201731 for ticket #180660 @banderror advised to refactor code\nin that PR to better separate the concerns (business logic from\ncomponents). This is the implementation of that review\n[remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191).\n\nRecording:\n\n\nhttps://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>\nCo-authored-by: Nikita Indik <nikita.indik@elastic.co>","sha":"20eb87d778a69b6b0d7132732cbea9cce44e895c","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["refactoring","release_note:skip","v9.0.0","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Feature:Prebuilt Detection Rules","ci:cloud-deploy","ci:project-deploy-security","backport:version","v8.18.0","v8.16.3","v8.17.1"],"title":"[Security Solution] Implement refactoring remark from PR #201731","number":204022,"url":"https://github.com/elastic/kibana/pull/204022","mergeCommit":{"message":"[Security Solution] Implement refactoring remark from PR #201731 (#204022)\n\n## Summary\n\nIn the PR #201731 for ticket #180660 @banderror advised to refactor code\nin that PR to better separate the concerns (business logic from\ncomponents). This is the implementation of that review\n[remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191).\n\nRecording:\n\n\nhttps://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>\nCo-authored-by: Nikita Indik <nikita.indik@elastic.co>","sha":"20eb87d778a69b6b0d7132732cbea9cce44e895c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16","8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204022","number":204022,"mergeCommit":{"message":"[Security Solution] Implement refactoring remark from PR #201731 (#204022)\n\n## Summary\n\nIn the PR #201731 for ticket #180660 @banderror advised to refactor code\nin that PR to better separate the concerns (business logic from\ncomponents). This is the implementation of that review\n[remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191).\n\nRecording:\n\n\nhttps://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>\nCo-authored-by: Nikita Indik <nikita.indik@elastic.co>","sha":"20eb87d778a69b6b0d7132732cbea9cce44e895c"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jacek Kolezynski <jacek.kolezynski@elastic.co>
… (elastic#204022) ## Summary In the PR elastic#201731 for ticket elastic#180660 @banderror advised to refactor code in that PR to better separate the concerns (business logic from components). This is the implementation of that review [remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191). Recording: https://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47 --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Nikita Indik <nikita.indik@elastic.co>
Summary
In the PR #201731 for ticket #180660 @banderror advised to refactor code in that PR to better separate the concerns (business logic from components). This is the implementation of that review remark.
Recording:
Refactoring_for_install_all_button.mov