Commit graph

41788 commits

Author SHA1 Message Date
Ester Martí Vilaseca 1d6f61f186
Change top_hits aggregation to top_metrics for snapshot api (#95644)
* Change top_hits aggregations to top_metrics for snapshot api

* Fix typing

* Remove top_hits types

* Add test for top metrics

* Fix functional test

* Add size 1 to top metrics aggregation

* change type for metadata rows

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-06 14:32:16 +02:00
Aleh Zasypkin 8bf9ea44e7
Upgrade globby dependency (8.0.111.0.3). 2021-04-06 10:57:40 +02:00
Marta Bondyra 3a4c62dd5b
[Lens] don't use eui variables for zindex (#96117)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-06 10:31:56 +02:00
Pierre Gayvallet 251bd9afc6
Remove /src/legacy (#95510)
* starting removing stuff

* fix jest config

* disable CLI mode until other PR is merged

* fix the schema

* add deprecation for maxPayloadBytes

* fix legacy start logic

* deletes `env` from unknown args

* fix FTR test config

* some legacy service deletion

* move config validation

* remove legacy exports from entrypoint

* preserve legacy logging in core logging config

* try to fix uiSettings integration tests

* fix legacy service tests

* more type fix

* use fromRoot from @kbn/utils

* cleanup kibana.d.ts

* fix unit tests

* remove src/core/server/utils

* fix server script

* add integration test for `/{path*}` route

* add unit tests on legacy config

* adapt uiSetting IT bis

* fix tests

* update generated doc

* address some review comments

* move review comments

* fix some stuff

* fix some stuff

* fix some stuff

* fix some stuff bis

* generated doc

* add test for ensureValidConfiguration
2021-04-06 09:25:36 +02:00
Tiago Costa d05d5634b3
skip flaky suite (#95899) 2021-04-06 02:29:43 +01:00
Nick Partridge d4b0f92c84
[Dashboard] Fix Lens and TSVB chart tooltip positioning relative to global headers (#94247) 2021-04-05 18:02:13 -05:00
Rashmi Kulkarni 7da1b82b7e
fixes a skipped management x-pack test (#96178)
* fixes a skipped management x-pack test

* modified the test to incoroporate the review comments

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-05 15:24:22 -07:00
Constance 56d9f3d968
[App Search] API logs: Add log detail flyout (#96162)
* Set up helper for showing JSON request/response bodies

* Set up mock API log obj for tests to use

* Add ApiLogLogic file for flyout handling

* Add ApiLogFlyout component

* Update views to load flyout

* Update table to open flyout

* Update x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/utils.ts

* PR feedback: comments

Co-authored-by: Byron Hulcher <byronhulcher@gmail.com>

Co-authored-by: Byron Hulcher <byronhulcher@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-05 16:48:00 -04:00
Clint Andrew Hall 5667435c38
[tech-debt] Remove defunct opacity parameters from EUI shadow functions (#96191)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-05 15:32:29 -05:00
Clint Andrew Hall f9917a6c8a
Add Input Controls project configuration (#96238)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-05 15:28:15 -05:00
Nathan Reese 2eae0969cb
[file upload] document file upload privileges and provide actionable UI when failures occur (#95883)
* [file upload] document file upload privileges and provide actionable UI when failures occur

* doc link

* call hasImportPermission

* docs tweeks

* tslint

* Update docs/maps/import-geospatial-data.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/import-geospatial-data.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/import-geospatial-data.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/import-geospatial-data.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* review feedback

* fix bullet list format

* clean-up i18n ids

* Update docs/maps/import-geospatial-data.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* documenation review feedback

* add period to last privilege bullet item

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-05 13:39:15 -06:00
Mikhail Shustov e457f212c4
Revert "TS Incremental build exclude test files (#95610)" (#96223)
This reverts commit b6e582c53e.
2021-04-05 11:59:26 -07:00
Jason Stoltzfus ad5f83a362
[App Search] Added Sample Response section to Result Settings (#95971) 2021-04-05 13:49:54 -04:00
Thomas Neirynck 1fad3175f9
[Maps] Safe-erase text-field (#94873) 2021-04-05 13:42:46 -04:00
Andrew Goldstein bcb72c596a
[RAC][Alert Triage][TGrid] Update the Alerts Table (TGrid) API to implement renderCellValue (#96098)
### [RAC][Alert Triage][TGrid] Update the Alerts Table (TGrid) API to implement `renderCellValue`

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

- The TGrid API was also updated to accept a collection of `RowRenderer`s as a prop

The API changes are summarized by the following screenshot:

<img width="1239" alt="render-cell-value" src="https://user-images.githubusercontent.com/4459398/113345484-c121f800-92ef-11eb-8a21-2b6dd8ef499b.png">

The following screenshot shows the `signal.rule.risk_score` column in the Alerts table being rendered with a green background color, using the same technique illustrated by `EuiDataGrid`'s [codesandbox example](https://codesandbox.io/s/nsmzs):

<img width="1231" alt="alerts" src="https://user-images.githubusercontent.com/4459398/113349015-a30ac680-92f4-11eb-8518-5c1b7465e76e.png">

Note: In the screenshot above, the values in the Alerts table are also _not_ rendered as draggables.

Related (RAC) issue: https://github.com/elastic/kibana/issues/94520

### Details

The `StatefulEventsViewer` has been updated to accept `renderCellValue` as a (required) prop:

```
renderCellValue: (props: CellValueElementProps) => React.ReactNode;
```

The type definition of `CellValueElementProps` is:

```
export type CellValueElementProps = EuiDataGridCellValueElementProps & {
  data: TimelineNonEcsData[];
  eventId: string; // _id
  header: ColumnHeaderOptions;
  linkValues: string[] | undefined;
  timelineId: string;
};
```

The `CellValueElementProps` type above is a _superset_ of `EuiDataGridCellValueElementProps`. The additional properties above include the `data` returned by the TGrid when it performs IO to retrieve alerts and events.

### Using `renderCellValue` to control rendering

The internal implementation of TGrid's cell rendering didn't change with this PR; it moved to

`x-pack/plugins/security_solution/public/timelines/components/timeline/cell_rendering/default_cell_renderer.tsx` as shown below:

```
export const DefaultCellRenderer: React.FC<CellValueElementProps> = ({
  columnId,
  data,
  eventId,
  header,
  linkValues,
  setCellProps,
  timelineId,
}) => (
  <>
    {getColumnRenderer(header.id, columnRenderers, data).renderColumn({
      columnName: header.id,
      eventId,
      field: header,
      linkValues,
      timelineId,
      truncate: true,
      values: getMappedNonEcsValue({
        data,
        fieldName: header.id,
      }),
    })}
  </>
);
```

Any usages of TGrid were updated to pass `DefaultCellRenderer` as the value of the `renderCellValue` prop, as shown in the screenshot below:

<img width="1239" alt="render-cell-value" src="https://user-images.githubusercontent.com/4459398/113345484-c121f800-92ef-11eb-8a21-2b6dd8ef499b.png">

The `EuiDataGrid` [codesandbox example](https://codesandbox.io/s/nsmzs) provides the following example `renderCellValue` implementation, which highlights a cell green based on it's numeric value:

```
  const renderCellValue = useMemo(() => {
    return ({ rowIndex, columnId, setCellProps }) => {
      const data = useContext(DataContext);
      useEffect(() => {
        if (columnId === 'amount') {
          if (data.hasOwnProperty(rowIndex)) {
            const numeric = parseFloat(
              data[rowIndex][columnId].match(/\d+\.\d+/)[0],
              10
            );
            setCellProps({
              style: {
                backgroundColor: `rgba(0, 255, 0, ${numeric * 0.0002})`,
              },
            });
          }
        }
      }, [rowIndex, columnId, setCellProps, data]);

      function getFormatted() {
        return data[rowIndex][columnId].formatted
          ? data[rowIndex][columnId].formatted
          : data[rowIndex][columnId];
      }

      return data.hasOwnProperty(rowIndex)
        ? getFormatted(rowIndex, columnId)
        : null;
    };
  }, []);
```

The sample code above formats the `amount` column in the example `EuiDataGrid` with a green `backgroundColor` based on the value of the data, as shown in the screenshot below:

<img width="956" alt="datagrid-cell-formatting" src="https://user-images.githubusercontent.com/4459398/113348300-a782af80-92f3-11eb-896a-3d92cf4b9b53.png">

To demonstrate that similar styling can be applied to TGrid using the same technique illustrated by `EuiDataGrid`'s [codesandbox example](https://codesandbox.io/s/nsmzs), we can update the `DefaultCellRenderer` in `x-pack/plugins/security_solution/public/timelines/components/timeline/cell_rendering/default_cell_renderer.tsx` to apply a similar technique:

```
export const DefaultCellRenderer: React.FC<CellValueElementProps> = ({
  columnId,
  data,
  eventId,
  header,
  linkValues,
  setCellProps,
  timelineId,
}) => {
  useEffect(() => {
    if (columnId === 'signal.rule.risk_score') {
      const value = getMappedNonEcsValue({
        data,
        fieldName: columnId,
      });
      if (Array.isArray(value) && value.length > 0) {
        const numeric = parseFloat(value[0]);
        setCellProps({
          style: {
            backgroundColor: `rgba(0, 255, 0, ${numeric * 0.002})`,
          },
        });
      }
    }
  }, [columnId, data, setCellProps]);

  return (
    <>
      {getMappedNonEcsValue({
        data,
        fieldName: columnId,
      })}
    </>
  );
};
```

The example code above renders the  `signal.rule.risk_score` column in the Alerts table with a green `backgroundColor` based on the value of the data, as shown in the screenshot below:

<img width="1231" alt="alerts" src="https://user-images.githubusercontent.com/4459398/113349015-a30ac680-92f4-11eb-8518-5c1b7465e76e.png">

Note: In the screenshot above, the values in the Alerts table are not rendered as draggables.
2021-04-05 13:39:09 -04:00
Thomas Neirynck 8e11e2598e
[Maps] Enable all zoom levels for all users (#96093) 2021-04-05 12:04:20 -04:00
Pierre Gayvallet 95e45ddebc
Use plugin version in its publicPath (#95945)
* Use plugin version in its publicPath

* remove useless comment

* fix types

* update generated doc
2021-04-05 18:00:13 +02:00
Scotty Bollinger ea03eb1bab
[Enterprise Search] Expose core.chrome.setIsVisible for use in Workplace Search (#95984)
* Hide chrome for Workplace Search by default

The Workplace Search Personal dashboard needs the chrome hidden. We hide it globally here first to prevent a flash of chrome on the Personal dashboard and unhide it for admin routes, which will be in a future commit

* Add core.chrome.setIsVisible to KibanaLogic

* Toggle chrome visibility for Workplace Search

* Add test

* Refactor to set context and chrome when pathname changes

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-05 11:27:05 -04:00
Scotty Bollinger 123f3400a8
[Workplace Search] Add sub nav and fix rendering bugs in Personal dashboard (#96100)
* Fix route for private deferated source summary

* Make schema types nullable

Federated sources don’t have counts and the server returns null so our routes have to expect that sometimes these values will be null

* Add SourceSubNav to Personal dashboard

We are able to leverage the existing component with a couple a small change; the existing componet is a subnav in the larger Enterprise Search shared navigation component and does not include its styles. This caused the list items to render with bullet points next to them. Adding this class and displaying the nav items as block elements fixes this issue.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-05 11:19:32 -04:00
Cauê Marcondes 9cebff1298
[OBS]home page is showing incorrect value of APM throughput (tpm) (#95991)
* fixing obs transaction per minute value

* addressing PR comments

* fixing unit test

* addressing PR comments

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-05 10:51:56 -04:00
Shahzad a640522140
[Observability] Exploratory View initial skeleton (#94426)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-05 15:26:48 +02:00
Caroline Horn 76acef0c2c
[KQL] Fixed styles of KQL textarea for the K8 theme (#96190)
* Fixed style of KQL textarea for K8 theme and some general heights and borders

* Fix popover paddings
2021-04-05 09:05:30 -04:00
Alexey Antonov b670ef29ae
[TSVB] fix wrong field list on overriding index pattern for series (#96204) 2021-04-05 15:57:42 +03:00
Tiago Costa 413477b788
skip flaky suite (#96113) 2021-04-05 13:36:28 +01:00
Anton Dosov 8c8323abfd
[Search Sessions] fix updating deleting sessions from non-default space (#96123)
* add spaces test

* fix updating and deleting sessions in non-default space

* revert back to batch update

* Add space tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Liza K <liza.katz@elastic.co>
2021-04-05 15:01:24 +03:00
Spencer cf22394807
pass script to bash to support scripts which aren't actually executable (#96198)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-04-04 14:40:42 -04:00
spalger 763c0038ae Revert "stop wrapping steps in runbld (#96195)"
This reverts commit f8a6ba223a.
2021-04-04 09:34:58 -07:00
Spencer f8a6ba223a
stop wrapping steps in runbld (#96195)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-04-04 09:15:14 -07:00
Larry Gregory 7d0920bbfa
Replace lodash templates with static react renderer for field formatters (#96048) 2021-04-02 22:26:35 -05:00
Jonathan Budzenski 8ccb0d4ca3
[docker] Consistent timestamps across builds (#96081)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-02 18:02:54 -05:00
Constance c97c51876e
Remove incorrect error toast on successful poll (#96159) 2021-04-02 17:28:18 -04:00
James Rodewig a0828c6797
[DOCS] Fix docker run code snippet (#96157)
The current docker run code snippet is malformed and renders incorrectly.

This fixes the rendering.
2021-04-02 16:15:16 -04:00
Jason Stoltzfus 82f7b2127e
Move trs to be under tbody in ResultSettings (#96132)
This was causing console errors.

I factored out the column headers to their own component, and moved
all table rows to be under a tbody. This alleviates the console
warnings.
2021-04-02 13:24:04 -04:00
Constance 1d58266559
[Enterprise Search] Add toasts support to FlashMessages component (#95981)
* Add toasts to FlashMessagesLogic

+ Tests cleanup:

- Group actions by their reducer blocks (since flashMessages has such specific logic) - recommend viewing with whitespace changes off for this
- Do not reset context between each test, but instead by mount(), which allows tests to maintain state between adding/removing/resetting
- Remove '()' from test names (feedback from previous PRs)

* Add toast message helpers

+ refactor FLASH_MESSAGE_TYPES to constants, so that both callouts & toasts can use it effectively

* Update FlashMessages to display toasts as well as callouts

- This means we can automatically use toasts alongside callouts in all views that already have FlashMessages

+ a11y enhancement! update callouts to also announce new messages to screenreaders

* [Example] Update ApiLogsLogic to flash an error toast on poll

+ update copy to better match EUI guidelines (shorter)

* Fix test caused by new FlashMessages structure

* PR suggestion - destructure

Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>

* PR feedback: implicit return

* Fix color types

- adding our own string enum fixes the typescript errors that both EuiCallout & EuiToast emit when passing color props to the base EUI types

* PR feedback: Update flashToast API to match callout helper API

- accepts a string title with optional args, creates a unique ID automatically if missing

Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>
2021-04-02 09:50:39 -07:00
Scotty Bollinger fb681d9062
[Workplace Search] Fix broken reauthenticate URLs and fix spelling (#96140)
* Remove kebabCase

Kibana routes are snake case, which matches the existing serviceType, so this is no longer needed

* Fix route segment

The word reauthenticate is not hyphenated

* Fix all misspelling of reauthenticate

Renames files too
2021-04-02 12:41:27 -04:00
Lukas Olson 59100b5626
Fix autocomplete telemetry (#95724)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-02 08:13:14 -07:00
Melissa Alvarez 8fef5fd9e1
[ML] Data Frame Analytics: adds support for runtime fields (#95734)
* add runtime mapping editor in wizard

* ensure depVar is updated correctly with RF changes

* remove old RF from includes

* ensure cloning works with RF as depVar

* ensure indexPattern RF work

* scatterplot supports RTF. depVar options have indexPattern RTF on first load

* remove unnecessary types

* ensure supported fields included by default

* update types in editor

* use isRuntimeMappings

* fix translations. ensure runtimeMappings persist when going back to step 1

* ensure histograms support runtime fields

* update types
2021-04-02 11:06:31 -04:00
renovate[bot] fe3ec69f9e
Update dependency @elastic/charts to v27 (#95963)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-02 16:01:06 +02:00
Constance 3237fd0637
[Enterprise Search] Fix eslint import rule not ordering sibling mocks with parent mocks (#96070)
* Enterprise Search eslint import order rule fix
- mocks in current folder should be grouped with mocks from parent folders

* Run --fix/update instances of importing ./__mocks__
2021-04-02 09:05:53 -04:00
Xavier Mouligneau f042ec8945
[SECURITY SOLUTIONS][Timeline] correlation bug (#96099)
* fix pagination bug with correlation

* fix close resolver to go back to prev tab
2021-04-02 09:00:51 -04:00
Stratoula Kalafateli d2a484c5bd
[TSVB] Enables url drilldowns for range selection (#95296)
* Temp research code

* Make it work

* Cleanup

* Convert series to datatable

* Remove unecessary log

* Minor

* Fix types problem

* Add unit tests

* Take under consideration the override index pattern setting

* Implement brush event for dual mode

* Move indexpatterns fetch outside the loop

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-02 15:51:09 +03:00
Constance 7db838e0b8
[App Search] API Logs: Add ApiLogsTable and NewApiEventsPrompt components (#96008)
* Set up getStatusColor util for upcoming EuiHealth components

* Add ApiLogsTable component

* Add NewApiEventsPrompt component

* Update ApiLogs view with new components

+ add EuiPageContent wrapper (missed this originally)

* Update EngineOverview with new components

* PR feedback: Comments + mock FormattedRelative

* Fix type error
2021-04-02 08:49:12 -04:00
Rudolf Meijering bffded3ca7
migrations v2: Retry tasks that timeout (#95305)
* Retry tasks that timeout with timeout_exception or receive_timeout_transport_exception

* Integration test: assert waitForPickupUpdatedMappingsTask waitForReindexTask returns retryable error when task has not completed within the timeout

* stateActionMachine: remove infinite loop failsafe

* Introduce wait_for_task_completion_timeout and keep on retrying *_WAIT_FOR_TASK steps until the ES task completes

* cloneIndex integration test if clone target exists but does not turn yellow within timeout

* Try to stabilize waitForReindexTask test

* Fix types

* Make v2 migrations retryAttempts configurable

* Improve type safety by narrowing left res types

* Fix test description

* Fix tests
2021-04-02 10:24:27 +02:00
spalger 6868f18343 skip flaky suite (#95660) (#95706) 2021-04-01 19:17:44 -07:00
James Rodewig eae160c419
Remove unneeded articles from button text (#96045)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-01 18:52:07 -04:00
Constance df8166f20e
[App Search] Update instances of EuiPanel/EuiPageContent to bordered or filled panels (#96090)
* Add hasBorder to all EuiPageContent panels

* EngineCreation: switch EuiPageBody to EuiPageContent
+ add hasBorder

* Credentials: update EuiPanels w/ hasBorder

* ApiCodeExample: switch to hasBorder

* DataPanel: update to take & pass hasBorder prop

* Analytics & EngineOverview: use hasBorder

* Relevance Tuning: update EuiPanels

- switch to hasBorder for top level panels
- switch to color="subdued" for boost accordion
- tweak padding of boost panel
- CSS cleanup

* Role Mappings: switch to hasBorder

+ remove unused class - `euiPanel--disabled` was not applying any styles
+ remove random 'export' string

* Sample engine CTA: switch to subdued panel
+ fix sizing - when loading button pops in, it was causing text to overflow
2021-04-01 17:54:53 -04:00
Tiago Costa f424b9cbb2
chore(NA): moving @elastic/datemath into bazel (#94665)
* chore(NA): majority of the changes needed to build elastic-datemath with bazel

* chore(NA): add missing bits on elastic-datemath package

* chore(NA): add missing build and watch scripts

* chore(NA): remove build scripts for elastic datemah

* chore(NA): remove typo from build baze production projects logs

* chore(NA): force install on CI

* chore(NA): introduce custom preserve symlinks resolver for jest

* chore(NA): update jest integration snapshot

* chore(NA): fix build for bazel packages

* chore(NA): correctly copy bazel built packages into final distributable build

* chore(NA): update kbn pm dist

* chore(NA): experimental new logic to handle bazel yarn rule rerun using yarn-integrity file

* chore(NA): update snapshots

* refact(NA): ensure yarn integrity exists into two methods

* chore(NA): fix ts error

* chore(NA): update snapshots

* chore(NA): update elastic-datemath build file to include ts_project rule

* chore(NA): update basic optimization test snapshots

* chore(NA): merge and solve conflicts cherry-pick from #96066

* chore(NA): update package.json and yarn.lock file

* chore(NA): update bazel/bin into bazel-bin on kbn-pm build bazel packages

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-01 22:51:32 +01:00
Lisa Cawley 32f2409396
Adds ingest pipeline links to documentation link service (#95837) 2021-04-01 14:21:42 -07:00
spalger 8f2db91cc5 add bazel directory back to .gitignore so it doesn't end up committed 2021-04-01 13:17:56 -07:00
Gabriel Landau 9683d32fa5
Standardize process fields in Endpoint Security Telemetry (#95836)
* Standardize process fields across process and Target.process

* Lint

* Bug fix

* Typo fix

* Add new fields to unit test, fix 0 truthiness bug, and exercise 0 truthiness bug in unit test

* Add a PR-requested unit test case

* Use Yoda Conditions, Kibana does not

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-01 15:43:37 -04:00