[IM] Index Templates UI list view#39922
Conversation
|
Pinging @elastic/es-ui |
💔 Build Failed |
8f94c99 to
5d8205f
Compare
💔 Build Failed |
💔 Build Failed |
eb0c9d7 to
5954ef9
Compare
💚 Build Succeeded |
6a10894 to
25f16e4
Compare
💚 Build Succeeded |
💔 Build Failed |
💔 Build Failed |
|
Retest |
💔 Build Failed |
|
retest |
💚 Build Succeeded |
💔 Build Failed |
b2c9e89 to
50611d7
Compare
💚 Build Succeeded |
50611d7 to
8365f80
Compare
|
FYI @yaronp68 this is ready for review |
|
@Bamieh do you have capacity to review |
8365f80 to
25bf57a
Compare
| @@ -0,0 +1,131 @@ | |||
| /* | |||
There was a problem hiding this comment.
I'll delete this file and adopt the shared plugin once #40777 is merged.
💚 Build Succeeded |
|
@cjcenizal @alisonelizabeth I'm fine with a confirmation approach for deleting system templates but worth checking with support later. I'll ask |
b0fc167 to
63ab1ae
Compare
|
updated PR to allow deletion of system templates with confirmation (see latest screenshots in first comment) |
💚 Build Succeeded |
sebelga
left a comment
There was a problem hiding this comment.
LGTM! Awesome work Alison! I tested locally and works great.
I made a few tiny (preference) code comments, nothing important.
There is only 1 UX that I am not 100% convinced (but it seems to be an EUI decision, not yours), is the "ILM Policy" button. For me, it should be a dropdown that indicates that it is a filter, with a label on top Filter templates for example. As a user, I am not used to click a button to filter item in a table.
| templatesToDelete.find(templateName => templateName.startsWith('.')) | ||
| ); | ||
|
|
||
| const handleDeleteTemplates = async () => { |
There was a problem hiding this comment.
nit: the async does not seem to be needed here
| ); | ||
|
|
||
| const handleDeleteTemplates = async () => { | ||
| deleteTemplates(templatesToDelete).then(({ data: { templatesDeleted, errors }, error }) => { |
There was a problem hiding this comment.
I haven't looked at the API yet, but it is a bit confusing to have both "errors" and "error". It does seem though that is is a pattern we have used in another app though (now I am the reader and not the writer of the code 😊 ). If error (singular) is the Http request that failed, could we rename it "apiError"?
|
|
||
| const [isDeleteConfirmed, setIsDeleteConfirmed] = useState<boolean>(false); | ||
|
|
||
| if (!numTemplatesToDelete) { |
There was a problem hiding this comment.
This would be better on L23 to exit early.
| const Checkmark = ({ tableCellData }: { tableCellData: object }) => { | ||
| const isChecked = Object.entries(tableCellData).length > 0; | ||
|
|
||
| if (isChecked) { |
There was a problem hiding this comment.
nit: In these cases, I usually personally prefer the shorter ternary version
return isChecked ? <EuiIcon type="check" /> : null;| } catch (e) { | ||
| return response.errors.push({ | ||
| name, | ||
| error: wrapEsError(e), |
| 'xpack.idxMgmt.deleteTemplatesModal.successNotificationMessageText', | ||
| { | ||
| defaultMessage: | ||
| 'Deleted {numSuccesses, number} {numSuccesses, plural, one {template} other {templates}}', |
There was a problem hiding this comment.
this is OK, but i'd use this:
| 'Deleted {numSuccesses, number} {numSuccesses, plural, one {template} other {templates}}', | |
| 'Deleted {numSuccesses, plural, one {# template} other {# templates}}', |
the # will return the variable value.
63ab1ae to
d48d60b
Compare
💚 Build Succeeded |
This PR is the first phase of adding support for
Index Templateswithin theIndex Managementapp.Changes include:
Indices&Index TemplatesRelease notes
This feature adds the list of Index Templates as a tab to the Index Management app. Users can also delete templates from this view.
Note: This is the first phase, additional functionality for Index Templates will be added for 7.4 in separate PRs.
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
Before

After
Indices (functionality unchanged, but now under
Indicestab)Index Templates (new)
List view w/o system templates:

List view with system templates toggled:

Filtered list view by ILM policy:

Delete single template:

Delete multiple templates:

Delete system template:
