diff --git a/packages/kbn-field-utils/src/types.ts b/packages/kbn-field-utils/src/types.ts index 4899ca6daad33..43b790ec9326b 100644 --- a/packages/kbn-field-utils/src/types.ts +++ b/packages/kbn-field-utils/src/types.ts @@ -21,7 +21,7 @@ export interface FieldBase { timeSeriesMetric?: DataViewField['timeSeriesMetric']; esTypes?: DataViewField['esTypes']; scripted?: DataViewField['scripted']; - empty?: DataViewField['empty']; + isNull?: DataViewField['isNull']; conflictDescriptions?: Record; } diff --git a/packages/kbn-unified-field-list/src/hooks/use_grouped_fields.test.tsx b/packages/kbn-unified-field-list/src/hooks/use_grouped_fields.test.tsx index 69723b012409b..c2a2379a676e1 100644 --- a/packages/kbn-unified-field-list/src/hooks/use_grouped_fields.test.tsx +++ b/packages/kbn-unified-field-list/src/hooks/use_grouped_fields.test.tsx @@ -472,13 +472,13 @@ describe('UnifiedFieldList useGroupedFields()', () => { expect(fieldListGroupedProps.fieldsExistInIndex).toBe(true); }); - it('should work correctly for text-based queries (no data view) with empty fields', async () => { + it('should work correctly for text-based queries (no data view) with isNull fields', async () => { const allFieldsEmpty = [...new Array(2)].flatMap((_, index) => allFields.map((field) => { return new DataViewField({ ...field.toSpec(), name: `${field.name}${index || ''}`, - empty: true, + isNull: true, }); }) ); diff --git a/packages/kbn-unified-field-list/src/hooks/use_grouped_fields.ts b/packages/kbn-unified-field-list/src/hooks/use_grouped_fields.ts index ce574acc153f1..cb4beb0648327 100644 --- a/packages/kbn-unified-field-list/src/hooks/use_grouped_fields.ts +++ b/packages/kbn-unified-field-list/src/hooks/use_grouped_fields.ts @@ -157,7 +157,7 @@ export function useGroupedFields({ return 'availableFields'; } - if (field?.empty) { + if (field?.isNull) { return 'emptyFields'; } if (dataView?.getFieldByName && !dataView.getFieldByName(field.name)) { diff --git a/src/plugins/data_views/common/fields/data_view_field.ts b/src/plugins/data_views/common/fields/data_view_field.ts index 213f9193455db..36cd78682aa97 100644 --- a/src/plugins/data_views/common/fields/data_view_field.ts +++ b/src/plugins/data_views/common/fields/data_view_field.ts @@ -309,8 +309,8 @@ export class DataViewField implements DataViewFieldBase { * Returns true if field is Empty */ - public get empty() { - return Boolean(this.spec.empty); + public get isNull() { + return Boolean(this.spec.isNull); } /** diff --git a/src/plugins/data_views/common/types.ts b/src/plugins/data_views/common/types.ts index 726fdb62c2f48..5f599cbf31894 100644 --- a/src/plugins/data_views/common/types.ts +++ b/src/plugins/data_views/common/types.ts @@ -410,7 +410,7 @@ export type FieldSpec = DataViewFieldBase & { /** * True if field is empty */ - empty?: boolean; + isNull?: boolean; /** * True if can be read from doc values */ diff --git a/src/plugins/discover/public/application/main/components/sidebar/lib/get_field_list.ts b/src/plugins/discover/public/application/main/components/sidebar/lib/get_field_list.ts index e8ddc9b592d38..487f0faf7a046 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/lib/get_field_list.ts +++ b/src/plugins/discover/public/application/main/components/sidebar/lib/get_field_list.ts @@ -74,7 +74,7 @@ export function getTextBasedQueryFieldList( type: column.meta?.type ?? 'unknown', searchable: false, aggregatable: false, - empty: Boolean(column?.isNull), + isNull: Boolean(column?.isNull), }) ); }