Skip to content

Commit

Permalink
[Security Solution][Data Quality Dashboard] Add missing same-family f…
Browse files Browse the repository at this point in the history
…ield in summary chart (elastic#178167)

Fixes elastic#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:


https://github.com/elastic/kibana/assets/1625373/b747657a-78c6-4b06-91e0-414317d13d7c

#### After:


https://github.com/elastic/kibana/assets/1625373/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
  • Loading branch information
kapral18 authored Mar 8, 2024
1 parent 7edaa68 commit 0f6c834
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 },
]);
});
});
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 0f6c834

Please sign in to comment.