Skip to content

Commit

Permalink
Apply PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula committed Feb 1, 2024
1 parent 5d935db commit 04210d6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/kbn-field-utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface FieldBase {
timeSeriesMetric?: DataViewField['timeSeriesMetric'];
esTypes?: DataViewField['esTypes'];
scripted?: DataViewField['scripted'];
empty?: DataViewField['empty'];
isNull?: DataViewField['isNull'];
conflictDescriptions?: Record<string, string[]>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export function useGroupedFields<T extends FieldListItem = DataViewField>({
return 'availableFields';
}

if (field?.empty) {
if (field?.isNull) {
return 'emptyFields';
}
if (dataView?.getFieldByName && !dataView.getFieldByName(field.name)) {
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/data_views/common/fields/data_view_field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data_views/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function getTextBasedQueryFieldList(
type: column.meta?.type ?? 'unknown',
searchable: false,
aggregatable: false,
empty: Boolean(column?.isNull),
isNull: Boolean(column?.isNull),
})
);
}

0 comments on commit 04210d6

Please sign in to comment.