Skip to content

Commit

Permalink
Fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Jul 25, 2020
1 parent fdba80b commit 2260613
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/plugins/data/common/index_patterns/fields/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ interface FieldDependencies {

export class Field implements IFieldType {
name: string;
label: string;
label?: string;
type: string;
script?: string;
lang?: string;
Expand Down
1 change: 1 addition & 0 deletions src/plugins/data/common/index_patterns/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export interface FieldSpecExportFmt {
lang?: string;
conflictDescriptions?: FieldSpecConflictDescriptions;
name: string;
label?: string;
type: KBN_FIELD_TYPES;
esTypes?: string[];
scripted: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { SortOrder } from './helpers';
interface Props {
colLeftIdx: number; // idx of the column to the left, -1 if moving is not possible
colRightIdx: number; // idx of the column to the right, -1 if moving is not possible
displayName: string;
displayName?: string;
isRemoveable: boolean;
isSortable: boolean;
name: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ export class IndexedFieldsTable extends Component<
fields.map((field) => {
return {
...field,
displayName: field.displayName,
displayName:
field.displayName !== field.name
? `${field.name} (${field.displayName})`
: field.displayName,
indexPattern: field.indexPattern,
format: getFieldFormat(indexPattern, field.name),
excluded: fieldWildcardMatch ? fieldWildcardMatch(field.name) : false,
Expand All @@ -95,7 +98,11 @@ export class IndexedFieldsTable extends Component<
(fields, fieldFilter, indexedFieldTypeFilter) => {
if (fieldFilter) {
const normalizedFieldFilter = fieldFilter.toLowerCase();
fields = fields.filter((field) => field.name.toLowerCase().includes(normalizedFieldFilter));
fields = fields.filter(
(field) =>
field.name.toLowerCase().includes(normalizedFieldFilter) ||
(field.displayName && field.displayName.toLowerCase().includes(normalizedFieldFilter))
);
}

if (indexedFieldTypeFilter) {
Expand Down

0 comments on commit 2260613

Please sign in to comment.