kibana/packages/kbn-react-field
Julia Rechkunova 85023d1618
[UnifiedFieldList] Support more field type icons and descriptions (#149416)
Closes https://github.com/elastic/kibana/issues/132688

This PR extends the icons and descriptions with other field types which
are supported by ES but Kibana was showing "unknown".
Descriptions are pulled from docs
https://www.elastic.co/guide/en/elasticsearch/reference/master/mapping-types.html

<img width="652" alt="Screenshot 2023-01-26 at 13 41 01"
src="https://user-images.githubusercontent.com/1415710/214838214-6bc6185a-ac8c-4892-946b-d37bb1f4c41f.png">


<details>
<summary>Sample data</summary>
<p>

```
PUT sample

PUT sample/_mapping
{
  "properties": {
    "keyword_key": {
      "type": "keyword"
    },
    "text_message": {
      "type": "text"
    },
    "number_amount": {
      "type": "long"
    },
    "number_price": {
      "type": "float"
    },
    "bool_enabled": {
      "type": "boolean"
    },
    "binary_blob": {
      "type": "binary"
    },
    "date": {
      "type": "date"
    },
    "date_nanos": {
      "type": "date_nanos"
    },
    "object_user": {
      "properties": {
        "first": { "type": "text" },
        "last": { "type": "text" }
      }
    },
    "nested_user": {
      "type": "nested"
    },
    "flattened_labels": {
      "type": "flattened"
    },
    "range_time_frame": {
      "type": "date_range", 
      "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
    },
    "ip_addr": {
      "type": "ip"
    },
    "version": {
      "type": "version"
    },
    "vector": {
      "type": "dense_vector",
      "dims": 3
    },
    "geo_point": {
      "type": "geo_point"
    },
    "histogram" : {
      "type" : "histogram"
    },
    "rank_features": {
      "type": "rank_features" 
    },
    "geometry": {
      "type": "shape"
    },
    "integer_range": {
      "type": "integer_range"
    },
    "long_range": {
      "type": "long_range"
    },
    "float_range": {
      "type": "float_range"
    },
    "double_range": {
      "type": "double_range"
    },
    "point_location": {
      "type": "point"
    },
    "object_manager": { 
      "properties": {
        "age":  { "type": "integer" },
        "name": { 
          "properties": {
            "first": { "type": "text" },
            "last":  { "type": "text" }
          }
        }
      }
    }
  }
}

DELETE sample/_doc/1
PUT sample/_doc/1
{
    "keyword_key": "abcd1",
    "text_message": "Hi there! I am a sample string.",
    "number_amount": 50,
    "number_price": 10.99,
    "bool_enabled": false,
    "binary_blob": "U29tZSBiaW5hcnkgYmxvYg==",
    "date": "2022-05-22T12:10:30Z",
    "date_nanos": "2022-01-01T12:10:30.123456789Z",
    "object_user": {
      "first": "John",
      "last": "Smith"
    },
    "nested_user" : [
      {
        "first": "John",
        "last": "Smith"
      },
      {
        "first": "Alice",
        "last": "White"
      }
    ],
    "flattened_labels": {
      "priority": "urgent",
      "release": ["v1.2.5", "v1.3.0"]
    },
    "range_time_frame" : {
      "gte" : "2015-10-31 12:00:00",
      "lte" : "2015-11-01"
    },
    "ip_addr": "192.168.1.1",
    "version": "1.2.3",
    "vector": [0.5, 10, 6],
    "geo_point" : "POINT (-71.34 41.12)",
    "array_tags": [ "elasticsearch", "wow" ],
    "array_objects": [
      {
        "name": "prog_list",
        "description": "programming list"
      },
      {
        "name": "cool_list",
        "description": "cool stuff list"
      }
    ],
    "histogram": {
      "values": [0.1, 0.2, 0.3, 0.4, 0.5], 
      "counts": [3, 7, 23, 12, 6] 
    },
    "rank_features": {
      "1star": 10,
      "2star": 100
    },
    "geometry": {
      "type" : "polygon",
      "coordinates" : [
        [ [1000.0, -1001.0], [1001.0, -1001.0], [1001.0, -1000.0], [1000.0, -1000.0], [1000.0, -1001.0] ]
      ]
    },
    "integer_range": {
      "gte" : 10,
      "lt" : 20
    },
    "long_range": {
      "gte" : 100,
      "lt" : 200
    },
    "float_range": {
      "gte" : 10.5,
      "lt" : 20.5
    },
    "double_range": {
      "gte" : 100.5,
      "lt" : 200.5
    },
    "point_location": { 
      "x": -71.34,
      "y": 41.12
    },
    "object_manager": { 
      "age": 30,
      "name": { 
        "first": "John",
        "last":  "Smith"
      }
    }
  }
  
DELETE sample/_doc/2
PUT sample/_doc/2
{
    "keyword_key": "=1+2\";=1+2",
    "text_message": "I'm multiline\n*&%$#@",
    "number_amount": 10,
    "number_price": 105.99,
    "bool_enabled": true,
    "binary_blob": "U29tZSBiaW5hcnkgYmxvYg==",
    "date": "2022-05-20",
    "date_nanos": "2022-01-02T11:10:30.123456789Z",
    "object_user": {
      "first": "Jane",
      "last": "Smith"
    },
    "nested_user": [
      {
        "first": "Jane",
        "last": "Smith"
      }
    ],
    "flattened_labels": {
      "priority": "minor",
      "release": ["v1.4.5"]
    },
    "range_time_frame": {
      "gte": "2015-10-31 12:00:00",
      "lte": "2016-11-01"
    },
    "ip_addr": "192.168.1.0",
    "version": "1.3.3",
    "vector": [0.5, 12, 6],
    "geo_point": {
      "lat": 41.12,
      "lon": -71.34
    },
    "array_tags": [ "=1+2'\" ;,=1+2" ],
    "array_objects": [
      {
        "name": "elastic_list",
        "description": "elastic list"
      }
    ],
    "histogram": {
      "values": [0.1, 0.25, 0.35, 0.4, 0.45, 0.5], 
      "counts": [8, 17, 8, 7, 6, 2] 
   },
   "rank_features": {
      "1star": 20,
      "2star": 350
    },
    "geometry": {
      "type": "geometrycollection",
      "geometries": [
        {
          "type": "point",
          "coordinates": [1000.0, 100.0]
        },
        {
          "type": "linestring",
          "coordinates": [ [1001.0, 100.0], [1002.0, 100.0] ]
        }
      ]
    },
    "integer_range": {
      "gte" : 30,
      "lt" : 40
    },
    "long_range": {
      "gte" : 300,
      "lt" : 400
    },
    "float_range": {
      "gte" : 30.5,
      "lt" : 40.5
    },
    "double_range": {
      "gte" : 300.5,
      "lt" : 400.5
    },
    "point_location": [ -71.34, 41.12 ],
    "object_manager": { 
      "age": 25,
      "name": { 
        "first": "Katy",
        "last":  "Smith"
      }
    }
  }
```

</p>
</details>
2023-01-30 03:07:17 -07:00
..
src [UnifiedFieldList] Support more field type icons and descriptions (#149416) 2023-01-30 03:07:17 -07:00
index.ts chore(NA): remove src folder requirement from packages (part 2) (#138476) 2022-08-30 15:57:35 +01:00
jest.config.js [kibana_react] Extract <FieldButton /> and <FieldIcon/> to a package (#115377) 2021-11-08 17:33:14 +01:00
kibana.jsonc Update codeowners to move AppServices packages to DataDiscovery (#149065) 2023-01-18 13:34:28 -07:00
package.json Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
README.md [kibana_react] Extract <FieldButton /> and <FieldIcon/> to a package (#115377) 2021-11-08 17:33:14 +01:00
tsconfig.json Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00

Shareable field type related React components