@cccsaurora/howler-ui 2.19.0-dev.1296 → 2.19.0-dev.1308
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/display/HandlebarsMarkdown.js +3 -2
- package/components/elements/hit/elements/Assigned.js +3 -3
- package/components/routes/cases/detail/AlertPanel.js +2 -1
- package/components/routes/cases/detail/AlertPanel.test.js +2 -2
- package/locales/en/translation.json +1 -0
- package/locales/fr/translation.json +1 -0
- package/package.json +1 -1
|
@@ -80,15 +80,16 @@ const HandlebarsMarkdown = ({ md, object = {}, disableLinks = false }) => {
|
|
|
80
80
|
}, [handlebars, helpers, mdComponents]);
|
|
81
81
|
useEffect(() => {
|
|
82
82
|
THROTTLER.debounce(async () => {
|
|
83
|
+
// Types are a bit muddled here due to the async helpers
|
|
83
84
|
const compiled = handlebars.compile(md || '');
|
|
84
85
|
try {
|
|
85
|
-
setRendered(compiled(object));
|
|
86
|
+
setRendered(await compiled(object));
|
|
86
87
|
}
|
|
87
88
|
catch (err) {
|
|
88
89
|
if (err.message?.startsWith('Missing helper')) {
|
|
89
90
|
const missingHelper = err.message.replace(/.+"(.+)"/, '$1');
|
|
90
91
|
handlebars.registerHelper(missingHelper, () => new Handlebars.SafeString(`<span style="color: red; font-weight: bold; font-family: monospace;">Missing helper ${missingHelper}</span>`));
|
|
91
|
-
setRendered(compiled(object));
|
|
92
|
+
setRendered(await compiled(object));
|
|
92
93
|
return;
|
|
93
94
|
}
|
|
94
95
|
if (err instanceof HowlerHandlebarsRenderError) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { avatarClasses, AvatarGroup, Chip, Divider, Stack
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { avatarClasses, AvatarGroup, Chip, Divider, Stack } from '@mui/material';
|
|
3
3
|
import { useAppUser } from '@cccsaurora/howler-ui/commons/components/app/hooks';
|
|
4
4
|
import { SocketContext } from '@cccsaurora/howler-ui/components/app/providers/SocketProvider';
|
|
5
5
|
import HowlerAvatar from '@cccsaurora/howler-ui/components/elements/display/HowlerAvatar';
|
|
@@ -22,7 +22,7 @@ const Assigned = ({ hit, layout, hideLabel = false, showAssigned = false }) => {
|
|
|
22
22
|
const { viewers } = useContext(SocketContext);
|
|
23
23
|
const hitViewers = uniq(viewers[hit?.howler?.id] ?? []).filter(viewer => viewer !== user.username);
|
|
24
24
|
const assigneeVisible = showAssigned || hit.howler.assignment !== 'unassigned';
|
|
25
|
-
return (_jsxs(Stack, { direction: "row", spacing: 0.5, children: [assigneeVisible && (
|
|
25
|
+
return (_jsxs(Stack, { direction: "row", spacing: 0.5, children: [assigneeVisible && (_jsx(AvatarChip, { userId: hit?.howler.assignment, noUser: "unassigned", placeholder: t('app.drawer.hit.assignment.unassigned.name'), layout: layout, hideLabel: hideLabel })), hitViewers.length > 0 && hideLabel && _jsx(Divider, { orientation: "vertical", flexItem: true, variant: "middle" }), _jsx(AvatarGroup, { max: 3, sx: { [`.${avatarClasses.root}`]: { border: 0, marginLeft: 0.5 } }, componentsProps: {
|
|
26
26
|
additionalAvatar: {
|
|
27
27
|
sx: {
|
|
28
28
|
height: layout !== HitLayout.COMFY ? 24 : 32,
|
|
@@ -6,6 +6,7 @@ import { chunk, uniq } from 'lodash-es';
|
|
|
6
6
|
import { useMemo, useState } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import { Link } from 'react-router-dom';
|
|
9
|
+
import { buildPathFromID } from '../utils';
|
|
9
10
|
const AlertPanel = ({ case: _case }) => {
|
|
10
11
|
const theme = useTheme();
|
|
11
12
|
const { t } = useTranslation();
|
|
@@ -15,7 +16,7 @@ const AlertPanel = ({ case: _case }) => {
|
|
|
15
16
|
return _jsx(Skeleton, { height: 240 });
|
|
16
17
|
}
|
|
17
18
|
return (_jsxs(Stack, { spacing: 1, children: [_jsxs(Stack, { direction: "row", children: [_jsx(Typography, { flex: 1, variant: "h4", children: t('page.cases.dashboard.alerts') }), _jsx(Pagination, { count: alertPages.length, page: alertPage, onChange: (_, page) => setAlertPage(page) })] }), _jsx(Divider, {}), alertPages?.length > 0 &&
|
|
18
|
-
alertPages[alertPage - 1].map(item => (_jsxs(Box, { position: "relative", children: [_jsx(HitCard, { layout: HitLayout.DENSE, id: item.value, lazy: true }), _jsx(Box, { component: Link, to: `/
|
|
19
|
+
alertPages[alertPage - 1].map(item => (_jsxs(Box, { position: "relative", children: [_jsx(HitCard, { layout: HitLayout.DENSE, id: item.value, lazy: true }), _jsx(Box, { component: Link, to: `/cases/${_case.case_id}/${buildPathFromID(_case, item.id)}`, sx: {
|
|
19
20
|
position: 'absolute',
|
|
20
21
|
top: 0,
|
|
21
22
|
left: 0,
|
|
@@ -89,8 +89,8 @@ describe('AlertPanel', () => {
|
|
|
89
89
|
const { container } = renderPanel(_case);
|
|
90
90
|
const links = Array.from(container.querySelectorAll('a'));
|
|
91
91
|
expect(links).toHaveLength(2);
|
|
92
|
-
expect(links[0]).toHaveAttribute('href', '/
|
|
93
|
-
expect(links[1]).toHaveAttribute('href', '/
|
|
92
|
+
expect(links[0]).toHaveAttribute('href', '/cases/case-3/hit-1');
|
|
93
|
+
expect(links[1]).toHaveAttribute('href', '/cases/case-3/hit-2');
|
|
94
94
|
});
|
|
95
95
|
it('shows pagination with multiple pages and switches to page 2 items', () => {
|
|
96
96
|
const items = Array.from({ length: 6 }, (_, idx) => makeHitItem(`hit-${idx + 1}`, `/cases/test/hit-${idx + 1}`));
|
|
@@ -405,6 +405,7 @@
|
|
|
405
405
|
"page.cases.dashboard.tasks.hide_child": "Hide child case tasks",
|
|
406
406
|
"page.cases.dashboard.tasks.show_child": "Show child case tasks",
|
|
407
407
|
"page.cases.dashboard.threat": "Threats",
|
|
408
|
+
"page.cases.detail.assignment": "Case Assignee(s)",
|
|
408
409
|
"page.cases.detail.escalation": "Escalation",
|
|
409
410
|
"page.cases.detail.participants": "Participants",
|
|
410
411
|
"page.cases.detail.properties": "Properties",
|
|
@@ -405,6 +405,7 @@
|
|
|
405
405
|
"page.cases.dashboard.tasks.hide_child": "Masquer les tâches des cas enfants",
|
|
406
406
|
"page.cases.dashboard.tasks.show_child": "Afficher les tâches des cas enfants",
|
|
407
407
|
"page.cases.dashboard.threat": "Menaces",
|
|
408
|
+
"page.cases.detail.assignment": "Assigné(s) du cas",
|
|
408
409
|
"page.cases.detail.escalation": "Escalade",
|
|
409
410
|
"page.cases.detail.participants": "Participants",
|
|
410
411
|
"page.cases.detail.properties": "Propriétés",
|