Go to file
Andrew Goldstein 99ee803459
[Security Solution] Enable schema-driven sorting descriptions in column headers (#111232)
## Summary

This PR resolves issue <https://github.com/elastic/kibana/issues/110041> reported by @snide to enable schema-driven sorting descriptions in column headers.

@chandlerprall recommends obtaining a **+1** from the Machine Learning and Observability solutions, because the fix updates an `i18n` constant in Kibana common to all consumers of `EuiDataGrid`.

## Details

Thanks @chandlerprall for paring on this!

The Alerts table, `Host > Events`, and other `EuiDataGrid`-based views in the Security Solution make use of the default [`EuiDataGrid` schemas](https://elastic.github.io/eui/#/tabular-content/data-grid-schemas-and-popovers).

The default schemas enable `EuiDataGrid` to automatically display, for example, `Old-New` and `New-Old` sorting descriptions for datetime fields, as opposed to generic `A-Z` and `Z-A` descriptions.

The following (shared) Kibana `i18n` constant in `src/core/public/i18n/i18n_eui_mapping.tsx` is expected to be rendered a `string` at runtime:

```ts
    'euiColumnActions.sort': ({ schemaLabel }: EuiValues) =>
      i18n.translate('core.euiColumnActions.sort', {
        defaultMessage: 'Sort {schemaLabel}',
        values: { schemaLabel },
      }),
```

But the constant was rendered in `EuiDataGrid` column headers as `[object Object]` when schemas were enabled, as shown in the screenshot below:

![column-header-object-object](https://user-images.githubusercontent.com/4459398/132079843-a8b0f5e5-9d47-4816-8baa-e29577511bf1.png)

_Above: The `sortTextAsc/Desc` text was rendered as `[object Object]`_

The temporary workaround described by [#110041](https://github.com/elastic/kibana/issues/110041) ensured that `Sort A-Z` and `Sort Z-A` labels were always displayed (in lieu of `[object Object]`), as shown in the screenshot below:

![image](https://user-images.githubusercontent.com/324519/130789326-bfe67cae-e4f7-469a-9b57-320cbf733cc8.png)

_Above: `Sort A-Z` and `Sort Z-A` labels were always displayed as a workaround_

The fix in this PR updates the following (shared) Kibana `i18n` constant in `src/core/public/i18n/i18n_eui_mapping.tsx` to use a `FormattedMessage`:

```ts
    'euiColumnActions.sort': ({ schemaLabel }: EuiValues) => (
      <FormattedMessage
        id="core.euiColumnActions.sort"
        defaultMessage="Sort {schemaLabel}"
        values={{ schemaLabel }}
      />
    ),
```

, which ensures a schema-specific sorting label is displayed as-expected.

It also removes the workaround, as shown in the animated gif below:

![after](https://user-images.githubusercontent.com/4459398/132080352-1ee41a7e-8884-45ad-ae3c-daa9a0127aac.gif)

_Above: Schema-specific sorting descriptions are displayed for `datetime`, `text`, and `numeric` column headers_
2021-09-08 11:54:39 -06:00
.buildkite Revert "[CI] Buildkite ES Snapshots Pipelines (#100843)" (#111560) 2021-09-08 11:43:47 -04:00
.ci Bump the Node.js version used by Docker in CI (#110760) 2021-09-01 12:05:15 +02:00
.github Change Graph ownership (#111157) 2021-09-03 19:12:42 +02:00
api_docs Move to vis_types folder part 2 (#110574) 2021-09-03 11:19:44 +03:00
config Support authenticating to Elasticsearch via service account tokens (#102121) 2021-07-12 14:18:35 -04:00
dev_docs Port performance docs to new docs system. (#111063) 2021-09-07 14:04:08 -04:00
docs Replace hard-coded doc links in uptime (#111075) 2021-09-08 09:27:08 -07:00
examples Adding owners to kibana plugins (#108407) 2021-08-17 10:21:06 -04:00
licenses Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
packages Share history package via shared deps (#111537) 2021-09-08 18:49:17 +02:00
plugins
rfcs [SO Migration] fix reindex race on multi-instance mode (#104516) 2021-07-07 22:10:37 +02:00
scripts Functional tests for execution context (#110299) 2021-09-03 05:48:32 -04:00
src [Security Solution] Enable schema-driven sorting descriptions in column headers (#111232) 2021-09-08 11:54:39 -06:00
tasks/config [Es query] Move to package (#103530) 2021-07-21 17:10:55 +02:00
test [Vislib] Removes old implementation of xy chart (#110786) 2021-09-08 18:35:51 +03:00
typings [Fleet] Replace usages of EuiCodeEditor by CodeEditor (#107434) 2021-08-05 11:40:40 -04:00
utilities Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
vars [SavedObjects] Integration tests for unsupported product 404 responses (#109755) 2021-08-30 19:36:21 -04:00
x-pack [Security Solution] Enable schema-driven sorting descriptions in column headers (#111232) 2021-09-08 11:54:39 -06:00
.backportrc.json chore(NA): adds 7.16 into backportrc (#109128) 2021-08-18 17:37:52 +01:00
.bazelignore chore(NA): stop grouping bazel out symlink folders (#96066) 2021-04-01 14:16:14 -05:00
.bazeliskversion chore(NA): bump bazelisk to v1.7.5 (#92905) 2021-02-26 00:48:47 +00:00
.bazelrc chore(NA): manage npm dependencies within bazel (#92864) 2021-03-03 12:37:20 -05:00
.bazelrc.common chore(NA): enable exports_directories_only on rules nodejs to improve performance (#104180) 2021-07-02 00:14:40 +01:00
.bazelversion chore(NA): bazel machinery installation on kbn bootstrap (#89469) 2021-01-28 00:51:01 +00:00
.browserslistrc [browserslist] remove unnecessary browsers (#89186) 2021-01-25 16:30:18 -07:00
.editorconfig .editorconfig MDX files should follow the same rules as MD (#96942) 2021-04-13 11:40:42 -04:00
.eslintignore [Reporting] Create reports with full state required to generate the report (#101048) 2021-08-12 18:40:19 +02:00
.eslintrc.js [eslint] add rule to prevent export* in plugin index files (#109357) 2021-09-01 18:05:45 -07:00
.fossa.yml
.gitattributes
.gitignore [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
.i18nrc.json Move to vis_types folder part 2 (#110574) 2021-09-03 11:19:44 +03:00
.node-version Bump Node.js from version 14.17.5 to 14.17.6 (#110654) 2021-09-01 08:50:50 +02:00
.npmrc
.nvmrc Bump Node.js from version 14.17.5 to 14.17.6 (#110654) 2021-09-01 08:50:50 +02:00
.prettierignore [dev] Replace sass-lint with stylelint (#86177) 2021-01-15 11:52:29 -06:00
.prettierrc
.stylelintignore chore(NA): stop grouping bazel out symlink folders (#96066) 2021-04-01 14:16:14 -05:00
.stylelintrc Amsterdam helpers (#93701) 2021-03-10 10:27:16 -06:00
.telemetryrc.json [Usage collection] Collect non-default kibana configs (#97368) 2021-04-20 11:02:27 -04:00
.yarnrc chore(NA): manage npm dependencies within bazel (#92864) 2021-03-03 12:37:20 -05:00
api-documenter.json
BUILD.bazel [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
CODE_OF_CONDUCT.md Add CODE_OF_CONDUCT.md (#87439) 2021-02-23 09:01:51 +01:00
CONTRIBUTING.md Point to new developer guide in CONTRIBUTING.md (#108953) 2021-08-17 14:04:12 -04:00
FAQ.md
github_checks_reporter.json
Gruntfile.js Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
Jenkinsfile chore(NA): remove KBN_ES_SNAPSHOT_USE_UNVERIFIED var from Jenkinsfile 2021-07-14 17:16:57 +01:00
jest.config.integration.js chore(NA): introduce preset for jest-integration tests on @kbn/test (#105144) 2021-07-14 20:53:12 +01:00
jest.config.js [Canvas] Expression tagcloud (#108036) 2021-08-23 06:52:19 -04:00
kibana.d.ts Remove /src/legacy (#95510) 2021-04-06 09:25:36 +02:00
LICENSE.txt Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
NOTICE.txt [Detections] Adds automatic updating for Prebuilt Security Detection Rules package (#101846) 2021-06-24 15:31:25 -06:00
package.json [Osquery] Fix support for disabled security (#110547) 2021-09-06 10:10:04 +03:00
preinstall_check.js Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
README.md STYLEGUIDE reference .md => .mdx (#107440) 2021-08-02 14:05:58 -05:00
renovate.json5 [renovate] cleanup and disable dependency dashboard (#110664) 2021-08-31 14:17:50 -04:00
RISK_MATRIX.mdx Add "Risk Matrix" section to the PR template (#100649) 2021-06-02 14:43:47 +02:00
SECURITY.md
STYLEGUIDE.mdx Update Styleguide path to .mdx (#107890) 2021-08-10 13:15:43 +02:00
tsconfig.base.json [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
tsconfig.bazel.json [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
tsconfig.browser.json
tsconfig.browser_bazel.json [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
tsconfig.json [maps] remove tile_map, region_map, and maps_legacy plugins (#105326) 2021-08-18 12:51:31 -06:00
tsconfig.types.json [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
TYPESCRIPT.md
WORKSPACE.bazel Bump Node.js from version 14.17.5 to 14.17.6 (#110654) 2021-09-01 08:50:50 +02:00
yarn.lock [Osquery] Fix support for disabled security (#110547) 2021-09-06 10:10:04 +03:00

Kibana

Kibana is your window into the Elastic Stack. Specifically, it's a browser-based analytics and search dashboard for Elasticsearch.

Getting Started

If you just want to try Kibana out, check out the Elastic Stack Getting Started Page to give it a whirl.

If you're interested in diving a bit deeper and getting a taste of Kibana's capabilities, head over to the Kibana Getting Started Page.

Using a Kibana Release

If you want to use a Kibana release in production, give it a test run, or just play around:

Building and Running Kibana, and/or Contributing Code

You might want to build Kibana locally to contribute some code, test out the latest features, or try out an open PR:

Documentation

Visit Elastic.co for the full Kibana documentation.

For information about building the documentation, see the README in elastic/docs.

Version Compatibility with Elasticsearch

Ideally, you should be running Elasticsearch and Kibana with matching version numbers. If your Elasticsearch has an older version number or a newer major number than Kibana, then Kibana will fail to run. If Elasticsearch has a newer minor or patch number than Kibana, then the Kibana Server will log a warning.

Note: The version numbers below are only examples, meant to illustrate the relationships between different types of version numbers.

Situation Example Kibana version Example ES version Outcome
Versions are the same. 5.1.2 5.1.2 💚 OK
ES patch number is newer. 5.1.2 5.1.5 ⚠️ Logged warning
ES minor number is newer. 5.1.2 5.5.0 ⚠️ Logged warning
ES major number is newer. 5.1.2 6.0.0 🚫 Fatal error
ES patch number is older. 5.1.2 5.1.0 ⚠️ Logged warning
ES minor number is older. 5.1.2 5.0.0 🚫 Fatal error
ES major number is older. 5.1.2 4.0.0 🚫 Fatal error

Questions? Problems? Suggestions?

  • If you've found a bug or want to request a feature, please create a GitHub Issue. Please check to make sure someone else hasn't already created an issue for the same topic.
  • Need help using Kibana? Ask away on our Kibana Discuss Forum and a fellow community member or Elastic engineer will be glad to help you out.