diff --git a/public/components/incontext_insight/generate_popover_body.test.tsx b/public/components/incontext_insight/generate_popover_body.test.tsx index c6c83319..7c61d7f6 100644 --- a/public/components/incontext_insight/generate_popover_body.test.tsx +++ b/public/components/incontext_insight/generate_popover_body.test.tsx @@ -338,7 +338,6 @@ describe('GeneratePopoverBody', () => { index: 'mock_index', dataSourceId: `test-data-source-id`, monitorType: 'query_level_monitor', - isVisualEditorMonitor: true, }, }); mockPost.mockImplementation((path: string, body) => { @@ -385,56 +384,4 @@ describe('GeneratePopoverBody', () => { }); expect(window.open).toHaveBeenCalledWith('formattedUrl', '_blank'); }); - - it('should hide navigate to discover if not from visual editor monitor', async () => { - incontextInsightMock.contextProvider = jest.fn().mockResolvedValue({ - additionalInfo: { - dsl: mockDSL, - index: 'mock_index', - dataSourceId: `test-data-source-id`, - monitorType: 'query_level_monitor', - isVisualEditorMonitor: false, - }, - }); - mockPost.mockImplementation((path: string, body) => { - let value; - switch (path) { - case SUMMARY_ASSISTANT_API.SUMMARIZE: - value = { - summary: 'Generated summary content', - insightAgentIdExists: true, - }; - break; - - case SUMMARY_ASSISTANT_API.INSIGHT: - value = 'Generated insight content'; - break; - - default: - return null; - } - return Promise.resolve(value); - }); - - const coreStart = coreMock.createStart(); - const dataStart = dataPluginMock.createStartContract(); - const getStartServices = jest.fn().mockResolvedValue([ - coreStart, - { - data: dataStart, - }, - ]); - const { queryByText } = render( - - ); - - await waitFor(() => { - expect(queryByText('Discover details')).not.toBeInTheDocument(); - }); - }); }); diff --git a/public/components/incontext_insight/generate_popover_body.tsx b/public/components/incontext_insight/generate_popover_body.tsx index ede3a119..a161e4a8 100644 --- a/public/components/incontext_insight/generate_popover_body.tsx +++ b/public/components/incontext_insight/generate_popover_body.tsx @@ -58,11 +58,6 @@ export const GeneratePopoverBody: React.FC<{ if (!contextObject) return; const monitorType = contextObject?.additionalInfo?.monitorType; const dsl = contextObject?.additionalInfo?.dsl; - const isVisualEditorMonitor = contextObject?.additionalInfo?.isVisualEditorMonitor; - // Only alerts from visual editor monitor support to navigate to discover. - if (!isVisualEditorMonitor) { - return; - } // Only this two types from alerting contain DSL and index. const isSupportedMonitorType = monitorType === 'query_level_monitor' || monitorType === 'bucket_level_monitor';