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.x] [Mappings editor] Handle unsupported types (#198185) #198421

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

Fixes elastic#197592

## Summary

This PR fixes the bug where the index Mappings details page crashes if
the index has a mapping field with a type that is not recognized in
Kibana. We fix this by using `getTypeLabelFromField` instead of directly
fetching the `label` property of an object that might be `undefined` -
`getTypeLabelFromField` takes care of this case.

**How to test:**
1. Create the following index in Console (it has the unsupported
`counted_keyword` field type):
```
PUT test
{
  "mappings": {
    "properties": {
      "@timestamp": {
        "type": "date"
      },
      "log": {
        "type": "text"
      },
      "ids": {
        "type": "counted_keyword"
      }
    }
  }
}
```
2. Go to Index Management and click on the index that we just created
3. Go to Mappings tab
4. Verify that the page loads correctly
5. Check that the opening filter and selecting an option doesn't make
the page crash.

https://github.com/user-attachments/assets/4a595968-7cd8-4d36-9a53-264a0d5db50f
(cherry picked from commit 3c5319f)
@kibanamachine kibanamachine merged commit 5a4a17f into elastic:8.x Oct 30, 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
indexManagement 688.1KB 688.0KB -25.0B

cc @ElenaStoeva

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