@cccsaurora/howler-ui 2.17.0-dev.514 → 2.17.0-dev.516
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -32,7 +32,12 @@ const HitBanner = ({ hit, layout = HitLayout.NORMAL, showAssigned = true }) => {
|
|
|
32
32
|
getMatchingAnalytic(hit).then(analytic => setAnalyticId(analytic?.analytic_id));
|
|
33
33
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34
34
|
}, [hit?.howler.analytic]);
|
|
35
|
-
const providerColor = useMemo(() =>
|
|
35
|
+
const providerColor = useMemo(() => {
|
|
36
|
+
if (!hit?.event.provider) {
|
|
37
|
+
return PROVIDER_COLORS.unknown;
|
|
38
|
+
}
|
|
39
|
+
return PROVIDER_COLORS[hit?.event.provider] ?? stringToColor(hit?.event.provider);
|
|
40
|
+
}, [hit?.event.provider]);
|
|
36
41
|
const mitreId = useMemo(() => {
|
|
37
42
|
if (hit.threat?.framework?.toLowerCase().startsWith('mitre')) {
|
|
38
43
|
return;
|
|
@@ -15,6 +15,7 @@ import Phrase from '@cccsaurora/howler-ui/components/elements/addons/search/phra
|
|
|
15
15
|
import SocketBadge from '@cccsaurora/howler-ui/components/elements/display/icons/SocketBadge';
|
|
16
16
|
import JSONViewer from '@cccsaurora/howler-ui/components/elements/display/json/JSONViewer';
|
|
17
17
|
import HitActions from '@cccsaurora/howler-ui/components/elements/hit/HitActions';
|
|
18
|
+
import HitBanner from '@cccsaurora/howler-ui/components/elements/hit/HitBanner';
|
|
18
19
|
import HitComments from '@cccsaurora/howler-ui/components/elements/hit/HitComments';
|
|
19
20
|
import HitLabels from '@cccsaurora/howler-ui/components/elements/hit/HitLabels';
|
|
20
21
|
import { HitLayout } from '@cccsaurora/howler-ui/components/elements/hit/HitLayout';
|
|
@@ -142,7 +143,7 @@ const InformationPane = ({ onClose, selected: _selected }) => {
|
|
|
142
143
|
}[tab]?.();
|
|
143
144
|
}, [dossiers, filter, hit, loading, tab, users]);
|
|
144
145
|
const hasError = useMemo(() => !validateRegex(filter), [filter]);
|
|
145
|
-
return (_jsxs(VSBox, { top: 10, sx: { height: '100%', flex: 1 }, children: [_jsxs(Stack, { direction: "column", flex: 1, sx: { overflowY: 'auto', flexGrow: 1 }, position: "relative", spacing: 1, ml: 2, children: [_jsxs(Stack, { direction: "row", alignItems: "center", spacing: 0.5, flexShrink: 0, pr: 2, children: [_jsx(FlexOne, {}), onClose && !location.pathname.startsWith('/bundles') && (_jsx(TuiIconButton, { size: "small", onClick: onClose, tooltip: t('hit.panel.details.exit'), children: _jsx(Clear, {}) })), _jsx(SocketBadge, { size: "small" }), analytic && (_jsx(TuiIconButton, { size: "small", tooltip: t('hit.panel.analytic.open'), disabled: !analytic || loading, route: `/analytics/${analytic.analytic_id}`, children: _jsx(QueryStats, {}) })), !!hit && (_jsx(TuiIconButton, { tooltip: t('hit.panel.open'), href: `/hits/${selected}`, disabled: !hit || loading, size: "small", target: "_blank", children: _jsx(OpenInNew, {}) }))] }), !!hit &&
|
|
146
|
+
return (_jsxs(VSBox, { top: 10, sx: { height: '100%', flex: 1 }, children: [_jsxs(Stack, { direction: "column", flex: 1, sx: { overflowY: 'auto', flexGrow: 1 }, position: "relative", spacing: 1, ml: 2, children: [_jsxs(Stack, { direction: "row", alignItems: "center", spacing: 0.5, flexShrink: 0, pr: 2, children: [_jsx(FlexOne, {}), onClose && !location.pathname.startsWith('/bundles') && (_jsx(TuiIconButton, { size: "small", onClick: onClose, tooltip: t('hit.panel.details.exit'), children: _jsx(Clear, {}) })), _jsx(SocketBadge, { size: "small" }), analytic && (_jsx(TuiIconButton, { size: "small", tooltip: t('hit.panel.analytic.open'), disabled: !analytic || loading, route: `/analytics/${analytic.analytic_id}`, children: _jsx(QueryStats, {}) })), !!hit && (_jsx(TuiIconButton, { tooltip: t('hit.panel.open'), href: `/hits/${selected}`, disabled: !hit || loading, size: "small", target: "_blank", children: _jsx(OpenInNew, {}) }))] }), _jsx(Box, { pr: 2, children: loading || !hit ? (_jsx(Skeleton, { variant: "rounded", height: 152 })) : (_jsx(HitBanner, { layout: HitLayout.DENSE, hit: hit })) }), !!hit &&
|
|
146
147
|
(!loading ? (_jsxs(_Fragment, { children: [_jsx(HitOutline, { hit: hit, layout: HitLayout.DENSE }), _jsx(HitLabels, { hit: hit })] })) : (_jsx(Skeleton, { height: 124 }))), (hit?.howler?.links?.length > 0 ||
|
|
147
148
|
analytic?.notebooks?.length > 0 ||
|
|
148
149
|
dossiers.filter(_dossier => _dossier.pivots?.length > 0).length > 0) && (_jsxs(Stack, { direction: "row", spacing: 1, pr: 2, children: [analytic?.notebooks?.length > 0 && _jsx(HitNotebooks, { analytic: analytic, hit: hit }), hit?.howler?.links?.length > 0 &&
|