parent
54b5fd275b
commit
5b68c54568
|
@ -41,7 +41,12 @@ export const CtiDisabledModuleComponent = () => {
|
|||
);
|
||||
|
||||
return (
|
||||
<ThreatIntelPanelView totalEventCount={0} splitPanel={danger} listItems={EMPTY_LIST_ITEMS} />
|
||||
<ThreatIntelPanelView
|
||||
totalEventCount={0}
|
||||
splitPanel={danger}
|
||||
listItems={EMPTY_LIST_ITEMS}
|
||||
isInspectEnabled={false}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -144,4 +144,32 @@ describe('ThreatIntelPanelView', () => {
|
|||
`Showing: ${mockThreatIntelPanelViewProps.totalEventCount} indicators`
|
||||
);
|
||||
});
|
||||
|
||||
it('renders inspect button by default', () => {
|
||||
const wrapper = mount(
|
||||
<Provider store={store}>
|
||||
<I18nProvider>
|
||||
<ThemeProvider theme={mockTheme}>
|
||||
<ThreatIntelPanelView {...mockThreatIntelPanelViewProps} />
|
||||
</ThemeProvider>
|
||||
</I18nProvider>
|
||||
</Provider>
|
||||
);
|
||||
|
||||
expect(wrapper.exists('[data-test-subj="inspect-icon-button"]')).toBe(true);
|
||||
});
|
||||
|
||||
it('does not render inspect button if isInspectEnabled is false', () => {
|
||||
const wrapper = mount(
|
||||
<Provider store={store}>
|
||||
<I18nProvider>
|
||||
<ThemeProvider theme={mockTheme}>
|
||||
<ThreatIntelPanelView {...mockThreatIntelPanelViewProps} isInspectEnabled={false} />
|
||||
</ThemeProvider>
|
||||
</I18nProvider>
|
||||
</Provider>
|
||||
);
|
||||
|
||||
expect(wrapper.exists('[data-test-subj="inspect-icon-button"]')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -55,6 +55,7 @@ const RightSideLink = styled(EuiLink)`
|
|||
interface ThreatIntelPanelViewProps {
|
||||
buttonHref?: string;
|
||||
isDashboardPluginDisabled?: boolean;
|
||||
isInspectEnabled?: boolean;
|
||||
listItems: CtiListItem[];
|
||||
splitPanel?: JSX.Element;
|
||||
totalEventCount: number;
|
||||
|
@ -77,6 +78,7 @@ const panelTitle = (
|
|||
export const ThreatIntelPanelView: React.FC<ThreatIntelPanelViewProps> = ({
|
||||
buttonHref = '',
|
||||
isDashboardPluginDisabled,
|
||||
isInspectEnabled = true,
|
||||
listItems,
|
||||
splitPanel,
|
||||
totalEventCount,
|
||||
|
@ -142,7 +144,11 @@ export const ThreatIntelPanelView: React.FC<ThreatIntelPanelViewProps> = ({
|
|||
<EuiFlexItem grow={1}>
|
||||
<InspectButtonContainer>
|
||||
<EuiPanel hasBorder>
|
||||
<HeaderSection id={CTIEventCountQueryId} subtitle={subtitle} title={panelTitle}>
|
||||
<HeaderSection
|
||||
id={isInspectEnabled ? CTIEventCountQueryId : undefined}
|
||||
subtitle={subtitle}
|
||||
title={panelTitle}
|
||||
>
|
||||
<>{button}</>
|
||||
</HeaderSection>
|
||||
{splitPanel}
|
||||
|
|
Loading…
Reference in a new issue