Closes https://github.com/elastic/kibana/issues/151702
## Summary
This PR migrates drag and drop logic from Lens plugin to a new package
so we can reuse it on Discover page later. At this point there should be
no visual changes. If you notice something, please comment on the PR.
- [x] Migrate drag&drop code to its own package `@kbn/dom-drag-drop`
- [x] Clean up i18n strings
- [x] Clean up styles
- [x] Adjust tests
- [x] Make telemetry optional
- [x] Configurable `data-test-subj`
Please test by using your mouse and also by using keyword shortcuts.
# Next steps
- Redesign for field list item (smaller button, a separate handle icon,
pill styles)
- Redesign for draggable buttons in the Lens layer panels (smaller
buttons)
-
[Figma](https://www.figma.com/file/SvpfCqaZPb2iAYnPtd0Gnr/KUI-Library?node-id=674%3A198901&t=OnQH2EQ4fdBjsRLp-0)
- https://github.com/elastic/kibana/issues/151703
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
# [Security Solution] Data Quality dashboard
## Check ECS compatibility with just one click
With just one click, the _Data Quality dashboard_ checks all the indices used by the Security Solution, (or anything else), for compatibility with the [Elastic Common Schema (ECS)](https://www.elastic.co/guide/en/ecs/current/ecs-reference.html)

## Create cases from results
Create a single case containing all the results, or create cases for specific indices

## Interactive tabs put results in context
Expand any index to reveal interactive tabs
- Summary
- Incompatible fields
- Custom fields
- ECS complaint fields
- All fields

## Share comprehensive markdown reports
Share markdown reports containing the same content as the dashboard

### On page load
When the Data Quality dashboard page loads, the alerts index, and any indices matching the selected `Data view` are displayed

Only `hot`, `warm`, or `unmanaged` indices are displayed by default
Indices are not checked automatically when the dashboard loads
Click either :
- `Check all` to check all the indices on the page
- The expand button to automatically check (just) one index, and instantly view results
### Check all
When the `Check all` button is clicked
- The `Check all` button changes to a `Cancel` button
- The `Last checked: n <time unit> ago` text is replaced with a progress bar indicating how many Indices are left to check
- The `Checking <index name>` text will update as each index is checked. Text will wrap if necessary
- The results tables begin updating with results
- Pattern stats update to summarize each table
- Rolled up results for the entire page update after every index is checked

<https://user-images.githubusercontent.com/4459398/216007795-2ebbc0c6-8c7a-49c7-a22c-b97d2a58dddd.mov>
When Check all, is running, the Data Quality dashboard adds a three second delay after every check completes, before beginning the next check.
Check all will keep checking indexes until the user cancels, or all indexes have (attempted to be) checked.
While Check all is running, users may simultaneously click on any index to check it on demand. The results are instantly rolled up when this happens.
When all checks complete, the page looks like this:

### Take action
Click the `Take action` popover to share the entire page of results via one of the following actions:
- Add to new case
- Copy to clipboard



### Expanding results
The `Incompatible fields` tab is always displayed by default when a result is expanded
The `Incompatible fields` tab shows a success message when a successful result is expanded

The `Incompatible fields` tab shows, side by side, expected ECS mapping types vs the actual mapping types when they are different

The `Incompatible fields` tab also compares field values expected by ECS vs the actual values in an index, when they are different

The `Incompatible fields` tab displays a callout that explains the consequences of having incompatible fields. The content is based on the following illustration, created by @MikePaquette
<img width="1264" alt="ecs_meter" src="https://user-images.githubusercontent.com/4459398/216016124-6fe89ab4-c364-40ec-8a6f-99349e6d583c.png">
The calllout has a call to action to create a case or copy a markdown report for just the expanded result
- Add to new case
- Copy to clipboard

### Tabs
The Summary tab displays a call to action when incompatible fields are found
Click on any part of the Summary tab chart or legend to navigate to the corresponding tab

Clicking on the `Copy to clipboard` call to action in the Custom fields tab copies a markdown version of the table to the clipboard

The search feature of the ECS complaint fields tab may, for example, be used to verify a specific ECS complaint mapping exists

The All fields tab displays the union of all other tabs

### Data view selection
The `Data view` dropdown defaults to the `Security Default Data View`

The alerts index is always checked and included in the results, even when another Data View is selected

### ILM phase options

Only `hot`, `warm`, or `unmanaged` indices may be selected for checking.
The `cold` and `frozen` options are disabled.
When all options in the `ILM phase` box are cleared, an informative empty prompt is displayed

### Errors
Errors may occur for some (or all) indices. The `View errors` button appears when the first error occurs

Users may click the `View errors` button to view them, even while a check is in progress

The Copy to clipboard button in the errors popover copies a markdown version of the errors table to the clipboard
When errors occur, the same content shown in the Errors popover is automatically included in the markdown report created by the `Take action` menu
### Markdown reports
The content of markdown reports (created by the Take action menu) includes most of the content from the Data Quality dashboard that created it
In the screenshot below, the Data Quality dashboard is on the left, and a markdown report (pasted into Github) is on the right

Stats rollups and tables are included in markdown reports

Markdown reports use the same "expected vs actual" format to display the details of incompatible field mappings
### Navigation
The Data Quality dashboard is grouped with the existing Security Solution dashboards

It may also be launched via the side navigation

## Privileges
The privileges in the table below are required to check any pattern of indices, or any specific index:
| Privilege | Required to | Required for API |
|-------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|------------------|
| `monitor` or `manage` (`manage` builds on `monitor`) | List indices that match a pattern, and get document counts for an index example: `GET logs-*/_stats` | `_stats` |
| `view_index_metadata` or `manage_ilm` | List index ILM configs (e.g. hot) that match a pattern example: `GET logs-*/_ilm/explain` | `_ilm/explain` |
| `view_index_metadata` or `manage` | Get index mappings for a specific index example: `GET .ds-logs-endpoint.events.process-default-2023.01.17-000001/_mapping` | `_mapping` |
| `read` or `read_cross_cluster` | Run aggregations to test for unallowed values example: `GET .ds-logs-endpoint.events.process-default-2023.01.17-000001/_search` | `_search` |
Users may have some of the privileges required to check an index, but not all of them.
The built-in `viewer` role does not have the `monitor` (or `manage`) role. The following screenshot illustrates what a user will see if they login as a user with the `viewer` role:

# An actual markdown report (all content below)
The rest of the content below is pasted from an actual report, created via the `Take action` menu:
# Data quality
| Incompatible fields | Indices checked | Indices | Docs |
|---------------------|-----------------|---------|------|
| 17 | 15 | 17 | 1,404,514 |
## .alerts-security.alerts-default
`hot(1)`
| Incompatible fields | Indices checked | Indices | Docs |
|---------------------|-----------------|---------|------|
| 1 | 1 | 1 | 1,837 |
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ❌ | .internal.alerts-security.alerts-default-000001 | 1,837 (100.0%) | 1 | `hot` |
### .internal.alerts-security.alerts-default-000001
The `.internal.alerts-security.alerts-default-000001` index has [mappings](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html) or field values that are different than the [Elastic Common Schema](https://www.elastic.co/guide/en/ecs/current/ecs-reference.html) (ECS), version `8.6.0` [definitions](https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html).
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ❌ | .internal.alerts-security.alerts-default-000001 | 1,837 (100.0%) | 1 | `hot` |
### **Incompatible fields** `1` **Custom fields** `188` **ECS compliant fields** `1219` **All fields** `1408`
#### 1 incompatible field
Fields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version 8.6.0.
❌ Detection engine rules referencing these fields may not match them correctly
❌ Pages may not display some events or fields due to unexpected field mappings or values
❌ Mappings or field values that don't comply with ECS are not supported
#### Incompatible field values - .internal.alerts-security.alerts-default-000001
| Field | ECS values (expected) | Document values (actual) |
|-------|-----------------------|--------------------------|
| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `behavior` (62) |
## auditbeat-*
`hot(11)` `unmanaged(1)`
| Incompatible fields | Indices checked | Indices | Docs |
|---------------------|-----------------|---------|------|
| 13 | 10 | 12 | 29,182 |
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ✅ | .ds-auditbeat-8.6.0-2023.01.17-000001 | 14,409 (49.4%) | 0 | `hot` |
| -- | .ds-auditbeat-8.5.3-2023.01.24-000001 | 2,857 (9.8%) | -- | `hot` |
| ✅ | .ds-auditbeat-8.2.3-2023.01.24-000001 | 2,246 (7.7%) | 0 | `hot` |
| ✅ | .ds-auditbeat-8.4.1-2023.01.24-000001 | 2,179 (7.5%) | 0 | `hot` |
| -- | .ds-auditbeat-8.3.3-2023.01.24-000001 | 1,921 (6.6%) | -- | `hot` |
| ✅ | auditbeat-7.16.0-2023.01.17-000001 | 1,880 (6.4%) | 0 | `hot` |
| ✅ | .ds-auditbeat-8.1.1-2023.01.24-000001 | 1,676 (5.7%) | 0 | `hot` |
| ✅ | .ds-auditbeat-8.2.2-2023.01.24-000001 | 1,578 (5.4%) | 0 | `hot` |
| ✅ | .ds-auditbeat-8.0.0-2023.01.24-000001 | 251 (0.9%) | 0 | `hot` |
| ❌ | auditbeat-7.10.2-2023.01.24-000001 | 111 (0.4%) | 12 | `hot` |
| ✅ | .ds-auditbeat-8.5.0-2023.01.24-000001 | 74 (0.3%) | 0 | `hot` |
| ❌ | auditbeat-custom-empty-index-1 | 0 (0.0%) | 1 | `unmanaged` |
### .ds-auditbeat-8.6.0-2023.01.17-000001
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ✅ | .ds-auditbeat-8.6.0-2023.01.17-000001 | 14,409 (49.4%) | 0 | `hot` |
### **Incompatible fields** `0` **Custom fields** `549` **ECS compliant fields** `1210` **All fields** `1759`
### .ds-auditbeat-8.2.3-2023.01.24-000001
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ✅ | .ds-auditbeat-8.2.3-2023.01.24-000001 | 2,246 (7.7%) | 0 | `hot` |
### **Incompatible fields** `0` **Custom fields** `510` **ECS compliant fields** `1210` **All fields** `1720`
### .ds-auditbeat-8.4.1-2023.01.24-000001
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ✅ | .ds-auditbeat-8.4.1-2023.01.24-000001 | 2,179 (7.5%) | 0 | `hot` |
### **Incompatible fields** `0` **Custom fields** `509` **ECS compliant fields** `1210` **All fields** `1719`
### auditbeat-7.16.0-2023.01.17-000001
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ✅ | auditbeat-7.16.0-2023.01.17-000001 | 1,880 (6.4%) | 0 | `hot` |
### **Incompatible fields** `0` **Custom fields** `523` **ECS compliant fields** `1111` **All fields** `1634`
### .ds-auditbeat-8.1.1-2023.01.24-000001
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ✅ | .ds-auditbeat-8.1.1-2023.01.24-000001 | 1,676 (5.7%) | 0 | `hot` |
### **Incompatible fields** `0` **Custom fields** `510` **ECS compliant fields** `1204` **All fields** `1714`
### .ds-auditbeat-8.2.2-2023.01.24-000001
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ✅ | .ds-auditbeat-8.2.2-2023.01.24-000001 | 1,578 (5.4%) | 0 | `hot` |
### **Incompatible fields** `0` **Custom fields** `510` **ECS compliant fields** `1210` **All fields** `1720`
### .ds-auditbeat-8.0.0-2023.01.24-000001
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ✅ | .ds-auditbeat-8.0.0-2023.01.24-000001 | 251 (0.9%) | 0 | `hot` |
### **Incompatible fields** `0` **Custom fields** `510` **ECS compliant fields** `1204` **All fields** `1714`
### auditbeat-7.10.2-2023.01.24-000001
The `auditbeat-7.10.2-2023.01.24-000001` index has [mappings](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html) or field values that are different than the [Elastic Common Schema](https://www.elastic.co/guide/en/ecs/current/ecs-reference.html) (ECS), version `8.6.0` [definitions](https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html).
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ❌ | auditbeat-7.10.2-2023.01.24-000001 | 111 (0.4%) | 12 | `hot` |
### **Incompatible fields** `12` **Custom fields** `467` **ECS compliant fields** `602` **All fields** `1081`
#### 12 incompatible fields
Fields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version 8.6.0.
❌ Detection engine rules referencing these fields may not match them correctly
❌ Pages may not display some events or fields due to unexpected field mappings or values
❌ Mappings or field values that don't comply with ECS are not supported
#### Incompatible field mappings - auditbeat-7.10.2-2023.01.24-000001
| Field | ECS mapping type (expected) | Index mapping type (actual) |
|-------|-----------------------------|-----------------------------|
| error.message | `match_only_text` | `text` |
| error.stack_trace | `wildcard` | `keyword` |
| http.request.body.content | `wildcard` | `keyword` |
| http.response.body.content | `wildcard` | `keyword` |
| message | `match_only_text` | `text` |
| process.command_line | `wildcard` | `keyword` |
| process.parent.command_line | `wildcard` | `keyword` |
| registry.data.strings | `wildcard` | `keyword` |
| url.full | `wildcard` | `keyword` |
| url.original | `wildcard` | `keyword` |
| url.path | `wildcard` | `keyword` |
#### Incompatible field values - auditbeat-7.10.2-2023.01.24-000001
| Field | ECS values (expected) | Document values (actual) |
|-------|-----------------------|--------------------------|
| event.kind | `alert`, `enrichment`, `event`, `metric`, `state`, `pipeline_error`, `signal` | `error` (1) |
### .ds-auditbeat-8.5.0-2023.01.24-000001
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ✅ | .ds-auditbeat-8.5.0-2023.01.24-000001 | 74 (0.3%) | 0 | `hot` |
### **Incompatible fields** `0` **Custom fields** `509` **ECS compliant fields** `1210` **All fields** `1719`
### auditbeat-custom-empty-index-1
The `auditbeat-custom-empty-index-1` index has [mappings](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html) or field values that are different than the [Elastic Common Schema](https://www.elastic.co/guide/en/ecs/current/ecs-reference.html) (ECS), version `8.6.0` [definitions](https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html).
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ❌ | auditbeat-custom-empty-index-1 | 0 (0.0%) | 1 | `unmanaged` |
### **Incompatible fields** `1` **Custom fields** `0` **ECS compliant fields** `0` **All fields** `0`
#### 1 incompatible field
Fields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version 8.6.0.
❌ Detection engine rules referencing these fields may not match them correctly
❌ Pages may not display some events or fields due to unexpected field mappings or values
❌ Mappings or field values that don't comply with ECS are not supported
#### Incompatible field mappings - auditbeat-custom-empty-index-1
| Field | ECS mapping type (expected) | Index mapping type (actual) |
|-------|-----------------------------|-----------------------------|
| @timestamp | `date` | `-` |
## logs-*
`hot(2)`
| Incompatible fields | Indices checked | Indices | Docs |
|---------------------|-----------------|---------|------|
| 3 | 2 | 2 | 602 |
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ❌ | .ds-logs-endpoint.alerts-default-2023.01.17-000001 | 342 (56.8%) | 2 | `hot` |
| ❌ | .ds-logs-endpoint.events.process-default-2023.01.17-000001 | 260 (43.2%) | 1 | `hot` |
### .ds-logs-endpoint.alerts-default-2023.01.17-000001
The `.ds-logs-endpoint.alerts-default-2023.01.17-000001` index has [mappings](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html) or field values that are different than the [Elastic Common Schema](https://www.elastic.co/guide/en/ecs/current/ecs-reference.html) (ECS), version `8.6.0` [definitions](https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html).
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ❌ | .ds-logs-endpoint.alerts-default-2023.01.17-000001 | 342 (56.8%) | 2 | `hot` |
### **Incompatible fields** `2` **Custom fields** `857` **ECS compliant fields** `675` **All fields** `1534`
#### 2 incompatible fields
Fields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version 8.6.0.
❌ Detection engine rules referencing these fields may not match them correctly
❌ Pages may not display some events or fields due to unexpected field mappings or values
❌ Mappings or field values that don't comply with ECS are not supported
#### Incompatible field mappings - .ds-logs-endpoint.alerts-default-2023.01.17-000001
| Field | ECS mapping type (expected) | Index mapping type (actual) |
|-------|-----------------------------|-----------------------------|
| process.env_vars | `keyword` | `object` |
#### Incompatible field values - .ds-logs-endpoint.alerts-default-2023.01.17-000001
| Field | ECS values (expected) | Document values (actual) |
|-------|-----------------------|--------------------------|
| event.category | `authentication`, `configuration`, `database`, `driver`, `email`, `file`, `host`, `iam`, `intrusion_detection`, `malware`, `network`, `package`, `process`, `registry`, `session`, `threat`, `vulnerability`, `web` | `behavior` (45) |
### .ds-logs-endpoint.events.process-default-2023.01.17-000001
The `.ds-logs-endpoint.events.process-default-2023.01.17-000001` index has [mappings](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html) or field values that are different than the [Elastic Common Schema](https://www.elastic.co/guide/en/ecs/current/ecs-reference.html) (ECS), version `8.6.0` [definitions](https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html).
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ❌ | .ds-logs-endpoint.events.process-default-2023.01.17-000001 | 260 (43.2%) | 1 | `hot` |
### **Incompatible fields** `1` **Custom fields** `130` **ECS compliant fields** `304` **All fields** `435`
#### 1 incompatible field
Fields are incompatible with ECS when index mappings, or the values of the fields in the index, don't conform to the Elastic Common Schema (ECS), version 8.6.0.
❌ Detection engine rules referencing these fields may not match them correctly
❌ Pages may not display some events or fields due to unexpected field mappings or values
❌ Mappings or field values that don't comply with ECS are not supported
#### Incompatible field mappings - .ds-logs-endpoint.events.process-default-2023.01.17-000001
| Field | ECS mapping type (expected) | Index mapping type (actual) |
|-------|-----------------------------|-----------------------------|
| process.env_vars | `keyword` | `object` |
## packetbeat-*
`hot(2)`
| Incompatible fields | Indices checked | Indices | Docs |
|---------------------|-----------------|---------|------|
| 0 | 2 | 2 | 1,372,893 |
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ✅ | .ds-packetbeat-8.6.0-2023.01.17-000001 | 704,062 (51.3%) | 0 | `hot` |
| ✅ | .ds-packetbeat-8.4.1-2023.01.24-000001 | 668,831 (48.7%) | 0 | `hot` |
### .ds-packetbeat-8.6.0-2023.01.17-000001
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ✅ | .ds-packetbeat-8.6.0-2023.01.17-000001 | 704,062 (51.3%) | 0 | `hot` |
### **Incompatible fields** `0` **Custom fields** `604` **ECS compliant fields** `1209` **All fields** `1813`
### .ds-packetbeat-8.4.1-2023.01.24-000001
| Result | Index | Docs | Incompatible fields | ILM Phase |
|--------|-------|------|---------------------|-----------|
| ✅ | .ds-packetbeat-8.4.1-2023.01.24-000001 | 668,831 (48.7%) | 0 | `hot` |
### **Incompatible fields** `0` **Custom fields** `604` **ECS compliant fields** `1209` **All fields** `1813`
## Errors
Some indices were not checked for Data Quality
Errors may occur when pattern or index metadata is temporarily unavailable, or because you don't have the privileges required for access
The following privileges are required to check an index:
- `monitor` or `manage`
- `view_index_metadata`
- `read` or `read_cross_cluster`
| Pattern | Index | Error |
|---------|-------|-------|
| .alerts-security.alerts-default | -- | `Error loading stats: Error: Forbidden` |
| auditbeat-* | -- | `Error loading stats: Error: Forbidden` |
| logs-* | -- | `Error loading stats: Error: Forbidden` |
| packetbeat-* | -- | `Error loading stats: Error: Forbidden` |
See also: https://github.com/elastic/security-team/issues/4559
Epic: https://github.com/elastic/kibana/issues/144943
## Summary
Moving the existing CellActions implementation to a new home. The
`kbn-cell-actions` package contains components and hooks that are going
to be used by solutions to show data cell actions with a consistent UI
across them.
Security Solution is going to start using it by migrating all
"hover-actions" to the unified implementation, but the usage is not
restricted to it. Any plugin can register and attach its own actions to
a trigger via uiActions, and use this package to render the CellActions
components in a consistent way.
The initial implementation was placed in the uiActions plugin itself due
to a types constraints
(https://github.com/elastic/kibana/tree/main/src/plugins/ui_actions/public/cell_actions),
the constraint has been solved so we are creating the package for it as
planned.
This PR only moves that implementation to the new package, with small
directory changes. The exported components are not being used anywhere
currently, so the implementation may change during the migration phase.
### Checklist
Delete any items that are not applicable to this PR.
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Files management UI that rounds out the files MVP. This is UI is
intended to be progressively enhanced and provides a way for system
administrators get some insight and manage the files created and stored
in Kibana.
## To reviewers
* This is UI for retrieval and deletion of files (the R+D of CRUD)
* Creating and deleting tags to be supported in a future version
* This UI is intended to form part of the broader content management
experience
* We use the `TableListView` component as far as possible
## How to test
1. Start Kibana with `yarn start --run-examples`
2. Go to the "Developer Examples" from the left nav menu
3. Go to the "Files example" plugin
4. Click the "Upload file" button, upload a few different image types
(PNG, JPG and WEBP)
5. Go to "Stack management" > "Files"
6. Behold your files in the management UI
7. (Bonus) check that the UI and API `GET /api/files/find`, `GET
/api/files/metrics` and `DELETE /api/files/blobs` are not accessible to
non-admin or appropriately privileged users (i.e., those with "Files
management" access).
## List of functionality
- [x] List all saved objects (scoped to admin)
- [x] Is able to bulk-delete files
- [x] Shows basic storage diagnostics
- [x] Is able to search and filter files
## Screenshots
<details>
<summary>screenshots</summary>
<img width="1545" alt="Screenshot 2022-11-08 at 13 56 54"
src="https://user-images.githubusercontent.com/8155004/200570783-cfefdbf3-c5ff-4ece-ba24-48a455fcca75.png">
<img width="910" alt="Screenshot 2022-11-10 at 12 52 35"
src="https://user-images.githubusercontent.com/8155004/201083812-bc9f25f5-b423-43a6-9229-5e2a4cdd943a.png">
<img width="451" alt="Screenshot 2022-11-10 at 12 37 07"
src="https://user-images.githubusercontent.com/8155004/201081039-832a1980-684c-4abb-bb05-0c7c6a849d4d.png">
<img width="959" alt="Screenshot 2022-11-08 at 13 57 15"
src="https://user-images.githubusercontent.com/8155004/200570797-f122cff5-7043-4e01-9b51-d5663c1b26d6.png">
<img width="500" alt="Screenshot 2022-11-08 at 13 57 38"
src="https://user-images.githubusercontent.com/8155004/200570801-35cdbd99-0256-4dee-9f78-2f6ad853305f.png">
</details>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
* [Discover] Create unifiedHistogram plugin
* [Discover] Move discover resizable panels to unifiedHistogram
* [Discover] Replace DiscoverPanels with unifiedHistogram Panels
* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'
* [Discover] Fix types and limtis.yml for unifiedHistogram
* [Discover] Begin migrating layout and chart to unified_histogram
* [Discover] Update i18n keys from discover to unifiedHistogram
* [Discover] Update data-test-subj tags from discover to unifiedHistogram
* [Discover] Update classNames, ids, and scss to change discover to unifiedHistogram
* [Discover] Remove more references to discover from unifiedHistogram
* [Discover] Replace DiscoverServices with UnifiedHistogramServices
* [Discover] Replacing CHART_HIDDEN_KEY with chartHiddenKey prop
* [Discover] Add missing tsconfig references
* [Discover] Remove remaining references to discover from unifiedHistogram
* [Discover] Migrate HitsCounter to unifiedHistogram
* [Discover] Continue removing discover dependencies from unifiedHistogram
* [Discover] Replace SCSS with emotion
* [Discover] Changing PANELS_MODE to be internal
* [Discover] Clean up types
* [Discover] Clean up props and types
* [Discover] Update layout to use Chart component
* [Discover] Update discover_main_content
* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'
* [Discover] Update discover_main_content to use UnifiedHistogramLayout, clean up unifiedHistogram implementation and props, add missing bundles
* [Discover] Fix missing styles in unifiedHistogram
* [Discover] Fix issue where mouse can get out of sync with the resize handle with the Discover resizable layout
* [Discover] Fix some Jest tests
* [Discover] Update discoverQueryHits to unifiedHistogramQueryHits in tests
* [Discover] Finish decoupling discover_main_content from unified histogram layout
* [Discover] Create useDiscoverHistogram hook and remove old histogram dependencies from Discover
* [Discover] Move functions to create chart data from discover to unifiedHistogram
* [Discover] Continue fixing broken Jest tests
* Revert unifiedHistogram.reloadSavedSearchButton removal
* [Discover] Add missing type export and a better suspense fallback
* [Discover] Make callback names consistent
* [Discover] Continue cleanup and add documentation to unifiedHistogram
* [Discover] Update genChartAggConfigs to take object
* [Discover] Update UnifiedHistogramHitsContext.number to total
* [Discover] Cleanup imports
* [Discover] Add support for hiding the entire top panel in the unified histogram by leaving all context props undefined
* [Discover] Fix broken discover_layout unit tests
* [Discover] Clean up naming in discover_main_content
* [Discover] Continue fixing Jest tests and adding new tests
* [Discover] Finish writing Jest tests
* [Discover] Fix conflicts with getVisualizeInformation and triggerVisualizeActions after merge
* [Discover] Fix hiding reset chart height button when default chart height
* [Discover] Update CODEOWNER file
* [Discover] Removed types for @link comments
* [Discover] Fix broken discover_layout.test.tsx file
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
* add components with a draft exception-list-details to test
* fix jest config in xPack=> security=> Public
* fix tests
* fix header test and use RTL
* covert meta test to use RTL and header
* fix utlity messageid
* fix messageid in utilty
* create osCondition, entryContent and entryContent.helper from Conditions.tsx
* comment test until fixing all
* create package with first components + test + jest config
* add constants for url
* [CI] Auto-commit changed files from 'node scripts/generate codeowners'
* disable tests until finishing moving rest of components or fix it+ add securityLinkAnchorComponent temp;
* add exceptionList-components +fixning build issues
* add exceptionList-components +fixning build issues
* fix translations id + pass comments as props
* move utiitly out of package until moving all + fixing css
* copy non-js/ts files through babel
* remove list-details-components
* apply comments
* apply comments in references
* fix meta tests
* update tests + add some descriptions
* fix camelcase file name in Readme
* fix camelcase file name in Readme
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: spalger <spencer@elastic.co>
* [Guided onboarding] Smashed commit of all POC work for guided onboarding and guided onboarding example plugins
* [Guided onboarding] Fixed type errors
* [Guided onboarding] Removed guidedOnboardingExample limit
* [Guided onboarding] Fixed a functonal test for exposed configs
* [Guided onboarding] Fixed plugin limit
* [Guided onboarding] Added more information to the example plugin
* [Guided onboarding] Fixed no-console error
* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'
* [Guided onboarding] Fixed snake case errors
* move guided_onboarding out of x-pack
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alison Goryachev <alison.goryachev@elastic.co>
* [Discover] Add initial support for tags to saved search modal
* [Discover] Add tags to savedSearch types
* [Discover] Finish initial support for adding tags to saved searches
* [Discover] Start to convert saved object finder to a table in order to support tags
* [Discover] Add support for displaying saved search tags in open search flyout
* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'
* [Discover] Continue support for tags in saved object finder
* [Discover] Clean up saved object finder
* [Discover] Finish initial support for tags in saved object finder
* [Discover] Update SimpleSavedObject constructor to SimpleSavedObjectImpl
* [Discover] Remove orig files
* [Discover] Saved search tag type registration and telemetry
* [Discover] Create new saved_objects_finder plugin
* [Discover] Continue work creating saved_objects_finder plugin
* [Discover] Revert some changes in saved_objects
* [Discover] Revert some changes in saved_objects again
* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'
* [Discover] Update saved_objects_finder i18n keys
* [Discover] Update docs
* [Discover] Add plugins to saved_object_finder and fix broken types
* [Discover] Finish creating saved_objects_finder plugin and use it in Discover
* [Discover] Update SavedObjectFinderProps type export, and update x-pack telemetry
* [Discover] Fix broken jest tests
* [Discover] Update saved_objects_finder API
* [Discover] Remove unused translations
* [Discover] Fix issue with initial saved object finder fetch
* [Discover] Fix some of the saved object finder jest tests
* [Discover] Clean up finder after merge
* [Discover] Fixing saved_object_finder.tsx
* [Discover] Add savedObjectsTaggingOss reference to saved_search plugin
* [Discover] Fix broken open_search_panel test
* [Discover] Removed allowed types from saved object finder
* [Discover] Removing type column when there's only one saved object type, and adjusting column widths
* [Discover] Fix issue where visible types were entirely removed, fixed pageSizeOptions
* [Discover] Add showFilter to open_search_panel's saved_objects_finder, fallback to all available types when no type filter is applied to saved_objects_finder, hide type column and filter button when there is only one type in metadata list
* [Discover] Fix remaining saved_object_finder Jest tests
* [Discover] Update snapshot
* [Discover] Fix failing functional tests
* [Discover] Add tagging Jest tests for saved_objects_finder
* [Discover] Fix small bugs in saved_object_finder, update Jest tests, add functional tests for Discover saved search tagging
* [Discover] Removed unused variable in functional test
* [Discover] Update Discover Jest tests with tagging tests
* [Discover] Remove translations
* [Discover] Updating saved_objects_finder to use static export vs preconfigured component, adding lazy load support
* [Discover] Move saved_object_finder service deps to a 'services' prop, fix broken open_search_panel Jest test
* [Discover] Fix broken Jest test
* [Discover] Fix broken Jest test from merge
* [Discover] Fix discover tags integration test description
* - Updated tags prop to be `string | undefined`
- Type imports cleanup
- Added loading indicator for saved object finder
- Changed `savedObjectsPlugin.settings.getListingLimit()` to `uiSettings.get(LISTING_LIMIT_SETTING)`
- Removed old saved object finder comment
- Removed tag changes from transform plugin
- Change code owners of saved_objects_finder to Data Discovery
* [Discover] Fixed LISTING_LIMIT_SETTING import
* [Discover] Revert tags saving change that introduced a bug
* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'
* [Discover] Try again to fix LISTING_LIMIT_SETTINGS import
* [Discover] Fix failing snapshot
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
* Creates packages for shared types: core-deprecations-common and core-deprecations-common-internal, moves types accordingly, updates src/core/public|server imports
* Moves more internal types to package
* Changes widely used internal deprecations-related types to public types, moves these to publically accessible packages
* Updates import, updates bazel build file
* Creates package core-deprecations-browser-internal and moves implementation and tests into package
* Updates imports of public deprecations implementations
* Creates package core-deprecations-browser-mocks, moves mock and deletes core-deprecations-common-internal
* Updates types in src/core
* Updates README's and build bazel files for core's client-side deprecations service
* Updates imports
* exports shared DeprecationsDetails from core/server
* Adds deprecations to i18n rc
* replace targetted core packages with top level packages for core in i18nrc file, cleans up tsconfig and bazel build files, addresses prefered style in core
* Add event annotation service structure
* adding annotation layer to lens. passing event annotation service
* simplify initial Dimensions
* add annotations to lens
* no datasource layer
* group the annotations into numerical icons
* color icons in tooltip, add the annotation icon, fix date interval bug
* display old time axis for annotations
* error in annotation dimension when date histogram is removed
* refactor: use the same methods for annotations and reference lines
* wip
* only check activeData for dataLayers
* added new icons for annotations
* refactor icons
* uniqueLabels
* unique Labels
* diff config from args
* change timestamp format
* added expression event_annotation_group
* names refactor
* ea service adding help descriptions
* rotate icon
* added tests
* fix button problem
* dnd problem
* dnd fix
* tests for dimension trigger
* tests for unique labels
* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'
* type
* add new button test
* remove noDatasource from config (only needed when initializing a layer or dimension in getSupportedLayers)
* addressing Joe's and Michael comments
* remove hexagon and square, address Stratoula's feedback
* stroke for icons & icon fill
* fix tests
* fix small things
* align the set with tsvb
* align IconSelect
* fix i18nrc
* Update src/plugins/event_annotation/public/event_annotation_service/index.tsx
Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
* refactor empty button
* CR
* date cr
* remove DimensionEditorSection
* change to emptyShade for traingle fill
* Update x-pack/plugins/lens/public/app_plugin/app.scss
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
* Added config for mosaic/pie/donut/treemap/waffle.
* Added sortPredicate functionality for waffle/mosaic/treemap/pie/donut
* Added Donut handling.
* Refactored get_color.
* Merged color computation for lens and vis_types.
* Added isFlatLegend support.
* Added showValuesInLegend for waffle and fixed tests.
* Removed not used position, which is equivalent to labels.show = false.
* legendDisplay added.
* Added migrations for pieVis addLegend argument.
* Added startFromSecondLargestSlice and support of correct formatters.
* Updated docs.
* Added functionality for truncate.
* Added unit tests for pie and partial for donut/waffle.
* Addressed issue with label truncation by default.
* Addressed issue with formatters.
* Added tests for accessor.test.ts
* Added support of formatter by meta data from columns at splitChartAccessors.
* Added tests for filterOutConfig.
* Added tests for getFormatters.
* Added tests for getAvailableFormatter.
* Added tests for getFormatter.
* Added tests for get_split_dimension_accessor.
* Add is legend scenario.
* Added tests for legend.
* Replaced sortPredicate, relying on the internal terms params, with the mosaic one.
* Fixed pie snapshot and added new snapshot for treemap.
* Added snapshots for mosaicVis.
* Added snapshot to waffleVis.
* Updated unit tests for *_vis_function's.
* Added storybook.
* Added snapshots for partition vis component.
* Added expression error on providing both, splitColumn && splitRow.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [WIP] Combine visualizations and visualize plugins
* Revert some changes and do some refactoring
* Refactor some code
* Fix some tests
* Fix functional tests and some jest test cases
* Update telemetry
* Fix get_visualization_instance.test and plugin-list.asciidoc
* Refactor some code
* fix CI
* Add visualizations to vis_default_editor tsconfig
* Revert changes related to telemetry and permissions
* Add dashboard to timeseries tsconfig.json
* Update limits file
* Update translation keys
* Add capabilitiesProvider back to server and replace visEditorsRegistry getter and setter with service
* Update mocks.ts
* Revert changes related to visEditorsRegistry
* Get rid of visEditorsRegistry getter and setter
* Remove dashboard from timeseries/tsconfig.json
* Return back dashboard dependency to timeseries/tsconfig.json, rename applicaion folder to visualize_app and APP_NAME to VISUALIZE_APP_NAME, revert types.ts
* Remove comma in .i18nrc.json
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
* gauge_expression
* fix
* CI fix
* make plugin required to use its methods
* move non-types from types
* share icon
* bundle, plugin
* load gaugeComponent async
* fix types
* async heatmap
* don't use d3
* optimizations
* feedback
* types
* adjusting the tests to the new max
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [WIP][Heatmap] Creates implementation with elastic-charts
* Fix types and connection with vislib
* Add coloring options
* Brush, click events, coloring etc
* Cleaning up the expression function
* Add legend picker, fix sorting and other fixes
* Further fixes
* Use the shared expression to Lens and cleanup
* PrepareLogTables for new expression function
* Use common renderer and expression function with lens
* Fix i18n
* Small tweaks
* Add unit tests
* Adds a unit test to the heatmap component
* update plugin list
* Fix types
* Fix types
* update limits
* Change to the expression function
* Cleanup translations
* Refactor to use vis
* Fix types
* further cleanup of the translations
* register new setting
* Fix sorting for histogram
* Adds functional tests for the new nisualize heatmap
* Cleanup
* Fix
* Apply PR comments
* Address PR comments
* Fix i18n
* Fix i18n
* Makes the <Heatmap /> id dynamic
* reverse
* fix translation file
* Apply design PR comments
* Fix package
* More fixes
* Fix brush problem
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>