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

[ML] DFA: Fix layout of job status in expanded row. #204978

Merged
merged 7 commits into from
Jan 7, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,23 @@ export const ExpandedRow: FC<Props> = ({ item }) => {
defaultMessage: 'Overall',
}),
items: [
{ title: 'badge', description: stateValues.state },
{
title: 'Create time',
title: i18n.translate(
'xpack.ml.dataframe.analyticsList.expandedRow.tabs.jobSettings.status',
{
defaultMessage: 'Status',
}
),
type: 'badge',
description: stateValues.state,
},
{
title: i18n.translate(
'xpack.ml.dataframe.analyticsList.expandedRow.tabs.jobSettings.createTime',
{
defaultMessage: 'Create time',
}
),
description: formatHumanReadableDateTimeSeconds(
moment(item.config.create_time).unix() * 1000
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import React from 'react';
import { i18n } from '@kbn/i18n';

import {
EuiBadge,
EuiBasicTable,
EuiBetaBadge,
EuiDescriptionListDescription,
EuiDescriptionListTitle,
EuiFlexGroup,
Expand All @@ -25,6 +25,7 @@ import {

export interface SectionItem {
title: string;
type?: 'plain' | 'badge';
description: string | ReactElement;
}
export interface SectionConfig {
Expand All @@ -41,35 +42,28 @@ export const OverallDetails: FC<{
overallDetails: SectionConfig;
}> = ({ overallDetails }) => (
<EuiFlexGroup alignItems="center" wrap data-test-subj={overallDetails.dataTestSubj}>
{overallDetails.items.map((item) => {
const key = item.title;
if (item.title === 'badge') {
return (
<EuiFlexItem grow={false} key={key}>
<EuiBetaBadge label={item.description} color="subdued" title={item.title} />
{overallDetails.items.map((item) => (
<EuiFlexItem grow={false} key={item.title}>
<EuiFlexGroup gutterSize="xs" alignItems="center">
<EuiFlexItem grow={false}>
<EuiDescriptionListDescription className="descriptionListTitle">
<EuiText size="xs">{item.title}</EuiText>
</EuiDescriptionListDescription>
</EuiFlexItem>
);
}

return (
<EuiFlexItem grow={false} key={key}>
<EuiFlexGroup gutterSize="xs">
<EuiFlexItem grow={false}>
<EuiDescriptionListDescription className="descriptionListTitle">
<EuiText size="xs">{item.title}</EuiText>
</EuiDescriptionListDescription>
</EuiFlexItem>
<EuiFlexItem>
<EuiDescriptionListTitle className="descriptionListDescription">
<EuiFlexItem>
<EuiDescriptionListTitle className="descriptionListDescription">
{item.type === 'badge' ? (
<EuiBadge color="hollow">{item.description}</EuiBadge>
) : (
<EuiText size="s">
<h5>{item.description}</h5>
</EuiText>
</EuiDescriptionListTitle>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
);
})}
)}
</EuiDescriptionListTitle>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
))}
</EuiFlexGroup>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ export default function ({ getService }: FtrProviderContext) {
section: 'state',
// Don't include the 'Create time' value entry as it's not stable.
expectedEntries: [
'STOPPED',
'Status',
'stopped',
'Create time',
'Model memory limit',
'25mb',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ export default function ({ getService }: FtrProviderContext) {
section: 'state',
// Don't include the 'Create time' value entry as it's not stable.
expectedEntries: [
'STOPPED',
'Status',
'stopped',
'Create time',
'Model memory limit',
'20mb',
Expand Down Expand Up @@ -219,7 +220,8 @@ export default function ({ getService }: FtrProviderContext) {
section: 'state',
// Don't include the 'Create time' value entry as it's not stable.
expectedEntries: [
'STOPPED',
'Status',
'stopped',
'Create time',
'Model memory limit',
'20mb',
Expand Down Expand Up @@ -317,7 +319,14 @@ export default function ({ getService }: FtrProviderContext) {
{
section: 'state',
// Don't include the 'Create time' value entry as it's not stable.
expectedEntries: ['STOPPED', 'Create time', 'Model memory limit', '7mb', 'Version'],
expectedEntries: [
'Status',
'stopped',
'Create time',
'Model memory limit',
'7mb',
'Version',
],
},
{
section: 'stats',
Expand Down Expand Up @@ -407,7 +416,14 @@ export default function ({ getService }: FtrProviderContext) {
{
section: 'state',
// Don't include the 'Create time' value entry as it's not stable.
expectedEntries: ['STOPPED', 'Create time', 'Model memory limit', '6mb', 'Version'],
expectedEntries: [
'Status',
'stopped',
'Create time',
'Model memory limit',
'6mb',
'Version',
],
},
{
section: 'stats',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,14 @@ export default function ({ getService }: FtrProviderContext) {
{
section: 'state',
// Don't include the 'Create time' value entry as it's not stable.
expectedEntries: ['STOPPED', 'Create time', 'Model memory limit', '2mb', 'Version'],
expectedEntries: [
'Status',
'stopped',
'Create time',
'Model memory limit',
'2mb',
'Version',
],
},
{
section: 'stats',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,14 @@ export default function ({ getService }: FtrProviderContext) {
{
section: 'state',
// Don't include the 'Create time' value entry as it's not stable.
expectedEntries: ['STOPPED', 'Create time', 'Model memory limit', '1mb', 'Version'],
expectedEntries: [
'Status',
'stopped',
'Create time',
'Model memory limit',
'1mb',
'Version',
],
},
{
section: 'stats',
Expand Down Expand Up @@ -160,7 +167,14 @@ export default function ({ getService }: FtrProviderContext) {
{
section: 'state',
// Don't include the 'Create time' value entry as it's not stable.
expectedEntries: ['STOPPED', 'Create time', 'Model memory limit', '1mb', 'Version'],
expectedEntries: [
'Status',
'stopped',
'Create time',
'Model memory limit',
'1mb',
'Version',
],
},
{
section: 'stats',
Expand Down Expand Up @@ -237,7 +251,14 @@ export default function ({ getService }: FtrProviderContext) {
{
section: 'state',
// Don't include the 'Create time' value entry as it's not stable.
expectedEntries: ['STOPPED', 'Create time', 'Model memory limit', '1mb', 'Version'],
expectedEntries: [
'Status',
'stopped',
'Create time',
'Model memory limit',
'1mb',
'Version',
],
},
{
section: 'stats',
Expand Down Expand Up @@ -315,7 +336,14 @@ export default function ({ getService }: FtrProviderContext) {
{
section: 'state',
// Don't include the 'Create time' value entry as it's not stable.
expectedEntries: ['STOPPED', 'Create time', 'Model memory limit', '1mb', 'Version'],
expectedEntries: [
'Status',
'stopped',
'Create time',
'Model memory limit',
'1mb',
'Version',
],
},
{
section: 'stats',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ export default function ({ getService }: FtrProviderContext) {
section: 'state',
// Don't include the 'Create time' value entry as it's not stable.
expectedEntries: [
'STOPPED',
'Status',
'stopped',
'Create time',
'Model memory limit',
'16mb',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ export default function ({ getService }: FtrProviderContext) {
section: 'state',
// Don't include the 'Create time' value entry as it's not stable.
expectedEntries: [
'STOPPED',
'Status',
'stopped',
'Create time',
'Model memory limit',
'10mb',
Expand Down Expand Up @@ -177,7 +178,8 @@ export default function ({ getService }: FtrProviderContext) {
section: 'state',
// Don't include the 'Create time' value entry as it's not stable.
expectedEntries: [
'STOPPED',
'Status',
'stopped',
'Create time',
'Model memory limit',
'10mb',
Expand Down Expand Up @@ -264,7 +266,14 @@ export default function ({ getService }: FtrProviderContext) {
{
section: 'state',
// Don't include the 'Create time' value entry as it's not stable.
expectedEntries: ['STOPPED', 'Create time', 'Model memory limit', '5mb', 'Version'],
expectedEntries: [
'Status',
'stopped',
'Create time',
'Model memory limit',
'5mb',
'Version',
],
},
{
section: 'stats',
Expand Down Expand Up @@ -346,7 +355,14 @@ export default function ({ getService }: FtrProviderContext) {
{
section: 'state',
// Don't include the 'Create time' value entry as it's not stable.
expectedEntries: ['STOPPED', 'Create time', 'Model memory limit', '5mb', 'Version'],
expectedEntries: [
'Status',
'stopped',
'Create time',
'Model memory limit',
'5mb',
'Version',
],
},
{
section: 'stats',
Expand Down
Loading