Commit graph

42690 commits

Author SHA1 Message Date
Nicolas Chaulet
613267f94d
[Fleet] Add sudo to fleet managed instructions (#98803) 2021-04-29 16:45:46 -04:00
Constance
d26f1dc82b
[App Search] Synonyms: Create/update/delete & modal behavior (#98344)
* Add SynonymsLogic create/update/delete actions & modal state

* [Setup] Update MultiInputRows to work with a ModalFooter submit + allow hiding submit button

* Add SynonymModal component

* Update existing views with modal behavior

* PR feedback: Fix MultiInputRows to not render a form component for Relevance Tuning / onChange-only components

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-29 13:35:57 -07:00
Poff Poffenberger
2628cea05e
Add essql search strategy and integrate in canvas (#94754)
* Add essql search strategy, new escount temporary function, and new essql temporary function

* Move old es* functions to legacy, add esdocs to use search strategy, add parameter arg for essql

* Clean up

* cleanup

* cleanup

* Move request builder files to common

* cleanup

* add comment

* PR Feedback

* Removing old types

* update type

* Add data.search to labs and fix error messages

* Fix function help type

* Add data service to usage collector types

* Update telemetry

* remove unrelated telemetry change

* Enable multi value leniency for SQL  queries

* Display data service lab project
2021-04-29 14:58:11 -05:00
Zacqary Adam Xeper
0f6923ac0c
[Fleet] Hide Fleet Server policies in standalone agent instructions (#98787) 2021-04-29 15:18:49 -04:00
Tiago Costa
480483bacc
chore(NA): correctly define sourceRoot for @kbn/config-schema (#98788) 2021-04-29 20:16:30 +01:00
Larry Gregory
10961cd9c7
Handle 503 responses from the status API (#98738)
* Handle 503 responses from the status API

* PR feedback: additional test
2021-04-29 15:10:25 -04:00
Spencer
1cd101a3eb
[cli/serve/integrationTests] log stdout from process when parsing fails (#98699)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-04-29 14:59:40 -04:00
Cauê Marcondes
a48b7b049c
[APM] Improving e2e test setup (#98743)
* creating different users to run the test

* fixing ts file

* fixing TS issues

* improving e2e tests

* removing commented lines

* fixing ts issues

* fixing ts issues

* fixing ts issues
2021-04-29 14:46:22 -04:00
Quynh Nguyen
dc4437a7d0
[ML] Disable Single Metric Viewer and Anomaly explorer charts for nested terms aggregations (#98510) 2021-04-29 13:33:09 -05:00
Andrew Goldstein
6198419e30
[Security Solution][Timeline] Fixes an issue where many OR clauses take up too much vertical space (#98706)
## [Security Solution][Timeline] Fixes an issue where many `OR` clauses take up too much vertical space

This PR makes Timeline's drag and drop query area resizable and scrollable to fix an issue reported by @aarju, where many `OR` clauses take up too much vertical space in Timeline.

To fix this issue:

* Timeline's drop area is now resizable
* The drop area still grows vertically, up to one third the size of the view hight
* A vertical scroll bar will automatically be displayed when entire query doesn't fit vertically within the drop area

The fix is shown in the animated gif below:

![resize_drop_area](https://user-images.githubusercontent.com/4459398/116512337-1caabb80-a885-11eb-8118-8eba46753435.gif)

_Above: Timeline's drop area is now resizable and scrollable_

### Side-by-side comparison

The side-by-side browsers in the image below show the same timeline in full screen mode before the fix (on the left), and after the fix (on the right):

![before_and_after](https://user-images.githubusercontent.com/4459398/116512491-5aa7df80-a885-11eb-9235-498d9e3a99ff.png)

_Above: Timeline in full screen mode before the fix (left), and after the fix (right)_

### Steps to reproduce

1. Create a new timeline
2. Drag approximately 15 fields as separate OR clauses to the timeline, as shown in the screenshot below:

![many_or_clauses](https://user-images.githubusercontent.com/4459398/116495389-076f6600-a860-11eb-8e43-e9e399149103.png)

**Expected behavior:**

* The drop area can be resized and scrolled

**Actual behavior:**

* The drag area keeps growing and pushing the table content down
2021-04-29 12:07:55 -06:00
Quynh Nguyen
d9a80d5bca
[ML] Fix Single Metric Viewer annotation tooltip hard to trigger (#98233)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-29 12:55:17 -05:00
gchaps
41ded7a8a2
[DOCS] Updates saved searches doc (#97936)
* [DOCS] Updates saved searches doc

* [DOCS] Adds info on adding a saved search to a dashboard

* [DOCS] Fixes silly typo

* Update docs/discover/save-search.asciidoc

Co-authored-by: Matthias Wilhelm <ankertal@gmail.com>

* Update docs/discover/save-search.asciidoc

Co-authored-by: Matthias Wilhelm <ankertal@gmail.com>

* Update docs/discover/save-search.asciidoc

Co-authored-by: Matthias Wilhelm <ankertal@gmail.com>

* [DOCS] Incorporates review feedback

* [DOCS] Updates doc per review comments

* [DOCS] Fixes description of saved query

* [DOCS] Incorporates review comments

Co-authored-by: Matthias Wilhelm <ankertal@gmail.com>
2021-04-29 10:26:34 -07:00
gchaps
7ef187ec89
[DOCS] Updates images and text in Discover (#98694)
* [DOCS] Updates images and text in Discover

* [DOCS] Edits after walkthrough

* [DOCS] Fixes typo

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-29 10:25:50 -07:00
Quynh Nguyen
762c57b995
[ML] Functional tests for Analytics list row expansion content (#98678) 2021-04-29 12:06:39 -05:00
Shahzad
18213b673f
[Uptime] Fix Monitor status toggle alert receovery state (#89273)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-29 18:42:52 +02:00
Scotty Bollinger
5f57766e03
[Workplace Search] Add 'Folders' to ObjTypes (#98558)
Adds 'Folders' to the list of synced items in the UI for Dropbox, Google Drive, OneDrive and SharePoint Online
2021-04-29 12:32:38 -04:00
Quynh Nguyen
f443d2af9a
[ML] Fix Single Metric Viewer and Anomaly Explorer charts still loading even after failure (#98490)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-29 11:30:59 -05:00
Tiago Costa
1f15c6a1ad
chore(NA): moving @elastic/eslint-config-kibana into bazel (#98648)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-29 17:20:52 +01:00
Walter Rafelsberger
2d885f4d6e
[ML] Fix application of runtime fields to index search. (#98718)
- A previous PR introduced a regression where only runtime fields would show up in the analytics wizard's source index preview. The code for transforms and analytics is a bit different so this regression didn't occur in transforms.
- This PR fixes the problem and cleans up use_index_data.ts for the analytics wizard to remove some duplicate code to determine runtime field mappings.
- Async fetch functions have been refactored to named function expressions and moved inside their corresponding useEffect calls (this change caused most of the diff).
- combinedRuntimeMappings has been moved to an outer useMemo so it doesn't have to be generated in multiple places.
- getIndexData has been renamed to fetchIndexData to indicate it's an async call getting remote data and to be in line with the other function names.
2021-04-29 18:19:08 +02:00
Chris Cowan
9b28ec8996
[Metrics UI] Fixing race condition in Metric Threshold alerts (#98563)
* [Metrics UI] Fixing race condition in Metric Threshold alerts

* fixing type issue
2021-04-29 08:11:37 -07:00
Tiago Costa
24374d9c4a
chore(NA): upgrades bazel rules nodejs into v3.4.2 (#98701)
* chore(NA): upgrade bazel rules nodejs to v3.4.1

* chore(NA): update rules nodejs into 3.4.2

* chore(NA): update yarn lock after updating rules
2021-04-29 15:18:14 +01:00
Maja Grubic
b7719d65ee
[Discover] Do not set fieldsFromSource when not using fields API (#98575)
* [Discover] Do not set fieldsFromSource when not using fields API

* Add Search Source unit test

* Add Search Source unit test
2021-04-29 14:55:52 +01:00
Alejandro Fernández Haro
ed2e5440ee
[API DOCS] Telemetry (#98610) 2021-04-29 14:38:06 +01:00
Sandra Gonzales
7eb733f7bd
remove object dependency (#98686) 2021-04-29 09:14:22 -04:00
Ashokaditya
c93e028e0c
[Security Solution][Endpoint] Allow wildcard in trusted app paths (#97623)
* show operator dropdown for path field

refs elastic/security-team/issues/543

* update translation to use consistent values

refs elastic/security-team/issues/543

* update schema to validate path values

refs elastic/security-team/issues/543

* add tests for field and operator values

refs elastic/security-team/issues/543

* review changes

refs elastic/security-team/issues/543

* update schema to enforce dropdown validation for PATH field

refs elastic/security-team/issues/543

* add tests for schema updates

refs 1deab39453
refs elastic/security-team/issues/543

* optimise dropdown list for re-renders

refs elastic/security-team/issues/543

* align input fields and keep alignments when resized

refs elastic/security-team/issues/543

* correctly enter operator data on trusted app CRUD

refs elastic/security-team/issues/543

* update tests

refs 2ac56ee839
refs elastic/security-team/issues/543

* remove redundant code

review changes

* better type assertion

review changes

* move operator options out of component

- these do not depend on component props and thus no need to have it within a useMemo callback.

- review changes

* derive keys from operator entry field

review changes

* update type

* use custom styles for aligning input fields

review changes

* add a custom type for trusted_apps operator

undo changes from list plugin and server/lib/detection_engine

refs 2ac56ee839
refs elastic/security-team/issues/543

* add wildcard entry type

refs elastic/security-team/issues/543
refs https://github.com/elastic/kibana/pull/97623#pullrequestreview-642618462

* use the new entry type

refs elastic/security-team/issues/543
refs https://github.com/elastic/kibana/pull/97623#pullrequestreview-642618462

* update tests

refs elastic/security-team/issues/543
refs https://github.com/elastic/kibana/pull/97623#pullrequestreview-642618462

* update name for wildcard type so that it can be used also for cased inputs

refs elastic/security-team/issues/543
refs f9cb7eddda

* update artifacts to support wildcard entries

refs elastic/security-team/issues/543

* add tests for list schemas

refs f9cb7eddda
refs elastic/security-team/issues/543

* add placeholders for path values

review changes
elastic/kibana/pull/97623#discussion_r620617999

* ignore type check for now

* add type assertion

refs 284352ec9a

* remove unnecessary test

refs 2ac56ee839

* fix types

refs f9cb7eddda
refs b3f5dc4553

* add a note to entries

review changes

refs dbd3532149

* remove redundant type assertions

review changes
refs bcf615ac98
refs b3f5dc4553

* move placeholder text logic to utils

review changes elastic/kibana/pull/97623#discussion_r621673881

refs 6f2d0d7810

* pass the style as prop

review changes

* update api doc

CI check suggestion

* make placeholderText a function expression

review suggestion

elastic/kibana/pull/97623/commits/2dc4fd390cf5ea0e4fa67b3f5fc2561cbb29555e

* use semantic names for functions

refs 330731ebfc

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-29 14:54:19 +02:00
Rudolf Meijering
c03a8306ad
v2 migration algorithm docs for rewriting saved object id's (#93002)
* Document v2 migration algorithm using control state names from source code

* v2 migrations support for rewriting document _id's

* Minor edits and clarifications

* Fix markdown formatting

* Review comments: improve algorithm description

* add WAIT_FOR_YELLOW_SOURCE step

Co-authored-by: restrry <restrry@gmail.com>
2021-04-29 05:19:29 -07:00
Shahzad
8ac4892abd
[Exploratory View] Fixed brushing/scrubbing on time series charts (#98623)
Co-authored-by: Casper Hübertz <casper@formgeist.com>
2021-04-29 14:14:11 +02:00
Steph Milovic
2d5ff8ab70
[Security Solution] [Cases] Cases UI Plugin for RAC (#97646)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
Co-authored-by: Michael Olorunnisola <michael.olorunnisola@elastic.co>
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
Co-authored-by: David Sánchez <davidsansol92@gmail.com>
Co-authored-by: Spencer <email@spalger.com>
Co-authored-by: Dmitry <dzmitry.lemechko@elastic.co>
2021-04-29 07:41:46 -04:00
Scotty Bollinger
1d5fa6f53a
[Workplace Search] Remove MVP and expose beta (#98680)
* Remove references to `/alpha` route

* Delete all files and references to them for the existing MVP

* Remove conditional MVP Personal dashboard link

* Remove extra Route component

* Wrap header actions in EuiHeaderLinks for mobile

This is an add-on and should be reviewed with white space changes hidden.
2021-04-29 08:24:57 -03:00
Peter Pisljar
6cde07e3c9
adding reference extraction/injection for canvas functions (#95895) 2021-04-29 12:01:58 +02:00
Katrin Freihofner
b322f20cfe
Polish: wording, experimental badge and button sizes (#98655) 2021-04-29 11:56:48 +02:00
Matthias Wilhelm
58d4164b6c
[Discover][doc] Add view document (#92472)
*  Adds info about the doc viewer of Discover
* Merges with the context view doc

Co-authored-by: Gail Chappell <gail.chappell@elastic.co>
2021-04-29 10:47:17 +02:00
Sergi Massaneda
3f48479376
[Security Solutions][Timeline] Added createFrom in action to hide (#98144)
* added createFrom in action to hide

* prettier configured

* tests to check timeline modal table actions

* test changes and contant extract

* removed unused dependency

* prevent adding empty column to timeline table when no action need

* test updated

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-29 10:22:15 +02:00
Walter Rafelsberger
42d361c644
[ML] Adds waiting state for transforms. (#98592)
When no transform nodes are available, existing continuous transform end up in a waiting state. This PR adds support for this state in the transforms UI. Without the fix, transforms in a waiting state would fail to show up in the transform list.
2021-04-29 10:17:22 +02:00
Diana Derevyankina
fe48ae396b
[Timelion] Support of Runtime Fields (#96700)
* [Timelion] Support of Runtime Fields

* Replace call of getScriptedFields() with getComputedFields().runtimeFields, refactor buildAggBody and es.test.js

* Refactor index.js and agg_body.js

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-29 10:38:57 +03:00
spalger
71145a6778 skip flaky suite (#32240) 2021-04-28 21:31:13 -07:00
Bryan Clement
b94f712f8c
[Asset management] Text updates (#98192)
* updated scheduled query activation toggle text and interval header in query group

* added id validation for schedule queries

* fixed up agent resolution to ignore inactive agents, and properly pull all agents

* nixed unused file

* more validation for query fields

* added status table to the results data tab, added more validation

* updated wording

* added error notifications for failed queries

* pr feedback and cleanup

* fix up last hook

* use the pluralize macro, removed rbac tags

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-28 22:54:09 -04:00
Tiago Costa
f690c60517
chore(NA): moving @kbn/dev-utils into bazel (#98496)
* chore(NA): moving @kbn/dev-utils into bazel

* docs(NA): updated generated plugin list
2021-04-28 23:46:33 +01:00
Trent Mick
22b32c23f2
Bump elastic-apm-node from v3.10.0 to v3.14.0 (#97509)
Changelog: https://www.elastic.co/guide/en/apm/agent/nodejs/current/release-notes-3.x.html
Notably:
- Adds apm.addMetadataFilter(fn) that can be used for PII filtering
- Improves communication with APM server to not be pathological if APM
  server is down for extended period of time and load is high.
- Fixes bugs in data for the Dependencies and Service Map in the APM
  app.
- The APM agent now collects cloud metadata.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-28 15:24:07 -07:00
Nathan Reese
40fddce405
[Maps] use index_exists route instead of /api/index_management/indices (#98479)
* [Maps] use index_exists route instead of /api/index_management/indices

* fix functional test

* add retry and correct permissions to fix functional tests

* fix upload functional test
2021-04-28 16:05:52 -06:00
Larry Gregory
9c469feb3b
Allow reserved privileges to coexist with other privileges (#98530) 2021-04-28 16:07:37 -04:00
Cauê Marcondes
9a15accb7f
[APM] Service overview page fetches data with wrong transaction type (#98657) 2021-04-28 16:00:05 -04:00
Patrick Mueller
b31f4a1a97
[actions] adds config allowing per-host networking options (#96630)
resolves: https://github.com/elastic/kibana/issues/80120

Adds a new Kibana configuration key xpack.actions.customHostSettings which
allows per-host configuration of connection settings for https and smtp for
alerting actions. Initially this is just for TLS settings, expandable to other
settings in the future.

The purpose of these is to allow customers to provide server certificates for
servers accessed by actions, whose certificate authority is not available
publicly. Alternatively, a per-server rejectUnauthorized: false configuration
may be used to bypass the verification step for specific servers, but require it
for other servers that do not have per-host customization.

Support was also added to allow per-host customization of ignoreTLS and
requireTLS flags for use with the email action.
2021-04-28 15:26:47 -04:00
Liza Katz
02ac599569
[Search] return full IKibanaSearchResponse from fetch$ (#98268)
* return full object from fetch$

* jest

* fun-ctional tests

* jest

* functional

* test

* test

* tesssst

* Update src/plugins/data/common/search/search_source/fetch/request_error.ts

Co-authored-by: Michael Dokolin <dokmic@gmail.com>

* Update src/plugins/data/common/search/expressions/esaggs/request_handler.test.ts

Co-authored-by: Michael Dokolin <dokmic@gmail.com>

* ts

* ts

* ts

* Revert "Update src/plugins/data/common/search/search_source/fetch/request_error.ts"

This reverts commit ab182e84ed.

Co-authored-by: Michael Dokolin <dokmic@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-28 21:49:47 +03:00
Dima Arnautov
3f46d6f8a7
[ML] Refresh Anomaly Detection jobs list on alerting rules updates (#98603) 2021-04-28 20:37:58 +02:00
Nicolas Chaulet
9703b74efc
[Fleet] Fix opening the settings flyout from the add agent flyout (#98536) 2021-04-28 14:36:50 -04:00
Andrew Goldstein
78ae33164e
[RAC][Alert Triage][TGrid] Update the Alerts Table (TGrid) API to implement a subset of the EuiDataGridColumn API (#98241)
## [RAC][Alert Triage][TGrid] Update the Alerts Table (TGrid) API to implement a subset of the `EuiDataGridColumn` API

This PR implements the following subset of the `EuiDataGridColumn` API from [EuiDataGrid](https://elastic.github.io/eui/#/tabular-content/data-grid) in the `TGrid` (Timeline grid):

```ts
Pick<EuiDataGridColumn, 'display' | 'displayAsText' | 'id' | 'initialWidth'>
```

The above properties are [documented in EuiDataGrid's data_grid_types.ts](https://github.com/elastic/eui/blob/master/src/components/datagrid/data_grid_types.ts), and summarized in the table below:

| Property                   | Description                                                                                                                                                                                                                        |
|----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `display?:  ReactNode`    | A `ReactNode` used when rendering the column header                                                                                                                                                                                |
| `displayAsText?:  string` | Displays the column name as text (in lieu of using `display`). If not used, `id` will be shown as the column name. |
| `id:  string`             | The unique identifier for this column, e.g. `user.name`                                                                                                                                                                            |
| `initialWidth?:  number`   | Initial width (in pixels) of the column                                                                                                                                                                                            |

The following screenshot shows the `TGrid` rendering (from left-to-right):

- An (example) RAC-flavored Observability alerts table
- An (example) RAC-flavored Security Solution alerts table
- The production alerts table in the Security Solutions `Detections` page, which remains the default

![three_table_configurations](https://user-images.githubusercontent.com/4459398/115944491-5a69a780-a473-11eb-85b6-36120c3092d6.png)

_Above, three table configurations, rendered via the updated API_

The `public/detections/configurations` directory contains the configurations for the three tables shown in the screenshot above

This change works in concert with another recent change to the `TGrid` that [added support for the `renderCellValue` API](https://github.com/elastic/kibana/pull/96098).

### Example configurations

#### (example) RAC-flavored Observability alerts table

![observability_alerts_example](https://user-images.githubusercontent.com/4459398/115944556-b3d1d680-a473-11eb-8338-6097731f2d48.png)

The column specification for the (example) RAC-flavored Observability alerts table, shown in the screenshot above is defined in `x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/columns.ts`:

```ts
export const columns: Array<
  Pick<EuiDataGridColumn, 'display' | 'displayAsText' | 'id' | 'initialWidth'> & ColumnHeaderOptions
> = [
  {
    columnHeaderType: defaultColumnHeaderType,
    displayAsText: i18n.STATUS,
    id: 'kibana.rac.alert.status',
    initialWidth: 74,
  },
  {
    columnHeaderType: defaultColumnHeaderType,
    displayAsText: i18n.TRIGGERED,
    id: '@timestamp',
    initialWidth: DEFAULT_DATE_COLUMN_MIN_WIDTH + 5,
  },
  {
    columnHeaderType: defaultColumnHeaderType,
    displayAsText: i18n.ALERT_DURATION,
    id: 'kibana.rac.alert.duration.us',
    initialWidth: 116,
  },
  {
    columnHeaderType: defaultColumnHeaderType,
    displayAsText: i18n.ALERTS_HEADERS_SEVERITY,
    id: 'signal.rule.severity',
    initialWidth: 102,
  },
  {
    columnHeaderType: defaultColumnHeaderType,
    displayAsText: i18n.ALERTS_HEADERS_REASON,
    id: 'signal.reason',
    initialWidth: 644,
  },
];
```

The example implementation of `EuiDataGrid`'s [`renderCellValue` API](https://github.com/elastic/kibana/pull/96098) used to render the RAC-flavored Observability alerts table shown in the screenshot above is located in `x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/render_cell_value.tsx`:

```ts
/**
 * This implementation of `EuiDataGrid`'s `renderCellValue`
 * accepts `EuiDataGridCellValueElementProps`, plus `data`
 * from the TGrid
 */
export const renderCellValue: React.FC<
  EuiDataGridCellValueElementProps & CellValueElementProps
> = ({
  columnId,
  data,
  eventId,
  header,
  isDetails,
  isExpandable,
  isExpanded,
  linkValues,
  rowIndex,
  setCellProps,
  timelineId,
}) => {
  const value =
    getMappedNonEcsValue({
      data,
      fieldName: columnId,
    })?.reduce((x) => x[0]) ?? '';

  switch (columnId) {
    case 'kibana.rac.alert.status':
      return <Status status={random(0, 1) ? 'recovered' : 'active'} />;
    case 'kibana.rac.alert.duration.us':
      return <span>{moment(value).fromNow(true)}</span>;
    case 'signal.rule.severity':
      return <Severity severity={value} />;
    case 'signal.reason':
      return (
        <EuiLink>
          <TruncatableText>{reason}</TruncatableText>
        </EuiLink>
      );
    default:
      // NOTE: we're using `DefaultCellRenderer` in this example configuration as a fallback, but
      // using `DefaultCellRenderer` here is entirely optional
      return (
        <DefaultCellRenderer
          columnId={columnId}
          data={data}
          eventId={eventId}
          header={header}
          isDetails={isDetails}
          isExpandable={isExpandable}
          isExpanded={isExpanded}
          linkValues={linkValues}
          rowIndex={rowIndex}
          setCellProps={setCellProps}
          timelineId={timelineId}
        />
      );
  }
};
```

#### (example) RAC-flavored Security Solution alerts table

![secuirty_solution_rac_example](https://user-images.githubusercontent.com/4459398/115944592-e8459280-a473-11eb-9e0f-cef8519102d4.png)

The column specification for the (example) RAC-flavored Security Solution alerts table, shown in the screenshot above is defined in `x-pack/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/columns.ts`:

```ts
/**
 * columns implements a subset of `EuiDataGrid`'s `EuiDataGridColumn` interface,
 * plus additional TGrid column properties
 */
export const columns: Array<
  Pick<EuiDataGridColumn, 'display' | 'displayAsText' | 'id' | 'initialWidth'> & ColumnHeaderOptions
> = [
  {
    columnHeaderType: defaultColumnHeaderType,
    id: '@timestamp',
    initialWidth: DEFAULT_DATE_COLUMN_MIN_WIDTH + 5,
  },
  {
    columnHeaderType: defaultColumnHeaderType,
    id: 'signal.rule.name',
    displayAsText: i18n.ALERTS_HEADERS_RULE_NAME,
    linkField: 'signal.rule.id',
    initialWidth: 212,
  },
  {
    columnHeaderType: defaultColumnHeaderType,
    id: 'signal.rule.severity',
    displayAsText: i18n.ALERTS_HEADERS_SEVERITY,
    initialWidth: 104,
  },
  {
    columnHeaderType: defaultColumnHeaderType,
    id: 'signal.reason',
    displayAsText: i18n.ALERTS_HEADERS_REASON,
    initialWidth: 644,
  },
];
```

### Testing the example configurations locally

For now, the alerts table in the Security Solution's `Detections` page is configured to use the existing (`7.13`) column configuration.

To test the Alerts table in the Security Solution `Detections` page with the example configurations provided in this PR:

1. Edit `x-pack/plugins/security_solution/public/detections/components/alerts_table/index.tsx` and change the following line:

```ts
import { columns, RenderCellValue } from '../../configurations/security_solution_detections';
```

from the above to

```ts
import { columns, RenderCellValue } from '../../configurations/examples/observablity_alerts';
```

for the (example) RAC-flavored Observability alerts table, or change it to

```ts
import { columns, RenderCellValue } from '../../configurations/examples/security_solution_rac';
```

for the (example) RAC-flavored Security solution alerts table.

2. Navigate to your local instance of the Security Solution [Detections page](http://localhost:5601/xyx/app/security/detections) (Note: you may need to enable detection rules to populate the alerts table.)

3. Click the `customize_columns` button shown in the screenshot below:

![customize_columns](https://user-images.githubusercontent.com/4459398/115796322-e3f37980-a38e-11eb-930b-5b21dfcb5e65.png)

4. In the `Customize Columns` popover, click the `Reset Fields` button, shown in the screenshot below:

![reset-fields](https://user-images.githubusercontent.com/4459398/115797081-49943580-a390-11eb-9485-7e6cae2f2a6f.png)

After clicking `Reset Fields`, the new default columns will be displayed.

### Backwards compatibility

The `width` property of Timeline's model was changed to `initialWidth` as part of this PR.

- This change has no effect on Timelines persisted as saved objects
- This change has no effect on Timeline's [Export and Import Timelines](https://www.elastic.co/guide/en/security/current/timelines-ui.html#import-export-timelines) feature
- When a TGrid's column configuration containing the legacy `width` and `label` `ColumnHeaderOptions` is read from `localstorage`, these properties are migrated to `initialWidth` and `displayAsText` respectively.
  - Backwards compatibility was desk tested by persisting a custom column configuration while running off `master`, and then re-visiting the page after running this PR branch. As expected, the previously persisted column configuration was rendered correctly after running the PR branch.
  - Unit tests were added to `x-pack/plugins/security_solution/public/timelines/containers/local_storage/index.test.ts` to test the migration of the `width` and `label` properties

### Other changes

- The minium width of a resized column is now `70px`. The new minium is no longer data-type specific.
2021-04-28 12:26:52 -06:00
Brandon Morelli
7963313e93
docs: remove apm_user (#98401) 2021-04-28 10:57:21 -07:00
Wylie Conlon
cdc01c66e5
Tinymath escape characters and empty named args (#98559) 2021-04-28 13:45:51 -04:00
Nicolas Chaulet
5b4b7a8c72
[Fleet] Handle dashboard not found in datastream API (#98622) 2021-04-28 12:30:32 -04:00