forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dataset quality] Dedicated column for namespace (elastic#173087)
## Changes 1. Splits `datasetname + namespace` from Dataset name column. 2. Creates a dedicated column for `namespace`. 3. Bring the human readable name from datasets. #### Before <img width="2411" alt="image" src="https://github.com/elastic/kibana/assets/1313018/0df47bb9-3109-4670-af4a-e917bc75deb1"> #### After <img width="2414" alt="image" src="https://github.com/elastic/kibana/assets/1313018/4f2c9db7-b8b4-4520-89b2-41ba0326524a">
- Loading branch information
Showing
15 changed files
with
224 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
x-pack/plugins/dataset_quality/server/routes/data_streams/get_integrations.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { PackageClient } from '@kbn/fleet-plugin/server'; | ||
import { DataStreamStat, Integration } from '../../../common/api_types'; | ||
|
||
export async function getIntegrations(options: { | ||
packageClient: PackageClient; | ||
dataStreams: DataStreamStat[]; | ||
}): Promise<Integration[]> { | ||
const { packageClient, dataStreams } = options; | ||
|
||
const packages = await packageClient.getPackages(); | ||
const installedPackages = dataStreams.map((item) => item.integration); | ||
|
||
return Promise.all( | ||
packages | ||
.filter((pkg) => installedPackages.includes(pkg.name)) | ||
.map(async (p) => ({ | ||
name: p.name, | ||
title: p.title, | ||
version: p.version, | ||
icons: p.icons, | ||
datasets: await getDatasets({ | ||
packageClient, | ||
name: p.name, | ||
version: p.version, | ||
}), | ||
})) | ||
); | ||
} | ||
|
||
const getDatasets = async (options: { | ||
packageClient: PackageClient; | ||
name: string; | ||
version: string; | ||
}) => { | ||
const { packageClient, name, version } = options; | ||
|
||
const pkg = await packageClient.getPackage(name, version); | ||
|
||
return pkg.packageInfo.data_streams?.reduce( | ||
(acc, curr) => ({ | ||
...acc, | ||
[curr.dataset]: curr.title, | ||
}), | ||
{} | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
x-pack/plugins/dataset_quality/server/types/data_stream.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
x-pack/plugins/dataset_quality/server/types/integration.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.