[IM] Index Templates UI details view#41602
Conversation
|
Pinging @elastic/es-ui |
|
FYI @yaronp68 |
💚 Build Succeeded |
|
LGTM |
sebelga
left a comment
There was a problem hiding this comment.
Great work @alisonelizabeth ! I tested locally and it works well. I made a few small comments, no blockers.
Do you know what are the limitation of an index template name though? I encoded special characters in the name and created the template PUT _template/template%25%24%263
It saved correctly. But then if I try to see the details in the UI it breaks.
|
|
||
| return ( | ||
| <Fragment> | ||
| <DeleteTemplatesModal |
There was a problem hiding this comment.
I am not a huge fan of this pattern where the child component is the one deciding if it is visible on the screen.
I prefer to have the parent deciding when a child component is visible:
{templateToDelete.length && (
<DeleteTemplatesModal
callback={data => {
if (data && data.hasDeletedTemplates) {
reload();
}
setTemplateToDelete([]);
onClose();
}}
templatesToDelete={templateToDelete}
/>
)}You don't need to change it, just sharing 😊
| </EuiFlexItem> | ||
|
|
||
| <EuiFlexItem grow={false}> | ||
| {templateDetails && ( |
There was a problem hiding this comment.
Wouldn't it make more sense to have the <EuiFlexItem grow={false}> wrapped inside?
| const { name } = req.params; | ||
| const indexTemplateByName = await callWithRequest('indices.getTemplate', { name }); | ||
|
|
||
| const { |
There was a problem hiding this comment.
Shouldn't we add a check to make sure the template exists on the response before deconstructuring?
There was a problem hiding this comment.
good point, fixed!
Bamieh
left a comment
There was a problem hiding this comment.
i18n looks good, one nit with trackUiMetric that needs to be addressed I believe
| <EuiLink | ||
| href={`#${BASE_PATH}templates/${name}`} | ||
| data-test-subj="templateDetailsLink" | ||
| onClick={trackUiMetric.bind(null, UIM_TEMPLATE_SHOW_DETAILS_CLICK)} |
There was a problem hiding this comment.
this is changed now, its gonna be trackUiMetric('click', UIM_TEMPLATE_SHOW_DETAILS_CLICK)
There was a problem hiding this comment.
fixed, thanks for catching this!
9bfabe2 to
aa7649d
Compare
|
@sebelga thanks for your review! I'm not aware of any limitations with the template name. I addressed the issue with creating a template name with special characters - thanks for catching that! |
💚 Build Succeeded |
💚 Build Succeeded |
💔 Build Failed |
| @@ -20,9 +21,19 @@ import { TemplatesTable } from './templates_table'; | |||
| import { loadIndexTemplates } from '../../../services/api'; | |||
| import { Template } from '../../../../common/types'; | |||
| import { trackUiMetric, METRIC_TYPE } from '../../../services/track_ui_metric'; | |||
There was a problem hiding this comment.
Minor suggestion: you might find this module's interface to be simpler if it exports trackClick, trackLoad, etc.
There was a problem hiding this comment.
@cjcenizal Thanks for suggestion! I will update on another PR.
This PR is continuation of #39922, and adds the details view to the Index Templates UI.
Changes include:
Release notes
This feature adds the details panel to the Index Templates UI. Users can also delete a template from this view.
Note: This is continuation of #39922.
Testing
There are several system index templates by default. To create your own index template, go to console and follow the ES API docs.
For example:
Screenshots
Summary view with multiple index patterns:

Summary view with single index pattern, ILM policy and no mappings:

Summary view with no aliases, mappings or settings:

Settings tab

Mappings tab

Aliases tab
