forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean up table and add more field types
- Loading branch information
1 parent
1038e96
commit 5cf6f73
Showing
2 changed files
with
136 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
...ins/discover/public/application/main/components/sidebar/lib/get_field_type_description.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
|
||
export function getFieldTypeDescription(type: string) { | ||
switch (type) { | ||
case 'boolean': | ||
return i18n.translate('discover.fieldNameDescription.booleanField', { | ||
defaultMessage: 'Boolean field', | ||
}); | ||
case 'conflict': | ||
return i18n.translate('discover.fieldNameDescription.conflictField', { | ||
defaultMessage: 'Conflicting field', | ||
}); | ||
case 'date': | ||
return i18n.translate('discover.fieldNameDescription.dateField', { | ||
defaultMessage: 'A date string or the number of seconds or milliseconds since 1/1/1970.', | ||
}); | ||
case 'geo_point': | ||
return i18n.translate('discover.fieldNameDescription.geoPointField', { | ||
defaultMessage: 'Latitude and longitude points.', | ||
}); | ||
case 'geo_shape': | ||
return i18n.translate('discover.fieldNameDescription.geoShapeField', { | ||
defaultMessage: 'Geo shape field', | ||
}); | ||
case 'ip': | ||
return i18n.translate('discover.fieldNameDescription.ipAddressField', { | ||
defaultMessage: 'IP address field', | ||
}); | ||
case 'murmur3': | ||
return i18n.translate('discover.fieldNameDescription.murmur3Field', { | ||
defaultMessage: 'Murmur3 field', | ||
}); | ||
case 'number': | ||
return i18n.translate('discover.fieldNameDescription.numberField', { | ||
defaultMessage: 'Long, integer, short, byte, double, and float values.', | ||
}); | ||
case 'source': | ||
// Note that this type is currently not provided, type for _source is undefined | ||
return i18n.translate('discover.fieldNameDescription.sourceField', { | ||
defaultMessage: 'Source field', | ||
}); | ||
case 'string': | ||
return i18n.translate('discover.fieldNameDescription.stringField', { | ||
defaultMessage: 'Full text such as the body of an email or a product description.', | ||
}); | ||
case 'text': | ||
return i18n.translate('discover.fieldNameDescription.textField', { | ||
defaultMessage: 'Text field', | ||
}); | ||
case 'keyword': | ||
return i18n.translate('discover.fieldNameDescription.keywordField', { | ||
defaultMessage: | ||
'Structured content such as an ID, email address, hostname, status code, or tag.', | ||
}); | ||
|
||
case 'nested': | ||
return i18n.translate('discover.fieldNameDescription.nestedField', { | ||
defaultMessage: 'Nested field', | ||
}); | ||
case 'version': | ||
return i18n.translate('discover.fieldNameDescription.versionField', { | ||
defaultMessage: 'Version field', | ||
}); | ||
default: | ||
return i18n.translate('discover.fieldNameDescription.unknownField', { | ||
defaultMessage: 'Unknown field', | ||
}); | ||
} | ||
} |