-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Canvas] Cleanup services #194634
[Canvas] Cleanup services #194634
Conversation
Pinging @elastic/kibana-presentation (Team:Presentation) |
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.
LGTM - just a couple of nits that can be ignored
code review only
x-pack/plugins/canvas/public/components/embeddable_flyout/flyout.tsx
Outdated
Show resolved
Hide resolved
@@ -94,6 +96,7 @@ export const createDispatchedHandlerFactory = ( | |||
break; | |||
case 'applyFilterAction': | |||
filters.updateFilter(element.id, event.data); | |||
dispatch(fetchAllRenderables()); |
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.
Was this a fix for something else? Why was dispatch added?
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.
This was part of the circular dependencies fix, since we had to move fetchAllRenderables
from updateFilter
x-pack/plugins/canvas/public/routes/workpad/hooks/use_fullscreen_presentation_helper.ts
Outdated
Show resolved
Hide resolved
Starting backport for target branches: 8.x |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsasync chunk count
ESLint disabled line counts
References to deprecated APIs
Total ESLint disabled count
History
|
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Closes elastic#194050 ## Summary This PR refactors the Canvas services to no longer use the `PluginServiceProvider` from the `PresentationUtil` plugin. Note that the Canvas storybooks are broken on main (and they have been for who knows how long) and so, while I did make some changes to the storybooks to make them **compile**, I didn't bother to get them fully functional. Note that the Ecommerce workpad is broken - this is not due to this PR, it is a [bug](elastic#195297) that is present on main. ### Checklist - [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 - [ ] 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) <!--ONMERGE {"backportTargets":["8.x"]} ONMERGE--> --------- Co-authored-by: Catherine Liu <[email protected]> (cherry picked from commit 91c045d)
# Backport This will backport the following commits from `main` to `8.x`: - [[Canvas] Cleanup services (#194634)](#194634) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Hannah Mudge","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-08T20:34:01Z","message":"[Canvas] Cleanup services (#194634)\n\nCloses https://github.com/elastic/kibana/issues/194050\r\n\r\n## Summary\r\n\r\nThis PR refactors the Canvas services to no longer use the\r\n`PluginServiceProvider` from the `PresentationUtil` plugin. Note that\r\nthe Canvas storybooks are broken on main (and they have been for who\r\nknows how long) and so, while I did make some changes to the storybooks\r\nto make them **compile**, I didn't bother to get them fully functional.\r\n\r\nNote that the Ecommerce workpad is broken - this is not due to this PR,\r\nit is a [bug](#195297) that is\r\npresent on main.\r\n\r\n### Checklist\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- [ ] 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\r\n<!--ONMERGE {\"backportTargets\":[\"8.x\"]} ONMERGE-->\r\n\r\n---------\r\n\r\nCo-authored-by: Catherine Liu <[email protected]>","sha":"91c045d698b2e68afd13f5d4bef9229d8a231abe","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","loe:medium","technical debt","release_note:skip","impact:high","v9.0.0","backport:prev-minor"],"number":194634,"url":"https://github.com/elastic/kibana/pull/194634","mergeCommit":{"message":"[Canvas] Cleanup services (#194634)\n\nCloses https://github.com/elastic/kibana/issues/194050\r\n\r\n## Summary\r\n\r\nThis PR refactors the Canvas services to no longer use the\r\n`PluginServiceProvider` from the `PresentationUtil` plugin. Note that\r\nthe Canvas storybooks are broken on main (and they have been for who\r\nknows how long) and so, while I did make some changes to the storybooks\r\nto make them **compile**, I didn't bother to get them fully functional.\r\n\r\nNote that the Ecommerce workpad is broken - this is not due to this PR,\r\nit is a [bug](#195297) that is\r\npresent on main.\r\n\r\n### Checklist\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- [ ] 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\r\n<!--ONMERGE {\"backportTargets\":[\"8.x\"]} ONMERGE-->\r\n\r\n---------\r\n\r\nCo-authored-by: Catherine Liu <[email protected]>","sha":"91c045d698b2e68afd13f5d4bef9229d8a231abe"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194634","number":194634,"mergeCommit":{"message":"[Canvas] Cleanup services (#194634)\n\nCloses https://github.com/elastic/kibana/issues/194050\r\n\r\n## Summary\r\n\r\nThis PR refactors the Canvas services to no longer use the\r\n`PluginServiceProvider` from the `PresentationUtil` plugin. Note that\r\nthe Canvas storybooks are broken on main (and they have been for who\r\nknows how long) and so, while I did make some changes to the storybooks\r\nto make them **compile**, I didn't bother to get them fully functional.\r\n\r\nNote that the Ecommerce workpad is broken - this is not due to this PR,\r\nit is a [bug](#195297) that is\r\npresent on main.\r\n\r\n### Checklist\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- [ ] 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\r\n<!--ONMERGE {\"backportTargets\":[\"8.x\"]} ONMERGE-->\r\n\r\n---------\r\n\r\nCo-authored-by: Catherine Liu <[email protected]>","sha":"91c045d698b2e68afd13f5d4bef9229d8a231abe"}}]}] BACKPORT-->
Closes #199110 ## Summary In #194634, we switched to hard-coded strings for the reducers to prevent an import circular dependency - see https://github.com/elastic/kibana/pull/194634/files#diff-12e4182415d9eb779aadf492d2b777393e2794c7ac2eb39c48310ab6493ab233L115-R120 for the relevant change. What we didn't realize at the time, however, is that there was actually a typo in the original creation of the set position action - the `actionType` was set to the singular `setMultiplePosition` rather than `setMultiplePositions`, so there was actually **no** reducer tied to the `setMultiplePositions` action type after our change - i.e. the reducer map was expecting `setMultiplePosition` and did nothing for `setMultiplePositions`. By changing the `actionType` to the proper plural `setMultiplePositions`, the reducer map now has a match, so the reducer gets called as expected. | Before | After | |--------|--------| | ![Nov-06-2024 14-04-37](https://github.com/user-attachments/assets/627a3fee-2835-446a-b949-f44632d797d3) | ![Nov-06-2024 14-05-19](https://github.com/user-attachments/assets/f0baed94-3858-47b7-b979-7f27deb50b08) | I looked through the other changes we made to reducer map keys, and every `actionType` defined via `createAction` seems to have a matching reducer map key - so this appears to be a one-off 🙈 ### Checklist - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels) - [ ] This will appear in the **Release Notes** and follow the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Closes elastic#199110 ## Summary In elastic#194634, we switched to hard-coded strings for the reducers to prevent an import circular dependency - see https://github.com/elastic/kibana/pull/194634/files#diff-12e4182415d9eb779aadf492d2b777393e2794c7ac2eb39c48310ab6493ab233L115-R120 for the relevant change. What we didn't realize at the time, however, is that there was actually a typo in the original creation of the set position action - the `actionType` was set to the singular `setMultiplePosition` rather than `setMultiplePositions`, so there was actually **no** reducer tied to the `setMultiplePositions` action type after our change - i.e. the reducer map was expecting `setMultiplePosition` and did nothing for `setMultiplePositions`. By changing the `actionType` to the proper plural `setMultiplePositions`, the reducer map now has a match, so the reducer gets called as expected. | Before | After | |--------|--------| | ![Nov-06-2024 14-04-37](https://github.com/user-attachments/assets/627a3fee-2835-446a-b949-f44632d797d3) | ![Nov-06-2024 14-05-19](https://github.com/user-attachments/assets/f0baed94-3858-47b7-b979-7f27deb50b08) | I looked through the other changes we made to reducer map keys, and every `actionType` defined via `createAction` seems to have a matching reducer map key - so this appears to be a one-off 🙈 ### Checklist - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels) - [ ] This will appear in the **Release Notes** and follow the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) (cherry picked from commit 1fa3089)
Closes elastic#199110 ## Summary In elastic#194634, we switched to hard-coded strings for the reducers to prevent an import circular dependency - see https://github.com/elastic/kibana/pull/194634/files#diff-12e4182415d9eb779aadf492d2b777393e2794c7ac2eb39c48310ab6493ab233L115-R120 for the relevant change. What we didn't realize at the time, however, is that there was actually a typo in the original creation of the set position action - the `actionType` was set to the singular `setMultiplePosition` rather than `setMultiplePositions`, so there was actually **no** reducer tied to the `setMultiplePositions` action type after our change - i.e. the reducer map was expecting `setMultiplePosition` and did nothing for `setMultiplePositions`. By changing the `actionType` to the proper plural `setMultiplePositions`, the reducer map now has a match, so the reducer gets called as expected. | Before | After | |--------|--------| | ![Nov-06-2024 14-04-37](https://github.com/user-attachments/assets/627a3fee-2835-446a-b949-f44632d797d3) | ![Nov-06-2024 14-05-19](https://github.com/user-attachments/assets/f0baed94-3858-47b7-b979-7f27deb50b08) | I looked through the other changes we made to reducer map keys, and every `actionType` defined via `createAction` seems to have a matching reducer map key - so this appears to be a one-off 🙈 ### Checklist - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels) - [ ] This will appear in the **Release Notes** and follow the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) (cherry picked from commit 1fa3089)
# Backport This will backport the following commits from `main` to `8.x`: - [[Canvas] Fix bug when trying to move elements (#199211)](#199211) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Hannah Mudge","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-06T23:54:44Z","message":"[Canvas] Fix bug when trying to move elements (#199211)\n\nCloses https://github.com/elastic/kibana/issues/199110\r\n\r\n## Summary\r\n\r\nIn #194634, we switched to\r\nhard-coded strings for the reducers to prevent an import circular\r\ndependency - see\r\nhttps://github.com//pull/194634/files#diff-12e4182415d9eb779aadf492d2b777393e2794c7ac2eb39c48310ab6493ab233L115-R120\r\nfor the relevant change.\r\n\r\nWhat we didn't realize at the time, however, is that there was actually\r\na typo in the original creation of the set position action - the\r\n`actionType` was set to the singular `setMultiplePosition` rather than\r\n`setMultiplePositions`, so there was actually **no** reducer tied to the\r\n`setMultiplePositions` action type after our change - i.e. the reducer\r\nmap was expecting `setMultiplePosition` and did nothing for\r\n`setMultiplePositions`. By changing the `actionType` to the proper\r\nplural `setMultiplePositions`, the reducer map now has a match, so the\r\nreducer gets called as expected.\r\n\r\n| Before | After |\r\n|--------|--------|\r\n| ![Nov-06-2024\r\n14-04-37](https://github.com/user-attachments/assets/627a3fee-2835-446a-b949-f44632d797d3)\r\n| ![Nov-06-2024\r\n14-05-19](https://github.com/user-attachments/assets/f0baed94-3858-47b7-b979-7f27deb50b08)\r\n|\r\n\r\nI looked through the other changes we made to reducer map keys, and\r\nevery `actionType` defined via `createAction` seems to have a matching\r\nreducer map key - so this appears to be a one-off 🙈\r\n\r\n### Checklist\r\n\r\n- [x] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)\r\n- [ ] This will appear in the **Release Notes** and follow the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"1fa30899ab2ba3f534ebb6620a34513a1431e0ed","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","loe:small","impact:critical","v9.0.0","Feature:Canvas","backport:version","v8.17.0","v8.16.1","v8.18.0"],"title":"[Canvas] Fix bug when trying to move elements","number":199211,"url":"https://github.com/elastic/kibana/pull/199211","mergeCommit":{"message":"[Canvas] Fix bug when trying to move elements (#199211)\n\nCloses https://github.com/elastic/kibana/issues/199110\r\n\r\n## Summary\r\n\r\nIn #194634, we switched to\r\nhard-coded strings for the reducers to prevent an import circular\r\ndependency - see\r\nhttps://github.com//pull/194634/files#diff-12e4182415d9eb779aadf492d2b777393e2794c7ac2eb39c48310ab6493ab233L115-R120\r\nfor the relevant change.\r\n\r\nWhat we didn't realize at the time, however, is that there was actually\r\na typo in the original creation of the set position action - the\r\n`actionType` was set to the singular `setMultiplePosition` rather than\r\n`setMultiplePositions`, so there was actually **no** reducer tied to the\r\n`setMultiplePositions` action type after our change - i.e. the reducer\r\nmap was expecting `setMultiplePosition` and did nothing for\r\n`setMultiplePositions`. By changing the `actionType` to the proper\r\nplural `setMultiplePositions`, the reducer map now has a match, so the\r\nreducer gets called as expected.\r\n\r\n| Before | After |\r\n|--------|--------|\r\n| ![Nov-06-2024\r\n14-04-37](https://github.com/user-attachments/assets/627a3fee-2835-446a-b949-f44632d797d3)\r\n| ![Nov-06-2024\r\n14-05-19](https://github.com/user-attachments/assets/f0baed94-3858-47b7-b979-7f27deb50b08)\r\n|\r\n\r\nI looked through the other changes we made to reducer map keys, and\r\nevery `actionType` defined via `createAction` seems to have a matching\r\nreducer map key - so this appears to be a one-off 🙈\r\n\r\n### Checklist\r\n\r\n- [x] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)\r\n- [ ] This will appear in the **Release Notes** and follow the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"1fa30899ab2ba3f534ebb6620a34513a1431e0ed"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16","8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199211","number":199211,"mergeCommit":{"message":"[Canvas] Fix bug when trying to move elements (#199211)\n\nCloses https://github.com/elastic/kibana/issues/199110\r\n\r\n## Summary\r\n\r\nIn #194634, we switched to\r\nhard-coded strings for the reducers to prevent an import circular\r\ndependency - see\r\nhttps://github.com//pull/194634/files#diff-12e4182415d9eb779aadf492d2b777393e2794c7ac2eb39c48310ab6493ab233L115-R120\r\nfor the relevant change.\r\n\r\nWhat we didn't realize at the time, however, is that there was actually\r\na typo in the original creation of the set position action - the\r\n`actionType` was set to the singular `setMultiplePosition` rather than\r\n`setMultiplePositions`, so there was actually **no** reducer tied to the\r\n`setMultiplePositions` action type after our change - i.e. the reducer\r\nmap was expecting `setMultiplePosition` and did nothing for\r\n`setMultiplePositions`. By changing the `actionType` to the proper\r\nplural `setMultiplePositions`, the reducer map now has a match, so the\r\nreducer gets called as expected.\r\n\r\n| Before | After |\r\n|--------|--------|\r\n| ![Nov-06-2024\r\n14-04-37](https://github.com/user-attachments/assets/627a3fee-2835-446a-b949-f44632d797d3)\r\n| ![Nov-06-2024\r\n14-05-19](https://github.com/user-attachments/assets/f0baed94-3858-47b7-b979-7f27deb50b08)\r\n|\r\n\r\nI looked through the other changes we made to reducer map keys, and\r\nevery `actionType` defined via `createAction` seems to have a matching\r\nreducer map key - so this appears to be a one-off 🙈\r\n\r\n### Checklist\r\n\r\n- [x] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)\r\n- [ ] This will appear in the **Release Notes** and follow the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"1fa30899ab2ba3f534ebb6620a34513a1431e0ed"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Hannah Mudge <[email protected]>
# Backport This will backport the following commits from `main` to `8.16`: - [[Canvas] Fix bug when trying to move elements (#199211)](#199211) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Hannah Mudge","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-06T23:54:44Z","message":"[Canvas] Fix bug when trying to move elements (#199211)\n\nCloses https://github.com/elastic/kibana/issues/199110\r\n\r\n## Summary\r\n\r\nIn #194634, we switched to\r\nhard-coded strings for the reducers to prevent an import circular\r\ndependency - see\r\nhttps://github.com//pull/194634/files#diff-12e4182415d9eb779aadf492d2b777393e2794c7ac2eb39c48310ab6493ab233L115-R120\r\nfor the relevant change.\r\n\r\nWhat we didn't realize at the time, however, is that there was actually\r\na typo in the original creation of the set position action - the\r\n`actionType` was set to the singular `setMultiplePosition` rather than\r\n`setMultiplePositions`, so there was actually **no** reducer tied to the\r\n`setMultiplePositions` action type after our change - i.e. the reducer\r\nmap was expecting `setMultiplePosition` and did nothing for\r\n`setMultiplePositions`. By changing the `actionType` to the proper\r\nplural `setMultiplePositions`, the reducer map now has a match, so the\r\nreducer gets called as expected.\r\n\r\n| Before | After |\r\n|--------|--------|\r\n| ![Nov-06-2024\r\n14-04-37](https://github.com/user-attachments/assets/627a3fee-2835-446a-b949-f44632d797d3)\r\n| ![Nov-06-2024\r\n14-05-19](https://github.com/user-attachments/assets/f0baed94-3858-47b7-b979-7f27deb50b08)\r\n|\r\n\r\nI looked through the other changes we made to reducer map keys, and\r\nevery `actionType` defined via `createAction` seems to have a matching\r\nreducer map key - so this appears to be a one-off 🙈\r\n\r\n### Checklist\r\n\r\n- [x] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)\r\n- [ ] This will appear in the **Release Notes** and follow the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"1fa30899ab2ba3f534ebb6620a34513a1431e0ed","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","loe:small","impact:critical","v9.0.0","Feature:Canvas","backport:version","v8.17.0","v8.16.1","v8.18.0"],"title":"[Canvas] Fix bug when trying to move elements","number":199211,"url":"https://github.com/elastic/kibana/pull/199211","mergeCommit":{"message":"[Canvas] Fix bug when trying to move elements (#199211)\n\nCloses https://github.com/elastic/kibana/issues/199110\r\n\r\n## Summary\r\n\r\nIn #194634, we switched to\r\nhard-coded strings for the reducers to prevent an import circular\r\ndependency - see\r\nhttps://github.com//pull/194634/files#diff-12e4182415d9eb779aadf492d2b777393e2794c7ac2eb39c48310ab6493ab233L115-R120\r\nfor the relevant change.\r\n\r\nWhat we didn't realize at the time, however, is that there was actually\r\na typo in the original creation of the set position action - the\r\n`actionType` was set to the singular `setMultiplePosition` rather than\r\n`setMultiplePositions`, so there was actually **no** reducer tied to the\r\n`setMultiplePositions` action type after our change - i.e. the reducer\r\nmap was expecting `setMultiplePosition` and did nothing for\r\n`setMultiplePositions`. By changing the `actionType` to the proper\r\nplural `setMultiplePositions`, the reducer map now has a match, so the\r\nreducer gets called as expected.\r\n\r\n| Before | After |\r\n|--------|--------|\r\n| ![Nov-06-2024\r\n14-04-37](https://github.com/user-attachments/assets/627a3fee-2835-446a-b949-f44632d797d3)\r\n| ![Nov-06-2024\r\n14-05-19](https://github.com/user-attachments/assets/f0baed94-3858-47b7-b979-7f27deb50b08)\r\n|\r\n\r\nI looked through the other changes we made to reducer map keys, and\r\nevery `actionType` defined via `createAction` seems to have a matching\r\nreducer map key - so this appears to be a one-off 🙈\r\n\r\n### Checklist\r\n\r\n- [x] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)\r\n- [ ] This will appear in the **Release Notes** and follow the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"1fa30899ab2ba3f534ebb6620a34513a1431e0ed"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16","8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199211","number":199211,"mergeCommit":{"message":"[Canvas] Fix bug when trying to move elements (#199211)\n\nCloses https://github.com/elastic/kibana/issues/199110\r\n\r\n## Summary\r\n\r\nIn #194634, we switched to\r\nhard-coded strings for the reducers to prevent an import circular\r\ndependency - see\r\nhttps://github.com//pull/194634/files#diff-12e4182415d9eb779aadf492d2b777393e2794c7ac2eb39c48310ab6493ab233L115-R120\r\nfor the relevant change.\r\n\r\nWhat we didn't realize at the time, however, is that there was actually\r\na typo in the original creation of the set position action - the\r\n`actionType` was set to the singular `setMultiplePosition` rather than\r\n`setMultiplePositions`, so there was actually **no** reducer tied to the\r\n`setMultiplePositions` action type after our change - i.e. the reducer\r\nmap was expecting `setMultiplePosition` and did nothing for\r\n`setMultiplePositions`. By changing the `actionType` to the proper\r\nplural `setMultiplePositions`, the reducer map now has a match, so the\r\nreducer gets called as expected.\r\n\r\n| Before | After |\r\n|--------|--------|\r\n| ![Nov-06-2024\r\n14-04-37](https://github.com/user-attachments/assets/627a3fee-2835-446a-b949-f44632d797d3)\r\n| ![Nov-06-2024\r\n14-05-19](https://github.com/user-attachments/assets/f0baed94-3858-47b7-b979-7f27deb50b08)\r\n|\r\n\r\nI looked through the other changes we made to reducer map keys, and\r\nevery `actionType` defined via `createAction` seems to have a matching\r\nreducer map key - so this appears to be a one-off 🙈\r\n\r\n### Checklist\r\n\r\n- [x] This was checked for [cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)\r\n- [ ] This will appear in the **Release Notes** and follow the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"1fa30899ab2ba3f534ebb6620a34513a1431e0ed"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Hannah Mudge <[email protected]>
Closes elastic#199110 ## Summary In elastic#194634, we switched to hard-coded strings for the reducers to prevent an import circular dependency - see https://github.com/elastic/kibana/pull/194634/files#diff-12e4182415d9eb779aadf492d2b777393e2794c7ac2eb39c48310ab6493ab233L115-R120 for the relevant change. What we didn't realize at the time, however, is that there was actually a typo in the original creation of the set position action - the `actionType` was set to the singular `setMultiplePosition` rather than `setMultiplePositions`, so there was actually **no** reducer tied to the `setMultiplePositions` action type after our change - i.e. the reducer map was expecting `setMultiplePosition` and did nothing for `setMultiplePositions`. By changing the `actionType` to the proper plural `setMultiplePositions`, the reducer map now has a match, so the reducer gets called as expected. | Before | After | |--------|--------| | ![Nov-06-2024 14-04-37](https://github.com/user-attachments/assets/627a3fee-2835-446a-b949-f44632d797d3) | ![Nov-06-2024 14-05-19](https://github.com/user-attachments/assets/f0baed94-3858-47b7-b979-7f27deb50b08) | I looked through the other changes we made to reducer map keys, and every `actionType` defined via `createAction` seems to have a matching reducer map key - so this appears to be a one-off 🙈 ### Checklist - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels) - [ ] This will appear in the **Release Notes** and follow the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Closes #194050
Summary
This PR refactors the Canvas services to no longer use the
PluginServiceProvider
from thePresentationUtil
plugin. Note that the Canvas storybooks are broken on main (and they have been for who knows how long) and so, while I did make some changes to the storybooks to make them compile, I didn't bother to get them fully functional.Note that the Ecommerce workpad is broken - this is not due to this PR, it is a bug that is present on main.
Checklist
For maintainers