-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Discover] Fixed tooltips for text and keyword fields displaying 'Unknown field' in expanded document #133536
[Discover] Fixed tooltips for text and keyword fields displaying 'Unknown field' in expanded document #133536
Conversation
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
4445e44
to
723b332
Compare
@elasticmachine merge upstream |
@@ -29,7 +29,7 @@ import type { DataViewField, DataView } from '@kbn/data-views-plugin/public'; | |||
import { getTypeForFieldIcon } from '../../../../utils/get_type_for_field_icon'; | |||
import { DiscoverFieldDetails } from './discover_field_details'; | |||
import { FieldDetails } from './types'; | |||
import { getFieldTypeName } from './lib/get_field_type_name'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx a lot for cleaning this up and removing duplicated code 👍 . You can flag the PR ready for review. One thing you could add on top of it, could be a Jest test for e.g. discover_field.tsx
that would catch the error. Or a basic one for get_field_type_name.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests added for get_field_type_name.ts
return i18n.translate('discover.fieldNameIcons.versionFieldAriaLabel', { | ||
defaultMessage: 'Version field', | ||
}); | ||
default: | ||
return i18n.translate('discover.fieldNameIcons.unknownFieldAriaLabel', { | ||
defaultMessage: 'Unknown field', | ||
defaultMessage: UNKNOWN_FIELD_TYPE_MESSAGE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is breaking the build. when you revert the change your tests would no longer work. So you could rewrite the test to first get the default message getFieldTypeName()
, and check that all known fieldtypes return different values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Broken tests should now be fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, didn't test again, great to have more test coverage, Congrats and welcome to the Discover side of Kibana 🥳
💛 Build succeeded, but was flakyFailed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @davismcphee |
…nown field' in expanded document (#133536) * [Discover] Fixed tooltips for text and keyword fields displaying 'Unknown field' * [Discover] Added tests for getFieldTypeName function * [Discover] Fixing issue where i18n defaultMessage was a variable instead of a constant string Co-authored-by: Kibana Machine <[email protected]> (cherry picked from commit 3e3ee3e)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
…nown field' in expanded document (#133536) (#134153) * [Discover] Fixed tooltips for text and keyword fields displaying 'Unknown field' * [Discover] Added tests for getFieldTypeName function * [Discover] Fixing issue where i18n defaultMessage was a variable instead of a constant string Co-authored-by: Kibana Machine <[email protected]> (cherry picked from commit 3e3ee3e) Co-authored-by: Davis McPhee <[email protected]>
Summary
This PR fixes an issue where tooltips/mouseover text on the expanded document shows 'Unknown field' for keyword or text fields.
The issue stems from the field list and expanded document flyout using two different functions to get the field name. The functions seemed to be clones of each other so I removed the broken one and moved the working one to what looks like a common utils folder so both areas can share it.
Fixes #131788.
Checklist
Documentation was added for features that require explanation or tutorialsAny UI touched in this PR is usable by keyboard only (learn more about keyboard accessibility)Any UI touched in this PR does not create any new axe failures (run axe in browser: FF, Chrome)If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker listThis renders correctly on smaller devices using a responsive layout. (You can test this in your browser)This was checked for cross-browser compatibilityFor maintainers