@cccsaurora/howler-ui 2.17.0-dev.539 → 2.17.0-dev.544
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/hit/HitLinks.d.ts +10 -0
- package/components/elements/hit/HitLinks.js +17 -0
- package/components/elements/hit/related/PivotLink.js +11 -2
- package/components/hooks/useMyPreferences.js +70 -62
- package/components/routes/hits/search/InformationPane.js +2 -12
- package/components/routes/hits/search/shared/SearchSpan.js +1 -1
- package/components/routes/hits/view/HitViewer.js +2 -12
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Analytic } from '@cccsaurora/howler-ui/models/entities/generated/Analytic';
|
|
2
|
+
import type { Dossier } from '@cccsaurora/howler-ui/models/entities/generated/Dossier';
|
|
3
|
+
import type { Hit } from '@cccsaurora/howler-ui/models/entities/generated/Hit';
|
|
4
|
+
import type { FC } from 'react';
|
|
5
|
+
declare const HitLinks: FC<{
|
|
6
|
+
hit?: Hit;
|
|
7
|
+
analytic?: Analytic;
|
|
8
|
+
dossiers: Dossier[];
|
|
9
|
+
}>;
|
|
10
|
+
export default HitLinks;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Grid } from '@mui/material';
|
|
3
|
+
import HitNotebooks from '@cccsaurora/howler-ui/components/elements/hit/HitNotebooks';
|
|
4
|
+
import PivotLink from '@cccsaurora/howler-ui/components/elements/hit/related/PivotLink';
|
|
5
|
+
import RelatedLink from '@cccsaurora/howler-ui/components/elements/hit/related/RelatedLink';
|
|
6
|
+
import { uniqBy } from 'lodash-es';
|
|
7
|
+
const HitLinks = ({ hit, analytic, dossiers = [] }) => {
|
|
8
|
+
return ((hit?.howler?.links?.length > 0 ||
|
|
9
|
+
analytic?.notebooks?.length > 0 ||
|
|
10
|
+
dossiers.filter(_dossier => _dossier.pivots?.length > 0).length > 0) && (_jsxs(Grid, { container: true, spacing: 1, pr: 2, children: [hit?.howler?.links?.length > 0 &&
|
|
11
|
+
uniqBy(hit.howler.links, 'href')
|
|
12
|
+
.slice(0, 3)
|
|
13
|
+
.map(l => (_jsx(Grid, { item: true, children: _jsx(RelatedLink, { compact: true, ...l }) }, l.href))), dossiers.flatMap(_dossier => (_dossier.pivots ?? []).map((_pivot, index) => (
|
|
14
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
15
|
+
_jsx(Grid, { item: true, children: _jsx(PivotLink, { pivot: _pivot, hit: hit, compact: true }) }, _dossier.dossier_id + index)))), analytic?.notebooks?.length > 0 && (_jsx(Grid, { item: true, children: _jsx(HitNotebooks, { analytic: analytic, hit: hit }) }))] })));
|
|
16
|
+
};
|
|
17
|
+
export default HitLinks;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ErrorOutline } from '@mui/icons-material';
|
|
3
|
-
import {
|
|
3
|
+
import { Tooltip } from '@mui/material';
|
|
4
|
+
import HowlerCard from '@cccsaurora/howler-ui/components/elements/display/HowlerCard';
|
|
4
5
|
import Handlebars from 'handlebars';
|
|
5
6
|
import { isEmpty } from 'lodash-es';
|
|
6
7
|
import React, { useMemo } from 'react';
|
|
@@ -50,7 +51,15 @@ const PivotLink = ({ pivot, hit, compact = false }) => {
|
|
|
50
51
|
if (pluginPivot) {
|
|
51
52
|
return pluginPivot;
|
|
52
53
|
}
|
|
53
|
-
return (_jsx(
|
|
54
|
+
return (_jsx(HowlerCard, { sx: [
|
|
55
|
+
theme => ({
|
|
56
|
+
p: 0.75,
|
|
57
|
+
backgroundColor: 'transparent',
|
|
58
|
+
transition: theme.transitions.create(['border-color']),
|
|
59
|
+
'&:hover': { borderColor: 'error.main' }
|
|
60
|
+
}),
|
|
61
|
+
{ border: 'thin solid', borderColor: 'transparent' }
|
|
62
|
+
], 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
63
|
popper: {
|
|
55
64
|
sx: {
|
|
56
65
|
'& > .MuiTooltip-tooltip': {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Api, Article, Book, Code, Dashboard, Description,
|
|
2
|
+
import { Api, Article, Book, Code, Dashboard, Description, ExitToApp, FormatListBulleted, Help, HelpCenter, Key, ManageSearch, QueryStats, SavedSearch, Search, Settings, SettingsSuggest, Shield, Storage, SupervisorAccount, Terminal, Topic } from '@mui/icons-material';
|
|
3
3
|
import { AppBrand } from '@cccsaurora/howler-ui/branding/AppBrand';
|
|
4
4
|
import Classification from '@cccsaurora/howler-ui/components/elements/display/Classification';
|
|
5
5
|
import DocumentationButton from '@cccsaurora/howler-ui/components/elements/display/DocumentationButton';
|
|
@@ -39,6 +39,10 @@ const useMyPreferences = () => {
|
|
|
39
39
|
items: []
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
|
+
{
|
|
43
|
+
type: 'divider',
|
|
44
|
+
element: null
|
|
45
|
+
},
|
|
42
46
|
{
|
|
43
47
|
type: 'item',
|
|
44
48
|
element: {
|
|
@@ -62,71 +66,75 @@ const useMyPreferences = () => {
|
|
|
62
66
|
element: null
|
|
63
67
|
},
|
|
64
68
|
{
|
|
65
|
-
type: '
|
|
69
|
+
type: 'item',
|
|
66
70
|
element: {
|
|
67
|
-
id: 'manage',
|
|
68
|
-
i18nKey: '
|
|
69
|
-
icon: _jsx(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
|
|
121
|
-
i18nKey: 'route.integrations',
|
|
122
|
-
icon: _jsx(Api, {}),
|
|
123
|
-
nested: true,
|
|
124
|
-
route: '/action/integrations',
|
|
125
|
-
userPropValidators: [{ prop: 'roles', value: 'automation_basic' }]
|
|
126
|
-
}
|
|
71
|
+
id: 'manage.views',
|
|
72
|
+
i18nKey: 'route.views',
|
|
73
|
+
icon: _jsx(ManageSearch, {}),
|
|
74
|
+
route: '/views'
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: 'item',
|
|
79
|
+
element: {
|
|
80
|
+
id: 'manage.analytics',
|
|
81
|
+
i18nKey: 'route.analytics',
|
|
82
|
+
icon: _jsx(QueryStats, {}),
|
|
83
|
+
route: '/analytics'
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
type: 'item',
|
|
88
|
+
element: {
|
|
89
|
+
id: 'manage.templates',
|
|
90
|
+
i18nKey: 'route.templates',
|
|
91
|
+
icon: _jsx(FormatListBulleted, {}),
|
|
92
|
+
route: '/templates'
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
type: 'item',
|
|
97
|
+
element: {
|
|
98
|
+
id: 'manage.overviews',
|
|
99
|
+
i18nKey: 'route.overviews',
|
|
100
|
+
icon: _jsx(Article, {}),
|
|
101
|
+
route: '/overviews'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: 'item',
|
|
106
|
+
element: {
|
|
107
|
+
id: 'manage.dossiers',
|
|
108
|
+
i18nKey: 'route.dossiers',
|
|
109
|
+
icon: _jsx(Topic, {}),
|
|
110
|
+
route: '/dossiers'
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
type: 'item',
|
|
115
|
+
element: {
|
|
116
|
+
id: 'manage.actions',
|
|
117
|
+
i18nKey: 'route.actions',
|
|
118
|
+
icon: _jsx(Terminal, {}),
|
|
119
|
+
route: '/action',
|
|
120
|
+
userPropValidators: [
|
|
121
|
+
{ prop: 'roles', value: 'automation_basic' },
|
|
122
|
+
{ prop: 'roles', value: 'automation_advanced' },
|
|
123
|
+
{ prop: 'roles', value: 'actionrunner_basic' },
|
|
124
|
+
{ prop: 'roles', value: 'actionrunner_advanced' }
|
|
127
125
|
]
|
|
128
126
|
}
|
|
129
127
|
},
|
|
128
|
+
{
|
|
129
|
+
type: 'item',
|
|
130
|
+
element: {
|
|
131
|
+
id: 'action.integrations',
|
|
132
|
+
i18nKey: 'route.integrations',
|
|
133
|
+
icon: _jsx(Api, {}),
|
|
134
|
+
route: '/action/integrations',
|
|
135
|
+
userPropValidators: [{ prop: 'roles', value: 'automation_basic' }]
|
|
136
|
+
}
|
|
137
|
+
},
|
|
130
138
|
{
|
|
131
139
|
type: 'divider',
|
|
132
140
|
element: null
|
|
@@ -21,17 +21,14 @@ import HitComments from '@cccsaurora/howler-ui/components/elements/hit/HitCommen
|
|
|
21
21
|
import HitDetails from '@cccsaurora/howler-ui/components/elements/hit/HitDetails';
|
|
22
22
|
import HitLabels from '@cccsaurora/howler-ui/components/elements/hit/HitLabels';
|
|
23
23
|
import { HitLayout } from '@cccsaurora/howler-ui/components/elements/hit/HitLayout';
|
|
24
|
-
import
|
|
24
|
+
import HitLinks from '@cccsaurora/howler-ui/components/elements/hit/HitLinks';
|
|
25
25
|
import HitOutline from '@cccsaurora/howler-ui/components/elements/hit/HitOutline';
|
|
26
26
|
import HitOverview from '@cccsaurora/howler-ui/components/elements/hit/HitOverview';
|
|
27
27
|
import HitRelated from '@cccsaurora/howler-ui/components/elements/hit/HitRelated';
|
|
28
28
|
import HitSummary from '@cccsaurora/howler-ui/components/elements/hit/HitSummary';
|
|
29
29
|
import HitWorklog from '@cccsaurora/howler-ui/components/elements/hit/HitWorklog';
|
|
30
|
-
import PivotLink from '@cccsaurora/howler-ui/components/elements/hit/related/PivotLink';
|
|
31
|
-
import RelatedLink from '@cccsaurora/howler-ui/components/elements/hit/related/RelatedLink';
|
|
32
30
|
import useMyUserList from '@cccsaurora/howler-ui/components/hooks/useMyUserList';
|
|
33
31
|
import ErrorBoundary from '@cccsaurora/howler-ui/components/routes/ErrorBoundary';
|
|
34
|
-
import { uniqBy } from 'lodash-es';
|
|
35
32
|
import howlerPluginStore from '@cccsaurora/howler-ui/plugins/store';
|
|
36
33
|
import { useContext, useEffect, useMemo, useState } from 'react';
|
|
37
34
|
import { useTranslation } from 'react-i18next';
|
|
@@ -166,14 +163,7 @@ const InformationPane = ({ onClose }) => {
|
|
|
166
163
|
const hasError = useMemo(() => !validateRegex(filter), [filter]);
|
|
167
164
|
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 &&
|
|
168
165
|
!hit.howler.is_bundle &&
|
|
169
|
-
(!loading ? (_jsxs(_Fragment, { children: [_jsx(HitOutline, { hit: hit, layout: HitLayout.DENSE }), _jsx(HitLabels, { hit: hit })] })) : (_jsx(Skeleton, { height: 124 }))), (hit
|
|
170
|
-
analytic?.notebooks?.length > 0 ||
|
|
171
|
-
dossiers.filter(_dossier => _dossier.pivots?.length > 0).length > 0) && (_jsxs(Stack, { direction: "row", spacing: 1, pr: 2, children: [analytic?.notebooks?.length > 0 && _jsx(HitNotebooks, { analytic: analytic, hit: hit }), hit?.howler?.links?.length > 0 &&
|
|
172
|
-
uniqBy(hit.howler.links, 'href')
|
|
173
|
-
.slice(0, 3)
|
|
174
|
-
.map(l => _jsx(RelatedLink, { compact: true, ...l }, l.href)), dossiers.flatMap(_dossier => (_dossier.pivots ?? []).map((_pivot, index) => (
|
|
175
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
176
|
-
_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: {
|
|
166
|
+
(!loading ? (_jsxs(_Fragment, { children: [_jsx(HitOutline, { hit: hit, layout: HitLayout.DENSE }), _jsx(HitLabels, { hit: hit })] })) : (_jsx(Skeleton, { height: 124 }))), _jsx(HitLinks, { hit: hit, analytic: analytic, dossiers: dossiers }), _jsxs(VSBoxHeader, { ml: -1, mr: -1, pb: 1, sx: { top: '0px' }, children: [_jsxs(Tabs, { value: tab === 'overview' && !hasOverview ? 'details' : tab, sx: {
|
|
177
167
|
display: 'flex',
|
|
178
168
|
flexDirection: 'row',
|
|
179
169
|
pr: 2,
|
|
@@ -50,6 +50,6 @@ const SearchSpan = ({ omitCustom = false, size }) => {
|
|
|
50
50
|
}, [getCurrentViews, views]);
|
|
51
51
|
return (_jsx(ChipPopper, { icon: _jsx(AvTimer, { fontSize: "small" }), label: _jsx(Typography, { variant: "body2", children: span !== 'date.range.custom'
|
|
52
52
|
? t(span)
|
|
53
|
-
: `${startDate
|
|
53
|
+
: `${startDate?.format('YYYY-MM-DD HH:mm') ?? '?'} ${t('to')} ${endDate?.format('YYYY-MM-DD HH:mm') ?? '?'}` }), minWidth: "225px", slotProps: { chip: { size: 'small' } }, children: _jsxs(Stack, { spacing: 1, children: [_jsx(Autocomplete, { fullWidth: true, sx: { minWidth: '200px', flex: 1 }, size: size ?? 'small', value: span, options: omitCustom ? DATE_RANGES.slice(0, DATE_RANGES.length - 1) : DATE_RANGES, renderInput: _params => _jsx(TextField, { ..._params, label: t('hit.search.span') }), getOptionLabel: option => t(option), onChange: (_, value) => setSpan(value), disableClearable: true }), _jsx(CustomSpan, {})] }) }));
|
|
54
54
|
};
|
|
55
55
|
export default memo(SearchSpan);
|
|
@@ -16,16 +16,13 @@ import HitComments from '@cccsaurora/howler-ui/components/elements/hit/HitCommen
|
|
|
16
16
|
import HitDetails from '@cccsaurora/howler-ui/components/elements/hit/HitDetails';
|
|
17
17
|
import HitLabels from '@cccsaurora/howler-ui/components/elements/hit/HitLabels';
|
|
18
18
|
import { HitLayout } from '@cccsaurora/howler-ui/components/elements/hit/HitLayout';
|
|
19
|
-
import
|
|
19
|
+
import HitLinks from '@cccsaurora/howler-ui/components/elements/hit/HitLinks';
|
|
20
20
|
import HitOutline from '@cccsaurora/howler-ui/components/elements/hit/HitOutline';
|
|
21
21
|
import HitOverview from '@cccsaurora/howler-ui/components/elements/hit/HitOverview';
|
|
22
22
|
import HitRelated from '@cccsaurora/howler-ui/components/elements/hit/HitRelated';
|
|
23
23
|
import HitWorklog from '@cccsaurora/howler-ui/components/elements/hit/HitWorklog';
|
|
24
|
-
import PivotLink from '@cccsaurora/howler-ui/components/elements/hit/related/PivotLink';
|
|
25
|
-
import RelatedLink from '@cccsaurora/howler-ui/components/elements/hit/related/RelatedLink';
|
|
26
24
|
import { useMyLocalStorageItem } from '@cccsaurora/howler-ui/components/hooks/useMyLocalStorage';
|
|
27
25
|
import useMyUserList from '@cccsaurora/howler-ui/components/hooks/useMyUserList';
|
|
28
|
-
import uniqBy from 'lodash-es/uniqBy';
|
|
29
26
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
30
27
|
import { useTranslation } from 'react-i18next';
|
|
31
28
|
import { useNavigate, useParams } from 'react-router-dom';
|
|
@@ -131,14 +128,7 @@ const HitViewer = () => {
|
|
|
131
128
|
display: 'flex',
|
|
132
129
|
'& > .MuiPaper-root': { flex: 1 },
|
|
133
130
|
mr: orientation === 'vertical' ? 0 : -2
|
|
134
|
-
}, children: [_jsx(HowlerCard, { tabIndex: 0, sx: { position: 'relative' }, children: _jsxs(CardContent, { children: [_jsx(HitBanner, { hit: hit, layout: HitLayout.COMFY, useListener: true }), _jsx(HitOutline, { hit: hit, layout: HitLayout.COMFY }), _jsx(HitLabels, { hit: hit }), (hit
|
|
135
|
-
analytic?.notebooks?.length > 0 ||
|
|
136
|
-
dossiers.filter(_dossier => _dossier.pivots?.length > 0).length > 0) && (_jsxs(Stack, { direction: "row", spacing: 1, pr: 2, children: [analytic?.notebooks?.length > 0 && _jsx(HitNotebooks, { analytic: analytic, hit: hit }), hit?.howler?.links?.length > 0 &&
|
|
137
|
-
uniqBy(hit.howler.links, 'href')
|
|
138
|
-
.slice(0, 3)
|
|
139
|
-
.map(l => _jsx(RelatedLink, { compact: true, ...l }, l.href)), dossiers.flatMap(_dossier => (_dossier.pivots ?? []).map((_pivot, index) => (
|
|
140
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
141
|
-
_jsx(PivotLink, { pivot: _pivot, hit: hit, compact: true }, _dossier.dossier_id + index))))] }))] }) }), !isUnderLg && (_jsxs(Stack, { spacing: 1, sx: {
|
|
131
|
+
}, children: [_jsx(HowlerCard, { tabIndex: 0, sx: { position: 'relative' }, children: _jsxs(CardContent, { children: [_jsx(HitBanner, { hit: hit, layout: HitLayout.COMFY, useListener: true }), _jsx(HitOutline, { hit: hit, layout: HitLayout.COMFY }), _jsx(HitLabels, { hit: hit }), _jsx(HitLinks, { hit: hit, analytic: analytic, dossiers: dossiers })] }) }), !isUnderLg && (_jsxs(Stack, { spacing: 1, sx: {
|
|
142
132
|
position: 'absolute',
|
|
143
133
|
top: theme.spacing(2),
|
|
144
134
|
right: theme.spacing(-6)
|