Skip to content

Commit

Permalink
topics
Browse files Browse the repository at this point in the history
  • Loading branch information
szwarckonrad committed Aug 3, 2023
1 parent 20df38a commit 4fce3b3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"infrastructure-ui-source": "113182d6895764378dfe7fa9fa027244f3a457c4",
"ingest-agent-policies": "f11cc19275f4c3e4ee7c5cd6423b6706b21b989d",
"ingest-download-sources": "d7edc5e588d9afa61c4b831604582891c54ef1c7",
"ingest-outputs": "8167fc8876fd83a5ea588a26e2b854d162772727",
"ingest-outputs": "7ead2d3652f444ecea485ee5d901553469e9c022",
"ingest-package-policies": "55816507db0134b8efbe0509e311a91ce7e1c6cc",
"ingest_manager_settings": "418311b03c8eda53f5d2ea6f54c1356afaa65511",
"inventory-view": "b8683c8e352a286b4aca1ab21003115a4800af83",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ export const OutputFormKafkaSection: React.FunctionComponent<Props> = (props) =>
helpText={
<FormattedMessage
id="xpack.fleet.settings.editOutputFlyout.kafkaHostsInputDescription"
defaultMessage="Specify the URLs that your agents will use to connect to Kafka. For more information, see the {guideLink}."
defaultMessage="Specify the URLs that your agents will use to connect to Kafka. {guideLink}."
values={{
guideLink: (
<EuiLink href={docLinks.links.fleet.settings} target="_blank" external>
<FormattedMessage
id="xpack.fleet.settings.fleetUserGuideLink"
defaultMessage="Fleet and Elastic Agent Guide"
id="xpack.fleet.settings.kafkaUserGuideLink"
defaultMessage="Learn more"
/>
</EuiLink>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ export function transformOutputToFullPolicyOutput(
required_acks,
} = output;
/* eslint-enable @typescript-eslint/naming-convention */

kafkaData = {
client_id,
version,
Expand All @@ -316,7 +315,22 @@ export function transformOutputToFullPolicyOutput(
password,
sasl,
partition,
topics,
topics: (topics ?? []).map((topic) => {
const { topic: topicName, ...rest } = topic;
const whenKeys = Object.keys(rest);

if (whenKeys.length === 0) {
return { topic: topicName };
}
if (rest.when) {
return {
topic: topicName,
[rest.when.type as string]: {
message: rest.when.condition,
},
};
}
}),
headers,
timeout,
broker_timeout,
Expand Down

0 comments on commit 4fce3b3

Please sign in to comment.