-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Dataset quality] Introduce management fly out #173554
Changes from 16 commits
fafbc13
1fbb4c8
5178402
795bf0a
786fdea
99153f2
c3688ef
e16bd18
c863e83
8a36845
16c23fd
8a961ab
90a9cb7
1ff810d
edc4b78
aaba951
12aa709
02bfbe0
9a3e853
a071ed8
7704d3c
b40fd9a
06f9485
210c691
5810d43
b68e259
732509a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we are not doing anything custom within this constructor we can omit it and use directly There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see the constructor expand as we add more information to the model in future.
yngrdyn marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* 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 { DataStreamDetailsType } from './types'; | ||
|
||
export class DataStreamDetails { | ||
createdOn?: number; | ||
|
||
private constructor(obj: DataStreamDetails) { | ||
this.createdOn = obj.createdOn; | ||
} | ||
|
||
public static create(dataStreamDetails: DataStreamDetailsType) { | ||
return new DataStreamDetails(dataStreamDetails); | ||
} | ||
} |
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'; |
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" /> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* 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 React from 'react'; | ||
import { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; | ||
import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/field-types'; | ||
import { | ||
flyoutDatasetCreatedOnText, | ||
flyoutDatasetDetailsText, | ||
flyoutDatasetLastActivityText, | ||
} from '../../../common/translations'; | ||
import { DataStreamStat } from '../../../common/data_streams_stats/data_stream_stat'; | ||
import { DataStreamDetails } from '../../../common/data_streams_stats/data_stream_details'; | ||
import { FieldsList } from './fields_list'; | ||
|
||
interface DatasetSummaryProps { | ||
fieldFormats: FieldFormatsStart; | ||
dataStreamDetails: DataStreamDetails; | ||
dataStreamStat: DataStreamStat; | ||
} | ||
|
||
export function DatasetSummary({ | ||
dataStreamStat, | ||
dataStreamDetails, | ||
fieldFormats, | ||
}: DatasetSummaryProps) { | ||
const dataFormatter = fieldFormats.getDefaultInstance(KBN_FIELD_TYPES.DATE, [ | ||
ES_FIELD_TYPES.DATE, | ||
]); | ||
const formattedLastActivity = dataFormatter.convert(dataStreamStat.lastActivity); | ||
const formattedCreatedOn = dataStreamDetails.createdOn | ||
? dataFormatter.convert(dataStreamDetails.createdOn) | ||
: ''; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @isaclfreire if we don't have the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense π There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't implement hiding the row yet. Will there be valid cases when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, an index without a backing index will not return a |
||
|
||
return ( | ||
<FieldsList | ||
title={flyoutDatasetDetailsText} | ||
fields={[ | ||
{ | ||
fieldTitle: flyoutDatasetLastActivityText, | ||
fieldValue: formattedLastActivity, | ||
}, | ||
{ | ||
fieldTitle: flyoutDatasetCreatedOnText, | ||
fieldValue: formattedCreatedOn, | ||
}, | ||
]} | ||
/> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
β€οΈ