-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Index Management] Improve UX of mappings editor (#152730)
Addresses #52708 ## 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** 1. Go to Stack Management -> Index Management -> Index Templates 2. Create a new index template with some mappings fields. 3. Start editing the created index template and go to the Mappings step of the form wizard. 4. Click on the Edit button of any of the fields. 5. Verify that the Update button is disabled. 6. Verify that any change on the form enables the Update button and displays the "Review all settings before updating" text with a tooltip. https://user-images.githubusercontent.com/59341489/223154894-e3d94e6e-a315-4c75-b10f-d20e0cabcba2.mov <img width="698" alt="Screenshot 2023-03-06 at 15 20 38" src="https://user-images.githubusercontent.com/59341489/223154905-d5e40602-de7e-4780-8998-f12cf50281bd.png"> ### 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 - [X] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [X] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) --------- Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
63da800
commit ee5acfd
Showing
7 changed files
with
167 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.