-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Index Management] Add support for index mode (#197874)
Closes #195772 ## Summary This PR displays the index mode setting in Index templates (at Review step in creation flow and at template details flyout) and Data streams (in ds table and ds details flyout). <img width="1523" alt="Screenshot 2024-10-28 at 14 39 18" src="https://github.com/user-attachments/assets/9d40c1cd-d08a-4950-a679-29d9910ee845"> <img width="1523" alt="Screenshot 2024-10-28 at 19 05 29" src="https://github.com/user-attachments/assets/463e549d-68cd-4ddf-ae0a-cfe43e47af10"> <img width="1523" alt="Screenshot 2024-10-28 at 14 41 01" src="https://github.com/user-attachments/assets/4ccf8727-5913-4857-9dc2-48c40da3a356"> <img width="1523" alt="Screenshot 2024-10-28 at 14 41 09" src="https://github.com/user-attachments/assets/a6b6a0a9-7ae2-4201-8ff9-3bead915fb2a"> ### How to test: **Creating a Logsdb index template and data stream:** 1. Go to Index Managament -> Index templates and start creating a new template 2. Add a name and an index pattern `test-logsdb` and then go to the Settings step 3. Add the setting `"index.mode": "logsdb`. 4. Go to last step (review) and verify that the index mode is correctly displayed in Summary. Save the template. 5. In the template flyout, verify that the index mode displays the correct label. 6. Go to Console and create a data stream that mathes the index pattern of the created index template: `PUT _data_stream/test-logsdb` 7. Go to Index Management -> Data streams 8. In the data streams table, verify that the index mode column is correct for the new data stream. 9. Open the new data stream and verify that the details flyout displays the correct index mode. **Creating a Time series index template and data stream:** 1. Go to Index Managament -> Index templates and start creating a new template 2. Add a name and an index pattern `test-tsds` and then go to the Settings step 3. Add the setting `"index.mode": "time_series`. 4. For time series index template, we also need to add a mapping with a `time_series_dimension` property. Go to the Mappings step, click on "Load JSON" and add the following mappings object: ``` { "properties": { "id": { "type": "keyword", "time_series_dimension": true } } } ``` 6. Go to last step (review) and verify that the index mode is correctly displayed in Summary. Save the template. 7. In the template flyout, verify that the index mode displays the correct label. 8. Go to Console and create a data stream that mathes the index pattern of the created index template: `PUT _data_stream/test-tsds` 9. Go to Index Management -> Data streams 10. In the data streams table, verify that the index mode column is correct for the new data stream. 11. Open the new data stream and verify that the details flyout displays the correct index mode. ### Checklist - [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] [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 - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7288 - [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [x] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) --------- Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit 40ddfbc)
- Loading branch information
1 parent
fe3a0ff
commit 8aaad32
Showing
20 changed files
with
246 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
x-pack/plugins/index_management/public/application/lib/index_mode_labels.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
|
||
export const getIndexModeLabel = (mode?: string | null) => { | ||
switch (mode) { | ||
case 'standard': | ||
case null: | ||
case undefined: | ||
return i18n.translate('xpack.idxMgmt.indexModeLabels.standardModeLabel', { | ||
defaultMessage: 'Standard', | ||
}); | ||
case 'logsdb': | ||
return i18n.translate('xpack.idxMgmt.indexModeLabels.logsdbModeLabel', { | ||
defaultMessage: 'LogsDB', | ||
}); | ||
case 'time_series': | ||
return i18n.translate('xpack.idxMgmt.indexModeLabels.tsdbModeLabel', { | ||
defaultMessage: 'Time series', | ||
}); | ||
default: | ||
return mode; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.