[Security Solution][Data Quality Dashboard] Add missing same-family field in summary chart (#178167)

Fixes #177780

## Summary

same-field category is missing in summary tab hollow chart. This PR
enables same-field category display in summary tab hollow chart.

#### Before:


b747657a-78c6-4b06-91e0-414317d13d7c

#### After:


0878c593-3a33-418a-94db-54d7922776f9

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
This commit is contained in:
Karen Grigoryan 2024-03-08 10:56:08 +01:00 committed by GitHub
parent 7edaa6821e
commit 0f6c834a26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -11,6 +11,7 @@ import { euiThemeVars } from '@kbn/ui-theme';
import { EMPTY_STAT } from '../../../helpers';
import { mockPartitionedFieldMetadata } from '../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata';
import { mockPartitionedFieldMetadataWithSameFamily } from '../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family';
import { PartitionedFieldMetadata } from '../../../types';
import {
ALL_TAB_ID,
@ -38,10 +39,11 @@ import {
describe('helpers', () => {
describe('getSummaryData', () => {
test('it returns the expected `SummaryData`', () => {
expect(getSummaryData(mockPartitionedFieldMetadata)).toEqual([
expect(getSummaryData(mockPartitionedFieldMetadataWithSameFamily)).toEqual([
{ categoryId: 'incompatible', mappings: 3 },
{ categoryId: 'custom', mappings: 4 },
{ categoryId: 'ecs-compliant', mappings: 2 },
{ categoryId: 'same-family', mappings: 1 },
]);
});
});

View file

@ -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 => {