@cccsaurora/howler-ui 2.15.0-dev.339 → 2.15.0-dev.341
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.
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ErrorOutline } from '@mui/icons-material';
|
|
3
|
+
import { Card, Tooltip } from '@mui/material';
|
|
3
4
|
import Handlebars from 'handlebars';
|
|
4
5
|
import { isEmpty } from 'lodash-es';
|
|
5
|
-
import { useMemo } from 'react';
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
6
7
|
import { useTranslation } from 'react-i18next';
|
|
7
8
|
import { usePluginStore } from 'react-pluggable';
|
|
8
9
|
import { flattenDeep } from '@cccsaurora/howler-ui/utils/utils';
|
|
@@ -33,17 +34,30 @@ const PivotLink = ({ pivot, hit, compact = false }) => {
|
|
|
33
34
|
if (href) {
|
|
34
35
|
return _jsx(RelatedLink, { title: pivot.label[i18n.language], href: href, compact: compact, icon: pivot.icon });
|
|
35
36
|
}
|
|
37
|
+
// Hide a relatively useless console error, we'll show a UI component instead
|
|
38
|
+
// eslint-disable-next-line no-console
|
|
39
|
+
const oldError = console.error;
|
|
40
|
+
let pluginPivot = null;
|
|
36
41
|
try {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
42
|
+
// eslint-disable-next-line no-console
|
|
43
|
+
console.error = () => { };
|
|
44
|
+
pluginPivot = pluginStore.executeFunction(`pivot.${pivot.format}`, { pivot, hit, compact });
|
|
41
45
|
}
|
|
42
|
-
|
|
46
|
+
finally {
|
|
43
47
|
// eslint-disable-next-line no-console
|
|
44
|
-
console.
|
|
45
|
-
|
|
48
|
+
console.error = oldError;
|
|
49
|
+
}
|
|
50
|
+
if (pluginPivot) {
|
|
51
|
+
return pluginPivot;
|
|
46
52
|
}
|
|
47
|
-
return _jsx(
|
|
53
|
+
return (_jsx(Card, { variant: "outlined", sx: { display: 'flex', alignItems: 'center', px: 1 }, children: _jsx(Tooltip, { title: _jsxs(_Fragment, { children: [_jsx("span", { children: `Missing Pivot Implementation ${pivot.format}` }), _jsx("code", { children: _jsx("pre", { children: JSON.stringify(pivot, null, 4) }) })] }), slotProps: {
|
|
54
|
+
popper: {
|
|
55
|
+
sx: {
|
|
56
|
+
'& > .MuiTooltip-tooltip': {
|
|
57
|
+
maxWidth: '90vw !important'
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}, children: _jsx(ErrorOutline, { color: "error" }) }) }));
|
|
48
62
|
};
|
|
49
63
|
export default PivotLink;
|
|
@@ -77,6 +77,13 @@ const InformationPane = ({ onClose }) => {
|
|
|
77
77
|
setUserIds(getUserList(hit));
|
|
78
78
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
79
79
|
}, [getHit, selected]);
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (selected) {
|
|
82
|
+
setAnalytic(null);
|
|
83
|
+
setDossiers(null);
|
|
84
|
+
setHasOverview(false);
|
|
85
|
+
}
|
|
86
|
+
}, [selected]);
|
|
80
87
|
useEffect(() => {
|
|
81
88
|
if (hit && !analytic) {
|
|
82
89
|
getMatchingAnalytic(hit).then(setAnalytic);
|