@cccsaurora/howler-ui 2.19.0-dev.979 → 2.19.0-dev.989
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/commons/components/app/hooks/useAppConfigs.d.ts +1 -1
- package/components/elements/hit/HitBanner.js +2 -2
- package/components/elements/hit/elements/{Assigned.d.ts → HitUsers.d.ts} +5 -2
- package/components/elements/hit/elements/HitUsers.js +33 -0
- package/components/routes/hits/search/grid/HitRow.js +2 -2
- package/locales/en/translation.json +3 -0
- package/locales/fr/translation.json +3 -0
- package/models/entities/generated/Hit.d.ts +1 -0
- package/models/entities/generated/Howler.d.ts +1 -0
- package/models/entities/generated/UserUser.d.ts +2 -0
- package/package.json +5 -5
- package/components/elements/hit/elements/Assigned.js +0 -31
|
@@ -24,7 +24,7 @@ export declare function useAppConfigs(): {
|
|
|
24
24
|
hideNestedIcons?: boolean;
|
|
25
25
|
};
|
|
26
26
|
appName: string;
|
|
27
|
-
appLink?: import("react-router
|
|
27
|
+
appLink?: import("react-router").To;
|
|
28
28
|
appIconDark: import("react").ReactElement<any>;
|
|
29
29
|
appIconLight: import("react").ReactElement<any>;
|
|
30
30
|
bannerDark?: import("react").ReactElement<any>;
|
|
@@ -12,9 +12,9 @@ import { Link } from 'react-router-dom';
|
|
|
12
12
|
import { ESCALATION_COLORS, PROVIDER_COLORS } from '@cccsaurora/howler-ui/utils/constants';
|
|
13
13
|
import { stringToColor } from '@cccsaurora/howler-ui/utils/utils';
|
|
14
14
|
import PluginTypography from '../PluginTypography';
|
|
15
|
-
import Assigned from './elements/Assigned';
|
|
16
15
|
import EscalationChip from './elements/EscalationChip';
|
|
17
16
|
import HitTimestamp from './elements/HitTimestamp';
|
|
17
|
+
import HitUsers from './elements/HitUsers';
|
|
18
18
|
import HitBannerTooltip from './HitBannerTooltip';
|
|
19
19
|
import { HitLayout } from './HitLayout';
|
|
20
20
|
const HitBanner = ({ hit, layout = HitLayout.NORMAL, showAssigned = true }) => {
|
|
@@ -115,7 +115,7 @@ const HitBanner = ({ hit, layout = HitLayout.NORMAL, showAssigned = true }) => {
|
|
|
115
115
|
width: theme.spacing(3)
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
], children: [_jsx(HitTimestamp, { hit: hit, layout: layout }),
|
|
118
|
+
], children: [_jsx(HitTimestamp, { hit: hit, layout: layout }), _jsx(HitUsers, { hit: hit, layout: layout, showAssigned: showAssigned }), hit.howler.links?.[0]?.href && (_jsx(Chip, { icon: _jsx(OpenInNew, {}), label: hit.howler.links[0].title || t('hit.header.link'), size: layout !== HitLayout.COMFY ? 'small' : 'medium', component: "a", href: hit.howler.links[0].href, target: "_blank", rel: "noopener noreferrer", sx: { [`.${chipClasses.label}`]: { cursor: 'pointer !important' } }, onClick: e => {
|
|
119
119
|
e.stopPropagation();
|
|
120
120
|
} })), _jsxs(Stack, { direction: "row", spacing: layout !== HitLayout.COMFY ? 0.5 : 1, children: [_jsx(EscalationChip, { hit: hit, layout: layout }), ['in-progress', 'on-hold'].includes(hit.howler.status) && (_jsx(Chip, { sx: { width: 'fit-content', display: 'inline-flex' }, label: hit.howler.status, size: layout !== HitLayout.COMFY ? 'small' : 'medium', color: "primary" })), hit.howler.is_bundle && (_jsx(Chip, { size: layout !== HitLayout.COMFY ? 'small' : 'medium', label: t('hit.header.bundlesize', { hits: hit.howler.hits.length }) }))] }), howlerPluginStore.plugins.flatMap(plugin => pluginStore.executeFunction(`${plugin}.status`, { hit, layout }))] })] }));
|
|
121
121
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { Hit } from '@cccsaurora/howler-ui/models/entities/generated/Hit';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import { HitLayout } from '../HitLayout';
|
|
4
|
-
|
|
4
|
+
type AssignedProps = FC<{
|
|
5
5
|
hit: Hit;
|
|
6
6
|
layout: HitLayout;
|
|
7
7
|
hideLabel?: boolean;
|
|
8
|
+
showAssigned?: boolean;
|
|
9
|
+
showAssessor?: boolean;
|
|
8
10
|
}>;
|
|
9
|
-
|
|
11
|
+
declare const HitUsers: AssignedProps;
|
|
12
|
+
export default HitUsers;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { avatarClasses, AvatarGroup, Chip, Divider, Stack, Typography } from '@mui/material';
|
|
3
|
+
import { useAppUser } from '@cccsaurora/howler-ui/commons/components/app/hooks';
|
|
4
|
+
import HowlerAvatar from '@cccsaurora/howler-ui/components/elements/display/HowlerAvatar';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { HitLayout } from '../HitLayout';
|
|
7
|
+
const AvatarChip = ({ userId, noUser, placeholder, layout, hideLabel }) => {
|
|
8
|
+
const userAvatar = (_jsx(HowlerAvatar, { userId: userId, sx: { height: layout !== HitLayout.COMFY ? 24 : 32, width: layout !== HitLayout.COMFY ? 24 : 32 } }));
|
|
9
|
+
return hideLabel ? (userAvatar) : (_jsx(Chip, { variant: "outlined", sx: {
|
|
10
|
+
width: 'fit-content',
|
|
11
|
+
'& .MuiChip-icon': {
|
|
12
|
+
marginLeft: 0
|
|
13
|
+
}
|
|
14
|
+
}, icon: userAvatar, label: userId && userId !== noUser ? userId : placeholder, size: layout !== HitLayout.COMFY ? 'small' : 'medium' }));
|
|
15
|
+
};
|
|
16
|
+
const HitUsers = ({ hit, layout, hideLabel = false, showAssigned = false, showAssessor = false }) => {
|
|
17
|
+
const { t } = useTranslation();
|
|
18
|
+
const { user } = useAppUser();
|
|
19
|
+
const assessorVisible = showAssessor || hit.howler.assessment != null;
|
|
20
|
+
const assigneeVisible = !hit.howler.assessor && (showAssigned || hit.howler.assignment !== 'unassigned');
|
|
21
|
+
return (_jsxs(Stack, { direction: hideLabel ? 'row' : 'column', spacing: 0.5, alignItems: "flex-start", children: [_jsxs(Stack, { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", alignItems: "center", columnGap: 0.5, rowGap: 0.25, children: [assigneeVisible && (_jsxs(_Fragment, { children: [!hideLabel && _jsxs(Typography, { variant: "caption", children: [t('app.drawer.hit.assignment.assignee'), ":"] }), _jsx(AvatarChip, { userId: hit?.howler.assignment, noUser: "unassigned", placeholder: t('app.drawer.hit.assignment.unassigned.name'), layout: layout, hideLabel: hideLabel })] })), assessorVisible && (_jsxs(_Fragment, { children: [!hideLabel && _jsxs(Typography, { variant: "caption", children: [t('app.drawer.hit.assessment.assessor'), ":"] }), _jsx(AvatarChip, { userId: hit.howler.assessor, noUser: "unknown", placeholder: t('app.drawer.hit.assessment.unknown.name'), layout: layout, hideLabel: hideLabel })] }))] }), hit.howler.viewers?.length > 0 && hideLabel && _jsx(Divider, { orientation: "vertical", flexItem: true, variant: "middle" }), _jsx(AvatarGroup, { max: 3, sx: { [`.${avatarClasses.root}`]: { border: 0, marginLeft: 0.5 } }, componentsProps: {
|
|
22
|
+
additionalAvatar: {
|
|
23
|
+
sx: {
|
|
24
|
+
height: layout !== HitLayout.COMFY ? 24 : 32,
|
|
25
|
+
width: layout !== HitLayout.COMFY ? 24 : 32,
|
|
26
|
+
fontSize: '12px'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}, children: [...new Set(hit?.howler.viewers)]
|
|
30
|
+
.filter(viewer => viewer !== user.username)
|
|
31
|
+
.map(viewer => (_jsx(HowlerAvatar, { userId: viewer, sx: { height: layout !== HitLayout.COMFY ? 24 : 32, width: layout !== HitLayout.COMFY ? 24 : 32 } }, viewer))) })] }));
|
|
32
|
+
};
|
|
33
|
+
export default HitUsers;
|
|
@@ -3,8 +3,8 @@ import { KeyboardArrowUp } from '@mui/icons-material';
|
|
|
3
3
|
import { Box, Collapse, IconButton, lighten, Stack, TableCell, TableRow, Typography, useTheme } from '@mui/material';
|
|
4
4
|
import { HitContext } from '@cccsaurora/howler-ui/components/app/providers/HitProvider';
|
|
5
5
|
import { ParameterContext } from '@cccsaurora/howler-ui/components/app/providers/ParameterProvider';
|
|
6
|
-
import Assigned from '@cccsaurora/howler-ui/components/elements/hit/elements/Assigned';
|
|
7
6
|
import EscalationChip from '@cccsaurora/howler-ui/components/elements/hit/elements/EscalationChip';
|
|
7
|
+
import HitUsers from '@cccsaurora/howler-ui/components/elements/hit/elements/HitUsers';
|
|
8
8
|
import HitCard from '@cccsaurora/howler-ui/components/elements/hit/HitCard';
|
|
9
9
|
import { HitLayout } from '@cccsaurora/howler-ui/components/elements/hit/HitLayout';
|
|
10
10
|
import { get } from 'lodash-es';
|
|
@@ -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] }),
|
|
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] }), _jsx(HitUsers, { hit: hit, layout: HitLayout.DENSE, hideLabel: true })] }) })] }) }), columns.map(col => (_jsx(EnhancedCell, { hit: hit, 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);
|
|
@@ -26,6 +26,9 @@
|
|
|
26
26
|
"apikey.impersonate": "Impersonate",
|
|
27
27
|
"apikey.read": "Read",
|
|
28
28
|
"apikey.write": "Write",
|
|
29
|
+
"app.drawer.hit.assessment.assessor": "Assessor",
|
|
30
|
+
"app.drawer.hit.assessment.unknown.name": "Unknown",
|
|
31
|
+
"app.drawer.hit.assignment.assignee": "Assignee",
|
|
29
32
|
"app.drawer.hit.assignment.autocomplete.label": "Choose Assignee",
|
|
30
33
|
"app.drawer.hit.assignment.description": "Choose a user to assign this hit to.",
|
|
31
34
|
"app.drawer.hit.assignment.success": "User assigned to hit sucessfully.",
|
|
@@ -26,6 +26,9 @@
|
|
|
26
26
|
"apikey.impersonate": "Imiter",
|
|
27
27
|
"apikey.read": "Lire",
|
|
28
28
|
"apikey.write": "Écrire",
|
|
29
|
+
"app.drawer.hit.assessment.assessor": "Évaluateur",
|
|
30
|
+
"app.drawer.hit.assessment.unknown.name": "Inconnu",
|
|
31
|
+
"app.drawer.hit.assignment.assignee": "Cessionnaire",
|
|
29
32
|
"app.drawer.hit.assignment.autocomplete.label": "Choisissez le destinataire",
|
|
30
33
|
"app.drawer.hit.assignment.description": "Choisissez un utilisateur à qui assigner ce hit.",
|
|
31
34
|
"app.drawer.hit.assignment.success": "L'utilisateur a été assigné au hit avec succès.",
|
|
@@ -4,6 +4,7 @@ import type { Dashboard } from './Dashboard';
|
|
|
4
4
|
* NOTE: This is an auto-generated file. Don't edit this manually.
|
|
5
5
|
*/
|
|
6
6
|
export interface UserUser {
|
|
7
|
+
access_control?: string;
|
|
7
8
|
api_quota?: number;
|
|
8
9
|
classification?: string;
|
|
9
10
|
dashboard?: Dashboard;
|
|
@@ -14,6 +15,7 @@ export interface UserUser {
|
|
|
14
15
|
is_active?: boolean;
|
|
15
16
|
name?: string;
|
|
16
17
|
password?: string;
|
|
18
|
+
refresh_rate?: number;
|
|
17
19
|
type?: string[];
|
|
18
20
|
uname?: string;
|
|
19
21
|
}
|
package/package.json
CHANGED
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"@monaco-editor/react": "^4.7.0",
|
|
29
29
|
"ajv": "^8.20.0",
|
|
30
30
|
"ajv-i18n": "^4.2.0",
|
|
31
|
-
"axios": "^1.
|
|
31
|
+
"axios": "^1.17.0",
|
|
32
32
|
"axios-retry": "^3.9.1",
|
|
33
33
|
"chart.js": "^4.5.1",
|
|
34
34
|
"chartjs-adapter-dayjs-4": "^1.0.4",
|
|
35
35
|
"chartjs-plugin-zoom": "^2.2.0",
|
|
36
36
|
"dayjs": "^1.11.21",
|
|
37
|
-
"dompurify": "^3.4.
|
|
37
|
+
"dompurify": "^3.4.8",
|
|
38
38
|
"flat": "^6.0.1",
|
|
39
|
-
"fuse.js": "^7.
|
|
39
|
+
"fuse.js": "^7.4.1",
|
|
40
40
|
"handlebars": "^4.7.9",
|
|
41
41
|
"handlebars-async-helpers": "^1.0.6",
|
|
42
42
|
"i18next": "^23.16.8",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"react-pluggable": "^0.4.3",
|
|
58
58
|
"react-resize-detector": "^9.1.1",
|
|
59
59
|
"react-router": "6.30.4",
|
|
60
|
-
"react-router-dom": "6.30.
|
|
60
|
+
"react-router-dom": "6.30.4",
|
|
61
61
|
"react-syntax-highlighter": "^15.6.6",
|
|
62
62
|
"rehype-raw": "^7.0.0",
|
|
63
63
|
"remark": "^15.0.1",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"internal-slot": "1.0.7"
|
|
97
97
|
},
|
|
98
98
|
"type": "module",
|
|
99
|
-
"version": "2.19.0-dev.
|
|
99
|
+
"version": "2.19.0-dev.989",
|
|
100
100
|
"exports": {
|
|
101
101
|
"./i18n": "./i18n.js",
|
|
102
102
|
"./index.css": "./index.css",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { avatarClasses, AvatarGroup, Chip, Stack } from '@mui/material';
|
|
3
|
-
import { useAppUser } from '@cccsaurora/howler-ui/commons/components/app/hooks';
|
|
4
|
-
import HowlerAvatar from '@cccsaurora/howler-ui/components/elements/display/HowlerAvatar';
|
|
5
|
-
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { HitLayout } from '../HitLayout';
|
|
7
|
-
const Assigned = ({ hit, layout, hideLabel = false }) => {
|
|
8
|
-
const { t } = useTranslation();
|
|
9
|
-
const { user } = useAppUser();
|
|
10
|
-
const userAvatar = (_jsx(HowlerAvatar, { userId: hit.howler.assignment, sx: { height: layout !== HitLayout.COMFY ? 24 : 32, width: layout !== HitLayout.COMFY ? 24 : 32 } }));
|
|
11
|
-
return (_jsxs(Stack, { direction: "row", spacing: 0.5, children: [hideLabel ? (userAvatar) : (_jsx(Chip, { variant: "outlined", sx: {
|
|
12
|
-
width: 'fit-content',
|
|
13
|
-
'& .MuiChip-icon': {
|
|
14
|
-
marginLeft: 0
|
|
15
|
-
}
|
|
16
|
-
}, icon: userAvatar, label: !hideLabel &&
|
|
17
|
-
(hit?.howler.assignment !== 'unassigned'
|
|
18
|
-
? hit?.howler.assignment
|
|
19
|
-
: t('app.drawer.hit.assignment.unassigned.name')), size: layout !== HitLayout.COMFY ? 'small' : 'medium' })), _jsx(AvatarGroup, { max: 3, sx: { [`.${avatarClasses.root}`]: { border: 0, marginLeft: 0.5 } }, componentsProps: {
|
|
20
|
-
additionalAvatar: {
|
|
21
|
-
sx: {
|
|
22
|
-
height: layout !== HitLayout.COMFY ? 24 : 32,
|
|
23
|
-
width: layout !== HitLayout.COMFY ? 24 : 32,
|
|
24
|
-
fontSize: '12px'
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}, children: [...new Set(hit?.howler.viewers)]
|
|
28
|
-
.filter(viewer => viewer !== user.username)
|
|
29
|
-
.map(viewer => (_jsx(HowlerAvatar, { userId: viewer, sx: { height: layout !== HitLayout.COMFY ? 24 : 32, width: layout !== HitLayout.COMFY ? 24 : 32 } }, viewer))) })] }));
|
|
30
|
-
};
|
|
31
|
-
export default Assigned;
|