From dc2aeb04dbadefde15ad0e9c1048b1ca697b2208 Mon Sep 17 00:00:00 2001 From: Mark Hopkin Date: Tue, 14 Feb 2023 14:40:46 +0000 Subject: [PATCH] [Fleet] Warn user when they are sending data to stream managed by different integration (#151075) ## Summary Closes #149427 Give the user a warning if they are sending data to a data stream that isn't managed by the integration being added. Screenshot 2023-02-13 at 21 17 13 (cherry picked from commit 25d4c9f3297bfcf685287d4b0fd3a91934d8eb04) --- .../steps/components/dataset_combo.tsx | 77 ++++++++++++++----- 1 file changed, 57 insertions(+), 20 deletions(-) diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/dataset_combo.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/dataset_combo.tsx index 6908f8fea130f..c310cf2b29d3a 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/dataset_combo.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/dataset_combo.tsx @@ -6,9 +6,11 @@ */ import React, { useEffect, useState } from 'react'; -import { EuiComboBox } from '@elastic/eui'; +import { EuiComboBox, EuiIcon, EuiLink, EuiSpacer, EuiText, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; + import type { DataStream } from '../../../../../../../../../common/types'; interface SelectedDataset { @@ -73,24 +75,59 @@ export const DatasetComboBox: React.FC<{ }); }; return ( - + <> + + {valueAsOption && valueAsOption.value.package !== pkgName && ( + <> + + + +   + + } + > + + {i18n.translate('xpack.fleet.datasetCombo.learnMoreLink', { + defaultMessage: 'learn more', + })} + + + ), + }} + /> + + + )} + ); };