@cccsaurora/howler-ui 2.14.0-dev.211 → 2.14.0-dev.217
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.
- package/components/elements/PluginChip.d.ts +1 -0
- package/components/elements/PluginChip.js +2 -1
- package/components/elements/PluginTypography.d.ts +1 -0
- package/components/elements/PluginTypography.js +2 -1
- package/components/elements/hit/HitBanner.js +4 -4
- package/components/elements/hit/HitDetails.js +4 -4
- package/components/elements/hit/HitSummary.js +1 -1
- package/components/elements/hit/outlines/DefaultOutline.js +1 -1
- package/components/routes/hits/search/grid/EnhancedCell.d.ts +1 -0
- package/components/routes/hits/search/grid/EnhancedCell.js +2 -2
- package/components/routes/hits/search/grid/HitRow.js +1 -1
- package/components/routes/overviews/markdownExtendedTokenProvider.js +2 -2
- package/locales/en/translation.json +1 -1
- package/models/entities/generated/ApiType.d.ts +0 -1
- package/package.json +94 -99
- package/plugins/borealis/Provider.d.ts +0 -3
- package/plugins/borealis/Provider.js +0 -14
- package/plugins/borealis/components/BorealisChip.d.ts +0 -3
- package/plugins/borealis/components/BorealisChip.js +0 -27
- package/plugins/borealis/components/BorealisLeadForm.d.ts +0 -4
- package/plugins/borealis/components/BorealisLeadForm.js +0 -23
- package/plugins/borealis/components/BorealisPivot.d.ts +0 -3
- package/plugins/borealis/components/BorealisPivot.js +0 -83
- package/plugins/borealis/components/BorealisPivotForm.d.ts +0 -4
- package/plugins/borealis/components/BorealisPivotForm.js +0 -44
- package/plugins/borealis/components/BorealisTypography.d.ts +0 -3
- package/plugins/borealis/components/BorealisTypography.js +0 -55
- package/plugins/borealis/helpers.d.ts +0 -3
- package/plugins/borealis/helpers.js +0 -169
- package/plugins/borealis/index.d.ts +0 -21
- package/plugins/borealis/index.js +0 -46
- package/plugins/borealis/locales/borealis.en.json +0 -7
- package/plugins/borealis/locales/borealis.fr.json +0 -7
- package/plugins/borealis/setup.d.ts +0 -2
- package/plugins/borealis/setup.js +0 -44
|
@@ -3,13 +3,14 @@ import { Chip } from '@mui/material';
|
|
|
3
3
|
import howlerPluginStore from '@cccsaurora/howler-ui/plugins/store';
|
|
4
4
|
import {} from 'react';
|
|
5
5
|
import { usePluginStore } from 'react-pluggable';
|
|
6
|
-
const PluginChip = ({ children, value, context, ...props }) => {
|
|
6
|
+
const PluginChip = ({ children, value, context, field, ...props }) => {
|
|
7
7
|
const pluginStore = usePluginStore();
|
|
8
8
|
for (const plugin of howlerPluginStore.plugins) {
|
|
9
9
|
const component = pluginStore.executeFunction(`${plugin}.chip`, {
|
|
10
10
|
children,
|
|
11
11
|
value,
|
|
12
12
|
context,
|
|
13
|
+
field,
|
|
13
14
|
...props
|
|
14
15
|
});
|
|
15
16
|
if (component) {
|
|
@@ -3,13 +3,14 @@ import { Typography } from '@mui/material';
|
|
|
3
3
|
import howlerPluginStore from '@cccsaurora/howler-ui/plugins/store';
|
|
4
4
|
import {} from 'react';
|
|
5
5
|
import { usePluginStore } from 'react-pluggable';
|
|
6
|
-
const PluginTypography = ({ children, value, context, ...props }) => {
|
|
6
|
+
const PluginTypography = ({ children, value, context, field, ...props }) => {
|
|
7
7
|
const pluginStore = usePluginStore();
|
|
8
8
|
for (const plugin of howlerPluginStore.plugins) {
|
|
9
9
|
const component = pluginStore.executeFunction(`${plugin}.typography`, {
|
|
10
10
|
children,
|
|
11
11
|
value,
|
|
12
12
|
context,
|
|
13
|
+
field,
|
|
13
14
|
...props
|
|
14
15
|
});
|
|
15
16
|
if (component) {
|
|
@@ -84,11 +84,11 @@ const HitBanner = ({ hit, layout = HitLayout.NORMAL, showAssigned = true }) => {
|
|
|
84
84
|
/**
|
|
85
85
|
* The tooltips are necessary only when in the most compressed format
|
|
86
86
|
*/
|
|
87
|
-
const Wrapper = useCallback(({ i18nKey, value, ...typographyProps }) => {
|
|
87
|
+
const Wrapper = useCallback(({ i18nKey, value, field, ...typographyProps }) => {
|
|
88
88
|
const _children = (_jsxs(Stack, { direction: "row", spacing: 1, flex: 1, children: [_jsxs(Typography, { variant: textVariant, noWrap: compressed, textOverflow: compressed ? 'ellipsis' : 'wrap', ...typographyProps, sx: [
|
|
89
89
|
{ display: 'flex', flexDirection: 'row' },
|
|
90
90
|
...(Array.isArray(typographyProps?.sx) ? typographyProps?.sx : [typographyProps?.sx])
|
|
91
|
-
], children: [t(i18nKey), ":"] }), (Array.isArray(value) ? value : [value]).map(val => (_jsx(PluginTypography, { component: "span", context: "banner", variant: textVariant, noWrap: compressed, textOverflow: compressed ? 'ellipsis' : 'wrap', ...typographyProps, value: val }, val)))] }));
|
|
91
|
+
], children: [t(i18nKey), ":"] }), (Array.isArray(value) ? value : [value]).map(val => (_jsx(PluginTypography, { component: "span", context: "banner", variant: textVariant, noWrap: compressed, textOverflow: compressed ? 'ellipsis' : 'wrap', ...typographyProps, value: val, field: field }, val)))] }));
|
|
92
92
|
return compressed ? (_jsx(Tooltip, { title: Array.isArray(value) ? (_jsx("div", { children: value.map(_indicator => (_jsx("p", { style: { margin: 0, padding: 0 }, children: _indicator }, _indicator))) })) : (value), children: _children })) : (_children);
|
|
93
93
|
}, [compressed, t, textVariant]);
|
|
94
94
|
return (_jsxs(Box, { display: "grid", gridTemplateColumns: "minmax(0, auto) minmax(0, 1fr) minmax(0, auto)", alignItems: "stretch", sx: { width: '100%', ml: 0, overflow: 'hidden' }, children: [leftBox, _jsxs(Stack, { sx: {
|
|
@@ -102,9 +102,9 @@ const HitBanner = ({ hit, layout = HitLayout.NORMAL, showAssigned = true }) => {
|
|
|
102
102
|
e.stopPropagation();
|
|
103
103
|
}, onClick: e => {
|
|
104
104
|
e.stopPropagation();
|
|
105
|
-
}, children: hit.howler.analytic })) : (hit.howler.analytic), hit.howler.detection && ': ', hit.howler.detection] }), hit.howler?.rationale && (_jsxs(Typography, { flex: 1, variant: textVariant, color: ESCALATION_COLORS[hit.howler.escalation] + '.main', sx: { fontWeight: 'bold' }, children: [t('hit.header.rationale'), ": ", hit.howler.rationale] })), hit.howler?.outline && (_jsxs(_Fragment, { children: [_jsxs(Grid, { container: true, spacing: layout !== HitLayout.COMFY ? 1 : 2, sx: { ml: `${theme.spacing(-1)} !important` }, children: [hit.howler.outline.threat && (_jsx(Grid, { item: true, children: _jsx(Wrapper, { i18nKey: "hit.header.threat", value: hit.howler.outline.threat }) })), hit.howler.outline.target && (_jsx(Grid, { item: true, children: _jsx(Wrapper, { i18nKey: "hit.header.target", value: hit.howler.outline.target }) }))] }), hit.howler.outline.indicators?.length > 0 && (_jsxs(Stack, { direction: "row", spacing: 1, children: [_jsxs(Typography, { component: "span", variant: textVariant, children: [t('hit.header.indicators'), ":"] }), _jsx(Grid, { container: true, spacing: 0.5, sx: { mt: `${theme.spacing(-0.5)} !important`, ml: `${theme.spacing(0.25)} !important` }, children: uniq(hit.howler.outline.indicators).map((_indicator, index) => {
|
|
105
|
+
}, children: hit.howler.analytic })) : (hit.howler.analytic), hit.howler.detection && ': ', hit.howler.detection] }), hit.howler?.rationale && (_jsxs(Typography, { flex: 1, variant: textVariant, color: ESCALATION_COLORS[hit.howler.escalation] + '.main', sx: { fontWeight: 'bold' }, children: [t('hit.header.rationale'), ": ", hit.howler.rationale] })), hit.howler?.outline && (_jsxs(_Fragment, { children: [_jsxs(Grid, { container: true, spacing: layout !== HitLayout.COMFY ? 1 : 2, sx: { ml: `${theme.spacing(-1)} !important` }, children: [hit.howler.outline.threat && (_jsx(Grid, { item: true, children: _jsx(Wrapper, { i18nKey: "hit.header.threat", value: hit.howler.outline.threat, field: "howler.outline.threat" }) })), hit.howler.outline.target && (_jsx(Grid, { item: true, children: _jsx(Wrapper, { i18nKey: "hit.header.target", value: hit.howler.outline.target, field: "howler.outline.target" }) }))] }), hit.howler.outline.indicators?.length > 0 && (_jsxs(Stack, { direction: "row", spacing: 1, children: [_jsxs(Typography, { component: "span", variant: textVariant, children: [t('hit.header.indicators'), ":"] }), _jsx(Grid, { container: true, spacing: 0.5, sx: { mt: `${theme.spacing(-0.5)} !important`, ml: `${theme.spacing(0.25)} !important` }, children: uniq(hit.howler.outline.indicators).map((_indicator, index) => {
|
|
106
106
|
return (_jsx(Grid, { item: true, children: _jsxs(Stack, { direction: "row", children: [_jsx(PluginTypography, { context: "indicators", variant: textVariant, value: _indicator, children: _indicator }), index < hit.howler.outline.indicators.length - 1 && (_jsx(Typography, { variant: textVariant, children: ',' }))] }) }, _indicator));
|
|
107
|
-
}) })] })), hit.howler.outline.summary && (_jsx(Wrapper, { i18nKey: "hit.header.summary", value: hit.howler.outline.summary, paragraph: true, textOverflow: "wrap", sx: [compressed && { marginTop: `0 !important` }] }))] }))] }), _jsxs(Stack, { direction: "column", spacing: layout !== HitLayout.COMFY ? 0.5 : 1, alignSelf: "stretch", sx: [
|
|
107
|
+
}) })] })), hit.howler.outline.summary && (_jsx(Wrapper, { i18nKey: "hit.header.summary", value: hit.howler.outline.summary, paragraph: true, textOverflow: "wrap", sx: [compressed && { marginTop: `0 !important` }], field: "howler.outline.summary" }))] }))] }), _jsxs(Stack, { direction: "column", spacing: layout !== HitLayout.COMFY ? 0.5 : 1, alignSelf: "stretch", sx: [
|
|
108
108
|
{ minWidth: 0, alignItems: { sm: 'end', md: 'start' }, flex: 1, pl: 1 },
|
|
109
109
|
compressed && {
|
|
110
110
|
[`& .${avatarClasses.root}`]: {
|
|
@@ -36,12 +36,12 @@ const ListRenderer = memo(({ objKey: key, entries, maxKeyLength }) => {
|
|
|
36
36
|
marginBottom: allPrimitives ? 0 : theme.spacing(1)
|
|
37
37
|
}, children: allPrimitives ? key.padStart(maxKeyLength ?? key.length) : key }) }), _jsxs(Grid, { container: true, spacing: allPrimitives ? 1 : 4, ml: allPrimitives ? -1 : -4, overflow: "hidden", maxWidth: "100%", children: [uniqueEntries.map((entry, index) => {
|
|
38
38
|
if (Array.isArray(entry)) {
|
|
39
|
-
return (_jsx(Grid, { item: true, xs: "auto", maxWidth: "100%", children: _jsx(ListRenderer, { objKey: `${key}.${index}
|
|
39
|
+
return (_jsx(Grid, { item: true, xs: "auto", maxWidth: "100%", children: _jsx(ListRenderer, { objKey: `${key}.${index}`, entries: entry }) }, index));
|
|
40
40
|
}
|
|
41
41
|
if (isPlainObject(entry)) {
|
|
42
|
-
return (_jsx(Grid, { item: true, xs: 'auto', maxWidth: "100%", minWidth: "350px", children: _jsx(ObjectRenderer, { parentKey: `${key}.${index}
|
|
42
|
+
return (_jsx(Grid, { item: true, xs: 'auto', maxWidth: "100%", minWidth: "350px", children: _jsx(ObjectRenderer, { parentKey: `${key}.${index}`, indent: true, data: entry }) }, index));
|
|
43
43
|
}
|
|
44
|
-
return (_jsxs(Grid, { item: true, maxWidth: "100%", className: `${key}_${index}`.replace(/\./g, '_'), component: "code", display: "flex", flexDirection: "row", children: [_jsx(PluginTypography, { context: "details", component: "code", style: { maxWidth: '100%', font: 'inherit' }, value: entry, children: entry }), allPrimitives && index < uniqueEntries.length - 1 && _jsx("span", { children: "," })] }, entry));
|
|
44
|
+
return (_jsxs(Grid, { item: true, maxWidth: "100%", className: `${key}_${index}`.replace(/\./g, '_'), component: "code", display: "flex", flexDirection: "row", children: [_jsx(PluginTypography, { context: "details", component: "code", style: { maxWidth: '100%', font: 'inherit' }, value: entry, field: key.replace(/\.[0-9]+/g, ''), children: entry }), allPrimitives && index < uniqueEntries.length - 1 && _jsx("span", { children: "," })] }, entry));
|
|
45
45
|
}), omittedDuplicates && (_jsx(Grid, { item: true, display: "flex", alignItems: "center", children: _jsx(Tooltip, { title: t('duplicates.omitted'), children: _jsx(InfoOutlined, { sx: { fontSize: '20px', ml: 1 }, color: "disabled" }) }) }))] })] }));
|
|
46
46
|
});
|
|
47
47
|
const ObjectRenderer = memo(({ data, parentKey, indent = false }) => {
|
|
@@ -75,7 +75,7 @@ const ObjectRenderer = memo(({ data, parentKey, indent = false }) => {
|
|
|
75
75
|
paddingRight: theme.spacing(1),
|
|
76
76
|
height: '100%',
|
|
77
77
|
wordWrap: 'break-word'
|
|
78
|
-
}, children: _jsx("code", { style: { maxWidth: '100%' }, children: key }) }), _jsx(Box, { display: "flex", alignItems: "start", children: _jsx(PluginTypography, { context: "details", component: "code", style: { maxWidth: '100%', font: 'inherit' }, value: val, children: val }) })] }, key));
|
|
78
|
+
}, children: _jsx("code", { style: { maxWidth: '100%' }, children: key }) }), _jsx(Box, { display: "flex", alignItems: "start", children: _jsx(PluginTypography, { context: "details", component: "code", style: { maxWidth: '100%', font: 'inherit' }, value: val, field: (parentKey ? parentKey.concat('.', key) : key).replace(/\.[0-9]+/g, ''), children: val }) })] }, key));
|
|
79
79
|
}) })] }));
|
|
80
80
|
});
|
|
81
81
|
const Collapsible = memo(({ title, data, query }) => {
|
|
@@ -144,7 +144,7 @@ const HitSummary = ({ query, response, onStart, onComplete }) => {
|
|
|
144
144
|
.filter(key => !isEmpty(aggregateResults[key]))
|
|
145
145
|
.flatMap(key => [
|
|
146
146
|
_jsx(Fade, { in: true, children: _jsxs(Stack, { direction: "row", alignItems: "center", spacing: 1, children: [_jsx(Typography, { variant: "body1", children: key }, key + '-title'), keyCounts[key]?.count < 0 ? (_jsxs(Typography, { variant: "caption", color: "text.secondary", children: ["(", t('hit.summary.adhoc.custom'), ")"] })) : (_jsxs(Typography, { variant: "caption", color: "text.secondary", children: ["(", keyCounts[key]?.count ?? '?', " ", t('references'), ")"] })), _jsx(Tooltip, { title: _jsxs(Stack, { children: [_jsx(Typography, { variant: "caption", children: t('hit.summary.aggregate.sources') }), keyCounts[key]?.sources.map(source => (_jsx(Typography, { variant: "caption", children: source }, source))) ?? '?'] }), children: _jsx(InfoOutlined, { fontSize: "inherit" }) })] }) }, key + '-refs'),
|
|
147
|
-
_jsx(Fade, { in: true, children: hitFields.find(f => f.key === key)?.type !== 'date' ? (_jsx(Box, { sx: theme => ({ ml: `${theme.spacing(1)} !important`, alignSelf: 'start' }), children: _jsx(Grid, { container: true, sx: theme => ({ mr: 1, mt: theme.spacing(-1) }), spacing: 1, children: Object.keys(aggregateResults[key]).map(
|
|
147
|
+
_jsx(Fade, { in: true, children: hitFields.find(f => f.key === key)?.type !== 'date' ? (_jsx(Box, { sx: theme => ({ ml: `${theme.spacing(1)} !important`, alignSelf: 'start' }), children: _jsx(Grid, { container: true, sx: theme => ({ mr: 1, mt: theme.spacing(-1) }), spacing: 1, children: Object.keys(aggregateResults[key]).map(item => (_jsx(Grid, { item: true, xs: "auto", children: _jsx(PluginChip, { context: "summary", size: "small", variant: "filled", value: item, label: `${item} (${aggregateResults[key][item]})`, onClick: () => setSearch(key, `"${item}"`), field: key }) }, item))) }, key + '-list') })) : (_jsx(Chip, { size: "small", sx: theme => ({ ml: `${theme.spacing(1)} !important`, alignSelf: 'start' }), label: getTimeRange(Object.keys(aggregateResults[key]))
|
|
148
148
|
.map(d => new Date(d).toLocaleString())
|
|
149
149
|
.join(' - '), onClick: () => setSearch(key, `[${getTimeRange(Object.keys(aggregateResults[key])).join(' TO ')}]`) })) }, key + '-results')
|
|
150
150
|
])] })] }));
|
|
@@ -41,7 +41,7 @@ const DefaultOutline = ({ hit, fields, template, layout = HitLayout.NORMAL, read
|
|
|
41
41
|
if (!displayedData) {
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
|
-
return (_jsxs(React.Fragment, { children: [_jsx(Tooltip, { title: (config.indexes.hit[field]?.description ?? t('none')).split('\n')[0], children: _jsxs(Typography, { variant: layout !== HitLayout.COMFY ? 'caption' : 'body1', fontWeight: "bold", children: [field, ":"] }) }), _jsx(PluginTypography, { context: "outline", variant: layout !== HitLayout.COMFY ? 'caption' : 'body1', whiteSpace: "normal", sx: { width: '100%', wordBreak: 'break-all' }, value: displayedData, children: displayedData })] }, field));
|
|
44
|
+
return (_jsxs(React.Fragment, { children: [_jsx(Tooltip, { title: (config.indexes.hit[field]?.description ?? t('none')).split('\n')[0], children: _jsxs(Typography, { variant: layout !== HitLayout.COMFY ? 'caption' : 'body1', fontWeight: "bold", children: [field, ":"] }) }), _jsx(PluginTypography, { context: "outline", variant: layout !== HitLayout.COMFY ? 'caption' : 'body1', whiteSpace: "normal", sx: { width: '100%', wordBreak: 'break-all' }, value: displayedData, field: field, children: displayedData })] }, field));
|
|
45
45
|
})] }));
|
|
46
46
|
};
|
|
47
47
|
export default memo(DefaultOutline);
|
|
@@ -4,7 +4,7 @@ import { Stack, TableCell } from '@mui/material';
|
|
|
4
4
|
import PluginTypography from '@cccsaurora/howler-ui/components/elements/PluginTypography';
|
|
5
5
|
import { memo } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
const EnhancedCell = ({ value: rawValue, sx = {}, className }) => {
|
|
7
|
+
const EnhancedCell = ({ value: rawValue, sx = {}, className, field }) => {
|
|
8
8
|
const { t } = useTranslation();
|
|
9
9
|
if (!rawValue) {
|
|
10
10
|
return _jsx(TableCell, { style: { borderBottom: 'none' }, children: t('none') });
|
|
@@ -13,6 +13,6 @@ const EnhancedCell = ({ value: rawValue, sx = {}, className }) => {
|
|
|
13
13
|
return (_jsx(TableCell, { sx: { borderBottom: 'none', borderRight: 'thin solid', borderRightColor: 'divider', fontSize: '0.8rem' }, children: _jsx(Stack, { direction: "row", className: className, spacing: 0.5, sx: [
|
|
14
14
|
{ display: 'flex', justifyContent: 'start', width: '100%', overflow: 'hidden' },
|
|
15
15
|
...(Array.isArray(sx) ? sx : [sx])
|
|
16
|
-
], children: values.map((value, index) => (_jsx(PluginTypography, { context: "table", sx: { fontSize: 'inherit', textOverflow: 'ellipsis' }, value: value, children: value }, value + index))) }) }));
|
|
16
|
+
], children: values.map((value, index) => (_jsx(PluginTypography, { context: "table", sx: { fontSize: 'inherit', textOverflow: 'ellipsis' }, value: value, field: field, children: value }, value + index))) }) }));
|
|
17
17
|
};
|
|
18
18
|
export default memo(EnhancedCell);
|
|
@@ -45,6 +45,6 @@ const HitRow = ({ hit, analyticIds, columns, columnWidths, collapseMainColumn, o
|
|
|
45
45
|
e.preventDefault();
|
|
46
46
|
e.stopPropagation();
|
|
47
47
|
setExpandRow(_expanded => !_expanded);
|
|
48
|
-
}, children: _jsx(KeyboardArrowUp, {}) }), _jsx(Collapse, { in: !collapseMainColumn, orientation: "horizontal", unmountOnExit: true, children: _jsxs(Stack, { direction: "row", spacing: 1, flexWrap: "nowrap", children: [_jsx(EscalationChip, { hit: hit, layout: HitLayout.DENSE, hideLabel: true }), _jsxs(Typography, { sx: { textWrap: 'nowrap', whiteSpace: 'nowrap', fontSize: 'inherit' }, children: [analyticIds[hit.howler.analytic] ? (_jsx(Link, { to: `/analytics/${analyticIds[hit.howler.analytic]}`, onClick: e => e.stopPropagation(), children: hit.howler.analytic })) : (hit.howler.analytic), hit.howler.detection && ': ', hit.howler.detection] }), hit.howler.assignment !== 'unassigned' && _jsx(Assigned, { hit: hit, layout: HitLayout.DENSE, hideLabel: true })] }) })] }) }), columns.map(col => (_jsx(EnhancedCell, { className: `col-${col.replaceAll('.', '-')}`, value: get(hit, col) ?? t('none'), sx: columnWidths[col] ? { width: columnWidths[col] } : { width: '220px', maxWidth: '300px' } }, col)))] }, hit.howler.id), _jsx(TableRow, { onClick: ev => onClick(ev, hit), children: _jsx(TableCell, { colSpan: columns.length + 2, style: { paddingBottom: 0, paddingTop: 0 }, children: _jsx(Collapse, { in: expandRow, unmountOnExit: true, children: _jsx(Box, { width: "100%", maxWidth: "1200px", margin: 1, children: _jsx(HitCard, { id: hit.howler.id, layout: HitLayout.NORMAL }) }) }) }) })] }));
|
|
48
|
+
}, children: _jsx(KeyboardArrowUp, {}) }), _jsx(Collapse, { in: !collapseMainColumn, orientation: "horizontal", unmountOnExit: true, children: _jsxs(Stack, { direction: "row", spacing: 1, flexWrap: "nowrap", children: [_jsx(EscalationChip, { hit: hit, layout: HitLayout.DENSE, hideLabel: true }), _jsxs(Typography, { sx: { textWrap: 'nowrap', whiteSpace: 'nowrap', fontSize: 'inherit' }, children: [analyticIds[hit.howler.analytic] ? (_jsx(Link, { to: `/analytics/${analyticIds[hit.howler.analytic]}`, onClick: e => e.stopPropagation(), children: hit.howler.analytic })) : (hit.howler.analytic), hit.howler.detection && ': ', hit.howler.detection] }), hit.howler.assignment !== 'unassigned' && _jsx(Assigned, { hit: hit, layout: HitLayout.DENSE, hideLabel: true })] }) })] }) }), columns.map(col => (_jsx(EnhancedCell, { className: `col-${col.replaceAll('.', '-')}`, value: get(hit, col) ?? t('none'), sx: columnWidths[col] ? { width: columnWidths[col] } : { width: '220px', maxWidth: '300px' }, field: col }, col)))] }, hit.howler.id), _jsx(TableRow, { onClick: ev => onClick(ev, hit), children: _jsx(TableCell, { colSpan: columns.length + 2, style: { paddingBottom: 0, paddingTop: 0 }, children: _jsx(Collapse, { in: expandRow, unmountOnExit: true, children: _jsx(Box, { width: "100%", maxWidth: "1200px", margin: 1, children: _jsx(HitCard, { id: hit.howler.id, layout: HitLayout.NORMAL }) }) }) }) })] }));
|
|
49
49
|
};
|
|
50
50
|
export default memo(HitRow);
|
|
@@ -620,7 +620,7 @@
|
|
|
620
620
|
"route.dossiers.manager.pivot.label.en": "English Title",
|
|
621
621
|
"route.dossiers.manager.pivot.label.fr": "Titre français",
|
|
622
622
|
"route.dossiers.manager.pivot.format": "Pivot format",
|
|
623
|
-
"route.dossiers.manager.pivot.value": "Pivot value
|
|
623
|
+
"route.dossiers.manager.pivot.value": "Pivot value",
|
|
624
624
|
"route.dossiers.manager.pivot.mappings": "Pivot Mappings",
|
|
625
625
|
"route.dossiers.manager.pivot.mapping.key": "Key",
|
|
626
626
|
"route.dossiers.manager.pivot.mapping.field": "Hit Field",
|
package/package.json
CHANGED
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"ajv-i18n": "^4.2.0",
|
|
30
30
|
"axios": "^1.12.0",
|
|
31
31
|
"axios-retry": "^3.9.1",
|
|
32
|
-
"borealis-ui": "0.11.0",
|
|
33
32
|
"chart.js": "^4.5.0",
|
|
34
33
|
"chartjs-adapter-dayjs-4": "^1.0.4",
|
|
35
34
|
"chartjs-plugin-zoom": "^2.2.0",
|
|
@@ -96,164 +95,160 @@
|
|
|
96
95
|
"internal-slot": "1.0.7"
|
|
97
96
|
},
|
|
98
97
|
"type": "module",
|
|
99
|
-
"version": "2.14.0-dev.
|
|
98
|
+
"version": "2.14.0-dev.217",
|
|
100
99
|
"exports": {
|
|
101
100
|
"./i18n": "./i18n.js",
|
|
102
101
|
"./index.css": "./index.css",
|
|
103
|
-
"./utils/*": "./utils/*.js",
|
|
104
|
-
"./utils/*.json": "./utils/*.json",
|
|
105
|
-
"./locales/*.json": "./locales/*.json",
|
|
106
|
-
"./commons/*": "./commons/*.js",
|
|
107
102
|
"./api/*": "./api/*.js",
|
|
108
103
|
"./api": "./api/index.js",
|
|
109
|
-
"./
|
|
110
|
-
"./
|
|
104
|
+
"./models/*": "./models/*.js",
|
|
105
|
+
"./locales/*.json": "./locales/*.json",
|
|
111
106
|
"./branding/*": "./branding/*.js",
|
|
112
|
-
"./
|
|
107
|
+
"./utils/*": "./utils/*.js",
|
|
108
|
+
"./utils/*.json": "./utils/*.json",
|
|
113
109
|
"./rest/*": "./rest/*.js",
|
|
114
110
|
"./rest": "./rest/index.js",
|
|
115
|
-
"./
|
|
116
|
-
"./
|
|
117
|
-
"./
|
|
118
|
-
"./
|
|
119
|
-
"./
|
|
120
|
-
"./
|
|
121
|
-
"./commons/components/utils/*": "./commons/components/utils/*.js",
|
|
122
|
-
"./commons/components/topnav/*": "./commons/components/topnav/*.js",
|
|
123
|
-
"./commons/components/app/*": "./commons/components/app/*.js",
|
|
124
|
-
"./commons/components/display/*": "./commons/components/display/*.js",
|
|
125
|
-
"./commons/components/breadcrumbs/*": "./commons/components/breadcrumbs/*.js",
|
|
126
|
-
"./commons/components/search/*": "./commons/components/search/*.js",
|
|
127
|
-
"./commons/components/pages/*": "./commons/components/pages/*.js",
|
|
128
|
-
"./commons/components/notification/*": "./commons/components/notification/*.js",
|
|
129
|
-
"./commons/components/notification": "./commons/components/notification/index.js",
|
|
130
|
-
"./commons/components/leftnav/*": "./commons/components/leftnav/*.js",
|
|
131
|
-
"./commons/components/utils/hooks/*": "./commons/components/utils/hooks/*.js",
|
|
132
|
-
"./commons/components/app/providers/*": "./commons/components/app/providers/*.js",
|
|
133
|
-
"./commons/components/app/hooks/*": "./commons/components/app/hooks/*.js",
|
|
134
|
-
"./commons/components/app/hooks": "./commons/components/app/hooks/index.js",
|
|
135
|
-
"./commons/components/display/hooks/*": "./commons/components/display/hooks/*.js",
|
|
136
|
-
"./commons/components/pages/hooks/*": "./commons/components/pages/hooks/*.js",
|
|
137
|
-
"./commons/components/notification/elements/*": "./commons/components/notification/elements/*.js",
|
|
138
|
-
"./commons/components/notification/elements/item/*": "./commons/components/notification/elements/item/*.js",
|
|
111
|
+
"./components/*": "./components/*.js",
|
|
112
|
+
"./commons/*": "./commons/*.js",
|
|
113
|
+
"./plugins/*": "./plugins/*.js",
|
|
114
|
+
"./tests/*": "./tests/*.js",
|
|
115
|
+
"./api/analytic/*": "./api/analytic/*.js",
|
|
116
|
+
"./api/analytic": "./api/analytic/index.js",
|
|
139
117
|
"./api/template/*": "./api/template/*.js",
|
|
140
118
|
"./api/template": "./api/template/index.js",
|
|
141
|
-
"./api/action/*": "./api/action/*.js",
|
|
142
|
-
"./api/action": "./api/action/index.js",
|
|
143
|
-
"./api/user/*": "./api/user/*.js",
|
|
144
|
-
"./api/user": "./api/user/index.js",
|
|
145
119
|
"./api/hit/*": "./api/hit/*.js",
|
|
146
120
|
"./api/hit": "./api/hit/index.js",
|
|
147
|
-
"./api/
|
|
148
|
-
"./api/
|
|
121
|
+
"./api/notebook/*": "./api/notebook/*.js",
|
|
122
|
+
"./api/notebook": "./api/notebook/index.js",
|
|
149
123
|
"./api/auth/*": "./api/auth/*.js",
|
|
150
124
|
"./api/auth": "./api/auth/index.js",
|
|
151
125
|
"./api/search/*": "./api/search/*.js",
|
|
152
126
|
"./api/search": "./api/search/index.js",
|
|
153
|
-
"./api/analytic/*": "./api/analytic/*.js",
|
|
154
|
-
"./api/analytic": "./api/analytic/index.js",
|
|
155
|
-
"./api/notebook/*": "./api/notebook/*.js",
|
|
156
|
-
"./api/notebook": "./api/notebook/index.js",
|
|
157
|
-
"./api/view/*": "./api/view/*.js",
|
|
158
|
-
"./api/view": "./api/view/index.js",
|
|
159
127
|
"./api/dossier/*": "./api/dossier/*.js",
|
|
160
128
|
"./api/dossier": "./api/dossier/index.js",
|
|
129
|
+
"./api/view/*": "./api/view/*.js",
|
|
130
|
+
"./api/view": "./api/view/index.js",
|
|
161
131
|
"./api/overview/*": "./api/overview/*.js",
|
|
162
132
|
"./api/overview": "./api/overview/index.js",
|
|
163
|
-
"./api/user
|
|
164
|
-
"./api/user
|
|
133
|
+
"./api/user/*": "./api/user/*.js",
|
|
134
|
+
"./api/user": "./api/user/index.js",
|
|
135
|
+
"./api/action/*": "./api/action/*.js",
|
|
136
|
+
"./api/action": "./api/action/index.js",
|
|
137
|
+
"./api/configs/*": "./api/configs/*.js",
|
|
138
|
+
"./api/configs": "./api/configs/index.js",
|
|
139
|
+
"./api/analytic/comments/*": "./api/analytic/comments/*.js",
|
|
140
|
+
"./api/analytic/comments": "./api/analytic/comments/index.js",
|
|
141
|
+
"./api/analytic/notebooks/*": "./api/analytic/notebooks/*.js",
|
|
142
|
+
"./api/analytic/notebooks": "./api/analytic/notebooks/index.js",
|
|
165
143
|
"./api/hit/comments/*": "./api/hit/comments/*.js",
|
|
166
144
|
"./api/hit/comments": "./api/hit/comments/index.js",
|
|
167
|
-
"./api/search/grouped/*": "./api/search/grouped/*.js",
|
|
168
|
-
"./api/search/grouped": "./api/search/grouped/index.js",
|
|
169
|
-
"./api/search/fields/*": "./api/search/fields/*.js",
|
|
170
|
-
"./api/search/fields": "./api/search/fields/index.js",
|
|
171
|
-
"./api/search/eql/*": "./api/search/eql/*.js",
|
|
172
145
|
"./api/search/facet/*": "./api/search/facet/*.js",
|
|
173
146
|
"./api/search/facet": "./api/search/facet/index.js",
|
|
174
147
|
"./api/search/count/*": "./api/search/count/*.js",
|
|
175
148
|
"./api/search/count": "./api/search/count/index.js",
|
|
149
|
+
"./api/search/fields/*": "./api/search/fields/*.js",
|
|
150
|
+
"./api/search/fields": "./api/search/fields/index.js",
|
|
151
|
+
"./api/search/eql/*": "./api/search/eql/*.js",
|
|
152
|
+
"./api/search/sigma/*": "./api/search/sigma/*.js",
|
|
153
|
+
"./api/search/grouped/*": "./api/search/grouped/*.js",
|
|
154
|
+
"./api/search/grouped": "./api/search/grouped/index.js",
|
|
176
155
|
"./api/search/histogram/*": "./api/search/histogram/*.js",
|
|
177
156
|
"./api/search/histogram": "./api/search/histogram/index.js",
|
|
178
|
-
"./api/
|
|
179
|
-
"./api/
|
|
180
|
-
"./
|
|
181
|
-
"./
|
|
182
|
-
"./
|
|
183
|
-
"./
|
|
184
|
-
"./
|
|
185
|
-
"./
|
|
186
|
-
"./
|
|
157
|
+
"./api/user/avatar/*": "./api/user/avatar/*.js",
|
|
158
|
+
"./api/user/avatar": "./api/user/avatar/index.js",
|
|
159
|
+
"./models/socket/*": "./models/socket/*.js",
|
|
160
|
+
"./models/entities/*": "./models/entities/*.js",
|
|
161
|
+
"./models/entities/generated/*": "./models/entities/generated/*.js",
|
|
162
|
+
"./locales/en/*.json": "./locales/en/*.json",
|
|
163
|
+
"./locales/fr/*.json": "./locales/fr/*.json",
|
|
164
|
+
"./locales/en/help/*.json": "./locales/en/help/*.json",
|
|
165
|
+
"./locales/fr/help/*.json": "./locales/fr/help/*.json",
|
|
166
|
+
"./components/hooks/*": "./components/hooks/*.js",
|
|
187
167
|
"./components/app/*": "./components/app/*.js",
|
|
168
|
+
"./components/logins/*": "./components/logins/*.js",
|
|
188
169
|
"./components/elements/*": "./components/elements/*.js",
|
|
189
170
|
"./components/routes/*": "./components/routes/*.js",
|
|
190
|
-
"./components/logins/*": "./components/logins/*.js",
|
|
191
|
-
"./components/hooks/*": "./components/hooks/*.js",
|
|
192
|
-
"./components/app/providers/*": "./components/app/providers/*.js",
|
|
193
171
|
"./components/app/hooks/*": "./components/app/hooks/*.js",
|
|
172
|
+
"./components/app/providers/*": "./components/app/providers/*.js",
|
|
194
173
|
"./components/app/drawers/*": "./components/app/drawers/*.js",
|
|
195
|
-
"./components/
|
|
174
|
+
"./components/logins/hooks/*": "./components/logins/hooks/*.js",
|
|
175
|
+
"./components/logins/auth/*": "./components/logins/auth/*.js",
|
|
176
|
+
"./components/elements/addons/*": "./components/elements/addons/*.js",
|
|
196
177
|
"./components/elements/hit/*": "./components/elements/hit/*.js",
|
|
197
178
|
"./components/elements/view/*": "./components/elements/view/*.js",
|
|
198
|
-
"./components/elements/
|
|
199
|
-
"./components/elements/display/markdownPlugins/*.md": "./components/elements/display/markdownPlugins/*.md.js",
|
|
200
|
-
"./components/elements/display/modals/*": "./components/elements/display/modals/*.js",
|
|
201
|
-
"./components/elements/display/features/*": "./components/elements/display/features/*.js",
|
|
202
|
-
"./components/elements/display/icons/*": "./components/elements/display/icons/*.js",
|
|
203
|
-
"./components/elements/display/json/*": "./components/elements/display/json/*.js",
|
|
204
|
-
"./components/elements/display/handlebars/*": "./components/elements/display/handlebars/*.js",
|
|
205
|
-
"./components/elements/display/icons/svg/*": "./components/elements/display/icons/svg/*.js",
|
|
206
|
-
"./components/elements/hit/elements/*": "./components/elements/hit/elements/*.js",
|
|
207
|
-
"./components/elements/hit/outlines/*": "./components/elements/hit/outlines/*.js",
|
|
208
|
-
"./components/elements/hit/related/*": "./components/elements/hit/related/*.js",
|
|
209
|
-
"./components/elements/hit/aggregate/*": "./components/elements/hit/aggregate/*.js",
|
|
210
|
-
"./components/elements/hit/actions/*": "./components/elements/hit/actions/*.js",
|
|
211
|
-
"./components/elements/hit/outlines/al/*": "./components/elements/hit/outlines/al/*.js",
|
|
179
|
+
"./components/elements/display/*": "./components/elements/display/*.js",
|
|
212
180
|
"./components/elements/addons/buttons/*": "./components/elements/addons/buttons/*.js",
|
|
213
181
|
"./components/elements/addons/buttons": "./components/elements/addons/buttons/index.js",
|
|
214
|
-
"./components/elements/addons/layout/*": "./components/elements/addons/layout/*.js",
|
|
215
182
|
"./components/elements/addons/search/*": "./components/elements/addons/search/*.js",
|
|
183
|
+
"./components/elements/addons/layout/*": "./components/elements/addons/layout/*.js",
|
|
216
184
|
"./components/elements/addons/lists/*": "./components/elements/addons/lists/*.js",
|
|
217
185
|
"./components/elements/addons/lists": "./components/elements/addons/lists/index.js",
|
|
218
|
-
"./components/elements/addons/layout/vsbox/*": "./components/elements/addons/layout/vsbox/*.js",
|
|
219
186
|
"./components/elements/addons/search/phrase/*": "./components/elements/addons/search/phrase/*.js",
|
|
220
187
|
"./components/elements/addons/search/phrase": "./components/elements/addons/search/phrase/index.js",
|
|
221
188
|
"./components/elements/addons/search/phrase/word/*": "./components/elements/addons/search/phrase/word/*.js",
|
|
222
189
|
"./components/elements/addons/search/phrase/word/consumers/*": "./components/elements/addons/search/phrase/word/consumers/*.js",
|
|
190
|
+
"./components/elements/addons/layout/vsbox/*": "./components/elements/addons/layout/vsbox/*.js",
|
|
223
191
|
"./components/elements/addons/lists/hooks/*": "./components/elements/addons/lists/hooks/*.js",
|
|
224
192
|
"./components/elements/addons/lists/table/*": "./components/elements/addons/lists/table/*.js",
|
|
225
193
|
"./components/elements/addons/lists/table": "./components/elements/addons/lists/table/index.js",
|
|
226
|
-
"./components/
|
|
227
|
-
"./components/
|
|
228
|
-
"./components/
|
|
194
|
+
"./components/elements/hit/aggregate/*": "./components/elements/hit/aggregate/*.js",
|
|
195
|
+
"./components/elements/hit/outlines/*": "./components/elements/hit/outlines/*.js",
|
|
196
|
+
"./components/elements/hit/related/*": "./components/elements/hit/related/*.js",
|
|
197
|
+
"./components/elements/hit/elements/*": "./components/elements/hit/elements/*.js",
|
|
198
|
+
"./components/elements/hit/actions/*": "./components/elements/hit/actions/*.js",
|
|
199
|
+
"./components/elements/hit/outlines/al/*": "./components/elements/hit/outlines/al/*.js",
|
|
200
|
+
"./components/elements/display/icons/*": "./components/elements/display/icons/*.js",
|
|
201
|
+
"./components/elements/display/modals/*": "./components/elements/display/modals/*.js",
|
|
202
|
+
"./components/elements/display/markdownPlugins/*.md": "./components/elements/display/markdownPlugins/*.md.js",
|
|
203
|
+
"./components/elements/display/json/*": "./components/elements/display/json/*.js",
|
|
204
|
+
"./components/elements/display/handlebars/*": "./components/elements/display/handlebars/*.js",
|
|
205
|
+
"./components/elements/display/features/*": "./components/elements/display/features/*.js",
|
|
206
|
+
"./components/elements/display/icons/svg/*": "./components/elements/display/icons/svg/*.js",
|
|
229
207
|
"./components/routes/admin/*": "./components/routes/admin/*.js",
|
|
208
|
+
"./components/routes/dossiers/*": "./components/routes/dossiers/*.js",
|
|
209
|
+
"./components/routes/advanced/*": "./components/routes/advanced/*.js",
|
|
230
210
|
"./components/routes/hits/*": "./components/routes/hits/*.js",
|
|
231
211
|
"./components/routes/settings/*": "./components/routes/settings/*.js",
|
|
232
212
|
"./components/routes/home/*": "./components/routes/home/*.js",
|
|
233
213
|
"./components/routes/home": "./components/routes/home/index.js",
|
|
234
|
-
"./components/routes/overviews/*": "./components/routes/overviews/*.js",
|
|
235
|
-
"./components/routes/advanced/*": "./components/routes/advanced/*.js",
|
|
236
214
|
"./components/routes/analytics/*": "./components/routes/analytics/*.js",
|
|
237
|
-
"./components/routes/templates/*": "./components/routes/templates/*.js",
|
|
238
215
|
"./components/routes/help/*": "./components/routes/help/*.js",
|
|
239
|
-
"./components/routes/action
|
|
240
|
-
"./components/routes/
|
|
241
|
-
"./components/routes/
|
|
216
|
+
"./components/routes/action/*": "./components/routes/action/*.js",
|
|
217
|
+
"./components/routes/views/*": "./components/routes/views/*.js",
|
|
218
|
+
"./components/routes/overviews/*": "./components/routes/overviews/*.js",
|
|
219
|
+
"./components/routes/templates/*": "./components/routes/templates/*.js",
|
|
242
220
|
"./components/routes/admin/users/*": "./components/routes/admin/users/*.js",
|
|
243
221
|
"./components/routes/hits/search/*": "./components/routes/hits/search/*.js",
|
|
244
222
|
"./components/routes/hits/view/*": "./components/routes/hits/view/*.js",
|
|
245
|
-
"./components/routes/hits/search/shared/*": "./components/routes/hits/search/shared/*.js",
|
|
246
223
|
"./components/routes/hits/search/grid/*": "./components/routes/hits/search/grid/*.js",
|
|
247
|
-
"./components/routes/
|
|
224
|
+
"./components/routes/hits/search/shared/*": "./components/routes/hits/search/shared/*.js",
|
|
248
225
|
"./components/routes/analytics/widgets/*": "./components/routes/analytics/widgets/*.js",
|
|
249
|
-
"./components/routes/help/markdown/*.md": "./components/routes/help/markdown/*.md.js",
|
|
250
226
|
"./components/routes/help/components/*": "./components/routes/help/components/*.js",
|
|
251
|
-
"./components/routes/help/markdown
|
|
227
|
+
"./components/routes/help/markdown/*.md": "./components/routes/help/markdown/*.md.js",
|
|
252
228
|
"./components/routes/help/markdown/en/*.md": "./components/routes/help/markdown/en/*.md.js",
|
|
253
|
-
"./components/
|
|
254
|
-
"./components/
|
|
255
|
-
"./
|
|
256
|
-
"./
|
|
257
|
-
"./
|
|
229
|
+
"./components/routes/help/markdown/fr/*.md": "./components/routes/help/markdown/fr/*.md.js",
|
|
230
|
+
"./components/routes/action/view/*": "./components/routes/action/view/*.js",
|
|
231
|
+
"./components/routes/action/shared/*": "./components/routes/action/shared/*.js",
|
|
232
|
+
"./components/routes/action/edit/*": "./components/routes/action/edit/*.js",
|
|
233
|
+
"./components/routes/overviews/template/*": "./components/routes/overviews/template/*.js",
|
|
234
|
+
"./commons/components/*": "./commons/components/*.js",
|
|
235
|
+
"./commons/components/utils/*": "./commons/components/utils/*.js",
|
|
236
|
+
"./commons/components/leftnav/*": "./commons/components/leftnav/*.js",
|
|
237
|
+
"./commons/components/pages/*": "./commons/components/pages/*.js",
|
|
238
|
+
"./commons/components/topnav/*": "./commons/components/topnav/*.js",
|
|
239
|
+
"./commons/components/app/*": "./commons/components/app/*.js",
|
|
240
|
+
"./commons/components/search/*": "./commons/components/search/*.js",
|
|
241
|
+
"./commons/components/breadcrumbs/*": "./commons/components/breadcrumbs/*.js",
|
|
242
|
+
"./commons/components/display/*": "./commons/components/display/*.js",
|
|
243
|
+
"./commons/components/notification/*": "./commons/components/notification/*.js",
|
|
244
|
+
"./commons/components/notification": "./commons/components/notification/index.js",
|
|
245
|
+
"./commons/components/utils/hooks/*": "./commons/components/utils/hooks/*.js",
|
|
246
|
+
"./commons/components/pages/hooks/*": "./commons/components/pages/hooks/*.js",
|
|
247
|
+
"./commons/components/app/hooks/*": "./commons/components/app/hooks/*.js",
|
|
248
|
+
"./commons/components/app/hooks": "./commons/components/app/hooks/index.js",
|
|
249
|
+
"./commons/components/app/providers/*": "./commons/components/app/providers/*.js",
|
|
250
|
+
"./commons/components/display/hooks/*": "./commons/components/display/hooks/*.js",
|
|
251
|
+
"./commons/components/notification/elements/*": "./commons/components/notification/elements/*.js",
|
|
252
|
+
"./commons/components/notification/elements/item/*": "./commons/components/notification/elements/item/*.js"
|
|
258
253
|
}
|
|
259
254
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { BorealisProvider } from 'borealis-ui/dist/hooks/BorealisProvider';
|
|
3
|
-
import { ApiConfigContext } from '@cccsaurora/howler-ui/components/app/providers/ApiConfigProvider';
|
|
4
|
-
import { useContext } from 'react';
|
|
5
|
-
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { StorageKey } from '@cccsaurora/howler-ui/utils/constants';
|
|
7
|
-
import { getStored } from '@cccsaurora/howler-ui/utils/localStorage';
|
|
8
|
-
const Provider = ({ children }) => {
|
|
9
|
-
const apiConfig = useContext(ApiConfigContext);
|
|
10
|
-
return (_jsx(BorealisProvider, { baseURL: location.origin + '/api/v1/borealis', getToken: () => getStored(StorageKey.APP_TOKEN), enabled: apiConfig.config?.configuration?.features?.borealis, publicIconify: false, customIconify: location.origin.includes('localhost')
|
|
11
|
-
? 'https://icons.dev.analysis.cyber.gc.ca'
|
|
12
|
-
: location.origin.replace(/howler(-stg)?/, 'icons'), defaultTimeout: 5, i18next: useTranslation('borealis'), chunkSize: 50, children: children }));
|
|
13
|
-
};
|
|
14
|
-
export default Provider;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Chip } from '@mui/material';
|
|
3
|
-
import { EnrichedChip, useBorealisEnrichSelector } from 'borealis-ui';
|
|
4
|
-
import { memo } from 'react';
|
|
5
|
-
const BorealisChip = ({ children, value, context, ...props }) => {
|
|
6
|
-
const guessType = useBorealisEnrichSelector(ctx => ctx.guessType);
|
|
7
|
-
const type = guessType(value);
|
|
8
|
-
if (!type) {
|
|
9
|
-
return _jsx(Chip, { ...props, children: children });
|
|
10
|
-
}
|
|
11
|
-
let enrichedProps = {
|
|
12
|
-
...props,
|
|
13
|
-
value
|
|
14
|
-
};
|
|
15
|
-
delete enrichedProps.label;
|
|
16
|
-
if (context === 'summary') {
|
|
17
|
-
enrichedProps = {
|
|
18
|
-
...enrichedProps,
|
|
19
|
-
sx: [
|
|
20
|
-
...(Array.isArray(enrichedProps.sx) ? enrichedProps.sx : [enrichedProps.sx]),
|
|
21
|
-
[{ height: '24px', '& .iconify': { fontSize: '1em' } }]
|
|
22
|
-
]
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
return _jsx(EnrichedChip, { ...enrichedProps, type: type });
|
|
26
|
-
};
|
|
27
|
-
export default memo(BorealisChip);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Autocomplete, Divider, ListItemText, TextField, Typography } from '@mui/material';
|
|
3
|
-
import { useBorealisEnrichSelector, useBorealisFetcherSelector } from 'borealis-ui';
|
|
4
|
-
import { ApiConfigContext } from '@cccsaurora/howler-ui/components/app/providers/ApiConfigProvider';
|
|
5
|
-
import { useContext, useState } from 'react';
|
|
6
|
-
import { useTranslation } from 'react-i18next';
|
|
7
|
-
const BorealisLeadForm = ({ lead, metadata, update, updateMetadata }) => {
|
|
8
|
-
const { t } = useTranslation();
|
|
9
|
-
const { config } = useContext(ApiConfigContext);
|
|
10
|
-
const fetchers = useBorealisFetcherSelector(ctx => ctx.fetchers);
|
|
11
|
-
const types = useBorealisEnrichSelector(ctx => ctx.typesDetection);
|
|
12
|
-
const [showCustom, setShowCustom] = useState(false);
|
|
13
|
-
return (_jsxs(_Fragment, { children: [_jsx(Divider, { orientation: "horizontal" }), _jsx(Autocomplete, { disabled: !lead, options: Object.keys(fetchers), renderInput: params => _jsx(TextField, { ...params, size: "small", label: t('route.dossiers.manager.borealis') }), value: Object.keys(fetchers).includes(lead?.content) ? lead.content : '', onChange: (_ev, content) => update({ content, metadata: '{}' }), renderOption: (props, option) => (_jsx(ListItemText, { ...props, sx: { flexDirection: 'column', alignItems: 'start !important' }, primary: _jsx("code", { children: option }), secondary: fetchers[option].description })) }), _jsx(Autocomplete, { options: Object.keys(types), renderInput: params => _jsx(TextField, { ...params, size: "small", label: t('route.dossiers.manager.borealis.type') }), value: metadata?.type ?? '', onChange: (_ev, type) => updateMetadata({ type }) }), _jsx(Autocomplete, { options: ['custom', ...Object.keys(config.indexes.hit)], disabled: !metadata?.type || !types[metadata.type], renderInput: params => (_jsx(TextField, { ...params, size: "small", label: t('route.dossiers.manager.borealis.value') })), getOptionLabel: opt => t(opt), value: metadata?.value ?? '', onChange: (_ev, value) => {
|
|
14
|
-
if (value === 'custom') {
|
|
15
|
-
setShowCustom(true);
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
setShowCustom(false);
|
|
19
|
-
updateMetadata({ value });
|
|
20
|
-
}
|
|
21
|
-
} }), showCustom && (_jsxs(_Fragment, { children: [_jsx(TextField, { size: "small", label: t('route.dossiers.manager.borealis.value.custom'), value: metadata?.value ?? '', disabled: !metadata?.type || !types[metadata.type], fullWidth: true, onChange: ev => updateMetadata({ value: ev.target.value }) }), _jsx(Typography, { variant: "caption", color: "text.secondary", sx: { mt: '0 !important' }, children: t('route.dossiers.manager.borealis.value.description') })] }))] }));
|
|
22
|
-
};
|
|
23
|
-
export default BorealisLeadForm;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Icon } from '@iconify/react/dist/iconify.js';
|
|
3
|
-
import { Settings } from '@mui/icons-material';
|
|
4
|
-
import { Divider, IconButton, Stack, Typography } from '@mui/material';
|
|
5
|
-
import { useBorealisActionsSelector, useBorealisEnrichSelector } from 'borealis-ui';
|
|
6
|
-
import HowlerCard from '@cccsaurora/howler-ui/components/elements/display/HowlerCard';
|
|
7
|
-
import useMySnackbar from '@cccsaurora/howler-ui/components/hooks/useMySnackbar';
|
|
8
|
-
import { get } from 'lodash-es';
|
|
9
|
-
import { memo, useCallback, useState } from 'react';
|
|
10
|
-
import { useTranslation } from 'react-i18next';
|
|
11
|
-
const BorealisPivot = ({ pivot, hit, compact }) => {
|
|
12
|
-
const guessType = useBorealisEnrichSelector(ctx => ctx?.guessType);
|
|
13
|
-
const { showErrorMessage } = useMySnackbar();
|
|
14
|
-
const { i18n, t } = useTranslation();
|
|
15
|
-
const actions = useBorealisActionsSelector(ctx => ctx?.availableActions ?? {});
|
|
16
|
-
const executeAction = useBorealisActionsSelector(ctx => ctx?.executeAction);
|
|
17
|
-
const [loading, setLoading] = useState(false);
|
|
18
|
-
const onBorealisClick = useCallback(async (event, forceMenu = false) => {
|
|
19
|
-
event.preventDefault();
|
|
20
|
-
event.stopPropagation();
|
|
21
|
-
if (loading) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
if (!actions[pivot.value]) {
|
|
25
|
-
showErrorMessage(t('pivot.borealis.missing'));
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
setLoading(true);
|
|
29
|
-
const data = Object.fromEntries(pivot.mappings.map(_mapping => {
|
|
30
|
-
const value = _mapping.field !== 'custom' ? get(hit, _mapping.field) : _mapping.custom_value;
|
|
31
|
-
if (['selector', 'selectors'].includes(_mapping.key)) {
|
|
32
|
-
if (Array.isArray(value)) {
|
|
33
|
-
return [
|
|
34
|
-
_mapping.key,
|
|
35
|
-
value.map(val => ({
|
|
36
|
-
// TODO: Use the mapped borealis values here eventually
|
|
37
|
-
type: guessType(val),
|
|
38
|
-
value: val
|
|
39
|
-
}))
|
|
40
|
-
];
|
|
41
|
-
}
|
|
42
|
-
return [
|
|
43
|
-
_mapping.key,
|
|
44
|
-
{
|
|
45
|
-
// TODO: Use the mapped borealis values here eventually
|
|
46
|
-
type: guessType(value),
|
|
47
|
-
value
|
|
48
|
-
}
|
|
49
|
-
];
|
|
50
|
-
}
|
|
51
|
-
return [_mapping.key, value];
|
|
52
|
-
}));
|
|
53
|
-
const selectors = (actions[pivot.value].accept_multiple ? [data.selectors] : [data.selector]).flat();
|
|
54
|
-
delete data.selector;
|
|
55
|
-
delete data.selectors;
|
|
56
|
-
try {
|
|
57
|
-
await executeAction(pivot.value, selectors, data, { forceMenu });
|
|
58
|
-
}
|
|
59
|
-
finally {
|
|
60
|
-
setLoading(false);
|
|
61
|
-
}
|
|
62
|
-
}, [actions, executeAction, guessType, hit, loading, pivot.mappings, pivot.value, showErrorMessage, t]);
|
|
63
|
-
if (!actions[pivot.value]) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
return (_jsx(HowlerCard, { variant: compact ? 'outlined' : 'elevation', onClick: e => onBorealisClick(e), sx: [
|
|
67
|
-
theme => ({
|
|
68
|
-
backgroundColor: 'transparent',
|
|
69
|
-
transition: theme.transitions.create(['border-color']),
|
|
70
|
-
'&:hover': { borderColor: 'primary.main' },
|
|
71
|
-
'& > div': {
|
|
72
|
-
height: '100%'
|
|
73
|
-
}
|
|
74
|
-
}),
|
|
75
|
-
loading
|
|
76
|
-
? { opacity: 0.5, pointerEvents: 'none' }
|
|
77
|
-
: {
|
|
78
|
-
cursor: 'pointer'
|
|
79
|
-
},
|
|
80
|
-
!compact && { border: 'thin solid', borderColor: 'transparent' }
|
|
81
|
-
], children: _jsxs(Stack, { direction: "row", p: compact ? 0.5 : 1, spacing: 1, alignItems: "center", children: [_jsx(Icon, { fontSize: "1.5rem", icon: pivot.icon }), _jsx(Typography, { children: pivot.label[i18n.language] }), _jsx(Divider, { orientation: "vertical", flexItem: true }), _jsx(IconButton, { size: "small", onClick: e => onBorealisClick(e, true), children: _jsx(Settings, { fontSize: "small" }) })] }) }));
|
|
82
|
-
};
|
|
83
|
-
export default memo(BorealisPivot);
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Autocomplete, Divider, Stack, TextField, Typography, useTheme } from '@mui/material';
|
|
3
|
-
import { useBorealisActionsSelector } from 'borealis-ui';
|
|
4
|
-
import { ApiConfigContext } from '@cccsaurora/howler-ui/components/app/providers/ApiConfigProvider';
|
|
5
|
-
import { Fragment, useContext } from 'react';
|
|
6
|
-
import { useTranslation } from 'react-i18next';
|
|
7
|
-
const BorealisPivotForm = ({ pivot, update }) => {
|
|
8
|
-
const theme = useTheme();
|
|
9
|
-
const { t } = useTranslation();
|
|
10
|
-
const { config } = useContext(ApiConfigContext);
|
|
11
|
-
const actions = useBorealisActionsSelector(ctx => ctx?.availableActions);
|
|
12
|
-
return (_jsxs(_Fragment, { children: [_jsx(Autocomplete, { fullWidth: true, disabled: !pivot, options: Object.entries(actions)
|
|
13
|
-
.filter(([_key, definition]) => !!definition && definition.format == 'pivot')
|
|
14
|
-
.map(([key]) => key), renderOption: ({ key, ...optionProps }, actionId) => {
|
|
15
|
-
const definition = actions[actionId];
|
|
16
|
-
return (_jsxs(Stack, { component: "li", ...optionProps, spacing: 1, children: [_jsxs(Stack, { direction: "row", spacing: 1, alignSelf: "start", alignItems: "center", children: [_jsx(Typography, { children: definition.name }), _jsx("pre", { style: {
|
|
17
|
-
fontSize: '0.85rem',
|
|
18
|
-
border: `thin solid ${theme.palette.divider}`,
|
|
19
|
-
padding: theme.spacing(0.5),
|
|
20
|
-
borderRadius: theme.shape.borderRadius
|
|
21
|
-
}, children: actionId })] }), _jsx(Typography, { variant: "body2", color: "text.secondary", alignSelf: "start", children: definition.summary })] }, key));
|
|
22
|
-
}, getOptionLabel: opt => actions[opt]?.name ?? '', renderInput: params => (_jsx(TextField, { ...params, size: "small", fullWidth: true, label: t('route.dossiers.manager.pivot.value') })), value: pivot?.value ?? '', onChange: (_ev, value) => update({
|
|
23
|
-
value,
|
|
24
|
-
mappings: [
|
|
25
|
-
{ key: actions[value].accept_multiple ? 'selectors' : 'selector', field: 'howler.id' },
|
|
26
|
-
...Object.entries(actions[value].params?.properties ?? [])
|
|
27
|
-
.filter(([property]) => !['selector', 'selectors'].includes(property))
|
|
28
|
-
.map(([prop, schema]) => ({
|
|
29
|
-
key: prop,
|
|
30
|
-
field: typeof schema === 'boolean' || !schema.default ? null : 'custom',
|
|
31
|
-
custom_value: typeof schema !== 'boolean' && !!schema.default ? schema.default.toString() : null
|
|
32
|
-
}))
|
|
33
|
-
]
|
|
34
|
-
}) }), _jsx(Divider, { flexItem: true }), _jsx(Typography, { children: t('route.dossiers.manager.pivot.mappings') }), pivot?.mappings?.map((_mapping, index) => (
|
|
35
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
36
|
-
_jsxs(Fragment, { children: [_jsxs(Stack, { direction: "row", spacing: 1, children: [_jsx(TextField, { size: "small", label: t('route.dossiers.manager.pivot.mapping.key'), disabled: !pivot, value: _mapping?.key ?? '', onChange: ev => update({
|
|
37
|
-
mappings: pivot.mappings.map((_m, _index) => index === _index ? { ..._m, key: ev.target.value } : _m)
|
|
38
|
-
}) }), _jsx(Autocomplete, { fullWidth: true, disabled: !pivot, options: ['custom', 'unset', ...Object.keys(config.indexes.hit)], renderInput: params => (_jsx(TextField, { ...params, size: "small", fullWidth: true, label: t('route.dossiers.manager.pivot.mapping.field'), sx: { minWidth: '150px' } })), getOptionLabel: opt => t(opt), value: _mapping.field ?? '', onChange: (_ev, field) => update({
|
|
39
|
-
mappings: pivot.mappings.map((_m, _index) => (index === _index ? { ..._m, field } : _m))
|
|
40
|
-
}) })] }), _mapping.field === 'custom' && (_jsx(TextField, { size: "small", label: t('route.dossiers.manager.pivot.mapping.custom'), disabled: !pivot, value: _mapping?.custom_value ?? '', onChange: ev => update({
|
|
41
|
-
mappings: pivot.mappings.map((_m, _index) => index === _index ? { ..._m, custom_value: ev.target.value } : _m)
|
|
42
|
-
}) }))] }, index)))] }));
|
|
43
|
-
};
|
|
44
|
-
export default BorealisPivotForm;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Typography } from '@mui/material';
|
|
3
|
-
import { EnrichedTypography, useBorealisEnrichSelector } from 'borealis-ui';
|
|
4
|
-
import { ApiConfigContext } from '@cccsaurora/howler-ui/components/app/providers/ApiConfigProvider';
|
|
5
|
-
import { memo, useContext } from 'react';
|
|
6
|
-
const BorealisTypography = ({ children, value, context, ...props }) => {
|
|
7
|
-
const guessType = useBorealisEnrichSelector(ctx => ctx.guessType);
|
|
8
|
-
const { config } = useContext(ApiConfigContext);
|
|
9
|
-
const type = config?.configuration?.mapping?.[value] ?? guessType(value);
|
|
10
|
-
if (!type) {
|
|
11
|
-
return _jsx(Typography, { ...props, children: children });
|
|
12
|
-
}
|
|
13
|
-
let enrichedProps = {
|
|
14
|
-
...props,
|
|
15
|
-
value
|
|
16
|
-
};
|
|
17
|
-
if (context === 'banner') {
|
|
18
|
-
enrichedProps = {
|
|
19
|
-
...enrichedProps,
|
|
20
|
-
slotProps: { stack: { component: 'span' } }
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
else if (context === 'outline') {
|
|
24
|
-
enrichedProps = {
|
|
25
|
-
...enrichedProps,
|
|
26
|
-
hideLoading: true,
|
|
27
|
-
slotProps: {
|
|
28
|
-
stack: {
|
|
29
|
-
sx: { mr: 'auto' },
|
|
30
|
-
onClick: e => {
|
|
31
|
-
e.preventDefault();
|
|
32
|
-
e.stopPropagation();
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
popover: {
|
|
36
|
-
onClick: e => {
|
|
37
|
-
e.preventDefault();
|
|
38
|
-
e.stopPropagation();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
else if (context === 'table') {
|
|
45
|
-
enrichedProps = {
|
|
46
|
-
...enrichedProps,
|
|
47
|
-
hideLoading: true,
|
|
48
|
-
slotProps: {
|
|
49
|
-
stack: { sx: { width: '100%', '& > p': { textOverflow: 'ellipsis', overflow: 'hidden' } } }
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
return _jsx(EnrichedTypography, { ...enrichedProps, type: type });
|
|
54
|
-
};
|
|
55
|
-
export default memo(BorealisTypography);
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
/* eslint-disable no-console */
|
|
3
|
-
import { Checkbox, Paper, Stack, Table, TableBody, TableCell, TableHead, TableRow } from '@mui/material';
|
|
4
|
-
import { EnrichedTypography, Entry, Fetcher, Group, useBorealisEnrichSelector } from 'borealis-ui';
|
|
5
|
-
import FlexOne from '@cccsaurora/howler-ui/components/elements/addons/layout/FlexOne';
|
|
6
|
-
import i18nInstance from '@cccsaurora/howler-ui/i18n';
|
|
7
|
-
import { capitalize, groupBy, uniq } from 'lodash-es';
|
|
8
|
-
import { useState } from 'react';
|
|
9
|
-
import { useTranslation } from 'react-i18next';
|
|
10
|
-
const BorealisTypography = props => {
|
|
11
|
-
const { t } = useTranslation();
|
|
12
|
-
try {
|
|
13
|
-
const guessType = useBorealisEnrichSelector(ctx => ctx.guessType);
|
|
14
|
-
let type = props.type;
|
|
15
|
-
if (!type || type?.toLowerCase() === 'guess') {
|
|
16
|
-
type = guessType(props.value);
|
|
17
|
-
}
|
|
18
|
-
if (!type) {
|
|
19
|
-
return _jsx("span", { children: props.value });
|
|
20
|
-
}
|
|
21
|
-
return _jsx(EnrichedTypography, { ...props, type: type });
|
|
22
|
-
}
|
|
23
|
-
catch (err) {
|
|
24
|
-
return (_jsxs(Stack, { children: [_jsx("strong", { style: { color: 'red' }, children: t('markdown.error') }), _jsx("strong", { children: err.toString() }), _jsx("code", { style: { fontSize: '0.8rem' }, children: _jsx("pre", { children: err.stack }) })] }));
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const BorealisGroup = props => {
|
|
28
|
-
if (!props.enabled) {
|
|
29
|
-
return _jsx(_Fragment, { children: props.children });
|
|
30
|
-
}
|
|
31
|
-
if (!props.type) {
|
|
32
|
-
console.error('Missing required props for group helper');
|
|
33
|
-
return (_jsxs(Stack, { spacing: 1, children: [_jsx("strong", { style: { color: 'red' }, children: i18nInstance.t('markdown.error') }), _jsxs("code", { style: { fontSize: '0.8rem' }, children: [i18nInstance.t('markdown.props.missing'), ": type"] })] }));
|
|
34
|
-
}
|
|
35
|
-
return _jsx(Group, { type: props.type, children: props.children });
|
|
36
|
-
};
|
|
37
|
-
const BorealisEntry = ({ value }) => {
|
|
38
|
-
const [checked, setChecked] = useState(false);
|
|
39
|
-
return (_jsx(Entry, { entry: value, selected: checked, children: _jsx(Paper, { sx: { p: 1 }, children: _jsxs(Stack, { direction: "row", spacing: 1, children: [_jsx(Checkbox, { checked: checked, onChange: (_event, _checked) => setChecked(_checked) }), _jsx(BorealisTypography, { value: value }), _jsx(FlexOne, {})] }) }) }));
|
|
40
|
-
};
|
|
41
|
-
const BorealisCheckbox = ({ value }) => {
|
|
42
|
-
const [checked, setChecked] = useState(false);
|
|
43
|
-
return (_jsx(Entry, { entry: value, selected: checked, children: _jsx(Checkbox, { checked: checked, onChange: (_event, _checked) => setChecked(_checked) }) }));
|
|
44
|
-
};
|
|
45
|
-
const HELPERS = [
|
|
46
|
-
{
|
|
47
|
-
keyword: 'borealis',
|
|
48
|
-
documentation: {
|
|
49
|
-
en: 'Given a selector, this helper enriches the selector through borealis.',
|
|
50
|
-
fr: 'Étant donné un sélecteur, cet assistant enrichit le sélecteur via borealis.'
|
|
51
|
-
},
|
|
52
|
-
componentCallback: (type, value) => {
|
|
53
|
-
if (typeof type !== 'string' || typeof value !== 'string') {
|
|
54
|
-
return (_jsxs(Stack, { spacing: 1, children: [_jsx("strong", { style: { color: 'red' }, children: i18nInstance.t('markdown.error') }), _jsx("code", { style: { fontSize: '0.8rem' }, children: "You must provide at least two arguments: type and value." })] }));
|
|
55
|
-
}
|
|
56
|
-
return (_jsx(BorealisTypography, { slotProps: { stack: { component: 'span', sx: { width: 'fit-content' } } }, component: "span", type: type, value: typeof value === 'string' ? value : null }));
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
keyword: 'fetcher',
|
|
61
|
-
documentation: {
|
|
62
|
-
en: 'Given a selector, this helper fetches data for the selector through borealis.',
|
|
63
|
-
fr: 'Étant donné un sélecteur, cet assistant récupère les données pour le sélecteur via borealis.'
|
|
64
|
-
},
|
|
65
|
-
componentCallback: (...args) => {
|
|
66
|
-
const options = args.pop();
|
|
67
|
-
const props = options?.hash ?? {};
|
|
68
|
-
if (!props.type || !props.value || !props.fetcherId) {
|
|
69
|
-
console.error('Missing required props for fetcher helper');
|
|
70
|
-
return (_jsxs(Stack, { spacing: 1, children: [_jsx("strong", { style: { color: 'red' }, children: i18nInstance.t('markdown.error') }), _jsxs("code", { style: { fontSize: '0.8rem' }, children: [i18nInstance.t('markdown.props.missing'), ":", ' ', ['type', 'value', 'fetcherId'].filter(key => !props[key]).join(', ')] })] }));
|
|
71
|
-
}
|
|
72
|
-
console.debug(`Rendering fetcher (${props.fetcherId}) for selector ${props.type}:${props.value}`);
|
|
73
|
-
return (_jsx(Fetcher, { slotProps: { stack: { component: 'span', sx: { width: 'fit-content' } } }, component: "span", ...props }));
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
keyword: 'borealis_group',
|
|
78
|
-
documentation: {
|
|
79
|
-
en: 'Initializes a borealis group',
|
|
80
|
-
fr: 'Initialise un groupe borealis'
|
|
81
|
-
},
|
|
82
|
-
componentCallback: (values, ...args) => {
|
|
83
|
-
const options = args.pop();
|
|
84
|
-
const props = options?.hash ?? {};
|
|
85
|
-
const missing = [];
|
|
86
|
-
if (!Array.isArray(values)) {
|
|
87
|
-
missing.push('values');
|
|
88
|
-
}
|
|
89
|
-
if (!props.type) {
|
|
90
|
-
missing.push('type');
|
|
91
|
-
}
|
|
92
|
-
if (missing.length > 0) {
|
|
93
|
-
return (_jsxs(Stack, { spacing: 1, children: [_jsx("strong", { style: { color: 'red' }, children: i18nInstance.t('markdown.error') }), _jsxs("code", { style: { fontSize: '0.8rem' }, children: [i18nInstance.t('markdown.props.missing'), ": ", missing.join(', ')] })] }));
|
|
94
|
-
}
|
|
95
|
-
return (_jsx(BorealisGroup, { type: props.type, enabled: true, children: _jsx(Stack, { spacing: 1, mt: 1, children: uniq(values).map(value => (_jsx(BorealisEntry, { value: value }, value))) }) }));
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
keyword: 'borealis_table',
|
|
100
|
-
documentation: {
|
|
101
|
-
en: `Render a table with optional Borealis enrichments and actions.
|
|
102
|
-
|
|
103
|
-
Borealis enrichments are performed for cells with a borealis_type.
|
|
104
|
-
|
|
105
|
-
Borealis actions are enabled by specifying a borealis action type using the optional borealis_action_type parameter. If enabled, cells with borealis_entity==true will be selectable for use with Borealis enrichments and actions, with a value of action_value if present, and otherwise value.
|
|
106
|
-
|
|
107
|
-
Example:
|
|
108
|
-
\`\`\`markdown
|
|
109
|
-
{{curly 'borealis_table borealis_table_cells borealis_action_type="ip"'}}
|
|
110
|
-
\`\`\`
|
|
111
|
-
where borealis_table_cells is an array with properties:
|
|
112
|
-
|
|
113
|
-
\`\`\`
|
|
114
|
-
column: string;
|
|
115
|
-
row: string;
|
|
116
|
-
value: string;
|
|
117
|
-
borealis_type (optional): string;
|
|
118
|
-
borealis_entity (optional): boolean;
|
|
119
|
-
action_value (optional): string;
|
|
120
|
-
\`\`\`
|
|
121
|
-
`,
|
|
122
|
-
fr: `Affiche un tableau avec des enrichissements et actions Borealis optionnels.
|
|
123
|
-
|
|
124
|
-
Les enrichissements Borealis sont effectués pour les cellules avec un borealis_type.
|
|
125
|
-
|
|
126
|
-
Les actions Borealis sont activées en spécifiant un type d'action borealis en utilisant le paramètre optionnel borealis_action_type. Si activé, les cellules avec borealis_entity==true seront sélectionnables pour utilisation avec les enrichissements et actions Borealis, avec une valeur de action_value si présente, sinon la valeur.
|
|
127
|
-
|
|
128
|
-
Exemple :
|
|
129
|
-
\`\`\`markdown
|
|
130
|
-
{{curly 'borealis_table borealis_table_cells borealis_action_type="ip"'}}
|
|
131
|
-
\`\`\`
|
|
132
|
-
où borealis_table_cells est un tableau avec les propriétés :
|
|
133
|
-
|
|
134
|
-
\`\`\`
|
|
135
|
-
column: string;
|
|
136
|
-
row: string;
|
|
137
|
-
value: string;
|
|
138
|
-
borealis_type (optionnel): string;
|
|
139
|
-
borealis_entity (optionnel): boolean;
|
|
140
|
-
action_value (optionnel): string;
|
|
141
|
-
\`\`\`
|
|
142
|
-
`
|
|
143
|
-
},
|
|
144
|
-
componentCallback: (cells, ...args) => {
|
|
145
|
-
const options = args.pop();
|
|
146
|
-
const props = options?.hash ?? {};
|
|
147
|
-
const columns = Object.keys(groupBy(cells, 'column'));
|
|
148
|
-
const rows = groupBy(cells, 'row');
|
|
149
|
-
const enableBorealisActions = !props.borealis_action_type ? false : true;
|
|
150
|
-
const borealisActionType = !props.borealis_action_type ? 'false' : props.borealis_action_type;
|
|
151
|
-
return (_jsx(Paper, { sx: { width: '95%', overflowX: 'auto', m: 1 }, children: _jsx(BorealisGroup, { type: borealisActionType, enabled: enableBorealisActions, children: _jsxs(Table, { children: [_jsx(TableHead, { children: _jsx(TableRow, { children: columns.map(col => (_jsx(TableCell, { sx: { maxWidth: '150px' }, children: col
|
|
152
|
-
.split(/[_-]/)
|
|
153
|
-
.map(word => capitalize(word))
|
|
154
|
-
.join(' ') }, col))) }) }), _jsx(TableBody, { sx: { '& td': { wordBreak: 'break-word' } }, children: Object.entries(rows).map(([rowId, _cells]) => {
|
|
155
|
-
return (_jsx(TableRow, { children: columns.map(col => {
|
|
156
|
-
const cell = _cells.find(row => row.column === col);
|
|
157
|
-
return (_jsxs(TableCell, { children: [enableBorealisActions && cell.borealis_entity === true ? (_jsx(BorealisCheckbox, { value: cell.action_value ?? cell.value })) : null, typeof cell.borealis_type === 'string' ? (_jsx(BorealisTypography, { slotProps: {
|
|
158
|
-
stack: {
|
|
159
|
-
component: 'span',
|
|
160
|
-
sx: { width: 'fit-content' },
|
|
161
|
-
display: 'inline-flex'
|
|
162
|
-
}
|
|
163
|
-
}, component: "span", type: cell?.borealis_type, value: cell?.value })) : ((cell?.value ?? 'N/A'))] }, col + cell?.value));
|
|
164
|
-
}) }, rowId));
|
|
165
|
-
}) })] }) }) }));
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
];
|
|
169
|
-
export default HELPERS;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { HowlerHelper } from '@cccsaurora/howler-ui/components/elements/display/handlebars/helpers';
|
|
2
|
-
import type { PluginChipProps } from '@cccsaurora/howler-ui/components/elements/PluginChip';
|
|
3
|
-
import type { PluginTypographyProps } from '@cccsaurora/howler-ui/components/elements/PluginTypography';
|
|
4
|
-
import { type i18n as I18N } from 'i18next';
|
|
5
|
-
import HowlerPlugin from '@cccsaurora/howler-ui/plugins/HowlerPlugin';
|
|
6
|
-
declare class BorealisPlugin extends HowlerPlugin {
|
|
7
|
-
name: string;
|
|
8
|
-
version: string;
|
|
9
|
-
author: string;
|
|
10
|
-
description: string;
|
|
11
|
-
activate(): void;
|
|
12
|
-
provider(): import("react").FC<{
|
|
13
|
-
children?: import("react").ReactNode | undefined;
|
|
14
|
-
}>;
|
|
15
|
-
setup(): () => void;
|
|
16
|
-
localization(i18nInstance: I18N): void;
|
|
17
|
-
helpers(): HowlerHelper[];
|
|
18
|
-
typography(_props: PluginTypographyProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
chip(_props: PluginChipProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
}
|
|
21
|
-
export default BorealisPlugin;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box } from '@mui/material';
|
|
3
|
-
import { Fetcher } from 'borealis-ui';
|
|
4
|
-
import borealisEN from 'borealis-ui/dist/en/translation.json';
|
|
5
|
-
import borealisFR from 'borealis-ui/dist/fr/translation.json';
|
|
6
|
-
import {} from 'i18next';
|
|
7
|
-
import HowlerPlugin from '@cccsaurora/howler-ui/plugins/HowlerPlugin';
|
|
8
|
-
import BorealisChip from './components/BorealisChip';
|
|
9
|
-
import BorealisLeadForm from './components/BorealisLeadForm';
|
|
10
|
-
import BorealisPivot from './components/BorealisPivot';
|
|
11
|
-
import BorealisPivotForm from './components/BorealisPivotForm';
|
|
12
|
-
import BorealisTypography from './components/BorealisTypography';
|
|
13
|
-
import HELPERS from './helpers';
|
|
14
|
-
import Provider from './Provider';
|
|
15
|
-
import useSetup from './setup';
|
|
16
|
-
class BorealisPlugin extends HowlerPlugin {
|
|
17
|
-
name = 'BorealisPlugin';
|
|
18
|
-
version = '0.0.1';
|
|
19
|
-
author = 'Matthew Rafuse <matthew.rafuse@cyber.gc.ca>';
|
|
20
|
-
description = 'This plugin enables borealis enrichment in Howler.';
|
|
21
|
-
activate() {
|
|
22
|
-
super.activate();
|
|
23
|
-
super.addLead('borealis', props => _jsx(BorealisLeadForm, { ...props }), (content, metadata) => (_jsx(Box, { p: 1, flex: 1, display: "flex", alignItems: "stretch", children: _jsx(Fetcher, { fetcherId: content, ...JSON.parse(metadata) }) })));
|
|
24
|
-
super.addPivot('borealis', props => _jsx(BorealisPivotForm, { ...props }), props => _jsx(BorealisPivot, { ...props }));
|
|
25
|
-
}
|
|
26
|
-
provider() {
|
|
27
|
-
return Provider;
|
|
28
|
-
}
|
|
29
|
-
setup() {
|
|
30
|
-
return useSetup;
|
|
31
|
-
}
|
|
32
|
-
localization(i18nInstance) {
|
|
33
|
-
i18nInstance.addResourceBundle('en', 'borealis', borealisEN, true, true);
|
|
34
|
-
i18nInstance.addResourceBundle('fr', 'borealis', borealisFR, true, true);
|
|
35
|
-
}
|
|
36
|
-
helpers() {
|
|
37
|
-
return HELPERS;
|
|
38
|
-
}
|
|
39
|
-
typography(_props) {
|
|
40
|
-
return _jsx(BorealisTypography, { ..._props });
|
|
41
|
-
}
|
|
42
|
-
chip(_props) {
|
|
43
|
-
return _jsx(BorealisChip, { ..._props });
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
export default BorealisPlugin;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"route.dossiers.manager.borealis": "Borealis Fetcher ID",
|
|
3
|
-
"route.dossiers.manager.borealis.type": "Selector Type",
|
|
4
|
-
"route.dossiers.manager.borealis.value": "Selector Value",
|
|
5
|
-
"route.dossiers.manager.borealis.value.custom": "Custom Selector Value",
|
|
6
|
-
"route.dossiers.manager.borealis.value.description": "You can use handlebars notation to insert fields from the corresponding alert (i.e. {{howler.id}})."
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"route.dossiers.manager.borealis": "ID du sélecteur Borealis",
|
|
3
|
-
"route.dossiers.manager.borealis.type": "Type de sélecteur",
|
|
4
|
-
"route.dossiers.manager.borealis.value": "Valeur du sélecteur",
|
|
5
|
-
"route.dossiers.manager.borealis.value.custom": "Valeur du sélecteur personnalisé",
|
|
6
|
-
"route.dossiers.manager.borealis.value.description": "Vous pouvez utiliser la notation « handlebars » pour insérer des champs à partir de l'alerte correspondante (c'est-à-dire {{howler.id}})."
|
|
7
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { SNACKBAR_EVENT_ID, useBorealis } from 'borealis-ui';
|
|
2
|
-
import { useAppUser } from '@cccsaurora/howler-ui/commons/components/app/hooks';
|
|
3
|
-
import { ApiConfigContext } from '@cccsaurora/howler-ui/components/app/providers/ApiConfigProvider';
|
|
4
|
-
import useMySnackbar from '@cccsaurora/howler-ui/components/hooks/useMySnackbar';
|
|
5
|
-
import { useContext, useEffect } from 'react';
|
|
6
|
-
const useSetup = () => {
|
|
7
|
-
const borealis = useBorealis();
|
|
8
|
-
const appUser = useAppUser();
|
|
9
|
-
const apiConfig = useContext(ApiConfigContext);
|
|
10
|
-
const { showSuccessMessage, showErrorMessage, showInfoMessage, showWarningMessage } = useMySnackbar();
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
// eslint-disable-next-line no-console
|
|
13
|
-
console.debug('Initializing borealis snackbar event handler');
|
|
14
|
-
const handleMessage = (event) => {
|
|
15
|
-
const { detail } = event;
|
|
16
|
-
if (detail.level === 'success') {
|
|
17
|
-
showSuccessMessage(detail.message, detail.timeout, detail.options);
|
|
18
|
-
}
|
|
19
|
-
else if (detail.level === 'error') {
|
|
20
|
-
showErrorMessage(detail.message, detail.timeout, detail.options);
|
|
21
|
-
}
|
|
22
|
-
else if (detail.level === 'info') {
|
|
23
|
-
showInfoMessage(detail.message, detail.timeout, detail.options);
|
|
24
|
-
}
|
|
25
|
-
else if (detail.level === 'warning') {
|
|
26
|
-
showWarningMessage(detail.message, detail.timeout, detail.options);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
window.addEventListener(SNACKBAR_EVENT_ID, handleMessage);
|
|
30
|
-
return () => {
|
|
31
|
-
window.removeEventListener(SNACKBAR_EVENT_ID, handleMessage);
|
|
32
|
-
};
|
|
33
|
-
}, [showErrorMessage, showInfoMessage, showSuccessMessage, showWarningMessage]);
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
if (!appUser.isReady()) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (apiConfig.config.configuration?.features?.borealis) {
|
|
39
|
-
borealis.setReady(true);
|
|
40
|
-
}
|
|
41
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
|
-
}, [apiConfig.config.configuration?.features?.borealis, appUser.isReady()]);
|
|
43
|
-
};
|
|
44
|
-
export default useSetup;
|