[Mappings editor] Fix UI and performance issues#54224
Conversation
|
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
jloleysens
left a comment
There was a problem hiding this comment.
Tested locally, changes look good to me!
alisonelizabeth
left a comment
There was a problem hiding this comment.
LGTM. Thanks for fixing these issues!
There was a problem hiding this comment.
Tested locally, and I think this looks great! I had a brainstorm while I was testing locally. Why don't we prepopulate the "Load JSON" modal with the existing mappings JSON, and change the language to be "Edit JSON" instead? Doesn't this get us most of the way to the "edit JSON" experience you had in mind, Seb? We also wouldn't need a callout to warn the user that this will replace the existing mappings because that's already implied (#54249).
++ I like this idea a lot. |
|
Wawww 3 reviewers for this PR... I knew that a
In that case, I would prefer to have the JsonEditor and get rid of the modal 😊 Your suggestion (having the edit JSON functionality in the modal) implies that we have to validate that there aren't any errors in the form(s) (e.g. that thee At this stage, it is simpler to add a call-out at the top of the load JSON warning the user that this will replace the current mappings and change the confirm button label with "Load and Replace" (The JsonEditor is not yet guaranteed to land for FF). Happy to have a second thought later on this. |

This PR fixes some issues detected when testing the mappings editor
Fixes #54212
Primary button when loading JSON
The "danger" color has been removed.
"Automagically" switch to the JSON editor when a big mapping is loaded
The behavior has been removed and it will be a conscientious decision by the user to switch to the JSON editor.
Performance when deNormalize the fields
When leaving the mappings editor (changing steps) with a big mapping (the metric beat for example), I noticed the UI not responsive. And indeed, there was a performance bug in the
deNormalize()function.Before (1.73s)
After (4.58ms):