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

[Index Management] Mappings form crashes when backspace is pressed #156202

Closed
yuliacech opened this issue Apr 28, 2023 · 1 comment · Fixed by #158912
Closed

[Index Management] Mappings form crashes when backspace is pressed #156202

yuliacech opened this issue Apr 28, 2023 · 1 comment · Fixed by #158912
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Index Management Index and index templates UI Feature:Mappings Editor Index mappings editor UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@yuliacech
Copy link
Contributor

Kibana version:
main branch bd5f330
Elasticsearch version:
8.9 snapshot
Server OS version:
macos 13.3.1
Browser version:
Google chrome Version 112.0.5615.137 (Official Build) (arm64)
Browser OS version:
macos 13.3.1
Original install method (e.g. download page, yum, from source, etc.):
from source
Describe the bug:
The Mappings editor crashes when backspace key is pressed
Steps to reproduce:

  1. Navigate to Index Management, tab Component templates
  2. Start the wizard to create a new component template
  3. Get to the Mappings step and add a field of type
  4. Click the pencil icon to edit this field and in the flyout click in the Numeric type dropdown
  5. Press backspace on the keyboard

Expected behavior:
The page should not crash
Screenshots (if relevant):

Screen.Recording.2023-04-28.at.18.36.41.mov

Errors in browser console (if relevant):

act-dom.development.js:11340 Uncaught TypeError: Cannot read properties of undefined (reading 'value')
    at edit_field.tsx:88:1
    at FormDataProviderComp (form_data_provider.ts:24:1)
    at renderWithHooks (react-dom.development.js:14985:1)
    at updateFunctionComponent (react-dom.development.js:17356:1)
    at updateSimpleMemoComponent (react-dom.development.js:17215:1)
    at beginWork (react-dom.development.js:19140:1)
    at HTMLUnknownElement.callCallback (react-dom.development.js:3945:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:1)
    at invokeGuardedCallback (react-dom.development.js:4056:1)
    at beginWork$1 (react-dom.development.js:23964:1)
(

Provide logs and/or server output (if relevant):

Any additional context:

@yuliacech yuliacech added bug Fixes for quality problems that affect the customer experience Feature:Index Management Index and index templates UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more Feature:Mappings Editor Index mappings editor UI labels Apr 28, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/platform-deployment-management (Team:Deployment Management)

ElenaStoeva added a commit that referenced this issue Jun 7, 2023
Fixes #156202

## Summary

This PR fixes the bug in Mappings fields from the Component template
wizard by changing the Subtype parameter so that it handles the case
when the value in the Subtype dropdown menu is cleared, similarly to
[what is done in the Type
parameter](https://github.com/elastic/kibana/blob/801919702ae03d8946c4a5677d387566f43f615c/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/type_parameter.tsx#L75).

**How to test:**

1. Navigate to Index Management, go to Component templates tab.
2. Start the wizard to create a new component template.
3. Go to the Mappings step and add a field of type **Numeric** or
**Range**, and click on the Subtype dropdown menu.
4. Verify that pressing backspace in the Subtype dropdown menu doesn't
make the page to crash.
5. After adding the mapping field, click the pencil icon to edit this
field and in the flyout click in the Numeric/Range type dropdown.
6. Verify that pressing backspace doesn't make the page to crash.

---------

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Index Management Index and index templates UI Feature:Mappings Editor Index mappings editor UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants