[ML] Fix lat_long anomalies table links menu and value formatting (#50916) (#52184)

This commit is contained in:
Pete Harverson 2019-12-04 15:32:16 +00:00 committed by GitHub
parent 06de1bac6b
commit 8592f59c1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 7 deletions

View file

@ -48,10 +48,10 @@ function renderTime(date, aggregationInterval) {
}
}
function showLinksMenuForItem(item) {
const canConfigureRules = (isRuleSupported(item) && checkPermission('canUpdateJob'));
function showLinksMenuForItem(item, showViewSeriesLink) {
const canConfigureRules = (isRuleSupported(item.source) && checkPermission('canUpdateJob'));
return (canConfigureRules ||
item.isTimeSeriesViewRecord ||
(showViewSeriesLink && item.isTimeSeriesViewRecord) ||
item.entityName === 'mlcategory' ||
item.customUrls !== undefined);
}
@ -248,7 +248,7 @@ export function getColumns(
});
}
const showLinks = (showViewSeriesLink === true) || items.some(item => showLinksMenuForItem(item));
const showLinks = items.some(item => showLinksMenuForItem(item, showViewSeriesLink));
if (showLinks === true) {
columns.push({

View file

@ -29,7 +29,7 @@ export function DescriptionCell({ actual, typical }) {
} = getMetricChangeDescription(actual, typical);
return (
<EuiFlexGroup gutterSize="s">
<EuiFlexGroup gutterSize="s" alignItems="center">
{iconType !== undefined &&
<EuiFlexItem grow={false}>
<EuiIcon

View file

@ -37,8 +37,10 @@ export function formatValue(value, mlFunction, fieldFormat, record) {
if (value.length === 1) {
return formatSingleValue(value[0], mlFunction, fieldFormat, record);
} else {
// Return with array style formatting.
const values = value.map(val => formatSingleValue(val, mlFunction, fieldFormat, record));
// Currently only multi-value response is for lat_long detectors.
// Return with array style formatting, with items formatted as numbers, rather than
// the default String format which is set for geo_point and geo_shape fields.
const values = value.map(val => formatSingleValue(val, mlFunction, undefined, record));
return `[${values}]`;
}
} else {