parent
54b5fd275b
commit
5b68c54568
|
@ -41,7 +41,12 @@ export const CtiDisabledModuleComponent = () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
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`
|
`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 {
|
interface ThreatIntelPanelViewProps {
|
||||||
buttonHref?: string;
|
buttonHref?: string;
|
||||||
isDashboardPluginDisabled?: boolean;
|
isDashboardPluginDisabled?: boolean;
|
||||||
|
isInspectEnabled?: boolean;
|
||||||
listItems: CtiListItem[];
|
listItems: CtiListItem[];
|
||||||
splitPanel?: JSX.Element;
|
splitPanel?: JSX.Element;
|
||||||
totalEventCount: number;
|
totalEventCount: number;
|
||||||
|
@ -77,6 +78,7 @@ const panelTitle = (
|
||||||
export const ThreatIntelPanelView: React.FC<ThreatIntelPanelViewProps> = ({
|
export const ThreatIntelPanelView: React.FC<ThreatIntelPanelViewProps> = ({
|
||||||
buttonHref = '',
|
buttonHref = '',
|
||||||
isDashboardPluginDisabled,
|
isDashboardPluginDisabled,
|
||||||
|
isInspectEnabled = true,
|
||||||
listItems,
|
listItems,
|
||||||
splitPanel,
|
splitPanel,
|
||||||
totalEventCount,
|
totalEventCount,
|
||||||
|
@ -142,7 +144,11 @@ export const ThreatIntelPanelView: React.FC<ThreatIntelPanelViewProps> = ({
|
||||||
<EuiFlexItem grow={1}>
|
<EuiFlexItem grow={1}>
|
||||||
<InspectButtonContainer>
|
<InspectButtonContainer>
|
||||||
<EuiPanel hasBorder>
|
<EuiPanel hasBorder>
|
||||||
<HeaderSection id={CTIEventCountQueryId} subtitle={subtitle} title={panelTitle}>
|
<HeaderSection
|
||||||
|
id={isInspectEnabled ? CTIEventCountQueryId : undefined}
|
||||||
|
subtitle={subtitle}
|
||||||
|
title={panelTitle}
|
||||||
|
>
|
||||||
<>{button}</>
|
<>{button}</>
|
||||||
</HeaderSection>
|
</HeaderSection>
|
||||||
{splitPanel}
|
{splitPanel}
|
||||||
|
|
Loading…
Reference in a new issue