@cccsaurora/howler-ui 2.13.0-dev.96 → 2.13.1
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/api/hit/index.d.ts +1 -1
- package/api/hit/index.js +6 -2
- package/api/search/index.d.ts +1 -0
- package/api/view/index.d.ts +1 -1
- package/api/view/index.js +2 -2
- package/commons/components/notification/elements/item/NotificationItemDate.js +2 -2
- package/commons/components/utils/hooks/useEnv.d.ts +1 -1
- package/components/app/App.js +1 -3
- package/components/app/drawers/ApiKeyDrawer.js +4 -4
- package/components/app/hooks/useMatchers.d.ts +9 -0
- package/components/app/hooks/useMatchers.js +82 -0
- package/components/app/hooks/useMatchers.test.d.ts +1 -0
- package/components/app/hooks/useMatchers.test.js +237 -0
- package/components/app/hooks/useTitle.js +5 -4
- package/components/app/providers/AnalyticProvider.d.ts +0 -4
- package/components/app/providers/AnalyticProvider.js +1 -44
- package/components/app/providers/ApiConfigProvider.js +2 -1
- package/components/app/providers/HitProvider.d.ts +2 -1
- package/components/app/providers/HitProvider.js +8 -2
- package/components/app/providers/HitSearchProvider.d.ts +2 -1
- package/components/app/providers/HitSearchProvider.js +2 -1
- package/components/app/providers/SocketProvider.js +1 -1
- package/components/app/providers/ViewProvider.d.ts +1 -1
- package/components/app/providers/ViewProvider.js +3 -3
- package/components/app/providers/ViewProvider.test.d.ts +1 -0
- package/components/app/providers/ViewProvider.test.js +150 -0
- package/components/elements/display/ActionButton.d.ts +8 -0
- package/components/elements/display/ActionButton.js +18 -0
- package/components/elements/display/handlebars/helpers.js +17 -2
- package/components/elements/display/json/JSONViewer.d.ts +2 -0
- package/components/elements/display/json/JSONViewer.js +6 -13
- package/components/elements/hit/HitActions.js +4 -6
- package/components/elements/hit/HitBanner.js +13 -5
- package/components/elements/hit/HitCard.js +0 -5
- package/components/elements/hit/HitComments.js +5 -4
- package/components/elements/hit/HitOutline.d.ts +2 -2
- package/components/elements/hit/HitOutline.js +11 -21
- package/components/elements/hit/HitOverview.js +7 -4
- package/components/elements/hit/HitSummary.d.ts +2 -1
- package/components/elements/hit/HitSummary.js +8 -7
- package/components/elements/hit/aggregate/HitGraph.d.ts +1 -1
- package/components/elements/hit/aggregate/HitGraph.js +7 -7
- package/components/elements/hit/elements/HitTimestamp.js +8 -8
- package/components/elements/hit/related/PivotLink.js +11 -5
- package/components/elements/hit/related/RelatedIcon.d.ts +8 -0
- package/components/elements/hit/related/RelatedIcon.js +32 -0
- package/components/elements/hit/related/RelatedLink.js +4 -25
- package/components/hooks/useMyChart.d.ts +1 -1
- package/components/hooks/useMyChart.js +1 -1
- package/components/routes/advanced/QueryBuilder.js +47 -11
- package/components/routes/advanced/QueryEditor.js +8 -13
- package/components/routes/analytics/AnalyticOverview.d.ts +1 -1
- package/components/routes/analytics/AnalyticOverview.js +1 -1
- package/components/routes/analytics/AnalyticOverviews.d.ts +1 -1
- package/components/routes/analytics/AnalyticOverviews.js +1 -1
- package/components/routes/analytics/AnalyticSearch.js +14 -2
- package/components/routes/analytics/AnalyticTemplates.d.ts +1 -1
- package/components/routes/analytics/AnalyticTemplates.js +10 -7
- package/components/routes/analytics/RuleView.d.ts +1 -1
- package/components/routes/analytics/RuleView.js +1 -1
- package/components/routes/analytics/TriageSettings.d.ts +1 -1
- package/components/routes/analytics/TriageSettings.js +1 -1
- package/components/routes/analytics/widgets/Assessment.d.ts +1 -1
- package/components/routes/analytics/widgets/Assessment.js +1 -1
- package/components/routes/analytics/widgets/Created.d.ts +1 -1
- package/components/routes/analytics/widgets/Created.js +1 -1
- package/components/routes/analytics/widgets/Detection.d.ts +1 -1
- package/components/routes/analytics/widgets/Detection.js +1 -1
- package/components/routes/analytics/widgets/Escalation.d.ts +1 -1
- package/components/routes/analytics/widgets/Escalation.js +1 -1
- package/components/routes/analytics/widgets/Stacked.d.ts +1 -1
- package/components/routes/analytics/widgets/Stacked.js +1 -1
- package/components/routes/analytics/widgets/Status.d.ts +1 -1
- package/components/routes/analytics/widgets/Status.js +1 -1
- package/components/routes/help/SearchDocumentation.js +2 -1
- package/components/routes/help/TemplateDocumentation.js +5 -5
- package/components/routes/hits/search/HitBrowser.js +2 -2
- package/components/routes/hits/search/HitContextMenu.js +6 -7
- package/components/routes/hits/search/HitQuery.js +2 -1
- package/components/routes/hits/search/InformationPane.js +75 -78
- package/components/routes/hits/search/SearchPane.js +3 -9
- package/components/routes/hits/search/grid/AddColumnModal.js +10 -5
- package/components/routes/hits/search/grid/HitGrid.js +6 -5
- package/components/routes/hits/search/shared/CustomSpan.js +6 -6
- package/components/routes/hits/view/HitViewer.js +18 -26
- package/components/routes/home/index.js +4 -4
- package/components/routes/overviews/OverviewViewer.js +33 -31
- package/components/routes/settings/SecuritySection.js +2 -2
- package/components/routes/templates/TemplateViewer.js +27 -36
- package/components/routes/templates/Templates.js +4 -11
- package/components/routes/views/ViewComposer.js +8 -1
- package/components/routes/views/Views.js +25 -9
- package/index.js +7 -0
- package/locales/en/help/search.json +17 -0
- package/locales/en/translation.json +12 -3
- package/locales/fr/help/search.json +17 -0
- package/locales/fr/translation.json +12 -4
- package/models/WithMetadata.d.ts +10 -0
- package/models/WithMetadata.js +1 -0
- package/models/entities/generated/ApiType.d.ts +7 -0
- package/package.json +112 -111
- package/plugins/borealis/components/BorealisTypography.js +4 -2
- package/setupTests.d.ts +1 -0
- package/setupTests.js +12 -0
- package/tests/MockLocalStorage.d.ts +5 -0
- package/tests/MockLocalStorage.js +44 -0
- package/tests/server-handlers.d.ts +5 -0
- package/tests/server-handlers.js +97 -0
- package/tests/server.d.ts +3 -0
- package/tests/server.js +5 -0
- package/utils/constants.js +2 -2
- package/utils/stringUtils.d.ts +1 -0
- package/utils/stringUtils.js +9 -0
- package/utils/utils.js +3 -3
- package/components/app/providers/DossierProvider.d.ts +0 -16
- package/components/app/providers/DossierProvider.js +0 -82
- package/components/app/providers/TemplateProvider.d.ts +0 -14
- package/components/app/providers/TemplateProvider.js +0 -103
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Checkbox, Divider, Grid, Paper, Stack, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Tooltip, Typography } from '@mui/material';
|
|
3
3
|
import api from '@cccsaurora/howler-ui/api';
|
|
4
|
-
import 'chartjs-adapter-
|
|
4
|
+
import 'chartjs-adapter-dayjs-4';
|
|
5
5
|
import { ApiConfigContext } from '@cccsaurora/howler-ui/components/app/providers/ApiConfigProvider';
|
|
6
6
|
import EditRow from '@cccsaurora/howler-ui/components/elements/EditRow';
|
|
7
7
|
import useMyApi from '@cccsaurora/howler-ui/components/hooks/useMyApi';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Skeleton, Typography } from '@mui/material';
|
|
3
3
|
import api from '@cccsaurora/howler-ui/api';
|
|
4
|
-
import 'chartjs-adapter-
|
|
4
|
+
import 'chartjs-adapter-dayjs-4';
|
|
5
5
|
import useMyChart from '@cccsaurora/howler-ui/components/hooks/useMyChart';
|
|
6
6
|
import { forwardRef, useEffect, useState } from 'react';
|
|
7
7
|
import { Bar } from 'react-chartjs-2';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Skeleton } from '@mui/material';
|
|
3
3
|
import api from '@cccsaurora/howler-ui/api';
|
|
4
|
-
import 'chartjs-adapter-
|
|
4
|
+
import 'chartjs-adapter-dayjs-4';
|
|
5
5
|
import useMyChart from '@cccsaurora/howler-ui/components/hooks/useMyChart';
|
|
6
6
|
import { forwardRef, useEffect, useState } from 'react';
|
|
7
7
|
import { Line } from 'react-chartjs-2';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Skeleton, useTheme } from '@mui/material';
|
|
3
3
|
import api from '@cccsaurora/howler-ui/api';
|
|
4
|
-
import 'chartjs-adapter-
|
|
4
|
+
import 'chartjs-adapter-dayjs-4';
|
|
5
5
|
import useMyChart from '@cccsaurora/howler-ui/components/hooks/useMyChart';
|
|
6
6
|
import { forwardRef, useEffect, useMemo, useState } from 'react';
|
|
7
7
|
import { Doughnut } from 'react-chartjs-2';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Skeleton } from '@mui/material';
|
|
3
3
|
import api from '@cccsaurora/howler-ui/api';
|
|
4
|
-
import 'chartjs-adapter-
|
|
4
|
+
import 'chartjs-adapter-dayjs-4';
|
|
5
5
|
import useMyChart from '@cccsaurora/howler-ui/components/hooks/useMyChart';
|
|
6
6
|
import sum from 'lodash-es/sum';
|
|
7
7
|
import { forwardRef, useCallback, useEffect, useMemo, useState } from 'react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useTheme } from '@mui/material';
|
|
3
|
-
import 'chartjs-adapter-
|
|
3
|
+
import 'chartjs-adapter-dayjs-4';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { STATUS_COLORS } from '@cccsaurora/howler-ui/utils/constants';
|
|
6
6
|
import Stacked from './Stacked';
|
|
@@ -60,6 +60,7 @@ const TOC_CONFIGS = [
|
|
|
60
60
|
id: 'fields',
|
|
61
61
|
subItems: [{ id: 'fields.legend' }, { id: 'fields.idx_hit' }, { id: 'fields.idx_user', is_admin: true }]
|
|
62
62
|
},
|
|
63
|
+
{ id: 'text vs keywords' },
|
|
63
64
|
{ id: 'wildcard' },
|
|
64
65
|
{
|
|
65
66
|
id: 'regex',
|
|
@@ -108,6 +109,6 @@ const SearchDocumentation = () => {
|
|
|
108
109
|
return (_jsx(PageCenterRoot, { margin: 4, width: "100%", maxWidth: "1750px", textAlign: "left", children: _jsxs(Stack, { sx: { flexDirection: useHorizontal ? 'column' : 'row', '& h1': { mt: 0 } }, children: [_jsx(HelpTabs, { value: location.hash || '#overview', children: TOC_CONFIGS.flatMap(value => [
|
|
109
110
|
_jsx(Tab, { href: `#${value.id}`, label: _jsx(Typography, { variant: "caption", children: t(value.id) }), value: `#${value.id}` }, value.id),
|
|
110
111
|
...(!useHorizontal && value.subItems ? value.subItems : []).map(subItem => (!subItem.is_admin || user.is_admin) && (_jsx(Tab, { sx: { '& > span': { pl: 1 } }, href: `#${subItem.id}`, label: _jsx(Typography, { variant: "caption", children: t(subItem.id) }), value: `#${subItem.id}` }, subItem.id)))
|
|
111
|
-
]) }), _jsxs(Box, { children: [_jsx(Typography, { variant: "h4", children: t('title') }), _jsx(Typography, { variant: "subtitle2", children: t('subtitle') }), _jsxs(Paragraph, { id: "overview", children: [_jsx(Typography, { variant: "h5", children: t('overview') }), _jsx(_Fragment, { children: t('overview.text') })] }), _jsxs(Paragraph, { id: "basic", children: [_jsx(Typography, { variant: "h5", children: t('basic') }), _jsx(_Fragment, { children: t('basic.text') }), _jsx(Typography, { variant: "subtitle2", className: "padded", children: t('exemples') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('basic.ex1') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('basic.ex2') })] }), _jsxs(Paragraph, { id: "fields", children: [_jsx(Typography, { variant: "h5", children: t('fields') }), _jsx(_Fragment, { children: t('fields.text') }), _jsx(Typography, { variant: "subtitle2", className: "padded", children: t('exemples') }), _jsxs("ul", { className: "multipleEx", children: [_jsxs("li", { children: [t('fields.ex1.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('fields.ex1') })] }), _jsxs("li", { children: [t('fields.ex2.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('fields.ex2') })] }), _jsxs("li", { children: [t('fields.ex3.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('fields.ex3') })] }), _jsxs("li", { children: [t('fields.ex4.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('fields.ex4') })] }), _jsxs("li", { children: [t('fields.ex5.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('fields.ex5') })] })] }), _jsx("div", { className: "padded", children: t('fields.text2') }), _jsxs("div", { children: [_jsx("b", { children: _jsx("i", { children: `${t('fields.important')}:` }) }), ` ${t('fields.important.text')}`] })] }), _jsxs(Paragraph, { id: "fields.legend", children: [_jsx(Typography, { variant: "h6", children: t('fields.legend') }), _jsx(_Fragment, { children: t('fields.legend.text') }), _jsxs("ul", { children: [_jsxs("li", { children: [_jsx("b", { children: 'text' }), `: ${t('fields.legend.text_field')}`] }), _jsxs("li", { children: [_jsx("b", { children: 'ip' }), `: ${t('fields.legend.ip_field')}`] }), _jsxs("li", { children: [_jsx(SquareChip, { color: "primary", size: "small", label: t('fields.att.default') }), ":", ' ', t('fields.legend.default')] }), _jsxs("li", { children: [_jsx(SquareChip, { color: "warning", size: "small", label: t('fields.att.list') }), ": ", t('fields.legend.list')] }), _jsxs("li", { children: [_jsx(SquareChip, { color: "info", size: "small", label: t('fields.att.stored') }), ": ", t('fields.legend.stored')] })] })] }), Object.keys(indexes).map(idx => (_jsxs(Accordion, { sx: { mb: 2, backgroundColor: 'background.paper' }, children: [_jsx(AccordionSummary, { expandIcon: _jsx(ExpandMore, {}), children: _jsx(Typography, { variant: "h6", children: t(`fields.idx_${idx}`) }) }), _jsx(AccordionDetails, { sx: { px: '0 !important', mt: -6 }, children: _jsx(Paragraph, { id: `fields.idx_${idx}`, children: _jsx(TableRoot, { children: _jsxs(Table, { size: "small", children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { children: t('fields.table.name') }), _jsx(TableCell, { children: t('fields.table.type') }), _jsx(TableCell, { children: t('fields.table.attrib') })] }) }), _jsx(TableBody, { children: Object.keys(indexes[idx]).map(field => indexes[idx][field].indexed && (_jsxs(TableRow, { hover: true, children: [_jsx(TableCell, { width: "50%", style: { wordBreak: 'break-word' }, children: field }), _jsx(TableCell, { children: indexes[idx][field].type }), _jsxs(TableCell, { children: [indexes[idx][field].stored && (_jsx(SquareChip, { color: "info", size: "small", label: t('fields.att.stored') })), indexes[idx][field].list && (_jsx(SquareChip, { color: "warning", size: "small", label: t('fields.att.list') })), indexes[idx][field].default && (_jsx(SquareChip, { color: "primary", size: "small", label: t('fields.att.default') }))] })] }, field))) })] }) }) }) })] }, idx))), _jsxs(Paragraph, { id: "wildcard", children: [_jsx(Typography, { variant: "h5", children: t('wildcard') }), _jsx("div", { className: "padded", children: t('wildcard.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('wildcard.ex') }), _jsx("div", { className: "padded", children: t('wildcard.text2') }), _jsxs("div", { children: [_jsx("b", { children: _jsx("i", { children: `${t('wildcard.note')}:` }) }), ` ${t('wildcard.note.text')}`] })] }), _jsxs(Paragraph, { id: "regex", children: [_jsx(Typography, { variant: "h5", children: t('regex') }), _jsx("div", { className: "padded", children: t('regex.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.ex') }), _jsx("div", { children: _jsx("b", { children: _jsx("i", { children: t('regex.warning') }) }) }), _jsx("div", { className: "padded", children: t('regex.warning.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.warning.ex') }), _jsx("div", { className: "padded", children: t('regex.warning.follow') })] }), _jsxs(Paragraph, { id: "regex.anchoring", children: [_jsx(Typography, { variant: "h6", children: t('regex.anchoring') }), _jsx("div", { className: "padded", children: t('regex.anchoring.text') }), _jsx("div", { className: "padded", children: t('regex.anchoring.text2') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.anchoring.ex') })] }), _jsxs(Paragraph, { id: "regex.chars", children: [_jsx(Typography, { variant: "h6", children: t('regex.chars') }), _jsx("div", { className: "padded", children: t('regex.chars.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.chars.ex') }), _jsx("div", { className: "padded", children: t('regex.chars.text2') }), _jsx("div", { className: "padded", children: t('regex.chars.text3') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.chars.ex2') })] }), _jsxs(Paragraph, { id: "regex.any", children: [_jsx(Typography, { variant: "h6", children: t('regex.any') }), _jsx("div", { className: "padded", children: t('regex.any.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.any.ex') })] }), _jsxs(Paragraph, { id: "regex.oneplus", children: [_jsx(Typography, { variant: "h6", children: t('regex.oneplus') }), _jsx("div", { className: "padded", children: t('regex.oneplus.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.oneplus.ex') })] }), _jsxs(Paragraph, { id: "regex.zeroplus", children: [_jsx(Typography, { variant: "h6", children: t('regex.zeroplus') }), _jsx("div", { className: "padded", children: t('regex.zeroplus.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.zeroplus.ex') })] }), _jsxs(Paragraph, { id: "regex.zeroone", children: [_jsx(Typography, { variant: "h6", children: t('regex.zeroone') }), _jsx("div", { className: "padded", children: t('regex.zeroone.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.zeroone.ex') })] }), _jsxs(Paragraph, { id: "regex.minmax", children: [_jsx(Typography, { variant: "h6", children: t('regex.minmax') }), _jsx("div", { className: "padded", children: t('regex.minmax.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.minmax.ex') }), _jsx("div", { className: "padded", children: t('regex.minmax.text2') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.minmax.ex2') })] }), _jsxs(Paragraph, { id: "regex.grouping", children: [_jsx(Typography, { variant: "h6", children: t('regex.grouping') }), _jsx("div", { className: "padded", children: t('regex.grouping.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.grouping.ex') })] }), _jsxs(Paragraph, { id: "regex.alternation", children: [_jsx(Typography, { variant: "h6", children: t('regex.alternation') }), _jsx("div", { className: "padded", children: t('regex.alternation.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.alternation.ex') })] }), _jsxs(Paragraph, { id: "regex.class", children: [_jsx(Typography, { variant: "h6", children: t('regex.class') }), _jsx("div", { className: "padded", children: t('regex.class.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.class.ex') }), _jsx("div", { className: "padded", children: t('regex.class.text2') }), _jsx("div", { className: "padded", children: t('regex.class.text3') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.class.ex2') })] }), _jsxs(Paragraph, { id: "fuzziness", children: [_jsx(Typography, { variant: "h5", children: t('fuzziness') }), _jsx("div", { className: "padded", children: t('fuzziness.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('fuzziness.ex') }), _jsx("div", { className: "padded", children: t('fuzziness.text2') }), _jsx("div", { className: "padded", children: t('fuzziness.text3') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('fuzziness.ex2') })] }), _jsxs(Paragraph, { id: "proximity", children: [_jsx(Typography, { variant: "h5", children: t('proximity') }), _jsx("div", { className: "padded", children: t('proximity.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('proximity.ex') }), _jsx("div", { className: "padded", children: t('proximity.text2') })] }), _jsxs(Paragraph, { id: "ranges", children: [_jsx(Typography, { variant: "h5", children: t('ranges') }), _jsx(_Fragment, { children: t('ranges.text') }), _jsx(Typography, { variant: "subtitle2", className: "padded", children: t('exemples') }), _jsxs("ul", { className: "multipleEx", children: [_jsxs("li", { children: [t('ranges.ex1.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex1') })] }), _jsxs("li", { children: [t('ranges.ex2.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex2') })] }), _jsxs("li", { children: [t('ranges.ex3.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex3') })] }), _jsxs("li", { children: [t('ranges.ex4.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex4') })] }), _jsxs("li", { children: [t('ranges.ex5.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex5') })] }), _jsxs("li", { children: [t('ranges.ex6.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex6') })] }), _jsxs("li", { children: [t('ranges.ex7.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex7') })] })] }), _jsx("div", { className: "padded", children: t('ranges.text2') }), _jsx("ul", { className: "multipleEx", children: _jsxs("li", { children: [t('ranges.ex8.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex8') })] }) }), _jsx("div", { className: "padded", children: t('ranges.text3') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex9') }), _jsx("div", { className: "padded", children: t('ranges.text4') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex10') })] }), _jsxs(Paragraph, { id: "ranges.datemath", children: [_jsx(Typography, { variant: "h6", children: t('ranges.datemath') }), _jsx("div", { className: "padded", children: t('ranges.datemath.text') }), _jsxs("ul", { children: [_jsx("li", { children: t('ranges.datemath.list1') }), _jsx("li", { children: t('ranges.datemath.list2') }), _jsx("li", { children: t('ranges.datemath.list3') })] }), _jsx("div", { className: "padded", children: t('ranges.datemath.text2') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.datemath.ex1') }), _jsx("div", { className: "padded", children: t('ranges.datemath.text3') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.datemath.ex2') })] }), _jsxs(Paragraph, { id: "operator", children: [_jsx(Typography, { variant: "h5", children: t('operator') }), _jsx("div", { className: "padded", children: t('operator.text') }), _jsx("div", { className: "padded", children: t('operator.text2') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('operator.ex1') }), _jsx("div", { className: "padded", children: t('operator.text3') }), _jsxs("ul", { children: [_jsx("li", { children: t('operator.list1') }), _jsx("li", { children: t('operator.list2') }), _jsx("li", { children: t('operator.list3') })] }), _jsx("div", { className: "padded", children: t('operator.text4') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('operator.ex2') }), _jsx("div", { className: "padded", children: t('operator.text5') })] }), _jsxs(Paragraph, { id: "grouping", children: [_jsx(Typography, { variant: "h5", children: t('grouping') }), _jsx("div", { className: "padded", children: t('grouping.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('grouping.ex') }), _jsx("div", { className: "padded", children: t('grouping.text2') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('grouping.ex2') })] }), _jsxs(Paragraph, { id: "reserved", children: [_jsx(Typography, { variant: "h5", children: t('reserved') }), _jsx("div", { className: "padded", children: t('reserved.text') }), _jsx("div", { className: "padded", children: t('reserved.text2') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('reserved.ex') }), _jsx("div", { className: "padded", children: t('reserved.text3') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('reserved.ex2') }), _jsx("div", { className: "padded", children: t('reserved.text4') }), _jsxs("div", { className: "padded", children: [_jsx("b", { children: _jsx("i", { children: t('reserved.note') }) }), `: ${t('reserved.text5')}`] })] })] })] }) }));
|
|
112
|
+
]) }), _jsxs(Box, { children: [_jsx(Typography, { variant: "h4", children: t('title') }), _jsx(Typography, { variant: "subtitle2", children: t('subtitle') }), _jsxs(Paragraph, { id: "overview", children: [_jsx(Typography, { variant: "h5", children: t('overview') }), _jsx(_Fragment, { children: t('overview.text') })] }), _jsxs(Paragraph, { id: "basic", children: [_jsx(Typography, { variant: "h5", children: t('basic') }), _jsx(_Fragment, { children: t('basic.text') }), _jsx(Typography, { variant: "subtitle2", className: "padded", children: t('exemples') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('basic.ex1') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('basic.ex2') })] }), _jsxs(Paragraph, { id: "fields", children: [_jsx(Typography, { variant: "h5", children: t('fields') }), _jsx(_Fragment, { children: t('fields.text') }), _jsx(Typography, { variant: "subtitle2", className: "padded", children: t('exemples') }), _jsxs("ul", { className: "multipleEx", children: [_jsxs("li", { children: [t('fields.ex1.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('fields.ex1') })] }), _jsxs("li", { children: [t('fields.ex2.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('fields.ex2') })] }), _jsxs("li", { children: [t('fields.ex3.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('fields.ex3') })] }), _jsxs("li", { children: [t('fields.ex4.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('fields.ex4') })] }), _jsxs("li", { children: [t('fields.ex5.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('fields.ex5') })] })] }), _jsx("div", { className: "padded", children: t('fields.text2') }), _jsxs("div", { children: [_jsx("b", { children: _jsx("i", { children: `${t('fields.important')}:` }) }), ` ${t('fields.important.text')}`] })] }), _jsxs(Paragraph, { id: "text vs keywords", children: [_jsx(Typography, { variant: "h5", children: t('fields.textvskeywords') }), _jsx(_Fragment, { children: t('fields.textvskeywords.description') }), _jsx(Typography, { variant: "subtitle2", className: "padded", children: t('fields.textvskeywords.keywordfamily') }), _jsxs("ul", { className: "multipleEx", children: [_jsxs("li", { children: [_jsx(Card, { variant: "outlined", className: "pre", children: t('fields.textvskeywords.wildcard') }), t('fields.textvskeywords.wildcard.description')] }), _jsxs("li", { children: [_jsx(Card, { variant: "outlined", className: "pre", children: t('fields.textvskeywords.keyword') }), t('fields.textvskeywords.keyword.description')] }), _jsxs("li", { children: [_jsx(Card, { variant: "outlined", className: "pre", children: t('fields.textvskeywords.constantkeyword') }), t('fields.textvskeywords.constantkeyword.description')] })] }), _jsxs(Typography, { variant: "subtitle2", className: "padded", children: [t('fields.textvskeywords.keyword.more.info'), ' ', _jsx("a", { href: "https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/keyword", style: { color: 'info', textDecoration: 'underline' }, children: "https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/keyword" })] }), _jsx(Typography, { variant: "subtitle2", className: "padded", children: t('fields.textvskeywords.textfamily') }), _jsxs("ul", { className: "multipleEx", children: [_jsxs("li", { children: [_jsx(Card, { variant: "outlined", className: "pre", children: t('fields.textvskeywords.text') }), t('fields.textvskeywords.text.description')] }), _jsxs("li", { children: [_jsx(Card, { variant: "outlined", className: "pre", children: t('fields.textvskeywords.matchonlytext') }), t('fields.textvskeywords.matchonlytext.description')] })] }), _jsxs(Typography, { variant: "subtitle2", className: "padded", children: [t('fields.textvskeywords.text.more.info'), ' ', _jsx("a", { href: "https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/text", style: { color: 'info', textDecoration: 'underline' }, children: "https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/text" })] }), _jsxs(Typography, { variant: "subtitle2", className: "padded", children: [t('fields.textvskeywords.text.keyword.compare'), ' ', _jsx("a", { href: "https://www.elastic.co/blog/strings-are-dead-long-live-strings", style: { color: 'info', textDecoration: 'underline' }, children: "https://www.elastic.co/blog/strings-are-dead-long-live-strings" })] }), _jsx("div", {})] }), _jsxs(Paragraph, { id: "fields.legend", children: [_jsx(Typography, { variant: "h6", children: t('fields.legend') }), _jsx(_Fragment, { children: t('fields.legend.text') }), _jsxs("ul", { children: [_jsxs("li", { children: [_jsx("b", { children: 'text' }), `: ${t('fields.legend.text_field')}`] }), _jsxs("li", { children: [_jsx("b", { children: 'ip' }), `: ${t('fields.legend.ip_field')}`] }), _jsxs("li", { children: [_jsx(SquareChip, { color: "primary", size: "small", label: t('fields.att.default') }), ":", ' ', t('fields.legend.default')] }), _jsxs("li", { children: [_jsx(SquareChip, { color: "warning", size: "small", label: t('fields.att.list') }), ": ", t('fields.legend.list')] }), _jsxs("li", { children: [_jsx(SquareChip, { color: "info", size: "small", label: t('fields.att.stored') }), ": ", t('fields.legend.stored')] })] })] }), Object.keys(indexes).map(idx => (_jsxs(Accordion, { sx: { mb: 2, backgroundColor: 'background.paper' }, children: [_jsx(AccordionSummary, { expandIcon: _jsx(ExpandMore, {}), children: _jsx(Typography, { variant: "h6", children: t(`fields.idx_${idx}`) }) }), _jsx(AccordionDetails, { sx: { px: '0 !important', mt: -6 }, children: _jsx(Paragraph, { id: `fields.idx_${idx}`, children: _jsx(TableRoot, { children: _jsxs(Table, { size: "small", children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { children: t('fields.table.name') }), _jsx(TableCell, { children: t('fields.table.type') }), _jsx(TableCell, { children: t('fields.table.attrib') })] }) }), _jsx(TableBody, { children: Object.keys(indexes[idx]).map(field => indexes[idx][field].indexed && (_jsxs(TableRow, { hover: true, children: [_jsx(TableCell, { width: "50%", style: { wordBreak: 'break-word' }, children: field }), _jsx(TableCell, { children: indexes[idx][field].type }), _jsxs(TableCell, { children: [indexes[idx][field].stored && (_jsx(SquareChip, { color: "info", size: "small", label: t('fields.att.stored') })), indexes[idx][field].list && (_jsx(SquareChip, { color: "warning", size: "small", label: t('fields.att.list') })), indexes[idx][field].default && (_jsx(SquareChip, { color: "primary", size: "small", label: t('fields.att.default') }))] })] }, field))) })] }) }) }) })] }, idx))), _jsxs(Paragraph, { id: "wildcard", children: [_jsx(Typography, { variant: "h5", children: t('wildcard') }), _jsx("div", { className: "padded", children: t('wildcard.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('wildcard.ex') }), _jsx("div", { className: "padded", children: t('wildcard.text2') }), _jsxs("div", { children: [_jsx("b", { children: _jsx("i", { children: `${t('wildcard.note')}:` }) }), ` ${t('wildcard.note.text')}`] })] }), _jsxs(Paragraph, { id: "regex", children: [_jsx(Typography, { variant: "h5", children: t('regex') }), _jsx("div", { className: "padded", children: t('regex.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.ex') }), _jsx("div", { children: _jsx("b", { children: _jsx("i", { children: t('regex.warning') }) }) }), _jsx("div", { className: "padded", children: t('regex.warning.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.warning.ex') }), _jsx("div", { className: "padded", children: t('regex.warning.follow') })] }), _jsxs(Paragraph, { id: "regex.anchoring", children: [_jsx(Typography, { variant: "h6", children: t('regex.anchoring') }), _jsx("div", { className: "padded", children: t('regex.anchoring.text') }), _jsx("div", { className: "padded", children: t('regex.anchoring.text2') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.anchoring.ex') })] }), _jsxs(Paragraph, { id: "regex.chars", children: [_jsx(Typography, { variant: "h6", children: t('regex.chars') }), _jsx("div", { className: "padded", children: t('regex.chars.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.chars.ex') }), _jsx("div", { className: "padded", children: t('regex.chars.text2') }), _jsx("div", { className: "padded", children: t('regex.chars.text3') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.chars.ex2') })] }), _jsxs(Paragraph, { id: "regex.any", children: [_jsx(Typography, { variant: "h6", children: t('regex.any') }), _jsx("div", { className: "padded", children: t('regex.any.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.any.ex') })] }), _jsxs(Paragraph, { id: "regex.oneplus", children: [_jsx(Typography, { variant: "h6", children: t('regex.oneplus') }), _jsx("div", { className: "padded", children: t('regex.oneplus.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.oneplus.ex') })] }), _jsxs(Paragraph, { id: "regex.zeroplus", children: [_jsx(Typography, { variant: "h6", children: t('regex.zeroplus') }), _jsx("div", { className: "padded", children: t('regex.zeroplus.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.zeroplus.ex') })] }), _jsxs(Paragraph, { id: "regex.zeroone", children: [_jsx(Typography, { variant: "h6", children: t('regex.zeroone') }), _jsx("div", { className: "padded", children: t('regex.zeroone.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.zeroone.ex') })] }), _jsxs(Paragraph, { id: "regex.minmax", children: [_jsx(Typography, { variant: "h6", children: t('regex.minmax') }), _jsx("div", { className: "padded", children: t('regex.minmax.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.minmax.ex') }), _jsx("div", { className: "padded", children: t('regex.minmax.text2') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.minmax.ex2') })] }), _jsxs(Paragraph, { id: "regex.grouping", children: [_jsx(Typography, { variant: "h6", children: t('regex.grouping') }), _jsx("div", { className: "padded", children: t('regex.grouping.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.grouping.ex') })] }), _jsxs(Paragraph, { id: "regex.alternation", children: [_jsx(Typography, { variant: "h6", children: t('regex.alternation') }), _jsx("div", { className: "padded", children: t('regex.alternation.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.alternation.ex') })] }), _jsxs(Paragraph, { id: "regex.class", children: [_jsx(Typography, { variant: "h6", children: t('regex.class') }), _jsx("div", { className: "padded", children: t('regex.class.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.class.ex') }), _jsx("div", { className: "padded", children: t('regex.class.text2') }), _jsx("div", { className: "padded", children: t('regex.class.text3') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('regex.class.ex2') })] }), _jsxs(Paragraph, { id: "fuzziness", children: [_jsx(Typography, { variant: "h5", children: t('fuzziness') }), _jsx("div", { className: "padded", children: t('fuzziness.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('fuzziness.ex') }), _jsx("div", { className: "padded", children: t('fuzziness.text2') }), _jsx("div", { className: "padded", children: t('fuzziness.text3') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('fuzziness.ex2') })] }), _jsxs(Paragraph, { id: "proximity", children: [_jsx(Typography, { variant: "h5", children: t('proximity') }), _jsx("div", { className: "padded", children: t('proximity.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('proximity.ex') }), _jsx("div", { className: "padded", children: t('proximity.text2') })] }), _jsxs(Paragraph, { id: "ranges", children: [_jsx(Typography, { variant: "h5", children: t('ranges') }), _jsx(_Fragment, { children: t('ranges.text') }), _jsx(Typography, { variant: "subtitle2", className: "padded", children: t('exemples') }), _jsxs("ul", { className: "multipleEx", children: [_jsxs("li", { children: [t('ranges.ex1.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex1') })] }), _jsxs("li", { children: [t('ranges.ex2.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex2') })] }), _jsxs("li", { children: [t('ranges.ex3.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex3') })] }), _jsxs("li", { children: [t('ranges.ex4.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex4') })] }), _jsxs("li", { children: [t('ranges.ex5.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex5') })] }), _jsxs("li", { children: [t('ranges.ex6.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex6') })] }), _jsxs("li", { children: [t('ranges.ex7.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex7') })] })] }), _jsx("div", { className: "padded", children: t('ranges.text2') }), _jsx("ul", { className: "multipleEx", children: _jsxs("li", { children: [t('ranges.ex8.title'), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex8') })] }) }), _jsx("div", { className: "padded", children: t('ranges.text3') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex9') }), _jsx("div", { className: "padded", children: t('ranges.text4') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.ex10') })] }), _jsxs(Paragraph, { id: "ranges.datemath", children: [_jsx(Typography, { variant: "h6", children: t('ranges.datemath') }), _jsx("div", { className: "padded", children: t('ranges.datemath.text') }), _jsxs("ul", { children: [_jsx("li", { children: t('ranges.datemath.list1') }), _jsx("li", { children: t('ranges.datemath.list2') }), _jsx("li", { children: t('ranges.datemath.list3') })] }), _jsx("div", { className: "padded", children: t('ranges.datemath.text2') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.datemath.ex1') }), _jsx("div", { className: "padded", children: t('ranges.datemath.text3') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('ranges.datemath.ex2') })] }), _jsxs(Paragraph, { id: "operator", children: [_jsx(Typography, { variant: "h5", children: t('operator') }), _jsx("div", { className: "padded", children: t('operator.text') }), _jsx("div", { className: "padded", children: t('operator.text2') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('operator.ex1') }), _jsx("div", { className: "padded", children: t('operator.text3') }), _jsxs("ul", { children: [_jsx("li", { children: t('operator.list1') }), _jsx("li", { children: t('operator.list2') }), _jsx("li", { children: t('operator.list3') })] }), _jsx("div", { className: "padded", children: t('operator.text4') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('operator.ex2') }), _jsx("div", { className: "padded", children: t('operator.text5') })] }), _jsxs(Paragraph, { id: "grouping", children: [_jsx(Typography, { variant: "h5", children: t('grouping') }), _jsx("div", { className: "padded", children: t('grouping.text') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('grouping.ex') }), _jsx("div", { className: "padded", children: t('grouping.text2') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('grouping.ex2') })] }), _jsxs(Paragraph, { id: "reserved", children: [_jsx(Typography, { variant: "h5", children: t('reserved') }), _jsx("div", { className: "padded", children: t('reserved.text') }), _jsx("div", { className: "padded", children: t('reserved.text2') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('reserved.ex') }), _jsx("div", { className: "padded", children: t('reserved.text3') }), _jsx(Card, { variant: "outlined", className: "pre", children: t('reserved.ex2') }), _jsx("div", { className: "padded", children: t('reserved.text4') }), _jsxs("div", { className: "padded", children: [_jsx("b", { children: _jsx("i", { children: t('reserved.note') }) }), `: ${t('reserved.text5')}`] })] })] })] }) }));
|
|
112
113
|
};
|
|
113
114
|
export default SearchDocumentation;
|
|
@@ -5,7 +5,7 @@ import Markdown from '@cccsaurora/howler-ui/components/elements/display/Markdown
|
|
|
5
5
|
import { HitLayout } from '@cccsaurora/howler-ui/components/elements/hit/HitLayout';
|
|
6
6
|
import DefaultOutline from '@cccsaurora/howler-ui/components/elements/hit/outlines/DefaultOutline';
|
|
7
7
|
import { useScrollRestoration } from '@cccsaurora/howler-ui/components/hooks/useScrollRestoration';
|
|
8
|
-
import
|
|
8
|
+
import dayjs from 'dayjs';
|
|
9
9
|
import { useMemo } from 'react';
|
|
10
10
|
import { useTranslation } from 'react-i18next';
|
|
11
11
|
import TEMPLATES_EN from './markdown/en/templates.md';
|
|
@@ -14,8 +14,8 @@ const ALERTS = [
|
|
|
14
14
|
{
|
|
15
15
|
howler: { id: 'hit1', analytic: 'Cat Checker', detection: 'Listening for Meows' },
|
|
16
16
|
event: {
|
|
17
|
-
start:
|
|
18
|
-
end:
|
|
17
|
+
start: dayjs().subtract(4, 'hour').toString(),
|
|
18
|
+
end: dayjs().subtract(3, 'hour').toString(),
|
|
19
19
|
kind: 'Loud meow',
|
|
20
20
|
outcome: 'Food provided'
|
|
21
21
|
}
|
|
@@ -23,8 +23,8 @@ const ALERTS = [
|
|
|
23
23
|
{
|
|
24
24
|
howler: { id: 'hit2', analytic: 'Cat Checker', detection: 'Looking for paw prints' },
|
|
25
25
|
event: {
|
|
26
|
-
start:
|
|
27
|
-
end:
|
|
26
|
+
start: dayjs().subtract(6, 'hour').toString(),
|
|
27
|
+
end: dayjs().subtract(5, 'hour').toString(),
|
|
28
28
|
provider: "The neighbour's cat (probably)",
|
|
29
29
|
reason: 'There was some fish we forgot to put away in the kitchen'
|
|
30
30
|
}
|
|
@@ -10,8 +10,8 @@ import FlexPort from '@cccsaurora/howler-ui/components/elements/addons/layout/Fl
|
|
|
10
10
|
import HitSummary from '@cccsaurora/howler-ui/components/elements/hit/HitSummary';
|
|
11
11
|
import { useMyLocalStorageItem } from '@cccsaurora/howler-ui/components/hooks/useMyLocalStorage';
|
|
12
12
|
import ErrorBoundary from '@cccsaurora/howler-ui/components/routes/ErrorBoundary';
|
|
13
|
+
import dayjs from 'dayjs';
|
|
13
14
|
import { has, isNull } from 'lodash-es';
|
|
14
|
-
import moment from 'moment';
|
|
15
15
|
import { memo, useCallback, useEffect, useMemo, useState } from 'react';
|
|
16
16
|
import { Trans, useTranslation } from 'react-i18next';
|
|
17
17
|
import { useLocation, useParams, useSearchParams } from 'react-router-dom';
|
|
@@ -88,7 +88,7 @@ const HitBrowser = () => {
|
|
|
88
88
|
useEffect(() => {
|
|
89
89
|
// On load check to filter out any queries older than one month
|
|
90
90
|
setQueryHistory(_queryHistory => {
|
|
91
|
-
const filterQueryTime =
|
|
91
|
+
const filterQueryTime = dayjs().subtract(1, 'month').toISOString();
|
|
92
92
|
return Object.fromEntries(Object.entries(_queryHistory).filter(([_, value]) => value > filterQueryTime));
|
|
93
93
|
});
|
|
94
94
|
}, [setQueryHistory]);
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Assignment, Edit, HowToVote, KeyboardArrowRight, OpenInNew, QueryStats, SettingsSuggest, Terminal } from '@mui/icons-material';
|
|
3
3
|
import { Box, Divider, Fade, ListItemIcon, ListItemText, Menu, MenuItem, MenuList, Paper } from '@mui/material';
|
|
4
4
|
import api from '@cccsaurora/howler-ui/api';
|
|
5
|
-
import
|
|
5
|
+
import useMatchers from '@cccsaurora/howler-ui/components/app/hooks/useMatchers';
|
|
6
6
|
import { ApiConfigContext } from '@cccsaurora/howler-ui/components/app/providers/ApiConfigProvider';
|
|
7
7
|
import { HitContext } from '@cccsaurora/howler-ui/components/app/providers/HitProvider';
|
|
8
8
|
import { TOP_ROW, VOTE_OPTIONS } from '@cccsaurora/howler-ui/components/elements/hit/actions/SharedComponents';
|
|
@@ -24,11 +24,11 @@ const ICON_MAP = {
|
|
|
24
24
|
};
|
|
25
25
|
const HitContextMenu = ({ children, getSelectedId, Component = Box }) => {
|
|
26
26
|
const { t } = useTranslation();
|
|
27
|
-
const analyticContext = useContext(AnalyticContext);
|
|
28
27
|
const { dispatchApi } = useMyApi();
|
|
29
28
|
const { executeAction } = useMyActionFunctions();
|
|
30
29
|
const { config } = useContext(ApiConfigContext);
|
|
31
30
|
const pluginStore = usePluginStore();
|
|
31
|
+
const { getMatchingAnalytic } = useMatchers();
|
|
32
32
|
const [id, setId] = useState(null);
|
|
33
33
|
const hit = useContextSelector(HitContext, ctx => ctx.hits[id]);
|
|
34
34
|
const selectedHits = useContextSelector(HitContext, ctx => ctx.selectedHits);
|
|
@@ -90,13 +90,12 @@ const HitContextMenu = ({ children, getSelectedId, Component = Box }) => {
|
|
|
90
90
|
return Object.entries(groupBy(_actions, 'type')).sort(([a], [b]) => ORDER.indexOf(a) - ORDER.indexOf(b));
|
|
91
91
|
}, [analytic, assess, availableTransitions, canAssess, canVote, config.lookups, vote, pluginActions]);
|
|
92
92
|
useEffect(() => {
|
|
93
|
-
if (!hit) {
|
|
93
|
+
if (!hit?.howler.analytic) {
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
|
-
(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}, [analyticContext, hit]);
|
|
96
|
+
getMatchingAnalytic(hit).then(setAnalytic);
|
|
97
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
98
|
+
}, [hit?.howler.analytic]);
|
|
100
99
|
useEffect(() => {
|
|
101
100
|
if (!anchorEl) {
|
|
102
101
|
setClickLocation([-1, -1]);
|
|
@@ -5,6 +5,7 @@ import { Badge, Box, Card, Skeleton, Tooltip, alpha, useTheme } from '@mui/mater
|
|
|
5
5
|
import { ParameterContext } from '@cccsaurora/howler-ui/components/app/providers/ParameterProvider';
|
|
6
6
|
import TuiIconButton from '@cccsaurora/howler-ui/components/elements/addons/buttons/CustomIconButton';
|
|
7
7
|
import QueryEditor from '@cccsaurora/howler-ui/components/routes/advanced/QueryEditor';
|
|
8
|
+
import ClearIcon from '@mui/icons-material/Clear';
|
|
8
9
|
import { HitSearchContext } from '@cccsaurora/howler-ui/components/app/providers/HitSearchProvider';
|
|
9
10
|
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
10
11
|
import { useTranslation } from 'react-i18next';
|
|
@@ -128,7 +129,7 @@ const HitQuery = ({ searching = false, disabled = false, compact = false, trigge
|
|
|
128
129
|
p: 0.5,
|
|
129
130
|
height: multiline ? `${DEFAULT_MULTILINE_HEIGHT + y}px` : theme.spacing(5)
|
|
130
131
|
}
|
|
131
|
-
], onKeyDown: e => e.stopPropagation(), children: [_jsx(TuiIconButton, { disabled: query.includes('\n#') || disabled, sx: { mr: 1, alignSelf: 'start' }, onClick: () => setMultiline(!multiline), color: multiline ? 'primary' : theme.palette.text.primary, transparent: !multiline, size: compact ? 'small' : 'medium', children: _jsx(Height, { sx: { fontSize: '20px' } }) }), _jsx(QueryEditor, { query: preppedQuery, setQuery: setQuery, language: "lucene", height: multiline ? `${DEFAULT_MULTILINE_HEIGHT - 30}px` : '20px', onMount: onMount, editorOptions: options }), fzfSearch && (_jsx(Tooltip, { title: t('route.history'), children: _jsx(History, {}) })), _jsx(TuiIconButton, { disabled: searching || disabled, onClick: search, sx: { ml: 1, alignSelf: 'start', flexShrink: 0 }, size: compact ? 'small' : 'medium', children: _jsx(Tooltip, { title: t('route.search'), children: _jsx(Badge, { invisible: !isDirty, color: "warning", variant: "dot", children: _jsx(Search, { sx: { fontSize: '20px' } }) }) }) }), !loaded && (_jsx(Skeleton, { variant: "rectangular", sx: { position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 }, height: "100%" })), multiline && (_jsx(Box, { sx: {
|
|
132
|
+
], onKeyDown: e => e.stopPropagation(), children: [_jsx(TuiIconButton, { disabled: query.includes('\n#') || disabled, sx: { mr: 1, alignSelf: 'start' }, onClick: () => setMultiline(!multiline), color: multiline ? 'primary' : theme.palette.text.primary, transparent: !multiline, size: compact ? 'small' : 'medium', children: _jsx(Height, { sx: { fontSize: '20px' } }) }), _jsx(QueryEditor, { query: preppedQuery, setQuery: setQuery, language: "lucene", height: multiline ? `${DEFAULT_MULTILINE_HEIGHT - 30}px` : '20px', onMount: onMount, editorOptions: options }), fzfSearch && (_jsx(Tooltip, { title: t('route.history'), children: _jsx(History, {}) })), _jsx(TuiIconButton, { disabled: searching || disabled, onClick: () => setQuery('howler.id:*'), sx: { ml: 1, alignSelf: 'start', flexShrink: 0 }, size: compact ? 'small' : 'medium', children: _jsx(Tooltip, { title: t('route.clear'), children: _jsx(ClearIcon, { sx: { fontSize: '20px' } }) }) }), _jsx(TuiIconButton, { disabled: searching || disabled, onClick: search, sx: { ml: 1, alignSelf: 'start', flexShrink: 0 }, size: compact ? 'small' : 'medium', children: _jsx(Tooltip, { title: t('route.search'), children: _jsx(Badge, { invisible: !isDirty, color: "warning", variant: "dot", children: _jsx(Search, { sx: { fontSize: '20px' } }) }) }) }), !loaded && (_jsx(Skeleton, { variant: "rectangular", sx: { position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 }, height: "100%" })), multiline && (_jsx(Box, { sx: {
|
|
132
133
|
position: 'absolute',
|
|
133
134
|
left: 0,
|
|
134
135
|
right: 0,
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Clear, Code, Comment, DataObject, History, LinkSharp, OpenInNew, QueryStats } from '@mui/icons-material';
|
|
3
|
-
import { Badge, Box, Divider, Skeleton, Stack, Tab, Tabs, Tooltip, useTheme } from '@mui/material';
|
|
3
|
+
import { Badge, Box, Divider, IconButton, Skeleton, Stack, Tab, Tabs, Tooltip, useTheme } from '@mui/material';
|
|
4
4
|
import TuiIconButton from '@cccsaurora/howler-ui/components/elements/addons/buttons/CustomIconButton';
|
|
5
5
|
import { Icon } from '@iconify/react/dist/iconify.js';
|
|
6
|
-
import
|
|
7
|
-
import { DossierContext } from '@cccsaurora/howler-ui/components/app/providers/DossierProvider';
|
|
6
|
+
import useMatchers from '@cccsaurora/howler-ui/components/app/hooks/useMatchers';
|
|
8
7
|
import { HitContext } from '@cccsaurora/howler-ui/components/app/providers/HitProvider';
|
|
9
|
-
import { OverviewContext } from '@cccsaurora/howler-ui/components/app/providers/OverviewProvider';
|
|
10
8
|
import { ParameterContext } from '@cccsaurora/howler-ui/components/app/providers/ParameterProvider';
|
|
11
9
|
import { SocketContext } from '@cccsaurora/howler-ui/components/app/providers/SocketProvider';
|
|
12
10
|
import FlexOne from '@cccsaurora/howler-ui/components/elements/addons/layout/FlexOne';
|
|
13
11
|
import VSBox from '@cccsaurora/howler-ui/components/elements/addons/layout/vsbox/VSBox';
|
|
14
12
|
import VSBoxContent from '@cccsaurora/howler-ui/components/elements/addons/layout/vsbox/VSBoxContent';
|
|
15
13
|
import VSBoxHeader from '@cccsaurora/howler-ui/components/elements/addons/layout/vsbox/VSBoxHeader';
|
|
14
|
+
import Phrase from '@cccsaurora/howler-ui/components/elements/addons/search/phrase/Phrase';
|
|
16
15
|
import BundleButton from '@cccsaurora/howler-ui/components/elements/display/icons/BundleButton';
|
|
17
16
|
import SocketBadge from '@cccsaurora/howler-ui/components/elements/display/icons/SocketBadge';
|
|
18
17
|
import JSONViewer from '@cccsaurora/howler-ui/components/elements/display/json/JSONViewer';
|
|
@@ -40,6 +39,7 @@ import { usePluginStore } from 'react-pluggable';
|
|
|
40
39
|
import { useLocation } from 'react-router-dom';
|
|
41
40
|
import { useContextSelector } from 'use-context-selector';
|
|
42
41
|
import { getUserList } from '@cccsaurora/howler-ui/utils/hitFunctions';
|
|
42
|
+
import { validateRegex } from '@cccsaurora/howler-ui/utils/stringUtils';
|
|
43
43
|
import { tryParse } from '@cccsaurora/howler-ui/utils/utils';
|
|
44
44
|
import LeadRenderer from '../view/LeadRenderer';
|
|
45
45
|
const InformationPane = ({ onClose }) => {
|
|
@@ -47,17 +47,19 @@ const InformationPane = ({ onClose }) => {
|
|
|
47
47
|
const theme = useTheme();
|
|
48
48
|
const location = useLocation();
|
|
49
49
|
const { emit, isOpen } = useContext(SocketContext);
|
|
50
|
-
const {
|
|
51
|
-
const { getMatchingOverview, refresh } = useContext(OverviewContext);
|
|
50
|
+
const { getMatchingOverview, getMatchingDossiers, getMatchingAnalytic } = useMatchers();
|
|
52
51
|
const selected = useContextSelector(ParameterContext, ctx => ctx.selected);
|
|
53
52
|
const pluginStore = usePluginStore();
|
|
54
|
-
const getMatchingDossiers = useContextSelector(DossierContext, ctx => ctx.getMatchingDossiers);
|
|
55
53
|
const getHit = useContextSelector(HitContext, ctx => ctx.getHit);
|
|
56
54
|
const [userIds, setUserIds] = useState(new Set());
|
|
57
55
|
const [analytic, setAnalytic] = useState();
|
|
56
|
+
const [hasOverview, setHasOverview] = useState(false);
|
|
58
57
|
const [tab, setTab] = useState('overview');
|
|
59
58
|
const [loading, setLoading] = useState(false);
|
|
60
|
-
const [
|
|
59
|
+
const [filter, setFilter] = useState('');
|
|
60
|
+
// In order to properly check for dossiers, we split dossiers into two
|
|
61
|
+
const [_dossiers, setDossiers] = useState(null);
|
|
62
|
+
const dossiers = useMemo(() => _dossiers ?? [], [_dossiers]);
|
|
61
63
|
const users = useMyUserList(userIds);
|
|
62
64
|
const hit = useContextSelector(HitContext, ctx => ctx.hits[selected]);
|
|
63
65
|
howlerPluginStore.plugins.forEach(plugin => {
|
|
@@ -67,29 +69,32 @@ const InformationPane = ({ onClose }) => {
|
|
|
67
69
|
if (!selected) {
|
|
68
70
|
return;
|
|
69
71
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
finally {
|
|
77
|
-
setLoading(false);
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
else if (!hit?.howler.data) {
|
|
82
|
-
getHit(selected, true);
|
|
83
|
-
}
|
|
84
|
-
setUserIds(getUserList(hit));
|
|
85
|
-
setAnalytic(await getAnalyticFromName(hit.howler.analytic));
|
|
86
|
-
if (tab === 'hit_aggregate' && !hit.howler.is_bundle) {
|
|
87
|
-
setTab('overview');
|
|
88
|
-
}
|
|
89
|
-
})();
|
|
72
|
+
if (!hit?.howler.data) {
|
|
73
|
+
setLoading(true);
|
|
74
|
+
getHit(selected, true).finally(() => setLoading(false));
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
setUserIds(getUserList(hit));
|
|
90
78
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
91
|
-
}, [
|
|
92
|
-
|
|
79
|
+
}, [getHit, selected]);
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (hit && !analytic) {
|
|
82
|
+
getMatchingAnalytic(hit).then(setAnalytic);
|
|
83
|
+
}
|
|
84
|
+
}, [analytic, getMatchingAnalytic, hit]);
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (hit && !_dossiers) {
|
|
87
|
+
getMatchingDossiers(hit).then(setDossiers);
|
|
88
|
+
}
|
|
89
|
+
}, [_dossiers, getMatchingDossiers, hit]);
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
getMatchingOverview(hit).then(_overview => setHasOverview(!!_overview));
|
|
92
|
+
}, [getMatchingOverview, hit]);
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
if (tab === 'hit_aggregate' && !hit?.howler.is_bundle) {
|
|
95
|
+
setTab('overview');
|
|
96
|
+
}
|
|
97
|
+
}, [hit?.howler.is_bundle, tab]);
|
|
93
98
|
useEffect(() => {
|
|
94
99
|
if (selected && isOpen()) {
|
|
95
100
|
emit({
|
|
@@ -105,17 +110,14 @@ const InformationPane = ({ onClose }) => {
|
|
|
105
110
|
}
|
|
106
111
|
}, [emit, selected, isOpen]);
|
|
107
112
|
useEffect(() => {
|
|
108
|
-
|
|
109
|
-
}, [refresh]);
|
|
110
|
-
useEffect(() => {
|
|
111
|
-
if (matchingOverview && tab === 'details') {
|
|
113
|
+
if (hasOverview && tab === 'details') {
|
|
112
114
|
setTab('overview');
|
|
113
115
|
}
|
|
114
|
-
else if (!
|
|
116
|
+
else if (!hasOverview && tab === 'overview') {
|
|
115
117
|
setTab('details');
|
|
116
118
|
}
|
|
117
119
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
118
|
-
}, [
|
|
120
|
+
}, [hasOverview]);
|
|
119
121
|
/**
|
|
120
122
|
* What to show as the header? If loading a skeleton, then it depends on bundle or not. Bundles don't
|
|
121
123
|
* show anything while normal hits do
|
|
@@ -139,8 +141,8 @@ const InformationPane = ({ onClose }) => {
|
|
|
139
141
|
overview: () => _jsx(HitOverview, { hit: hit }),
|
|
140
142
|
details: () => _jsx(HitDetails, { hit: hit }),
|
|
141
143
|
hit_comments: () => _jsx(HitComments, { hit: hit, users: users }),
|
|
142
|
-
hit_raw: () => _jsx(JSONViewer, { data: !loading && hit }),
|
|
143
|
-
hit_data: () => (_jsx(JSONViewer, { data: !loading && hit?.howler?.data?.map(entry => tryParse(entry)), collapse: false })),
|
|
144
|
+
hit_raw: () => _jsx(JSONViewer, { data: !loading && hit, hideSearch: true, filter: filter }),
|
|
145
|
+
hit_data: () => (_jsx(JSONViewer, { data: !loading && hit?.howler?.data?.map(entry => tryParse(entry)), collapse: false, hideSearch: true, filter: filter })),
|
|
144
146
|
hit_worklog: () => _jsx(HitWorklog, { hit: !loading && hit, users: users }),
|
|
145
147
|
hit_aggregate: () => _jsx(HitSummary, { query: `howler.bundles:(${hit?.howler?.id})` }),
|
|
146
148
|
hit_related: () => _jsx(HitRelated, { hit: hit }),
|
|
@@ -150,13 +152,8 @@ const InformationPane = ({ onClose }) => {
|
|
|
150
152
|
() => _jsx(LeadRenderer, { lead: _lead, hit: hit })
|
|
151
153
|
])))
|
|
152
154
|
}[tab]?.();
|
|
153
|
-
}, [dossiers, hit, loading, tab, users]);
|
|
154
|
-
|
|
155
|
-
if (!hit) {
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
getMatchingDossiers(hit.howler.id).then(setDossiers);
|
|
159
|
-
}, [getMatchingDossiers, hit]);
|
|
155
|
+
}, [dossiers, filter, hit, loading, tab, users]);
|
|
156
|
+
const hasError = useMemo(() => !validateRegex(filter), [filter]);
|
|
160
157
|
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, sx: [hit?.howler?.is_bundle && { position: 'absolute', top: 1, right: 0, zIndex: 1100 }], 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?.howler.bundles?.length > 0 && _jsx(BundleButton, { ids: hit.howler.bundles, disabled: loading }), !!hit && !hit.howler.is_bundle && (_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: header }), !!hit &&
|
|
161
158
|
!hit.howler.is_bundle &&
|
|
162
159
|
(!loading ? (_jsxs(_Fragment, { children: [_jsx(HitOutline, { hit: hit, layout: HitLayout.DENSE }), _jsx(HitLabels, { hit: hit })] })) : (_jsx(Skeleton, { height: 124 }))), (hit?.howler?.links?.length > 0 ||
|
|
@@ -166,39 +163,39 @@ const InformationPane = ({ onClose }) => {
|
|
|
166
163
|
.slice(0, 3)
|
|
167
164
|
.map(l => _jsx(RelatedLink, { compact: true, ...l }, l.href)), dossiers.flatMap(_dossier => (_dossier.pivots ?? []).map((_pivot, index) => (
|
|
168
165
|
// eslint-disable-next-line react/no-array-index-key
|
|
169
|
-
_jsx(PivotLink, { pivot: _pivot, hit: hit, compact: true }, _dossier.dossier_id + index))))] })),
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
166
|
+
_jsx(PivotLink, { pivot: _pivot, hit: hit, compact: true }, _dossier.dossier_id + index))))] })), _jsxs(VSBoxHeader, { ml: -1, mr: -1, pb: 1, sx: { top: '0px' }, children: [_jsxs(Tabs, { value: tab === 'overview' && !hasOverview ? 'details' : tab, sx: {
|
|
167
|
+
display: 'flex',
|
|
168
|
+
flexDirection: 'row',
|
|
169
|
+
pr: 2,
|
|
170
|
+
alignItems: 'center',
|
|
171
|
+
position: 'relative',
|
|
172
|
+
'& > .MuiTabScrollButton-root': {
|
|
173
|
+
position: 'absolute',
|
|
174
|
+
top: 0,
|
|
175
|
+
bottom: 0,
|
|
176
|
+
zIndex: 5,
|
|
177
|
+
backgroundColor: theme.palette.background.paper,
|
|
178
|
+
'&:not(.Mui-disabled)': {
|
|
179
|
+
opacity: 1
|
|
180
|
+
},
|
|
181
|
+
'&:first-of-type': {
|
|
182
|
+
left: 0
|
|
183
|
+
},
|
|
184
|
+
'&:last-of-type': {
|
|
185
|
+
right: 0
|
|
186
|
+
}
|
|
189
187
|
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
'
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
, { label: _jsxs(Stack, { direction: "row", spacing: 0.5, children: [_lead.icon && _jsx(Icon, { icon: _lead.icon }), _jsx("span", { children: i18n.language === 'en' ? _lead.label.en : _lead.label.fr })] }), value: `external-lead:${dossierIndex}:${leadIndex}`, onClick: () => setTab(`external-lead:${dossierIndex}:${leadIndex}`) }, `external-lead:${dossierIndex}:${leadIndex}`)))), _jsx(FlexOne, {}), _jsx(Tab, { sx: { px: 2, minWidth: 0 }, label: _jsx(Tooltip, { title: t('hit.viewer.data'), children: _jsx(DataObject, {}) }), value: "hit_data", onClick: () => setTab('hit_data'), disabled: !hit?.howler?.data }), _jsx(Tab, { sx: { px: 2, minWidth: 0 }, label: _jsx(Tooltip, { title: t('hit.viewer.json'), children: _jsx(Code, {}) }), value: "hit_raw", onClick: () => setTab('hit_raw') }), _jsx(Tab, { sx: { px: 2, minWidth: 0 }, label: _jsx(Tooltip, { title: t('hit.viewer.worklog'), children: _jsx(History, {}) }), value: "hit_worklog", onClick: () => setTab('hit_worklog') }), _jsx(Tab, { sx: { px: 2, minWidth: 0 }, label: _jsx(Tooltip, { title: t('hit.viewer.related'), children: _jsx(LinkSharp, {}) }), value: "hit_related", onClick: () => setTab('hit_related') })] }) }), _jsx(ErrorBoundary, { children: _jsx(VSBoxContent, { mr: -1, ml: -1, height: "100%", children: _jsx(Stack, { height: "100%", flex: 1, children: tabContent }) }) })] }), !!hit && hit?.howler && (_jsxs(Box, { pr: 2, bgcolor: theme.palette.background.default, position: "relative", children: [_jsx(Divider, { orientation: "horizontal" }), _jsx(HitActions, { hit: hit })] }))] }));
|
|
188
|
+
}, variant: "scrollable", children: [_jsx(Tab, { sx: { px: 2, minWidth: 0 }, label: _jsx(Tooltip, { title: t('hit.viewer.comments'), children: _jsx(Badge, { sx: {
|
|
189
|
+
'& > .MuiBadge-badge': {
|
|
190
|
+
backgroundColor: theme.palette.divider,
|
|
191
|
+
zIndex: 1,
|
|
192
|
+
right: theme.spacing(-0.5)
|
|
193
|
+
},
|
|
194
|
+
'& > svg': { zIndex: 2 }
|
|
195
|
+
}, badgeContent: hit?.howler.comment?.length ?? 0, children: _jsx(Comment, {}) }) }), value: "hit_comments", onClick: () => setTab('hit_comments') }), hit?.howler?.is_bundle && (_jsx(Tab, { label: t('hit.viewer.aggregate'), value: "hit_aggregate", onClick: () => setTab('hit_aggregate') })), hasOverview && (_jsx(Tab, { label: t('hit.viewer.overview'), value: "overview", onClick: () => setTab('overview') })), _jsx(Tab, { label: t('hit.viewer.details'), value: "details", onClick: () => setTab('details') }), hit?.howler.dossier?.map((lead, index) => (_jsx(Tab
|
|
196
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
197
|
+
, { label: _jsxs(Stack, { direction: "row", spacing: 0.5, children: [lead.icon && _jsx(Icon, { icon: lead.icon }), _jsx("span", { children: i18n.language === 'en' ? lead.label.en : lead.label.fr })] }), value: 'lead:' + index, onClick: () => setTab('lead:' + index) }, 'lead:' + index))), dossiers.flatMap((_dossier, dossierIndex) => _dossier.leads?.map((_lead, leadIndex) => (_jsx(Tab
|
|
198
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
199
|
+
, { label: _jsxs(Stack, { direction: "row", spacing: 0.5, children: [_lead.icon && _jsx(Icon, { icon: _lead.icon }), _jsx("span", { children: i18n.language === 'en' ? _lead.label.en : _lead.label.fr })] }), value: `external-lead:${dossierIndex}:${leadIndex}`, onClick: () => setTab(`external-lead:${dossierIndex}:${leadIndex}`) }, `external-lead:${dossierIndex}:${leadIndex}`)))), _jsx(FlexOne, {}), _jsx(Tab, { sx: { px: 2, minWidth: 0 }, label: _jsx(Tooltip, { title: t('hit.viewer.data'), children: _jsx(DataObject, {}) }), value: "hit_data", onClick: () => setTab('hit_data'), disabled: !hit?.howler?.data }), _jsx(Tab, { sx: { px: 2, minWidth: 0 }, label: _jsx(Tooltip, { title: t('hit.viewer.json'), children: _jsx(Code, {}) }), value: "hit_raw", onClick: () => setTab('hit_raw') }), _jsx(Tab, { sx: { px: 2, minWidth: 0 }, label: _jsx(Tooltip, { title: t('hit.viewer.worklog'), children: _jsx(History, {}) }), value: "hit_worklog", onClick: () => setTab('hit_worklog') }), _jsx(Tab, { sx: { px: 2, minWidth: 0 }, label: _jsx(Tooltip, { title: t('hit.viewer.related'), children: _jsx(LinkSharp, {}) }), value: "hit_related", onClick: () => setTab('hit_related') })] }), ['hit_raw', 'hit_data'].includes(tab) && (_jsx(Phrase, { sx: { mt: 1, pr: 1 }, value: filter, onChange: setFilter, error: hasError, label: t('json.viewer.search.label'), placeholder: t('json.viewer.search.prompt'), endAdornment: _jsx(IconButton, { onClick: () => setFilter(''), children: _jsx(Clear, {}) }) }))] }), _jsx(ErrorBoundary, { children: _jsx(VSBoxContent, { mr: -1, ml: -1, height: "100%", children: _jsx(Stack, { height: "100%", flex: 1, children: tabContent }) }) })] }), !!hit && hit?.howler && (_jsxs(Box, { pr: 2, bgcolor: theme.palette.background.default, position: "relative", children: [_jsx(Divider, { orientation: "horizontal" }), _jsx(HitActions, { hit: hit })] }))] }));
|
|
203
200
|
};
|
|
204
201
|
export default InformationPane;
|