-
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
[ML] Data visualizer: Add field types in-product help #137121
Conversation
48b5c7b
to
69cd035
Compare
Pinging @elastic/ml-ui (:ml) |
defaultMessage: 'Software versions. Supports {SemanticVersioningLink} precedence rules.', | ||
values: { | ||
SemanticVersioningLink: | ||
`<a href="https://semver.org/" |
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.
Any reason this has to be a string of an a tag as opposed to a link component from the eui library?
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 originally copied from Discover. Since this is in a constant file used in a helper function, using EuiLink would require this file to be importing React. However, if readability is important, we can definitely switch over.
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.
Sounds good 👍
const closeHelp = () => setIsHelpOpen(false); | ||
|
||
const items: FieldTypeTableItem[] = useMemo(() => { | ||
return fieldTypes.map((type, index) => ({ |
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.
nit: could be implicit return
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.
Updated here 024eac1
defaultMessage: 'Description', | ||
}), | ||
// eslint-disable-next-line react/no-danger | ||
render: (description: string) => <div dangerouslySetInnerHTML={{ __html: description }} />, |
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.
The description here is only ever set internally, right? Just making sure we want use the set inner html
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.
I realized we don't even need it so I removed that part here 024eac1
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.
Minor comments about the punctuation, otherwise text strings LGTM
switch (type) { | ||
case SUPPORTED_FIELD_TYPES.BOOLEAN: | ||
return i18n.translate('xpack.dataVisualizer.index.fieldNameDescription.booleanField', { | ||
defaultMessage: 'True and false 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.
These incomplete phrases don't warrant punctuation IMO
defaultMessage: 'True and false values.', | |
defaultMessage: 'True and false 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.
Updated here 024eac1
}); | ||
case SUPPORTED_FIELD_TYPES.DATE: | ||
return i18n.translate('xpack.dataVisualizer.index.fieldNameDescription.dateField', { | ||
defaultMessage: 'A date string or the number of seconds or milliseconds since 1/1/1970.', |
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.
defaultMessage: 'A date string or the number of seconds or milliseconds since 1/1/1970.', | |
defaultMessage: 'A date string or the number of seconds or milliseconds since 1/1/1970', |
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.
Updated here 024eac1
}); | ||
case SUPPORTED_FIELD_TYPES.GEO_POINT: | ||
return i18n.translate('xpack.dataVisualizer.index.fieldNameDescription.geoPointField', { | ||
defaultMessage: 'Latitude and longitude points.', |
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.
defaultMessage: 'Latitude and longitude points.', | |
defaultMessage: 'Latitude and longitude points', |
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.
Updated here 024eac1
}); | ||
case SUPPORTED_FIELD_TYPES.GEO_SHAPE: | ||
return i18n.translate('xpack.dataVisualizer.index.fieldNameDescription.geoShapeField', { | ||
defaultMessage: 'Complex shapes, such as polygons.', |
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.
defaultMessage: 'Complex shapes, such as polygons.', | |
defaultMessage: 'Complex shapes such as polygons', |
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.
Updated here 024eac1
}); | ||
case SUPPORTED_FIELD_TYPES.HISTOGRAM: | ||
return i18n.translate('xpack.dataVisualizer.index.fieldNameDescription.histogramField', { | ||
defaultMessage: 'Pre-aggregated numerical values in the form of a histogram.', |
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.
defaultMessage: 'Pre-aggregated numerical values in the form of a histogram.', | |
defaultMessage: 'Pre-aggregated numerical values in the form of a histogram', |
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.
Updated here 024eac1
}); | ||
case SUPPORTED_FIELD_TYPES.NUMBER: | ||
return i18n.translate('xpack.dataVisualizer.index.fieldNameDescription.numberField', { | ||
defaultMessage: 'Long, integer, short, byte, double, and float 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.
defaultMessage: 'Long, integer, short, byte, double, and float values.', | |
defaultMessage: 'Long, integer, short, byte, double, and float 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.
Updated here 024eac1
}); | ||
case SUPPORTED_FIELD_TYPES.STRING: | ||
return i18n.translate('xpack.dataVisualizer.index.fieldNameDescription.stringField', { | ||
defaultMessage: 'Full text such as the body of an email or a product description.', |
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.
defaultMessage: 'Full text such as the body of an email or a product description.', | |
defaultMessage: 'Full text such as the body of an email or a product description', |
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.
Updated here 024eac1
}); | ||
case SUPPORTED_FIELD_TYPES.TEXT: | ||
return i18n.translate('xpack.dataVisualizer.index.fieldNameDescription.textField', { | ||
defaultMessage: 'Full text such as the body of an email or a product description.', |
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.
defaultMessage: 'Full text such as the body of an email or a product description.', | |
defaultMessage: 'Full text such as the body of an email or a product description', |
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.
Updated here 024eac1
case SUPPORTED_FIELD_TYPES.KEYWORD: | ||
return i18n.translate('xpack.dataVisualizer.index.fieldNameDescription.keywordField', { | ||
defaultMessage: | ||
'Structured content such as an ID, email address, hostname, status code, or tag.', |
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.
'Structured content such as an ID, email address, hostname, status code, or tag.', | |
'Structured content such as an ID, email address, hostname, status code, or tag', |
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.
Updated here 024eac1
}); | ||
case SUPPORTED_FIELD_TYPES.VERSION: | ||
return i18n.translate('xpack.dataVisualizer.index.fieldNameDescription.versionField', { | ||
defaultMessage: 'Software versions. Supports {SemanticVersioningLink} precedence rules.', |
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.
defaultMessage: 'Software versions. Supports {SemanticVersioningLink} precedence rules.', | |
defaultMessage: 'Software versions. Supports {SemanticVersioningLink} precedence rules', |
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.
Updated here 024eac1
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.
Tested and other than the changes already suggested LGTM
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 ⚡
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @qn895 |
Summary
This PR addresses #131577 and is part of #86387. It adds the popover with the help information for each field type.
Index based
File based
Checklist
Fixes #131577