diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.scss b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.scss index df73789eadedf..15464bb204f17 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.scss +++ b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.scss @@ -10,6 +10,10 @@ margin-bottom: $euiSizeS; } +.lnsInnerIndexPatternDataPanel__titleTooltip { + margin-right: $euiSizeXS; +} + .lnsInnerIndexPatternDataPanel__fieldItems { // Quick fix for making sure the shadow and focus rings are visible outside the accordion bounds padding: $euiSizeXS; @@ -34,3 +38,5 @@ margin-right: $euiSizeS; } } + + diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx index 5121714050c68..4bb18d1ee4a17 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx @@ -335,7 +335,10 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({ : i18n.translate('xpack.lens.indexPattern.availableFieldsLabel', { defaultMessage: 'Available fields', }), - + helpText: i18n.translate('xpack.lens.indexPattern.allFieldsLabelHelp', { + defaultMessage: + 'Available fields have data in the first 500 documents that match your filters. To view all fields, expand Empty fields. Some field types cannot be visualized in Lens, including full text and geographic fields.', + }), isAffectedByGlobalFilter: !!filters.length, isAffectedByTimeFilter: true, hideDetails: fieldInfoUnavailable, @@ -357,6 +360,10 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({ defaultNoFieldsMessage: i18n.translate('xpack.lens.indexPatterns.noEmptyDataLabel', { defaultMessage: `There are no empty fields.`, }), + helpText: i18n.translate('xpack.lens.indexPattern.emptyFieldsLabelHelp', { + defaultMessage: + 'Empty fields did not contain any values in the first 500 documents based on your filters.', + }), }, MetaFields: { fields: groupedFields.metaFields, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/field_list.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/field_list.tsx index 16d1ecbf3296b..5668e85510f9d 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/field_list.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/field_list.tsx @@ -22,6 +22,7 @@ export type FieldGroups = Record< showInAccordion: boolean; isInitiallyOpen: boolean; title: string; + helpText?: string; isAffectedByGlobalFilter: boolean; isAffectedByTimeFilter: boolean; hideDetails?: boolean; @@ -150,6 +151,7 @@ export function FieldList({ key={key} id={`lnsIndexPattern${key}`} label={fieldGroup.title} + helpTooltip={fieldGroup.helpText} exists={exists} hideDetails={fieldGroup.hideDetails} hasLoaded={!!hasSyncedExistingFields} diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.tsx index 19f478c335784..ef249f87f05e4 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.tsx @@ -15,6 +15,7 @@ import { EuiLoadingSpinner, EuiIconTip, } from '@elastic/eui'; +import classNames from 'classnames'; import { DataPublicPluginStart } from 'src/plugins/data/public'; import { IndexPatternField } from './types'; import { FieldItem } from './field_item'; @@ -39,6 +40,7 @@ export interface FieldsAccordionProps { onToggle: (open: boolean) => void; id: string; label: string; + helpTooltip?: string; hasLoaded: boolean; fieldsCount: number; isFiltered: boolean; @@ -55,6 +57,7 @@ export const InnerFieldsAccordion = function InnerFieldsAccordion({ onToggle, id, label, + helpTooltip, hasLoaded, fieldsCount, isFiltered, @@ -78,6 +81,11 @@ export const InnerFieldsAccordion = function InnerFieldsAccordion({ [fieldProps, exists, hideDetails] ); + const titleClassname = classNames({ + // eslint-disable-next-line @typescript-eslint/naming-convention + lnsInnerIndexPatternDataPanel__titleTooltip: !!helpTooltip, + }); + return ( - {label} + {label} + {!!helpTooltip && ( + + )} } extraAction={