@cccsaurora/howler-ui 2.14.1 → 2.14.2

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 { Skeleton } from '@mui/material';
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
- const pluginPivot = pluginStore.executeFunction(`pivot.${pivot.format}`, { pivot, hit, compact });
38
- if (pluginPivot) {
39
- return pluginPivot;
40
- }
42
+ // eslint-disable-next-line no-console
43
+ console.error = () => { };
44
+ pluginPivot = pluginStore.executeFunction(`pivot.${pivot.format}`, { pivot, hit, compact });
41
45
  }
42
- catch (e) {
46
+ finally {
43
47
  // eslint-disable-next-line no-console
44
- console.warn(`Pivot plugin for format ${pivot.format} does not exist, not rendering`);
45
- return null;
48
+ console.error = oldError;
49
+ }
50
+ if (pluginPivot) {
51
+ return pluginPivot;
46
52
  }
47
- return _jsx(Skeleton, { variant: "rounded" });
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);
package/package.json CHANGED
@@ -96,7 +96,7 @@
96
96
  "internal-slot": "1.0.7"
97
97
  },
98
98
  "type": "module",
99
- "version": "2.14.1",
99
+ "version": "2.14.2",
100
100
  "exports": {
101
101
  "./i18n": "./i18n.js",
102
102
  "./index.css": "./index.css",