kibana/x-pack/plugins/index_management
Spencer fecdba7eba
[eslint] add rule to prevent export* in plugin index files (#109357)
* [eslint] add rule to prevent export* in plugin index files

* deduplicate export names for types/instances with the same name

* attempt to auto-fix duplicate exports too

* capture exported enums too

* enforce no_export_all for core too

* disable rule by default, allow opting-in for help fixing

* update tests

* reduce yarn.lock duplication

* add rule but no fixes

* disable all existing violations

* update api docs with new line numbers

* revert unnecessary changes to yarn.lock which only had drawbacks

* remove unnecessary eslint-disable

* rework codegen to split type exports and use babel to generate valid code

* check for "export types" deeply

* improve test by using fixtures

* add comments to some helper functions

* disable fix for namespace exports including types

* label all eslint-disable comments with related team-specific issue

* ensure that child exports of `export type` are always tracked as types

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-01 18:05:45 -07:00
..
__jest__ Migrate Stack Management apps to consume internal EuiCodeEditor (#108629) 2021-08-19 10:23:55 -07:00
common [eslint] add rule to prevent export* in plugin index files (#109357) 2021-09-01 18:05:45 -07:00
public [eslint] prevent async Promise constructor mistakes (#110349) 2021-08-31 17:54:13 -04:00
server Index Management ES JS client migration followup (#107463) 2021-08-03 09:16:59 -07:00
test Migrate Stack Management apps to consume internal EuiCodeEditor (#108629) 2021-08-19 10:23:55 -07:00
jest.config.js Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
kibana.json Adding owners to kibana plugins (#108407) 2021-08-17 10:21:06 -04:00
README.md Index Management ES JS client migration followup (#107463) 2021-08-03 09:16:59 -07:00
tsconfig.json [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00

Index Management UI

Indices tab

Quick steps for testing

Create an index with special characters and verify it renders correctly:

# Renders as %{[@metadata][beat]}-%{[@metadata][version]}-2020.08.23
PUT %25%7B%5B%40metadata%5D%5Bbeat%5D%7D-%25%7B%5B%40metadata%5D%5Bversion%5D%7D-2020.08.23

Data streams tab

Quick steps for testing

Create a data stream using Console and you'll be able to view it in the UI:

# Configure template for creating a data stream
PUT _index_template/ds
{
  "index_patterns": ["ds"],
  "data_stream": {}
}

# Add a document to the data stream
POST ds/_doc
{
  "@timestamp": "2020-01-27"
}

Create a data stream with special characters and verify it renders correctly:

# Configure template for creating a data stream
PUT _index_template/special_ds
{
  "index_patterns": ["%{[@metadata][beat]}-%{[@metadata][version]}-2020.08.23"],
  "data_stream": {}
}

# Add a document to the data stream, which will render as %{[@metadata][beat]}-%{[@metadata][version]}-2020.08.23
POST %25%7B%5B%40metadata%5D%5Bbeat%5D%7D-%25%7B%5B%40metadata%5D%5Bversion%5D%7D-2020.08.23/_doc
{
  "@timestamp": "2020-01-27"
}

Index templates tab

Quick steps for testing

By default, legacy index templates are not shown in the UI. Make them appear by creating one in Console:

PUT _template/template_1
{
  "index_patterns": ["foo*"]
}

To test Cloud-managed templates:

  1. Add cluster.metadata.managed_index_templates setting via Dev Tools:
PUT /_cluster/settings
{
  "persistent": {
    "cluster.metadata.managed_index_templates": ".cloud-"
  }
}
  1. Create a template with the format: .cloud-<template_name> via Dev Tools.
PUT _template/.cloud-example
{
  "index_patterns": [ "foobar*"]
}

The UI will now prevent you from editing or deleting this template.

In 7.x, the UI supports types defined as part of the mappings for legacy index templates. To test this out, use the "Load JSON" feature and verify the custom type is preserved:

{
  "my_custom_type": {
    "_source": {
      "enabled": false
    },
    "properties": {
      "name1": {
        "type": "keyword"
      }
    }
  }
}