Skip to content

Commit

Permalink
[SecuritySolution] Unsync highlight state between visualizations (#15…
Browse files Browse the repository at this point in the history
  • Loading branch information
angorayc committed May 4, 2023
1 parent 12f1f08 commit 0e9d84d
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 0 deletions.
Expand Up @@ -53,6 +53,8 @@ const LensMarkDownRendererComponent: React.FC<LensMarkDownRendererProps> = ({
executionContext={{
type: 'cases',
}}
syncTooltips={false}
syncCursor={false}
/>
<LensChartTooltipFix />
</Container>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -480,4 +480,19 @@ describe('getEventsHistogramLensAttributes', () => {
})
);
});

it('should render values in legend', () => {
const { result } = renderHook(
() =>
useLensAttributes({
getLensAttributes: getEventsHistogramLensAttributes,
stackByField: 'event.dataset',
}),
{ wrapper }
);

expect(result?.current?.state?.visualization).toEqual(
expect.objectContaining({ valuesInLegend: true })
);
});
});
Expand Up @@ -49,6 +49,7 @@ export const getEventsHistogramLensAttributes: GetLensAttributes = (
yLeft: false,
yRight: true,
},
valuesInLegend: true,
},
query: {
query: '',
Expand Down
Expand Up @@ -43,4 +43,19 @@ describe('getExternalAlertLensAttributes', () => {

expect(result?.current).toMatchSnapshot();
});

it('should render values in legend', () => {
const { result } = renderHook(
() =>
useLensAttributes({
getLensAttributes: getExternalAlertLensAttributes,
stackByField: 'event.dataset',
}),
{ wrapper }
);

expect(result?.current?.state?.visualization).toEqual(
expect.objectContaining({ valuesInLegend: true })
);
});
});
Expand Up @@ -42,6 +42,12 @@ export const getExternalAlertLensAttributes: GetLensAttributes = (
yLeftExtent: {
mode: 'full',
},
axisTitlesVisibilitySettings: {
x: false,
yLeft: false,
yRight: true,
},
valuesInLegend: true,
},
query: {
query: '',
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -157,4 +157,10 @@ describe('getDnsTopDomainsLensAttributes', () => {
}
`);
});

it('should render values in legend', () => {
expect(result?.current?.state?.visualization).toEqual(
expect.objectContaining({ valuesInLegend: true })
);
});
});
Expand Up @@ -36,6 +36,7 @@ export const getDnsTopDomainsLensAttributes: GetLensAttributes = (
yLeft: false,
yRight: false,
},
valuesInLegend: true,
tickLabelsVisibilitySettings: {
x: true,
yLeft: true,
Expand Down
Expand Up @@ -123,4 +123,9 @@ describe('LensEmbeddable', () => {
it('should render with searchSessionId', () => {
expect(mockEmbeddableComponent.mock.calls[0][0].searchSessionId).toEqual(mockSearchSessionId);
});

it('should not sync highlight state between visualizations', () => {
expect(mockEmbeddableComponent.mock.calls[0][0].syncTooltips).toEqual(false);
expect(mockEmbeddableComponent.mock.calls[0][0].syncCursor).toEqual(false);
});
});
Expand Up @@ -271,6 +271,8 @@ const LensEmbeddableComponent: React.FC<LensEmbeddableComponentProps> = ({
extraActions={actions}
searchSessionId={searchSessionId}
showInspector={false}
syncTooltips={false}
syncCursor={false}
/>
</LensComponentWrapper>
)}
Expand Down

0 comments on commit 0e9d84d

Please sign in to comment.