(Outdated) [Index Management] Improve UX of mappings editor #152486
Closed
+156
−58
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Renamed the branch which closed this PR. Here is the updated PR: #152730
Summary
This PR implements the short-term solution proposed in #52708 (comment) - disabling the Update button of the mappings editor form when no changes have been made by the user and, when there are saveable changes, displaying some text guiding the user to review all of the field's settings and a tooltip that provides more context.
This implementation uses the
useFormIsModified
hook from the form lib (https://docs.elastic.dev/form-lib/core/use-form-is-modified) which didn't work as expected for this use case so a fix to this hook is added as well. I verified that all other forms that use this hook (the field editor from Data Views and the Connector editor) are working fine with the added fix to the hook. Also, several mappings editor jest tests are modified to match the new scenario and a new one was added to test if the Update button is enabled/disabled as supposed.How to test
Screen.Recording.2023-03-06.at.15.19.57.mov
Checklist