in PR #105440, a new capability in the connectors UX is added - the ability to display a warning icon beside a connector. This is used in the PR to note connectors which are "deprecated" and need to be updated.
The way this is done in the PR is to check a specific field for a specific set of connector types:
|
const itemConfig = ( |
|
item as UserConfiguredActionConnector<Record<string, unknown>, Record<string, unknown>> |
|
).config; |
|
const showLegacyTooltip = |
|
itemConfig?.isLegacy && |
|
// TODO: Remove when applications are certified |
|
((ENABLE_NEW_SN_ITSM_CONNECTOR && item.actionTypeId === '.servicenow') || |
|
(ENABLE_NEW_SN_SIR_CONNECTOR && item.actionTypeId === '.servicenow-sir')); |
That code will get complicated if we need to add more of these.
Rather than continue in that style, it seems like a connector should be able to return some kind of "warning" indicator, that would have at least the content needed for the tooltip - title and content. Perhaps we'd also want to allow a customized icon, and a URL (in case the warning message is actionable, and the URL would help the user perform that action).
If we have a generic way of allowing a connector to return this kind of information, then we can move that logic into the connectors, and out of the generic UX code.
in PR #105440, a new capability in the connectors UX is added - the ability to display a warning icon beside a connector. This is used in the PR to note connectors which are "deprecated" and need to be updated.
The way this is done in the PR is to check a specific field for a specific set of connector types:
kibana/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx
Lines 176 to 183 in 409e31d
That code will get complicated if we need to add more of these.
Rather than continue in that style, it seems like a connector should be able to return some kind of "warning" indicator, that would have at least the content needed for the tooltip -
titleandcontent. Perhaps we'd also want to allow a customized icon, and a URL (in case the warning message is actionable, and the URL would help the user perform that action).If we have a generic way of allowing a connector to return this kind of information, then we can move that logic into the connectors, and out of the generic UX code.