-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dataset quality] Introduce management fly out (#173554)
related to #170441 ## 📝 Summary This PR introduces the dataset quality flyout and shows the first 2 sections in the flyout, dataset and integration details. The new Actions column is also added as part of this PR. --------- Co-authored-by: mohamedhamed-ahmed <mohamed.ahmed@elastic.co> Co-authored-by: Abdul Zahid <awahab07@yahoo.com>
- Loading branch information
1 parent
0d06c17
commit 22ff125
Showing
41 changed files
with
1,274 additions
and
110 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
10 changes: 10 additions & 0 deletions
10
x-pack/plugins/dataset_quality/common/data_streams_stats/data_stream_details.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,10 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export interface DataStreamDetails { | ||
createdOn?: number; | ||
} |
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
19 changes: 19 additions & 0 deletions
19
x-pack/plugins/dataset_quality/common/types/dataset_types.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,19 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
// https://github.com/gcanti/io-ts/blob/master/index.md#union-of-string-literals | ||
import * as t from 'io-ts'; | ||
|
||
export const dataStreamTypesRt = t.keyof({ | ||
logs: null, | ||
metrics: null, | ||
traces: null, | ||
synthetics: null, | ||
profiling: null, | ||
}); | ||
|
||
export type DataStreamType = t.TypeOf<typeof dataStreamTypesRt>; |
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,8 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export * from './dataset_types'; |
55 changes: 55 additions & 0 deletions
55
x-pack/plugins/dataset_quality/common/utils/dataset_name.test.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,55 @@ | ||
/* | ||
* 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 { | ||
dataStreamPartsToIndexName, | ||
streamPartsToIndexPattern, | ||
indexNameToDataStreamParts, | ||
} from './dataset_name'; | ||
|
||
describe('dataset_name', () => { | ||
describe('streamPartsToIndexPattern', () => { | ||
it('returns the correct index pattern', () => { | ||
expect( | ||
streamPartsToIndexPattern({ | ||
typePattern: 'logs', | ||
datasetPattern: '*nginx.access*', | ||
}) | ||
).toEqual('logs-*nginx.access*'); | ||
}); | ||
}); | ||
|
||
describe('dataStreamPartsToIndexName', () => { | ||
it('returns the correct index name', () => { | ||
expect( | ||
dataStreamPartsToIndexName({ | ||
type: 'logs', | ||
dataset: 'nginx.access', | ||
namespace: 'default', | ||
}) | ||
).toEqual('logs-nginx.access-default'); | ||
}); | ||
}); | ||
|
||
describe('indexNameToDataStreamParts', () => { | ||
it('returns the correct data stream name', () => { | ||
expect(indexNameToDataStreamParts('logs-nginx.access-default')).toEqual({ | ||
type: 'logs', | ||
dataset: 'nginx.access', | ||
namespace: 'default', | ||
}); | ||
}); | ||
|
||
it('handles the case where the dataset name contains a hyphen', () => { | ||
expect(indexNameToDataStreamParts('logs-heartbeat-8-default')).toEqual({ | ||
type: 'logs', | ||
dataset: 'heartbeat-8', | ||
namespace: 'default', | ||
}); | ||
}); | ||
}); | ||
}); |
40 changes: 40 additions & 0 deletions
40
x-pack/plugins/dataset_quality/common/utils/dataset_name.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,40 @@ | ||
/* | ||
* 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 { DataStreamType } from '../types'; | ||
|
||
export interface DataStreamNameParts { | ||
type: DataStreamType; | ||
dataset: string; | ||
namespace: string; | ||
} | ||
|
||
export const streamPartsToIndexPattern = ({ | ||
typePattern, | ||
datasetPattern, | ||
}: { | ||
datasetPattern: string; | ||
typePattern: string; | ||
}) => { | ||
return `${typePattern}-${datasetPattern}`; | ||
}; | ||
|
||
export const dataStreamPartsToIndexName = ({ type, dataset, namespace }: DataStreamNameParts) => { | ||
return `${type}-${dataset}-${namespace}`; | ||
}; | ||
|
||
export const indexNameToDataStreamParts = (dataStreamName: string) => { | ||
const [type, ...dataStreamParts] = dataStreamName.split('-'); | ||
const namespace = dataStreamParts[dataStreamParts.length - 1]; | ||
const dataset = dataStreamParts.slice(0, dataStreamParts.length - 1).join('-'); | ||
|
||
return { | ||
type: type as DataStreamType, | ||
dataset, | ||
namespace, | ||
}; | ||
}; |
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,8 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export * from './dataset_name'; |
8 changes: 8 additions & 0 deletions
8
x-pack/plugins/dataset_quality/public/components/common/index.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,8 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export * from './integration_icon'; |
30 changes: 30 additions & 0 deletions
30
x-pack/plugins/dataset_quality/public/components/common/integration_icon.tsx
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,30 @@ | ||
/* | ||
* 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 { EuiIcon } from '@elastic/eui'; | ||
import { PackageIcon } from '@kbn/fleet-plugin/public'; | ||
import React from 'react'; | ||
import { Integration } from '../../../common/data_streams_stats/integration'; | ||
import loggingIcon from '../../icons/logging.svg'; | ||
|
||
interface IntegrationIconProps { | ||
integration?: Integration; | ||
} | ||
|
||
export const IntegrationIcon = ({ integration }: IntegrationIconProps) => { | ||
return integration ? ( | ||
<PackageIcon | ||
packageName={integration.name} | ||
version={integration.version!} | ||
icons={integration.icons} | ||
size="m" | ||
tryApi | ||
/> | ||
) : ( | ||
<EuiIcon type={loggingIcon} size="m" /> | ||
); | ||
}; |
Oops, something went wrong.