diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx
index 5bcfbc64ec706..a0cc5ec352130 100644
--- a/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx
+++ b/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx
@@ -186,9 +186,13 @@ export const InnerFieldItem = function InnerFieldItem(props: FieldItemProps) {
? i18n.translate('xpack.lens.indexPattern.fieldItemTooltip', {
defaultMessage: 'Drag and drop to visualize.',
})
- : i18n.translate('xpack.lens.indexPattern.fieldStatsButtonLabel', {
+ : exists
+ ? i18n.translate('xpack.lens.indexPattern.fieldStatsButtonLabel', {
defaultMessage: 'Click for a field preview, or drag and drop to visualize.',
})
+ : i18n.translate('xpack.lens.indexPattern.fieldStatsButtonEmptyLabel', {
+ defaultMessage: "This field doesn't have data. Drag and drop to visualize.",
+ })
}
type="iInCircle"
color="subdued"
@@ -217,11 +221,7 @@ export const InnerFieldItem = function InnerFieldItem(props: FieldItemProps) {
isDraggable
isActive={infoIsOpen}
data-test-subj={`lnsFieldListPanelField-${field.name}`}
- onClick={() => {
- if (exists) {
- togglePopover();
- }
- }}
+ onClick={togglePopover}
aria-label={i18n.translate('xpack.lens.indexPattern.fieldStatsButtonAriaLabel', {
defaultMessage: '{fieldName}: {fieldType}. Hit enter for a field preview.',
values: {
@@ -313,7 +313,8 @@ function FieldItemPopoverContents(props: State & FieldItemProps) {
return (
{i18n.translate('xpack.lens.indexPattern.fieldStatsNoData', {
- defaultMessage: 'No data to display.',
+ defaultMessage:
+ 'This field is empty because it doesn’t exist in the 500 sampled documents.',
})}
);
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 1d60b0b5cbbee..af2ed97ad8125 100644
--- a/x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.tsx
+++ b/x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.tsx
@@ -64,9 +64,9 @@ export const InnerFieldsAccordion = function InnerFieldsAccordion({
showExistenceFetchError,
}: FieldsAccordionProps) {
const renderField = useCallback(
- (field: IndexPatternField) => {
- return ;
- },
+ (field: IndexPatternField) => (
+
+ ),
[fieldProps, exists]
);
diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json
index 5ab376194d703..f70ffd6d01f16 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -9946,7 +9946,6 @@
"xpack.lens.indexPattern.fieldStatsButtonLabel": "フィールドプレビューを表示するには、クリックします。可視化するには、ドラッグアンドドロップします。",
"xpack.lens.indexPattern.fieldStatsCountLabel": "カウント",
"xpack.lens.indexPattern.fieldStatsDisplayToggle": "次のどちらかを切り替えます:",
- "xpack.lens.indexPattern.fieldStatsNoData": "表示するデータがありません",
"xpack.lens.indexPattern.fieldTimeDistributionLabel": "時間分布",
"xpack.lens.indexPattern.fieldTopValuesLabel": "トップの値",
"xpack.lens.indexPattern.groupByDropdown": "グループ分けの条件",
diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json
index 0a350d3dabb2a..85f7654998d8e 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -9949,7 +9949,6 @@
"xpack.lens.indexPattern.fieldStatsButtonLabel": "单击以进行字段预览,或拖放以进行可视化。",
"xpack.lens.indexPattern.fieldStatsCountLabel": "计数",
"xpack.lens.indexPattern.fieldStatsDisplayToggle": "切换",
- "xpack.lens.indexPattern.fieldStatsNoData": "没有可显示的数据",
"xpack.lens.indexPattern.fieldTimeDistributionLabel": "时间分布",
"xpack.lens.indexPattern.fieldTopValuesLabel": "排名最前值",
"xpack.lens.indexPattern.groupByDropdown": "分组依据",