Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fleet] Add a banner to the top of the Kafka Output UI to say that Elastic Defend integration is not supported #163579

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions x-pack/plugins/fleet/cypress/screens/fleet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ export const SETTINGS_OUTPUTS = {
NAME_INPUT: 'settingsOutputsFlyout.nameInput',
TYPE_INPUT: 'settingsOutputsFlyout.typeInput',
ADD_HOST_ROW_BTN: 'fleetServerHosts.multiRowInput.addRowButton',
WARNING_KAFKA_CALLOUT: 'settingsOutputsFlyout.kafkaOutputTypeCallout',
WARNING_ELASTICSEARCH_CALLOUT: 'settingsOutputsFlyout.elasticsearchOutputTypeCallout',
};

export const getSpecificSelectorId = (selector: string, id: number) => {
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/fleet/cypress/screens/fleet_outputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const selectKafkaOutput = () => {
visit('/app/fleet/settings');
cy.getBySel(SETTINGS_OUTPUTS.ADD_BTN).click();
cy.getBySel(SETTINGS_OUTPUTS.TYPE_INPUT).select('kafka');
cy.getBySel(SETTINGS_OUTPUTS.WARNING_KAFKA_CALLOUT);
cy.getBySel(SETTINGS_OUTPUTS_KAFKA.AUTHENTICATION_USERNAME_PASSWORD_OPTION).click();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export const EditOutputFlyout: React.FunctionComponent<EditOutputFlyoutProps> =
[proxies]
);

const isESOutput = inputs.typeInput.value === outputType.Elasticsearch;
const { kafkaOutput: isKafkaOutputEnabled } = ExperimentalFeaturesService.get();

const OUTPUT_TYPE_OPTIONS = [
Expand Down Expand Up @@ -249,6 +248,43 @@ export const EditOutputFlyout: React.FunctionComponent<EditOutputFlyoutProps> =
}
};

const renderTypeSpecificWarning = () => {
const isESOutput = inputs.typeInput.value === outputType.Elasticsearch;
const isKafkaOutput = inputs.typeInput.value === outputType.Kafka;
if (!isKafkaOutput && !isESOutput) {
return null;
}

const generateWarningMessage = () => {
switch (inputs.typeInput.value) {
case outputType.Kafka:
return i18n.translate('xpack.fleet.settings.editOutputFlyout.kafkaOutputTypeCallout', {
defaultMessage:
'Kafka output is currently not supported on Agents using the Elastic Defend integration.',
});
default:
case outputType.Elasticsearch:
return i18n.translate('xpack.fleet.settings.editOutputFlyout.esOutputTypeCallout', {
defaultMessage:
'This output type currently does not support connectivity to a remote Elasticsearch cluster.',
});
}
};
return (
<>
<EuiSpacer size="xs" />
<EuiCallOut
data-test-subj={`settingsOutputsFlyout.${inputs.typeInput.value}OutputTypeCallout`}
title={generateWarningMessage()}
iconType="alert"
color="warning"
size="s"
heading="p"
/>
</>
);
};

return (
<EuiFlyout maxWidth={FLYOUT_MAX_WIDTH} onClose={onClose}>
<EuiFlyoutHeader hasBorder={true}>
Expand Down Expand Up @@ -350,24 +386,7 @@ export const EditOutputFlyout: React.FunctionComponent<EditOutputFlyoutProps> =
}
)}
/>
{isESOutput && (
<>
<EuiSpacer size="xs" />
<EuiCallOut
title={i18n.translate(
'xpack.fleet.settings.editOutputFlyout.esOutputTypeCallout',
{
defaultMessage:
'This output type currently does not support connectivity to a remote Elasticsearch cluster.',
}
)}
iconType="alert"
color="warning"
size="s"
heading="p"
/>
</>
)}
{renderTypeSpecificWarning()}
</>
</EuiFormRow>

Expand Down
Loading