Skip to content

Commit

Permalink
[ES|QL] exclude inactive integration data stream suggestions (elastic…
Browse files Browse the repository at this point in the history
  • Loading branch information
drewdaemon committed Sep 16, 2024
1 parent 5f8e564 commit 0bac8ad
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions packages/kbn-text-based-editor/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,20 +249,22 @@ const getIntegrations = async (core: CoreStart) => {
// and this needs to be done in various places in the codebase which use the editor
// https://github.com/elastic/kibana/issues/186061
const response = (await core.http
.get(INTEGRATIONS_API, { query: undefined, version: API_VERSION })
.get(INTEGRATIONS_API, { query: { showOnlyActiveDataStreams: true }, version: API_VERSION })
.catch((error) => {
// eslint-disable-next-line no-console
console.error('Failed to fetch integrations', error);
})) as IntegrationsResponse;

return (
response?.items?.map((source) => ({
name: source.name,
hidden: false,
title: source.title,
dataStreams: source.dataStreams,
type: 'Integration',
})) ?? []
response?.items
?.filter(({ dataStreams }) => dataStreams.length)
.map((source) => ({
name: source.name,
hidden: false,
title: source.title,
dataStreams: source.dataStreams,
type: 'Integration',
})) ?? []
);
};

Expand Down

0 comments on commit 0bac8ad

Please sign in to comment.