Skip to content

Commit

Permalink
fix(security-solution): add missing same-family field in summary chart
Browse files Browse the repository at this point in the history
  • Loading branch information
kapral18 committed Mar 6, 2024
1 parent 171acb4 commit 972f9f3
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,65 @@ import {
describe('helpers', () => {
describe('getSummaryData', () => {
test('it returns the expected `SummaryData`', () => {
expect(getSummaryData(mockPartitionedFieldMetadata)).toEqual([
expect(
getSummaryData({
...mockPartitionedFieldMetadata,
sameFamily: [
{
dashed_name: 'source-ip',
description: 'IP address of the source (IPv4 or IPv6).',
flat_name: 'source.ip',
level: 'core',
name: 'ip',
normalize: [],
short: 'IP address of the source.',
type: 'ip',
indexFieldName: 'source.ip',
indexFieldType: 'ip',
indexInvalidValues: [],
hasEcsMetadata: true,
isEcsCompliant: true,
isInSameFamily: true,
},
{
indexFieldName: 'source.ip.keyword2',
indexFieldType: 'keyword2',
indexInvalidValues: [],
hasEcsMetadata: false,
isEcsCompliant: false,
isInSameFamily: true,
},
{
indexFieldName: 'source.ip.text',
indexFieldType: 'text',
indexInvalidValues: [],
hasEcsMetadata: false,
isEcsCompliant: false,
isInSameFamily: true,
},
{
indexFieldName: 'source.ip.text2',
indexFieldType: 'text2',
indexInvalidValues: [],
hasEcsMetadata: false,
isEcsCompliant: false,
isInSameFamily: true,
},
{
indexFieldName: 'source.port.keyword',
indexFieldType: 'keyword',
indexInvalidValues: [],
hasEcsMetadata: false,
isEcsCompliant: false,
isInSameFamily: true,
},
],
})
).toEqual([
{ categoryId: 'incompatible', mappings: 3 },
{ categoryId: 'custom', mappings: 4 },
{ categoryId: 'ecs-compliant', mappings: 2 },
{ categoryId: 'same-family', mappings: 5 },
]);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const getSummaryData = (
{ categoryId: 'incompatible', mappings: partitionedFieldMetadata.incompatible.length },
{ categoryId: 'custom', mappings: partitionedFieldMetadata.custom.length },
{ categoryId: 'ecs-compliant', mappings: partitionedFieldMetadata.ecsCompliant.length },
{ categoryId: 'same-family', mappings: partitionedFieldMetadata.sameFamily.length },
];

export const getFillColor = (categoryId: CategoryId | string): string => {
Expand Down

0 comments on commit 972f9f3

Please sign in to comment.