[IM] prevent users from editing and deleting cloud-managed templates#43901
[IM] prevent users from editing and deleting cloud-managed templates#43901cjcenizal merged 5 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/es-ui |
💔 Build Failed |
💚 Build Succeeded |
There was a problem hiding this comment.
Code LGTM! Didn't test locally.
Some non-blocker suggestions but heavily encouraged 😄:
-
I would love to see tooltips on the table action items that explain why they are disabled, but I know that is a limitation of using EUI's default action items props, which don't support tooltips when an action is disabled. It may be possible by rendering custom actions instead, though that may be tricky too since there are more than 2 actions here. I ran into a similar issue for SLM and ended up rendering one custom action that shows three button icons (screenshot).
-
If we don't render custom actions, then I think it would be great to add a warning callout to the detail panel of a managed template so that an explanation is given somewhere. As it currently stands, the only explanation is on the edit page which is largely inaccessible since Edit is disabled. I also wouldn't be opposed to rendering this callout regardless of if we are able to add tooltips! 🙂Example screenshot from managed repository, note that the repository also gets a
Managedbadge in the table. PR for handling managed repository: #36947
|
Great suggestion @jen-huang! I added a callout using the primary color (warning seemed inappropriate since the UI already prevents the user from doing any harm). |
| selectable: ({ isManaged }: Template) => !isManaged, | ||
| selectableMessage: (selectable: boolean) => { | ||
| if (!selectable) { | ||
| return i18n.translate('xpack.idxMgmt.templateList.table.deleteManagedTemplateTooltip', { |
There was a problem hiding this comment.
Where does this message get surfaced?
💔 Build Failed |
💚 Build Succeeded |


This PR prevents cloud-managed templates from being edited or deleted via the UI.
I followed a similar implementation done via #40104.
Testing instructions
cluster.metadata.managed_index_templatessetting via Dev Tools:.cloud-<template_name>via Dev Tools.Note: both of these steps are for testing purposes only.
Screenshots
Edit/clone disabled via table

Edit/clone disabled via details panel

Error displays if you attempt to access the url directly to edit a cloud-managed template
