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 ada7c3e447e6a..d58848eff90c7 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -9937,7 +9937,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 164f5ed22dd88..b5985fc922eef 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -9940,7 +9940,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": "分组依据",