Skip to content
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

[8.16] [Canvas] Fix bug when trying to move elements (#199211) #199245

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.16:

Questions ?

Please refer to the Backport tool documentation

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)
@kibanamachine kibanamachine merged commit e63d4ec into elastic:8.16 Nov 7, 2024
24 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
canvas 1.1MB 1.1MB +1.0B

cc @Heenawter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants