-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Cases] Fix attachment's renderer memoization #156179
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verified locally, looks good 👍
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
To update your PR or re-run it, just comment with: cc @cnasikas |
## Summary PR elastic#154436 changed the memoization function (my fault 🙂) and that caused the attachments to rerender each time a user does an action in cases. This PR fixes this issue. **Before:** https://user-images.githubusercontent.com/7871006/235171360-62be773f-8317-4762-9f14-0310d3825a1e.mov **After:** https://user-images.githubusercontent.com/7871006/235171429-5e06f9c4-9c0a-4148-8580-bde2360169af.mov ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) (cherry picked from commit 60e3d98)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.8`: - [[Cases] Fix attachment's renderer memoization (#156179)](#156179) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Christos Nasikas","email":"christos.nasikas@elastic.co"},"sourceCommit":{"committedDate":"2023-04-28T16:14:41Z","message":"[Cases] Fix attachment's renderer memoization (#156179)\n\n## Summary\r\n\r\nPR #154436 changed the memoization\r\nfunction (my fault 🙂) and that caused the attachments to rerender each\r\ntime a user does an action in cases. This PR fixes this issue.\r\n\r\n**Before:**\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/7871006/235171360-62be773f-8317-4762-9f14-0310d3825a1e.mov\r\n\r\n**After:**\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/7871006/235171429-5e06f9c4-9c0a-4148-8580-bde2360169af.mov\r\n\r\n\r\n\r\n### For maintainers\r\n\r\n- [x] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"60e3d98ba837d31130bf104681381ebe5a2df5c2","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","Feature:Cases","v8.8.0","v8.9.0"],"number":156179,"url":"https://github.com/elastic/kibana/pull/156179","mergeCommit":{"message":"[Cases] Fix attachment's renderer memoization (#156179)\n\n## Summary\r\n\r\nPR #154436 changed the memoization\r\nfunction (my fault 🙂) and that caused the attachments to rerender each\r\ntime a user does an action in cases. This PR fixes this issue.\r\n\r\n**Before:**\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/7871006/235171360-62be773f-8317-4762-9f14-0310d3825a1e.mov\r\n\r\n**After:**\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/7871006/235171429-5e06f9c4-9c0a-4148-8580-bde2360169af.mov\r\n\r\n\r\n\r\n### For maintainers\r\n\r\n- [x] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"60e3d98ba837d31130bf104681381ebe5a2df5c2"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156179","number":156179,"mergeCommit":{"message":"[Cases] Fix attachment's renderer memoization (#156179)\n\n## Summary\r\n\r\nPR #154436 changed the memoization\r\nfunction (my fault 🙂) and that caused the attachments to rerender each\r\ntime a user does an action in cases. This PR fixes this issue.\r\n\r\n**Before:**\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/7871006/235171360-62be773f-8317-4762-9f14-0310d3825a1e.mov\r\n\r\n**After:**\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/7871006/235171429-5e06f9c4-9c0a-4148-8580-bde2360169af.mov\r\n\r\n\r\n\r\n### For maintainers\r\n\r\n- [x] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"60e3d98ba837d31130bf104681381ebe5a2df5c2"}}]}] BACKPORT--> Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
## Summary In #156179 I fixed a bug with the memorization of the react components of registered attachments in Cases. This fix introduced another bug which I am fixing in this PR. Fixes: #158447 ### Bug https://github.com/elastic/kibana/assets/7871006/782a552c-29bd-4bae-b66b-8620cbdeb5ff ### Fix https://github.com/elastic/kibana/assets/7871006/a4834ce2-73c8-48cb-9ec4-f480133eca38 ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ## Release notes Fix a bug where ML embeddables, OsQuery, and IoCs attachments in a case render the wrong view.
## Summary In elastic#156179 I fixed a bug with the memorization of the react components of registered attachments in Cases. This fix introduced another bug which I am fixing in this PR. Fixes: elastic#158447 ### Bug https://github.com/elastic/kibana/assets/7871006/782a552c-29bd-4bae-b66b-8620cbdeb5ff ### Fix https://github.com/elastic/kibana/assets/7871006/a4834ce2-73c8-48cb-9ec4-f480133eca38 ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ## Release notes Fix a bug where ML embeddables, OsQuery, and IoCs attachments in a case render the wrong view. (cherry picked from commit a2a0860) # Conflicts: # x-pack/test/functional_with_es_ssl/apps/cases/group2/attachment_framework.ts
#158559) # Backport This will backport the following commits from `main` to `8.8`: - [[Cases] Fix bug with registered attachmets memoization (#158441)](#158441) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Christos Nasikas","email":"christos.nasikas@elastic.co"},"sourceCommit":{"committedDate":"2023-05-26T12:43:43Z","message":"[Cases] Fix bug with registered attachmets memoization (#158441)\n\n## Summary\r\n\r\nIn #156179 I fixed a bug with the\r\nmemorization of the react components of registered attachments in Cases.\r\nThis fix introduced another bug which I am fixing in this PR.\r\n\r\nFixes: https://github.com/elastic/kibana/issues/158447\r\n\r\n### Bug\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/7871006/782a552c-29bd-4bae-b66b-8620cbdeb5ff\r\n\r\n### Fix\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/7871006/a4834ce2-73c8-48cb-9ec4-f480133eca38\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\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\r\n### For maintainers\r\n\r\n- [x] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n## Release notes\r\n\r\nFix a bug where ML embeddables, OsQuery, and IoCs attachments in a case\r\nrender the wrong view.","sha":"a2a0860f65013167a8e097d821eefa7fe81b8832","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:ResponseOps","Feature:Cases","v8.9.0","v8.8.1"],"number":158441,"url":"https://github.com/elastic/kibana/pull/158441","mergeCommit":{"message":"[Cases] Fix bug with registered attachmets memoization (#158441)\n\n## Summary\r\n\r\nIn #156179 I fixed a bug with the\r\nmemorization of the react components of registered attachments in Cases.\r\nThis fix introduced another bug which I am fixing in this PR.\r\n\r\nFixes: https://github.com/elastic/kibana/issues/158447\r\n\r\n### Bug\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/7871006/782a552c-29bd-4bae-b66b-8620cbdeb5ff\r\n\r\n### Fix\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/7871006/a4834ce2-73c8-48cb-9ec4-f480133eca38\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\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\r\n### For maintainers\r\n\r\n- [x] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n## Release notes\r\n\r\nFix a bug where ML embeddables, OsQuery, and IoCs attachments in a case\r\nrender the wrong view.","sha":"a2a0860f65013167a8e097d821eefa7fe81b8832"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/158441","number":158441,"mergeCommit":{"message":"[Cases] Fix bug with registered attachmets memoization (#158441)\n\n## Summary\r\n\r\nIn #156179 I fixed a bug with the\r\nmemorization of the react components of registered attachments in Cases.\r\nThis fix introduced another bug which I am fixing in this PR.\r\n\r\nFixes: https://github.com/elastic/kibana/issues/158447\r\n\r\n### Bug\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/7871006/782a552c-29bd-4bae-b66b-8620cbdeb5ff\r\n\r\n### Fix\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/7871006/a4834ce2-73c8-48cb-9ec4-f480133eca38\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\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\r\n### For maintainers\r\n\r\n- [x] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n## Release notes\r\n\r\nFix a bug where ML embeddables, OsQuery, and IoCs attachments in a case\r\nrender the wrong view.","sha":"a2a0860f65013167a8e097d821eefa7fe81b8832"}},{"branch":"8.8","label":"v8.8.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
Summary
PR #154436 changed the memoization function (my fault 🙂) and that caused the attachments to rerender each time a user does an action in cases. This PR fixes this issue.
Before:
Screen.Recording.2023-04-28.at.5.12.10.PM.mov
After:
Screen.Recording.2023-04-28.at.5.11.32.PM.mov
For maintainers