mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[8.7] [Fleet] Warn user when they are sending data to stream managed by different integration (#151075) (#151146)
# Backport This will backport the following commits from `main` to `8.7`: - [[Fleet] Warn user when they are sending data to stream managed by different integration (#151075)](https://github.com/elastic/kibana/pull/151075) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Mark Hopkin","email":"mark.hopkin@elastic.co"},"sourceCommit":{"committedDate":"2023-02-14T14:40:46Z","message":"[Fleet] Warn user when they are sending data to stream managed by different integration (#151075)\n\n## Summary\r\n\r\nCloses #149427\r\n\r\nGive the user a warning if they are sending data to a data stream that\r\nisn't managed by the integration being added.\r\n\r\n<img width=\"697\" alt=\"Screenshot 2023-02-13 at 21 17 13\"\r\nsrc=\"https://user-images.githubusercontent.com/3315046/218576500-a0817207-451e-47c5-ba0b-d0faaddca1a4.png\">","sha":"25d4c9f3297bfcf685287d4b0fd3a91934d8eb04","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v8.7.0","v8.8.0"],"number":151075,"url":"https://github.com/elastic/kibana/pull/151075","mergeCommit":{"message":"[Fleet] Warn user when they are sending data to stream managed by different integration (#151075)\n\n## Summary\r\n\r\nCloses #149427\r\n\r\nGive the user a warning if they are sending data to a data stream that\r\nisn't managed by the integration being added.\r\n\r\n<img width=\"697\" alt=\"Screenshot 2023-02-13 at 21 17 13\"\r\nsrc=\"https://user-images.githubusercontent.com/3315046/218576500-a0817207-451e-47c5-ba0b-d0faaddca1a4.png\">","sha":"25d4c9f3297bfcf685287d4b0fd3a91934d8eb04"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/151075","number":151075,"mergeCommit":{"message":"[Fleet] Warn user when they are sending data to stream managed by different integration (#151075)\n\n## Summary\r\n\r\nCloses #149427\r\n\r\nGive the user a warning if they are sending data to a data stream that\r\nisn't managed by the integration being added.\r\n\r\n<img width=\"697\" alt=\"Screenshot 2023-02-13 at 21 17 13\"\r\nsrc=\"https://user-images.githubusercontent.com/3315046/218576500-a0817207-451e-47c5-ba0b-d0faaddca1a4.png\">","sha":"25d4c9f3297bfcf685287d4b0fd3a91934d8eb04"}}]}] BACKPORT--> Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
This commit is contained in:
parent
238244efd4
commit
ff2877b193
1 changed files with 57 additions and 20 deletions
|
@ -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 (
|
||||
<EuiComboBox
|
||||
aria-label={i18n.translate('xpack.fleet.datasetCombo.ariaLabel', {
|
||||
defaultMessage: 'Dataset combo box',
|
||||
})}
|
||||
placeholder={i18n.translate('xpack.fleet.datasetCombo.placeholder', {
|
||||
defaultMessage: 'Select a dataset',
|
||||
})}
|
||||
singleSelection={{ asPlainText: true }}
|
||||
options={datasetOptions}
|
||||
selectedOptions={selectedOptions}
|
||||
onCreateOption={onCreateOption}
|
||||
onChange={onDatasetChange}
|
||||
customOptionText={i18n.translate('xpack.fleet.datasetCombo.customOptionText', {
|
||||
defaultMessage: 'Add {searchValue} as a custom option',
|
||||
values: { searchValue: '{searchValue}' },
|
||||
})}
|
||||
isClearable={false}
|
||||
isDisabled={isDisabled}
|
||||
/>
|
||||
<>
|
||||
<EuiComboBox
|
||||
aria-label={i18n.translate('xpack.fleet.datasetCombo.ariaLabel', {
|
||||
defaultMessage: 'Dataset combo box',
|
||||
})}
|
||||
placeholder={i18n.translate('xpack.fleet.datasetCombo.placeholder', {
|
||||
defaultMessage: 'Select a dataset',
|
||||
})}
|
||||
singleSelection={{ asPlainText: true }}
|
||||
options={datasetOptions}
|
||||
selectedOptions={selectedOptions}
|
||||
onCreateOption={onCreateOption}
|
||||
onChange={onDatasetChange}
|
||||
customOptionText={i18n.translate('xpack.fleet.datasetCombo.customOptionText', {
|
||||
defaultMessage: 'Add {searchValue} as a custom option',
|
||||
values: { searchValue: '{searchValue}' },
|
||||
})}
|
||||
isClearable={false}
|
||||
isDisabled={isDisabled}
|
||||
/>
|
||||
{valueAsOption && valueAsOption.value.package !== pkgName && (
|
||||
<>
|
||||
<EuiSpacer size="xs" />
|
||||
<EuiText size="xs" color="warning">
|
||||
<EuiIcon type="alert" />
|
||||
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.datasetCombo.warning"
|
||||
defaultMessage="This data stream is managed by the {package} integration, {learnMore}."
|
||||
values={{
|
||||
package: valueAsOption.value.package,
|
||||
learnMore: (
|
||||
<EuiToolTip
|
||||
position="bottom"
|
||||
content={
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.datasetCombo.warningTooltip"
|
||||
defaultMessage="The destination data stream may not be designed to receive data from this integration, check that the mappings and ingest pipelines are compatible before sending data."
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiLink target="_blank">
|
||||
{i18n.translate('xpack.fleet.datasetCombo.learnMoreLink', {
|
||||
defaultMessage: 'learn more',
|
||||
})}
|
||||
</EuiLink>
|
||||
</EuiToolTip>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</EuiText>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue