@cccsaurora/howler-ui 2.18.0-dev.704 → 2.18.0-dev.705

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.
Files changed (245) hide show
  1. package/api/index.d.ts +2 -0
  2. package/api/index.js +4 -2
  3. package/api/search/case.d.ts +4 -0
  4. package/api/search/case.js +8 -0
  5. package/api/search/index.d.ts +2 -1
  6. package/api/search/index.js +2 -1
  7. package/api/v2/case/index.d.ts +8 -0
  8. package/api/v2/case/index.js +20 -0
  9. package/api/v2/case/items.d.ts +6 -0
  10. package/api/v2/case/items.js +18 -0
  11. package/api/v2/index.d.ts +4 -0
  12. package/api/v2/index.js +6 -0
  13. package/api/v2/search/facet.d.ts +3 -0
  14. package/api/v2/search/facet.js +12 -0
  15. package/api/v2/search/index.d.ts +5 -0
  16. package/api/v2/search/index.js +24 -0
  17. package/commons/components/leftnav/LeftNavDrawer.js +1 -1
  18. package/components/app/App.js +34 -7
  19. package/components/app/hooks/useMatchers.js +2 -2
  20. package/components/app/hooks/useMatchers.test.js +22 -22
  21. package/components/app/hooks/useTitle.js +3 -3
  22. package/components/app/providers/FavouritesProvider.js +2 -2
  23. package/components/app/providers/ModalProvider.d.ts +1 -0
  24. package/components/app/providers/ParameterProvider.d.ts +9 -2
  25. package/components/app/providers/ParameterProvider.js +165 -240
  26. package/components/app/providers/ParameterProvider.test.js +307 -14
  27. package/components/app/providers/RecordProvider.d.ts +23 -0
  28. package/components/app/providers/{HitProvider.js → RecordProvider.js} +41 -41
  29. package/components/app/providers/{HitSearchProvider.d.ts → RecordSearchProvider.d.ts} +6 -6
  30. package/components/app/providers/{HitSearchProvider.js → RecordSearchProvider.js} +12 -17
  31. package/components/app/providers/{HitSearchProvider.test.js → RecordSearchProvider.test.js} +51 -70
  32. package/components/elements/ContextMenu.d.ts +56 -0
  33. package/components/elements/ContextMenu.js +109 -0
  34. package/components/elements/ContextMenu.test.js +215 -0
  35. package/components/{routes/overviews/OverviewEditor.js → elements/MarkdownEditor.js} +3 -3
  36. package/components/elements/ObjectDetails.d.ts +6 -0
  37. package/components/elements/{hit/HitDetails.js → ObjectDetails.js} +17 -17
  38. package/components/elements/PluginTypography.d.ts +2 -1
  39. package/components/elements/PluginTypography.js +3 -2
  40. package/components/elements/UserList.d.ts +5 -2
  41. package/components/elements/UserList.js +14 -5
  42. package/components/elements/addons/search/phrase/Phrase.js +1 -1
  43. package/components/elements/case/CaseCard.d.ts +12 -0
  44. package/components/elements/case/CaseCard.js +42 -0
  45. package/components/elements/case/CasePreview.d.ts +6 -0
  46. package/components/elements/case/CasePreview.js +17 -0
  47. package/components/elements/case/StatusIcon.d.ts +5 -0
  48. package/components/elements/case/StatusIcon.js +13 -0
  49. package/components/elements/display/ChipPopper.d.ts +1 -1
  50. package/components/elements/display/HowlerCard.js +1 -1
  51. package/components/elements/display/Modal.js +2 -0
  52. package/components/elements/hit/HitActions.js +4 -4
  53. package/components/elements/hit/HitBanner.js +28 -48
  54. package/components/elements/hit/HitCard.js +5 -5
  55. package/components/elements/hit/HitLabels.js +2 -2
  56. package/components/elements/hit/{HitQuickSearch.d.ts → HitPreview.d.ts} +3 -3
  57. package/components/elements/hit/{HitQuickSearch.js → HitPreview.js} +10 -4
  58. package/components/elements/hit/HitSummary.d.ts +2 -1
  59. package/components/elements/hit/HitSummary.js +6 -5
  60. package/components/elements/hit/aggregate/HitGraph.js +8 -8
  61. package/components/elements/hit/elements/AnalyticLink.d.ts +8 -0
  62. package/components/elements/hit/elements/AnalyticLink.js +22 -0
  63. package/components/elements/hit/outlines/DefaultOutline.js +1 -1
  64. package/components/elements/hit/related/RelatedRecords.js +63 -0
  65. package/components/elements/observable/ObservableCard.d.ts +6 -0
  66. package/components/elements/observable/ObservableCard.js +23 -0
  67. package/components/elements/observable/ObservablePreview.d.ts +6 -0
  68. package/components/elements/observable/ObservablePreview.js +12 -0
  69. package/components/elements/{hit/HitComments.d.ts → record/RecordComments.d.ts} +5 -4
  70. package/components/elements/{hit/HitComments.js → record/RecordComments.js} +29 -28
  71. package/components/{routes/hits/search/HitContextMenu.d.ts → elements/record/RecordContextMenu.d.ts} +3 -3
  72. package/components/elements/record/RecordContextMenu.js +247 -0
  73. package/components/elements/record/RecordContextMenu.test.d.ts +1 -0
  74. package/components/{routes/hits/search/HitContextMenu.test.js → elements/record/RecordContextMenu.test.js} +94 -39
  75. package/components/elements/record/RecordRelated.d.ts +7 -0
  76. package/components/elements/record/RecordRelated.js +34 -0
  77. package/components/elements/{hit/HitWorklog.d.ts → record/RecordWorklog.d.ts} +4 -3
  78. package/components/elements/{hit/HitWorklog.js → record/RecordWorklog.js} +15 -13
  79. package/components/elements/view/ViewTitle.d.ts +1 -0
  80. package/components/elements/view/ViewTitle.js +9 -2
  81. package/components/hooks/useHitActions.d.ts +1 -1
  82. package/components/hooks/useHitActions.js +4 -4
  83. package/components/hooks/useMyPreferences.js +10 -1
  84. package/components/hooks/useMySearch.js +2 -2
  85. package/components/hooks/useMySitemap.js +4 -1
  86. package/components/hooks/useMyTheme.js +9 -2
  87. package/components/hooks/useParamState.test.js +3 -4
  88. package/components/hooks/{useHitSelection.d.ts → useRecordSelection.d.ts} +2 -2
  89. package/components/hooks/{useHitSelection.js → useRecordSelection.js} +12 -33
  90. package/components/hooks/useRelatedRecords.d.ts +13 -0
  91. package/components/hooks/useRelatedRecords.js +32 -0
  92. package/components/routes/action/edit/ActionEditor.js +2 -2
  93. package/components/routes/action/view/ActionSearch.js +1 -1
  94. package/components/routes/advanced/QueryBuilder.js +1 -1
  95. package/components/routes/advanced/QueryEditor.js +3 -3
  96. package/components/routes/advanced/historyCompletionProvider.js +3 -3
  97. package/components/routes/analytics/AnalyticDetails.js +2 -2
  98. package/components/routes/analytics/AnalyticSearch.js +1 -1
  99. package/components/routes/cases/CaseViewer.d.ts +2 -0
  100. package/components/routes/cases/CaseViewer.js +22 -0
  101. package/components/routes/cases/Cases.d.ts +2 -0
  102. package/components/routes/cases/Cases.js +101 -0
  103. package/components/routes/cases/constants.d.ts +5 -0
  104. package/components/routes/cases/constants.js +5 -0
  105. package/components/routes/cases/detail/AlertPanel.d.ts +6 -0
  106. package/components/routes/cases/detail/AlertPanel.js +33 -0
  107. package/components/routes/cases/detail/CaseAssets.d.ts +12 -0
  108. package/components/routes/cases/detail/CaseAssets.js +104 -0
  109. package/components/routes/cases/detail/CaseAssets.test.d.ts +1 -0
  110. package/components/routes/cases/detail/CaseAssets.test.js +167 -0
  111. package/components/routes/cases/detail/CaseDashboard.d.ts +7 -0
  112. package/components/routes/cases/detail/CaseDashboard.js +54 -0
  113. package/components/routes/cases/detail/CaseDetails.d.ts +6 -0
  114. package/components/routes/cases/detail/CaseDetails.js +61 -0
  115. package/components/routes/cases/detail/CaseOverview.d.ts +7 -0
  116. package/components/routes/cases/detail/CaseOverview.js +43 -0
  117. package/components/routes/cases/detail/CaseSidebar.d.ts +8 -0
  118. package/components/routes/cases/detail/CaseSidebar.js +61 -0
  119. package/components/routes/cases/detail/CaseTask.d.ts +11 -0
  120. package/components/routes/cases/detail/CaseTask.js +57 -0
  121. package/components/routes/cases/detail/ItemPage.d.ts +6 -0
  122. package/components/routes/cases/detail/ItemPage.js +99 -0
  123. package/components/routes/cases/detail/RelatedCasePanel.d.ts +6 -0
  124. package/components/routes/cases/detail/RelatedCasePanel.js +31 -0
  125. package/components/routes/cases/detail/TaskPanel.d.ts +7 -0
  126. package/components/routes/cases/detail/TaskPanel.js +52 -0
  127. package/components/routes/cases/detail/aggregates/CaseAggregate.d.ts +12 -0
  128. package/components/routes/cases/detail/aggregates/CaseAggregate.js +19 -0
  129. package/components/routes/cases/detail/aggregates/SourceAggregate.d.ts +6 -0
  130. package/components/routes/cases/detail/aggregates/SourceAggregate.js +30 -0
  131. package/components/routes/cases/detail/assets/Asset.d.ts +14 -0
  132. package/components/routes/cases/detail/assets/Asset.js +12 -0
  133. package/components/routes/cases/detail/assets/Asset.test.d.ts +1 -0
  134. package/components/routes/cases/detail/assets/Asset.test.js +72 -0
  135. package/components/routes/cases/detail/sidebar/CaseFolder.d.ts +14 -0
  136. package/components/routes/cases/detail/sidebar/CaseFolder.js +133 -0
  137. package/components/routes/cases/detail/sidebar/CaseFolderContextMenu.d.ts +34 -0
  138. package/components/routes/cases/detail/sidebar/CaseFolderContextMenu.js +105 -0
  139. package/components/routes/cases/detail/sidebar/CaseFolderContextMenu.test.d.ts +1 -0
  140. package/components/routes/cases/detail/sidebar/CaseFolderContextMenu.test.js +351 -0
  141. package/components/routes/cases/detail/sidebar/types.d.ts +3 -0
  142. package/components/routes/cases/detail/sidebar/utils.d.ts +3 -0
  143. package/components/routes/cases/detail/sidebar/utils.js +25 -0
  144. package/components/routes/cases/hooks/useCase.d.ts +13 -0
  145. package/components/routes/cases/hooks/useCase.js +51 -0
  146. package/components/routes/cases/modals/AddToCaseModal.d.ts +7 -0
  147. package/components/routes/cases/modals/AddToCaseModal.js +62 -0
  148. package/components/routes/cases/modals/RenameItemModal.d.ts +9 -0
  149. package/components/routes/cases/modals/RenameItemModal.js +48 -0
  150. package/components/routes/cases/modals/ResolveModal.d.ts +7 -0
  151. package/components/routes/cases/modals/ResolveModal.js +62 -0
  152. package/components/routes/dossiers/DossierEditor.js +2 -2
  153. package/components/routes/dossiers/DossierEditor.test.js +1 -1
  154. package/components/routes/help/ApiDocumentation.js +1 -1
  155. package/components/routes/help/HitBannerDocumentation.js +1 -0
  156. package/components/routes/help/HitDocumentation.js +1 -3
  157. package/components/routes/hits/search/InformationPane.d.ts +1 -0
  158. package/components/routes/hits/search/InformationPane.js +47 -60
  159. package/components/routes/hits/search/LayoutSettings.js +3 -3
  160. package/components/routes/hits/search/QuerySettings.js +2 -1
  161. package/components/routes/hits/search/QuerySettings.test.js +14 -9
  162. package/components/routes/hits/search/{HitBrowser.js → RecordBrowser.js} +9 -9
  163. package/components/routes/hits/search/{HitQuery.d.ts → RecordQuery.d.ts} +2 -2
  164. package/components/routes/hits/search/{HitQuery.js → RecordQuery.js} +6 -6
  165. package/components/routes/hits/search/SearchPane.js +26 -49
  166. package/components/routes/hits/search/ViewLink.js +3 -3
  167. package/components/routes/hits/search/ViewLink.test.js +8 -8
  168. package/components/routes/hits/search/grid/AddColumnModal.js +5 -4
  169. package/components/routes/hits/search/grid/EnhancedCell.d.ts +2 -1
  170. package/components/routes/hits/search/grid/EnhancedCell.js +2 -2
  171. package/components/routes/hits/search/grid/HitGrid.js +20 -18
  172. package/components/routes/hits/search/grid/{HitRow.d.ts → RecordRow.d.ts} +3 -2
  173. package/components/routes/hits/search/grid/{HitRow.js → RecordRow.js} +10 -8
  174. package/components/routes/hits/search/shared/IndexPicker.d.ts +2 -0
  175. package/components/routes/hits/search/shared/IndexPicker.js +20 -0
  176. package/components/routes/hits/view/HitViewer.js +12 -13
  177. package/components/routes/home/ViewCard.js +47 -41
  178. package/components/routes/observables/ObservableViewer.d.ts +7 -0
  179. package/components/routes/observables/ObservableViewer.js +27 -0
  180. package/components/routes/overviews/OverviewViewer.js +2 -2
  181. package/components/routes/views/ViewComposer.js +46 -19
  182. package/locales/en/translation.json +80 -3
  183. package/locales/fr/translation.json +78 -3
  184. package/models/WithMetadata.d.ts +2 -1
  185. package/models/entities/generated/AttachmentsFile.d.ts +12 -0
  186. package/models/entities/generated/Case.d.ts +28 -0
  187. package/models/entities/generated/DestinationOriginal.d.ts +19 -0
  188. package/models/entities/generated/EmailAttachment.d.ts +8 -0
  189. package/models/entities/generated/EmailParent.d.ts +19 -0
  190. package/models/entities/generated/Enrichments.d.ts +7 -0
  191. package/models/entities/generated/EnrichmentsIndicator.d.ts +21 -0
  192. package/models/entities/generated/Hit.d.ts +1 -0
  193. package/models/entities/generated/Howler.d.ts +0 -4
  194. package/models/entities/generated/HttpResponse.d.ts +11 -0
  195. package/models/entities/generated/Item.d.ts +9 -0
  196. package/models/entities/generated/Observable.d.ts +85 -0
  197. package/models/entities/generated/ObservableCloud.d.ts +20 -0
  198. package/models/entities/generated/ObservableDestination.d.ts +23 -0
  199. package/models/entities/generated/ObservableEmail.d.ts +30 -0
  200. package/models/entities/generated/ObservableFile.d.ts +36 -0
  201. package/models/entities/generated/ObservableHowler.d.ts +43 -0
  202. package/models/entities/generated/ObservableHttp.d.ts +11 -0
  203. package/models/entities/generated/ObservableObserver.d.ts +21 -0
  204. package/models/entities/generated/ObservableOrganization.d.ts +7 -0
  205. package/models/entities/generated/ObservableProcess.d.ts +34 -0
  206. package/models/entities/generated/ObservableSource.d.ts +23 -0
  207. package/models/entities/generated/ObservableThreat.d.ts +21 -0
  208. package/models/entities/generated/ObservableTls.d.ts +12 -0
  209. package/models/entities/generated/ObserverIngress.d.ts +9 -0
  210. package/models/entities/generated/Rule.d.ts +2 -10
  211. package/models/entities/generated/Task.d.ts +10 -0
  212. package/models/entities/generated/Threat.d.ts +2 -2
  213. package/models/entities/generated/{Enrichment.d.ts → ThreatEnrichment.d.ts} +1 -1
  214. package/models/entities/generated/View.d.ts +1 -0
  215. package/package.json +18 -1
  216. package/plugins/clue/components/ClueTypography.js +2 -2
  217. package/plugins/clue/utils.d.ts +2 -1
  218. package/tests/server-handlers.js +6 -1
  219. package/tests/utils.d.ts +4 -0
  220. package/tests/utils.js +20 -0
  221. package/utils/constants.d.ts +3 -3
  222. package/utils/hitFunctions.d.ts +2 -1
  223. package/utils/hitFunctions.js +4 -4
  224. package/utils/typeUtils.d.ts +7 -0
  225. package/utils/typeUtils.js +27 -0
  226. package/utils/viewUtils.js +3 -0
  227. package/components/app/providers/HitProvider.d.ts +0 -22
  228. package/components/elements/display/icons/BundleButton.d.ts +0 -6
  229. package/components/elements/display/icons/BundleButton.js +0 -32
  230. package/components/elements/hit/HitRelated.d.ts +0 -6
  231. package/components/elements/hit/HitRelated.js +0 -7
  232. package/components/routes/help/BundleDocumentation.d.ts +0 -3
  233. package/components/routes/help/BundleDocumentation.js +0 -12
  234. package/components/routes/help/markdown/en/bundles.md.js +0 -1
  235. package/components/routes/help/markdown/fr/bundles.md.js +0 -1
  236. package/components/routes/hits/search/BundleParentMenu.d.ts +0 -6
  237. package/components/routes/hits/search/BundleParentMenu.js +0 -32
  238. package/components/routes/hits/search/BundleScroller.d.ts +0 -2
  239. package/components/routes/hits/search/BundleScroller.js +0 -6
  240. package/components/routes/hits/search/HitContextMenu.js +0 -227
  241. /package/components/app/providers/{HitSearchProvider.test.d.ts → RecordSearchProvider.test.d.ts} +0 -0
  242. /package/components/{routes/hits/search/HitContextMenu.test.d.ts → elements/ContextMenu.test.d.ts} +0 -0
  243. /package/components/{routes/overviews/OverviewEditor.d.ts → elements/MarkdownEditor.d.ts} +0 -0
  244. /package/components/elements/hit/{HitDetails.d.ts → related/RelatedRecords.d.ts} +0 -0
  245. /package/components/routes/hits/search/{HitBrowser.d.ts → RecordBrowser.d.ts} +0 -0
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Close, ErrorOutline, SavedSearch, Terminal } from '@mui/icons-material';
2
+ import { ErrorOutline, SavedSearch, Terminal } from '@mui/icons-material';
3
3
  import { Box, IconButton, LinearProgress, Stack, Tooltip, Typography, useMediaQuery, useTheme } from '@mui/material';
4
4
  import { grey } from '@mui/material/colors';
5
5
  import AppListEmpty from '@cccsaurora/howler-ui/commons/components/display/AppListEmpty';
6
6
  import PageCenter from '@cccsaurora/howler-ui/commons/components/pages/PageCenter';
7
- import { HitContext } from '@cccsaurora/howler-ui/components/app/providers/HitProvider';
8
- import { HitSearchContext } from '@cccsaurora/howler-ui/components/app/providers/HitSearchProvider';
9
7
  import { ParameterContext } from '@cccsaurora/howler-ui/components/app/providers/ParameterProvider';
8
+ import { RecordContext } from '@cccsaurora/howler-ui/components/app/providers/RecordProvider';
9
+ import { RecordSearchContext } from '@cccsaurora/howler-ui/components/app/providers/RecordSearchProvider';
10
10
  import FlexOne from '@cccsaurora/howler-ui/components/elements/addons/layout/FlexOne';
11
11
  import FlexPort from '@cccsaurora/howler-ui/components/elements/addons/layout/FlexPort';
12
12
  import VSBox from '@cccsaurora/howler-ui/components/elements/addons/layout/vsbox/VSBox';
@@ -14,27 +14,25 @@ import VSBoxContent from '@cccsaurora/howler-ui/components/elements/addons/layou
14
14
  import VSBoxHeader from '@cccsaurora/howler-ui/components/elements/addons/layout/vsbox/VSBoxHeader';
15
15
  import SearchPagination from '@cccsaurora/howler-ui/components/elements/addons/search/SearchPagination';
16
16
  import SearchTotal from '@cccsaurora/howler-ui/components/elements/addons/search/SearchTotal';
17
- import HowlerCard from '@cccsaurora/howler-ui/components/elements/display/HowlerCard';
18
- import HitBanner from '@cccsaurora/howler-ui/components/elements/hit/HitBanner';
19
17
  import HitCard from '@cccsaurora/howler-ui/components/elements/hit/HitCard';
20
18
  import { HitLayout } from '@cccsaurora/howler-ui/components/elements/hit/HitLayout';
21
- import useHitSelection from '@cccsaurora/howler-ui/components/hooks/useHitSelection';
19
+ import ObservableCard from '@cccsaurora/howler-ui/components/elements/observable/ObservableCard';
20
+ import RecordContextMenu from '@cccsaurora/howler-ui/components/elements/record/RecordContextMenu';
22
21
  import { useMyLocalStorageItem } from '@cccsaurora/howler-ui/components/hooks/useMyLocalStorage';
23
- import React, { memo, useCallback, useEffect, useMemo } from 'react';
22
+ import useRecordSelection from '@cccsaurora/howler-ui/components/hooks/useRecordSelection';
23
+ import React, { memo, useCallback, useMemo } from 'react';
24
24
  import { isMobile } from 'react-device-detect';
25
25
  import { useTranslation } from 'react-i18next';
26
- import { Link, useLocation, useNavigate, useParams } from 'react-router-dom';
26
+ import { Link } from 'react-router-dom';
27
27
  import { useContextSelector } from 'use-context-selector';
28
28
  import { StorageKey } from '@cccsaurora/howler-ui/utils/constants';
29
- import BundleParentMenu from './BundleParentMenu';
30
- import { BundleScroller } from './BundleScroller';
31
- import HitContextMenu from './HitContextMenu';
32
- import HitQuery from './HitQuery';
29
+ import { isHit, isObservable } from '@cccsaurora/howler-ui/utils/typeUtils';
33
30
  import LayoutSettings from './LayoutSettings';
34
31
  import QuerySettings from './QuerySettings';
35
- const Item = memo(({ hit, onClick }) => {
32
+ import RecordQuery from './RecordQuery';
33
+ const Item = memo(({ record, onClick }) => {
36
34
  const theme = useTheme();
37
- const selectedHits = useContextSelector(HitContext, ctx => ctx.selectedHits);
35
+ const selectedRecords = useContextSelector(RecordContext, ctx => ctx.selectedRecords);
38
36
  const selected = useContextSelector(ParameterContext, ctx => ctx.selected);
39
37
  const checkMiddleClick = useCallback((e, id) => {
40
38
  if (e.button === 1) {
@@ -46,14 +44,14 @@ const Item = memo(({ hit, onClick }) => {
46
44
  const [hitLayout] = useMyLocalStorageItem(StorageKey.HIT_LAYOUT, HitLayout.NORMAL);
47
45
  const layout = useMemo(() => (isMobile ? HitLayout.COMFY : hitLayout), [hitLayout]);
48
46
  // Search result list item renderer.
49
- return (_jsx(Box, { id: hit.howler.id, onAuxClick: e => checkMiddleClick(e, hit.howler.id), onClick: ev => onClick(ev, hit), sx: [
47
+ return (_jsxs(Box, { id: record.howler.id, onAuxClick: e => checkMiddleClick(e, record.howler.id), onClick: ev => onClick(ev, record), sx: [
50
48
  {
51
49
  mb: 2,
52
50
  cursor: 'pointer',
53
51
  '& span,p,h6': {
54
52
  cursor: 'text'
55
53
  },
56
- '& .MuiPaper-root': {
54
+ '& > .MuiPaper-root': {
57
55
  border: '4px solid transparent',
58
56
  boxShadow: `0px 0px 0px 0px transparent`,
59
57
  transition: theme.transitions.create(['border-color', 'box-shadow'])
@@ -66,34 +64,26 @@ const Item = memo(({ hit, onClick }) => {
66
64
  paddingBottom: 'inherit' // prevents slight height variation on selected card.
67
65
  }
68
66
  },
69
- selectedHits.some(_hit => _hit.howler.id === hit.howler.id) && {
70
- '& .MuiPaper-root': { borderColor: grey[500], boxShadow: `0px 0px 5px 2px ${grey[500]}` }
67
+ selectedRecords.some(_record => _record.howler.id === record.howler.id) && {
68
+ '& > .MuiPaper-root': { borderColor: grey[500], boxShadow: `0px 0px 5px 2px ${grey[500]}` }
71
69
  },
72
- selected === hit.howler.id && {
73
- '& .MuiPaper-root': {
70
+ selected === record.howler.id && {
71
+ '& > .MuiPaper-root': {
74
72
  borderColor: 'primary.main',
75
73
  boxShadow: `0px 0px 5px 2px ${theme.palette.primary.main}`
76
74
  }
77
75
  }
78
- ], children: _jsx(HitCard, { id: hit.howler.id, layout: layout }) }));
76
+ ], children: [isHit(record) && _jsx(HitCard, { id: record.howler.id, layout: layout }), isObservable(record) && _jsx(ObservableCard, { id: record.howler.id, observable: record })] }));
79
77
  });
80
78
  const SearchPane = () => {
81
79
  const { t } = useTranslation();
82
- const location = useLocation();
83
- const navigate = useNavigate();
84
- const routeParams = useParams();
85
- const selected = useContextSelector(ParameterContext, ctx => ctx.selected);
86
- const setSelected = useContextSelector(ParameterContext, ctx => ctx.setSelected);
87
80
  const query = useContextSelector(ParameterContext, ctx => ctx.query);
88
81
  const setOffset = useContextSelector(ParameterContext, ctx => ctx.setOffset);
89
- const triggerSearch = useContextSelector(HitSearchContext, ctx => ctx.search);
90
- const searching = useContextSelector(HitSearchContext, ctx => ctx.searching);
91
- const response = useContextSelector(HitSearchContext, ctx => ctx.response);
92
- const error = useContextSelector(HitSearchContext, ctx => ctx.error);
93
- const { onClick } = useHitSelection();
94
- const getHit = useContextSelector(HitContext, ctx => ctx.getHit);
95
- const clearSelectedHits = useContextSelector(HitContext, ctx => ctx.clearSelectedHits);
96
- const bundleHit = useContextSelector(HitContext, ctx => location.pathname.startsWith('/bundles') ? ctx.hits[routeParams.id] : null);
82
+ const triggerSearch = useContextSelector(RecordSearchContext, ctx => ctx.search);
83
+ const searching = useContextSelector(RecordSearchContext, ctx => ctx.searching);
84
+ const response = useContextSelector(RecordSearchContext, ctx => ctx.response);
85
+ const error = useContextSelector(RecordSearchContext, ctx => ctx.error);
86
+ const { onClick } = useRecordSelection();
97
87
  const searchPaneWidth = useMyLocalStorageItem(StorageKey.SEARCH_PANE_WIDTH, null)[0];
98
88
  const verticalSorters = useMediaQuery('(max-width: 1919px)') || (searchPaneWidth ?? Number.MAX_SAFE_INTEGER) < 900;
99
89
  const getSelectedId = useCallback((event) => {
@@ -104,26 +94,13 @@ const SearchPane = () => {
104
94
  }
105
95
  return selectedElement.id;
106
96
  }, []);
107
- useEffect(() => {
108
- if (location.pathname.startsWith('/bundles')) {
109
- getHit(routeParams.id);
110
- }
111
- // eslint-disable-next-line react-hooks/exhaustive-deps
112
- }, [location.pathname, routeParams.id]);
113
- return (_jsx(FlexPort, { id: "hitscrollbar", children: _jsx(PageCenter, { textAlign: "left", mt: 0, mb: 6, ml: 0, mr: 0, maxWidth: "1500px", children: _jsxs(VSBox, { top: 0, children: [_jsxs(Stack, { ml: -1, mr: -1, sx: { '& .overflowingContentWidgets > *': { zIndex: '2000 !important' } }, spacing: 1, children: [bundleHit && (_jsx(BundleScroller, { children: _jsx(HitContextMenu, { getSelectedId: () => bundleHit.howler.id, children: _jsx(Stack, { spacing: 1, sx: { mx: -1 }, children: _jsx(HowlerCard, { sx: [
114
- { p: 1, border: '4px solid transparent', cursor: 'pointer' },
115
- location.pathname.startsWith('/bundles') &&
116
- selected === routeParams.id && { borderColor: 'primary.main' }
117
- ], onClick: () => {
118
- clearSelectedHits(bundleHit.howler.id);
119
- setSelected(bundleHit.howler.id);
120
- }, children: _jsx(HitBanner, { hit: bundleHit, layout: HitLayout.DENSE, useListener: true }) }) }) }) })), _jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [_jsx(Typography, { sx: { color: 'text.secondary', fontSize: '0.9em', fontStyle: 'italic', mb: 0.5 }, variant: "body2", children: t('hit.search.prompt') }), error && (_jsx(Tooltip, { title: `${t('route.advanced.error')}: ${error}`, children: _jsx(ErrorOutline, { fontSize: "small", color: "error" }) })), _jsx(FlexOne, {}), bundleHit?.howler.bundles.length > 0 && _jsx(BundleParentMenu, { bundle: bundleHit }), bundleHit && (_jsx(Tooltip, { title: t('hit.bundle.close'), children: _jsx(IconButton, { size: "small", onClick: () => navigate('/search'), children: _jsx(Close, {}) }) })), _jsx(Tooltip, { title: t('route.views.save'), children: _jsx(IconButton, { component: Link, disabled: !query, to: `/views/create?query=${query}`, children: _jsx(SavedSearch, {}) }) }), _jsx(Tooltip, { title: t('route.actions.save'), children: _jsx(IconButton, { component: Link, disabled: !query, to: `/action/execute?query=${query}`, children: _jsx(Terminal, {}) }) }), _jsx(LayoutSettings, {})] })] }), _jsxs(VSBoxHeader, { ml: -3, mr: -3, px: 2, pb: 1, sx: { zIndex: 989 }, children: [_jsxs(Stack, { sx: { pt: 1 }, children: [_jsxs(Stack, { sx: { position: 'relative', flex: 1 }, children: [_jsx(HitQuery, { searching: searching, triggerSearch: triggerSearch }), searching && (_jsx(LinearProgress, { sx: theme => ({
97
+ return (_jsx(FlexPort, { id: "hitscrollbar", children: _jsx(PageCenter, { textAlign: "left", mt: 0, mb: 6, ml: 0, mr: 0, maxWidth: "1500px", children: _jsxs(VSBox, { top: 0, children: [_jsx(Stack, { ml: -1, mr: -1, sx: { '& .overflowingContentWidgets > *': { zIndex: '2000 !important' } }, spacing: 1, children: _jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [_jsx(Typography, { sx: { color: 'text.secondary', fontSize: '0.9em', fontStyle: 'italic', mb: 0.5 }, variant: "body2", children: t('hit.search.prompt') }), error && (_jsx(Tooltip, { title: `${t('route.advanced.error')}: ${error}`, children: _jsx(ErrorOutline, { fontSize: "small", color: "error" }) })), _jsx(FlexOne, {}), _jsx(Tooltip, { title: t('route.views.save'), children: _jsx(IconButton, { component: Link, disabled: !query, to: `/views/create?query=${query}`, children: _jsx(SavedSearch, {}) }) }), _jsx(Tooltip, { title: t('route.actions.save'), children: _jsx(IconButton, { component: Link, disabled: !query, to: `/action/execute?query=${query}`, children: _jsx(Terminal, {}) }) }), _jsx(LayoutSettings, {})] }) }), _jsxs(VSBoxHeader, { ml: -3, mr: -3, px: 2, pb: 1, sx: { zIndex: 989 }, children: [_jsxs(Stack, { sx: { pt: 1 }, children: [_jsxs(Stack, { sx: { position: 'relative', flex: 1 }, children: [_jsx(RecordQuery, { searching: searching, triggerSearch: triggerSearch }), searching && (_jsx(LinearProgress, { sx: theme => ({
121
98
  position: 'absolute',
122
99
  left: 0,
123
100
  right: 0,
124
101
  bottom: 0,
125
102
  borderBottomLeftRadius: theme.shape.borderRadius,
126
103
  borderBottomRightRadius: theme.shape.borderRadius
127
- }) }))] }), _jsx(QuerySettings, { verticalSorters: verticalSorters, boxSx: { position: 'relative', pt: 1.5 } })] }), response && (_jsxs(Stack, { direction: "row", alignItems: "center", sx: { pt: 1 }, children: [_jsx(SearchTotal, { total: response.total, pageLength: response.items.length, offset: response.offset, sx: theme => ({ color: theme.palette.text.secondary, fontSize: '0.9em', fontStyle: 'italic' }) }), _jsx(Box, { flex: 1 }), _jsx(SearchPagination, { total: response.total, limit: response.rows, offset: response.offset, onChange: nextOffset => setOffset(nextOffset) })] }))] }), _jsx(VSBoxContent, { mr: -1, ml: -1, mt: 1, children: _jsx(HitContextMenu, { getSelectedId: getSelectedId, children: !response ? (_jsx(AppListEmpty, {})) : (response.items.map(hit => _jsx(Item, { hit: hit, onClick: onClick }, hit.howler.id))) }) })] }) }) }));
104
+ }) }))] }), _jsx(QuerySettings, { verticalSorters: verticalSorters, boxSx: { position: 'relative', pt: 1.5 } })] }), response && (_jsxs(Stack, { direction: "row", alignItems: "center", sx: { pt: 1 }, children: [_jsx(SearchTotal, { total: response.total, pageLength: response.items.length, offset: response.offset, sx: theme => ({ color: theme.palette.text.secondary, fontSize: '0.9em', fontStyle: 'italic' }) }), _jsx(Box, { flex: 1 }), _jsx(SearchPagination, { total: response.total, limit: response.rows, offset: response.offset, onChange: nextOffset => setOffset(nextOffset) })] }))] }), _jsx(VSBoxContent, { mr: -1, ml: -1, mt: 1, children: _jsx(RecordContextMenu, { getSelectedId: getSelectedId, children: !response ? (_jsx(AppListEmpty, {})) : (response.items.map(record => _jsx(Item, { record: record, onClick: onClick }, record.howler.id))) }) })] }) }) }));
128
105
  };
129
106
  export default memo(SearchPane);
@@ -2,8 +2,8 @@ import { createElement as _createElement } from "react";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { ArrowDropDown, Delete, Edit, Language, Lock, OpenInNew, Person, Refresh, SavedSearch, SelectAll } from '@mui/icons-material';
4
4
  import { Autocomplete, Chip, CircularProgress, IconButton, Stack, TextField, Tooltip, Typography } from '@mui/material';
5
- import { HitSearchContext } from '@cccsaurora/howler-ui/components/app/providers/HitSearchProvider';
6
5
  import { ParameterContext } from '@cccsaurora/howler-ui/components/app/providers/ParameterProvider';
6
+ import { RecordSearchContext } from '@cccsaurora/howler-ui/components/app/providers/RecordSearchProvider';
7
7
  import { ViewContext } from '@cccsaurora/howler-ui/components/app/providers/ViewProvider';
8
8
  import ChipPopper from '@cccsaurora/howler-ui/components/elements/display/ChipPopper';
9
9
  import { memo, useEffect, useMemo, useState } from 'react';
@@ -20,7 +20,7 @@ const ViewLink = ({ id, viewId }) => {
20
20
  const currentViews = useContextSelector(ParameterContext, ctx => ctx.views);
21
21
  const removeView = useContextSelector(ParameterContext, ctx => ctx.removeView);
22
22
  const setParamView = useContextSelector(ParameterContext, ctx => ctx.setView);
23
- const search = useContextSelector(HitSearchContext, ctx => ctx.search);
23
+ const search = useContextSelector(RecordSearchContext, ctx => ctx.search);
24
24
  const [loading, setLoading] = useState(true);
25
25
  const [view, setView] = useState(null);
26
26
  useEffect(() => {
@@ -47,7 +47,7 @@ const ViewLink = ({ id, viewId }) => {
47
47
  }, [query, sort, span, view]);
48
48
  const options = useMemo(() => Object.values(views).filter(_view => !!_view && !currentViews?.includes(_view.view_id)), [currentViews, views]);
49
49
  if (loading) {
50
- return _jsx(Chip, { size: "small", icon: _jsx(CircularProgress, { size: 12 }) });
50
+ return _jsx(Chip, { icon: _jsx(CircularProgress, { size: 12 }) });
51
51
  }
52
52
  if (viewId === '') {
53
53
  return (_jsx(ChipPopper, { icon: _jsx(SelectAll, {}), label: t('hit.search.view.select'), deleteIcon: _jsx(ArrowDropDown, {}), toggleOnDelete: true, slotProps: { chip: { size: 'small', color: 'warning' } }, children: _jsxs(Stack, { spacing: 1, direction: "row", children: [_jsx(Autocomplete, { fullWidth: true, size: "small", options: options, getOptionLabel: _view => t(_view.title), renderOption: ({ key, ...props }, o) => (_createElement("li", { ...props, key: key },
@@ -7,8 +7,8 @@ import { setupReactRouterMock } from '@cccsaurora/howler-ui/tests/mocks';
7
7
  import { vi } from 'vitest';
8
8
  setupReactRouterMock();
9
9
  // Import component after mocks
10
- import { HitSearchContext } from '@cccsaurora/howler-ui/components/app/providers/HitSearchProvider';
11
10
  import { ParameterContext } from '@cccsaurora/howler-ui/components/app/providers/ParameterProvider';
11
+ import { RecordSearchContext } from '@cccsaurora/howler-ui/components/app/providers/RecordSearchProvider';
12
12
  import { ViewContext } from '@cccsaurora/howler-ui/components/app/providers/ViewProvider';
13
13
  import i18n from '@cccsaurora/howler-ui/i18n';
14
14
  import { I18nextProvider } from 'react-i18next';
@@ -26,7 +26,7 @@ let mockParameterContext = {
26
26
  removeView: vi.fn(),
27
27
  setView: vi.fn()
28
28
  };
29
- let mockHitSearchContext = {
29
+ let mockRecordSearchContext = {
30
30
  search: vi.fn()
31
31
  };
32
32
  let mockViewContext = {
@@ -38,7 +38,7 @@ let mockViewContext = {
38
38
  };
39
39
  // Test wrapper
40
40
  const Wrapper = ({ children }) => {
41
- return (_jsx(I18nextProvider, { i18n: i18n, children: _jsx(ParameterContext.Provider, { value: mockParameterContext, children: _jsx(HitSearchContext.Provider, { value: mockHitSearchContext, children: _jsx(ViewContext.Provider, { value: mockViewContext, children: children }) }) }) }));
41
+ return (_jsx(I18nextProvider, { i18n: i18n, children: _jsx(ParameterContext.Provider, { value: mockParameterContext, children: _jsx(RecordSearchContext.Provider, { value: mockRecordSearchContext, children: _jsx(ViewContext.Provider, { value: mockViewContext, children: children }) }) }) }));
42
42
  };
43
43
  describe('ViewLink', () => {
44
44
  let user;
@@ -52,7 +52,7 @@ describe('ViewLink', () => {
52
52
  mockParameterContext.views = ['test-view-id'];
53
53
  mockParameterContext.removeView = vi.fn();
54
54
  mockParameterContext.setView = vi.fn();
55
- mockHitSearchContext.search = vi.fn();
55
+ mockRecordSearchContext.search = vi.fn();
56
56
  mockViewContext.getCurrentViews = vi.fn().mockResolvedValue([createMockView()]);
57
57
  mockViewContext.views = {
58
58
  'test-view-id': createMockView(),
@@ -230,7 +230,7 @@ describe('ViewLink', () => {
230
230
  await user.click(screen.getByText('Test View').parentElement);
231
231
  const refreshButton = await screen.findByLabelText(i18n.t('view.refresh'));
232
232
  await user.click(refreshButton);
233
- expect(mockHitSearchContext.search).toHaveBeenCalledWith('howler.id:*');
233
+ expect(mockRecordSearchContext.search).toHaveBeenCalledWith('howler.id:*');
234
234
  });
235
235
  it('should display open button', async () => {
236
236
  render(_jsx(ViewLink, { id: 0, viewId: "test-view-id" }), { wrapper: Wrapper });
@@ -306,7 +306,7 @@ describe('ViewLink', () => {
306
306
  await user.click(screen.getByText('Test View').parentElement);
307
307
  const refreshButton = await screen.findByLabelText(i18n.t('view.refresh'));
308
308
  await user.click(refreshButton);
309
- expect(mockHitSearchContext.search).toHaveBeenCalledWith(undefined);
309
+ expect(mockRecordSearchContext.search).toHaveBeenCalledWith(undefined);
310
310
  });
311
311
  it('should handle custom span correctly', async () => {
312
312
  mockParameterContext.span = 'date.range.custom';
@@ -398,14 +398,14 @@ describe('ViewLink', () => {
398
398
  expect(mockParameterContext.removeView).toHaveBeenCalledWith('test-view-id');
399
399
  }
400
400
  });
401
- it('should use search from HitSearchContext', async () => {
401
+ it('should use search from RecordSearchContext', async () => {
402
402
  mockViewContext.getCurrentViews = vi.fn().mockResolvedValue([createMockView()]);
403
403
  render(_jsx(ViewLink, { id: 0, viewId: "test-view-id" }), { wrapper: Wrapper });
404
404
  await screen.findByText('Test View');
405
405
  await user.click(screen.getByText('Test View').parentElement);
406
406
  const refreshButton = await screen.findByLabelText(i18n.t('view.refresh'));
407
407
  await user.click(refreshButton);
408
- expect(mockHitSearchContext.search).toHaveBeenCalledWith('howler.id:*');
408
+ expect(mockRecordSearchContext.search).toHaveBeenCalledWith('howler.id:*');
409
409
  });
410
410
  it('should filter available views using currentViews from ParameterContext', async () => {
411
411
  mockParameterContext.views = ['test-view-id'];
@@ -3,23 +3,24 @@ import { Add, Check, Settings, TableChart } from '@mui/icons-material';
3
3
  import { Autocomplete, Chip, Divider, Grid, IconButton, Stack, TextField } from '@mui/material';
4
4
  import useMatchers from '@cccsaurora/howler-ui/components/app/hooks/useMatchers';
5
5
  import { FieldContext } from '@cccsaurora/howler-ui/components/app/providers/FieldProvider';
6
- import { HitSearchContext } from '@cccsaurora/howler-ui/components/app/providers/HitSearchProvider';
6
+ import { RecordSearchContext } from '@cccsaurora/howler-ui/components/app/providers/RecordSearchProvider';
7
7
  import ChipPopper from '@cccsaurora/howler-ui/components/elements/display/ChipPopper';
8
- import { has, sortBy, uniq } from 'lodash-es';
8
+ import { sortBy, uniq } from 'lodash-es';
9
9
  import { memo, useContext, useEffect, useMemo, useState } from 'react';
10
10
  import { useTranslation } from 'react-i18next';
11
11
  import { useContextSelector } from 'use-context-selector';
12
+ import { isHit } from '@cccsaurora/howler-ui/utils/typeUtils';
12
13
  const AddColumnModal = ({ addColumn, columns }) => {
13
14
  const { t } = useTranslation();
14
15
  const { hitFields } = useContext(FieldContext);
15
- const response = useContextSelector(HitSearchContext, ctx => ctx.response);
16
+ const response = useContextSelector(RecordSearchContext, ctx => ctx.response);
16
17
  const { getMatchingTemplate } = useMatchers();
17
18
  const [columnToAdd, setColumnToAdd] = useState(null);
18
19
  const options = useMemo(() => hitFields.map(field => field.key), [hitFields]);
19
20
  const [suggestions, setSuggestions] = useState([]);
20
21
  useEffect(() => {
21
22
  (async () => {
22
- setSuggestions(uniq((await Promise.all((response?.items ?? []).map(async (_hit) => (has(_hit, '__template') ? _hit.__template?.keys : (await getMatchingTemplate(_hit))?.keys) ?? []))).flat()));
23
+ setSuggestions(uniq((await Promise.all((response?.items ?? []).filter(isHit).map(async (_hit) => (await getMatchingTemplate(_hit))?.keys ?? []))).flat()));
23
24
  })();
24
25
  }, [getMatchingTemplate, response?.items]);
25
26
  return (_jsx(ChipPopper, { icon: _jsx(TableChart, {}), deleteIcon: _jsx(Settings, {}), toggleOnDelete: true, slotProps: { chip: { size: 'small' } }, children: _jsxs(Stack, { spacing: 1, p: 1, width: "500px", children: [_jsxs(Stack, { direction: "row", spacing: 1, children: [_jsx(Autocomplete, { sx: { flex: 1 }, size: "small", options: options, value: columnToAdd, renderInput: params => _jsx(TextField, { fullWidth: true, placeholder: t('hit.fields'), ...params }), onChange: (_ev, value) => setColumnToAdd(value) }), _jsx(IconButton, { disabled: !columnToAdd, onClick: () => {
@@ -1,7 +1,8 @@
1
1
  import { type SxProps } from '@mui/material';
2
2
  import type { Hit } from '@cccsaurora/howler-ui/models/entities/generated/Hit';
3
+ import type { Observable } from '@cccsaurora/howler-ui/models/entities/generated/Observable';
3
4
  declare const _default: import("react").NamedExoticComponent<{
4
- hit: Hit;
5
+ record: Hit | Observable;
5
6
  value: string;
6
7
  sx?: SxProps;
7
8
  className: string;
@@ -4,7 +4,7 @@ import { Stack, TableCell } from '@mui/material';
4
4
  import PluginTypography from '@cccsaurora/howler-ui/components/elements/PluginTypography';
5
5
  import { memo } from 'react';
6
6
  import { useTranslation } from 'react-i18next';
7
- const EnhancedCell = ({ hit, value: rawValue, sx = {}, className, field }) => {
7
+ const EnhancedCell = ({ record, value: rawValue, sx = {}, className, field }) => {
8
8
  const { t } = useTranslation();
9
9
  if (!rawValue) {
10
10
  return _jsx(TableCell, { style: { borderBottom: 'none' }, children: t('none') });
@@ -13,6 +13,6 @@ const EnhancedCell = ({ hit, value: rawValue, sx = {}, className, field }) => {
13
13
  return (_jsx(TableCell, { sx: { borderBottom: 'none', borderRight: 'thin solid', borderRightColor: 'divider', fontSize: '0.8rem' }, children: _jsx(Stack, { direction: "row", className: className, spacing: 0.5, sx: [
14
14
  { display: 'flex', justifyContent: 'start', width: '100%', overflow: 'hidden' },
15
15
  ...(Array.isArray(sx) ? sx : [sx])
16
- ], children: values.map((value, index) => (_jsx(PluginTypography, { context: "table", sx: { fontSize: 'inherit', textOverflow: 'ellipsis' }, value: value, field: field, hit: hit, children: value }, value + index))) }) }));
16
+ ], children: values.map((value, index) => (_jsx(PluginTypography, { context: "table", sx: { fontSize: 'inherit', textOverflow: 'ellipsis' }, value: value, field: field, obj: record, children: value }, value + index))) }) }));
17
17
  };
18
18
  export default memo(EnhancedCell);
@@ -4,36 +4,37 @@ import { arrayMove, SortableContext, sortableKeyboardCoordinates } from '@dnd-ki
4
4
  import { FormatIndentDecrease, FormatIndentIncrease, Info, List, Search, TableChart } from '@mui/icons-material';
5
5
  import { IconButton, LinearProgress, Paper, Stack, Table, TableBody, TableCell, TableHead, TableRow, ToggleButton, ToggleButtonGroup, Typography, useTheme } from '@mui/material';
6
6
  import useMatchers from '@cccsaurora/howler-ui/components/app/hooks/useMatchers';
7
- import { HitContext } from '@cccsaurora/howler-ui/components/app/providers/HitProvider';
8
- import { HitSearchContext } from '@cccsaurora/howler-ui/components/app/providers/HitSearchProvider';
9
7
  import { ParameterContext } from '@cccsaurora/howler-ui/components/app/providers/ParameterProvider';
8
+ import { RecordContext } from '@cccsaurora/howler-ui/components/app/providers/RecordProvider';
9
+ import { RecordSearchContext } from '@cccsaurora/howler-ui/components/app/providers/RecordSearchProvider';
10
10
  import SearchTotal from '@cccsaurora/howler-ui/components/elements/addons/search/SearchTotal';
11
11
  import DevelopmentBanner from '@cccsaurora/howler-ui/components/elements/display/features/DevelopmentBanner';
12
- import useHitSelection from '@cccsaurora/howler-ui/components/hooks/useHitSelection';
12
+ import RecordContextMenu from '@cccsaurora/howler-ui/components/elements/record/RecordContextMenu';
13
13
  import { useMyLocalStorageItem } from '@cccsaurora/howler-ui/components/hooks/useMyLocalStorage';
14
+ import useRecordSelection from '@cccsaurora/howler-ui/components/hooks/useRecordSelection';
14
15
  import { uniq } from 'lodash-es';
15
16
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
16
17
  import { useTranslation } from 'react-i18next';
17
18
  import { useContextSelector } from 'use-context-selector';
18
19
  import { StorageKey } from '@cccsaurora/howler-ui/utils/constants';
19
- import HitContextMenu from '../HitContextMenu';
20
- import HitQuery from '../HitQuery';
20
+ import { isHit } from '@cccsaurora/howler-ui/utils/typeUtils';
21
21
  import QuerySettings from '../QuerySettings';
22
+ import RecordQuery from '../RecordQuery';
22
23
  import AddColumnModal from './AddColumnModal';
23
24
  import ColumnHeader from './ColumnHeader';
24
- import HitRow from './HitRow';
25
+ import RecordRow from './RecordRow';
25
26
  const HitGrid = () => {
26
27
  const { t } = useTranslation();
27
28
  const theme = useTheme();
28
29
  const sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }));
29
- const { onClick } = useHitSelection();
30
+ const { onClick } = useRecordSelection();
30
31
  const { getMatchingAnalytic } = useMatchers();
31
- const search = useContextSelector(HitSearchContext, ctx => ctx.search);
32
- const displayType = useContextSelector(HitSearchContext, ctx => ctx.displayType);
33
- const setDisplayType = useContextSelector(HitSearchContext, ctx => ctx.setDisplayType);
34
- const response = useContextSelector(HitSearchContext, ctx => ctx.response);
35
- const searching = useContextSelector(HitSearchContext, ctx => ctx.searching);
36
- const selectedHits = useContextSelector(HitContext, ctx => ctx.selectedHits);
32
+ const search = useContextSelector(RecordSearchContext, ctx => ctx.search);
33
+ const displayType = useContextSelector(RecordSearchContext, ctx => ctx.displayType);
34
+ const setDisplayType = useContextSelector(RecordSearchContext, ctx => ctx.setDisplayType);
35
+ const response = useContextSelector(RecordSearchContext, ctx => ctx.response);
36
+ const searching = useContextSelector(RecordSearchContext, ctx => ctx.searching);
37
+ const selectedHits = useContextSelector(RecordContext, ctx => ctx.selectedRecords);
37
38
  const query = useContextSelector(ParameterContext, ctx => ctx.query);
38
39
  const selected = useContextSelector(ParameterContext, ctx => ctx.selected);
39
40
  const [collapseMainColumn, setCollapseMainColumn] = useMyLocalStorageItem(StorageKey.GRID_COLLAPSE_COLUMN, false);
@@ -56,10 +57,11 @@ const HitGrid = () => {
56
57
  return false;
57
58
  }, [selected, selectedHits]);
58
59
  useEffect(() => {
59
- response?.items.forEach(hit => {
60
- if (!analyticIds[hit.howler.analytic]) {
61
- getMatchingAnalytic(hit).then(_analytic => setAnalyticIds(_analyticIds => ({ ..._analyticIds, [hit.howler.analytic]: _analytic.analytic_id })));
60
+ response?.items.forEach(record => {
61
+ if (!isHit(record) || analyticIds[record.howler.analytic]) {
62
+ return;
62
63
  }
64
+ getMatchingAnalytic(record).then(_analytic => setAnalyticIds(_analyticIds => ({ ..._analyticIds, [record.howler.analytic]: _analytic.analytic_id })));
63
65
  });
64
66
  // eslint-disable-next-line react-hooks/exhaustive-deps
65
67
  }, [analyticIds, response]);
@@ -117,7 +119,7 @@ const HitGrid = () => {
117
119
  }
118
120
  return selectedElement.id;
119
121
  }, []);
120
- return (_jsxs(Stack, { spacing: 1, p: 2, width: "100%", sx: { overflow: 'hidden', height: `calc(100vh - ${theme.spacing(showSelectBar ? 13 : 8)})` }, children: [_jsx(DevelopmentBanner, {}), _jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [_jsx(Typography, { sx: { color: 'text.secondary', fontSize: '0.9em', fontStyle: 'italic', mb: 0.5, textAlign: 'left' }, variant: "body2", children: t('hit.search.prompt') }), response && (_jsx(SearchTotal, { sx: { color: 'text.secondary', fontSize: '0.9em', fontStyle: 'italic', mb: 0.5 }, variant: "body2", offset: response.offset, pageLength: response.rows, total: response.total }))] }), _jsxs(Stack, { direction: "row", spacing: 1, children: [_jsxs(Stack, { position: "relative", flex: 1, children: [_jsx(HitQuery, { searching: searching, triggerSearch: search, compact: true }), searching && (_jsx(LinearProgress, { sx: {
122
+ return (_jsxs(Stack, { spacing: 1, p: 2, width: "100%", sx: { overflow: 'hidden', height: `calc(100vh - ${theme.spacing(showSelectBar ? 13 : 8)})` }, children: [_jsx(DevelopmentBanner, {}), _jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [_jsx(Typography, { sx: { color: 'text.secondary', fontSize: '0.9em', fontStyle: 'italic', mb: 0.5, textAlign: 'left' }, variant: "body2", children: t('hit.search.prompt') }), response && (_jsx(SearchTotal, { sx: { color: 'text.secondary', fontSize: '0.9em', fontStyle: 'italic', mb: 0.5 }, variant: "body2", offset: response.offset, pageLength: response.rows, total: response.total }))] }), _jsxs(Stack, { direction: "row", spacing: 1, children: [_jsxs(Stack, { position: "relative", flex: 1, children: [_jsx(RecordQuery, { searching: searching, triggerSearch: search, compact: true }), searching && (_jsx(LinearProgress, { sx: {
121
123
  position: 'absolute',
122
124
  left: 0,
123
125
  right: 0,
@@ -127,6 +129,6 @@ const HitGrid = () => {
127
129
  } }))] }), _jsxs(ToggleButtonGroup, { exclusive: true, value: displayType, onChange: (__, value) => setDisplayType(value), size: "small", children: [_jsx(ToggleButton, { value: "list", children: _jsx(List, {}) }), _jsx(ToggleButton, { value: "grid", children: _jsx(TableChart, {}) })] })] }), _jsxs(Stack, { direction: "row", spacing: 1, width: "100%", alignItems: "center", children: [_jsx(QuerySettings, { boxSx: { flex: 1 } }), _jsx(AddColumnModal, { columns: columns, addColumn: key => setColumns(uniq([...columns, key])) })] }), _jsxs(Stack, { component: Paper, spacing: 1, width: "100%", height: "100%", sx: { overflow: 'auto', flex: 1 }, onScroll: onScroll, children: [_jsxs(Table, { sx: { '& td,th': { px: 1, py: 0.25, whiteSpace: 'nowrap' } }, children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { sx: {
128
130
  borderRight: 'thin solid',
129
131
  borderRightColor: 'divider'
130
- }, children: _jsx(IconButton, { onClick: () => setCollapseMainColumn(!collapseMainColumn), children: collapseMainColumn ? (_jsx(FormatIndentIncrease, { fontSize: "small" })) : (_jsx(FormatIndentDecrease, { fontSize: "small" })) }) }), _jsx(DndContext, { sensors: sensors, collisionDetection: pointerWithin, onDragEnd: handleDragEnd, children: _jsx(SortableContext, { items: columns, children: columns.map(col => (_jsx(ColumnHeader, { col: col, width: columnWidths[col], onMouseDown: onMouseDown, setColumns: setColumns }, col))) }) }), _jsx(TableCell, { sx: { width: '100%' } })] }) }), _jsxs(HitContextMenu, { Component: TableBody, getSelectedId: getSelectedId, children: [response?.items.map(hit => (_jsx(HitRow, { hit: hit, analyticIds: analyticIds, columns: columns, columnWidths: columnWidths, collapseMainColumn: collapseMainColumn, onClick: onClick }, hit.howler.id))), _jsx(TableRow, { children: _jsx(TableCell, { colSpan: columns.length + 2, children: _jsx(Stack, { alignItems: "center", justifyContent: "center", py: 0.5, px: 1, children: _jsx(IconButton, { onClick: () => search(query, true), children: _jsx(Search, {}) }) }) }) })] })] }), (response?.total ?? 0) < 1 && (_jsx(Stack, { direction: "row", spacing: 1, alignItems: "center", p: 1, justifyContent: "center", flex: 1, children: _jsxs(Typography, { variant: "h3", color: "text.secondary", display: "flex", flexDirection: "row", alignItems: "center", children: [_jsx(Info, { fontSize: "inherit", sx: { color: 'text.secondary', mr: 1 } }), _jsx("span", { children: t('app.list.empty') })] }) }))] })] }));
132
+ }, children: _jsx(IconButton, { onClick: () => setCollapseMainColumn(!collapseMainColumn), children: collapseMainColumn ? (_jsx(FormatIndentIncrease, { fontSize: "small" })) : (_jsx(FormatIndentDecrease, { fontSize: "small" })) }) }), _jsx(DndContext, { sensors: sensors, collisionDetection: pointerWithin, onDragEnd: handleDragEnd, children: _jsx(SortableContext, { items: columns, children: columns.map(col => (_jsx(ColumnHeader, { col: col, width: columnWidths[col], onMouseDown: onMouseDown, setColumns: setColumns }, col))) }) }), _jsx(TableCell, { sx: { width: '100%' } })] }) }), _jsxs(RecordContextMenu, { Component: TableBody, getSelectedId: getSelectedId, children: [response?.items.map(hit => (_jsx(RecordRow, { record: hit, analyticIds: analyticIds, columns: columns, columnWidths: columnWidths, collapseMainColumn: collapseMainColumn, onClick: onClick }, hit.howler.id))), _jsx(TableRow, { children: _jsx(TableCell, { colSpan: columns.length + 2, children: _jsx(Stack, { alignItems: "center", justifyContent: "center", py: 0.5, px: 1, children: _jsx(IconButton, { onClick: () => search(query, true), children: _jsx(Search, {}) }) }) }) })] })] }), (response?.total ?? 0) < 1 && (_jsx(Stack, { direction: "row", spacing: 1, alignItems: "center", p: 1, justifyContent: "center", flex: 1, children: _jsxs(Typography, { variant: "h3", color: "text.secondary", display: "flex", flexDirection: "row", alignItems: "center", children: [_jsx(Info, { fontSize: "inherit", sx: { color: 'text.secondary', mr: 1 } }), _jsx("span", { children: t('app.list.empty') })] }) }))] })] }));
131
133
  };
132
134
  export default HitGrid;
@@ -1,10 +1,11 @@
1
1
  import type { Hit } from '@cccsaurora/howler-ui/models/entities/generated/Hit';
2
+ import type { Observable } from '@cccsaurora/howler-ui/models/entities/generated/Observable';
2
3
  declare const _default: import("react").NamedExoticComponent<{
3
- hit: Hit;
4
+ record: Hit | Observable;
4
5
  analyticIds: Record<string, string>;
5
6
  columns: string[];
6
7
  columnWidths: Record<string, string>;
7
8
  collapseMainColumn: boolean;
8
- onClick: (e: React.MouseEvent<HTMLDivElement>, hit: Hit) => void;
9
+ onClick: (e: React.MouseEvent<HTMLDivElement>, record: Hit | Observable) => void;
9
10
  }>;
10
11
  export default _default;
@@ -1,25 +1,27 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { KeyboardArrowUp } from '@mui/icons-material';
3
3
  import { Box, Collapse, IconButton, lighten, Stack, TableCell, TableRow, Typography, useTheme } from '@mui/material';
4
- import { HitContext } from '@cccsaurora/howler-ui/components/app/providers/HitProvider';
5
4
  import { ParameterContext } from '@cccsaurora/howler-ui/components/app/providers/ParameterProvider';
5
+ import { RecordContext } from '@cccsaurora/howler-ui/components/app/providers/RecordProvider';
6
6
  import Assigned from '@cccsaurora/howler-ui/components/elements/hit/elements/Assigned';
7
7
  import EscalationChip from '@cccsaurora/howler-ui/components/elements/hit/elements/EscalationChip';
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
+ import ObservableCard from '@cccsaurora/howler-ui/components/elements/observable/ObservableCard';
10
11
  import { get } from 'lodash-es';
11
12
  import { memo, useState } from 'react';
12
13
  import { useTranslation } from 'react-i18next';
13
14
  import { Link } from 'react-router-dom';
14
15
  import { useContextSelector } from 'use-context-selector';
16
+ import { isHit } from '@cccsaurora/howler-ui/utils/typeUtils';
15
17
  import EnhancedCell from './EnhancedCell';
16
- const HitRow = ({ hit, analyticIds, columns, columnWidths, collapseMainColumn, onClick }) => {
18
+ const RecordRow = ({ record, analyticIds, columns, columnWidths, collapseMainColumn, onClick }) => {
17
19
  const theme = useTheme();
18
20
  const { t } = useTranslation();
19
- const selectedHits = useContextSelector(HitContext, ctx => ctx.selectedHits);
21
+ const selectedHits = useContextSelector(RecordContext, ctx => ctx.selectedRecords);
20
22
  const selected = useContextSelector(ParameterContext, ctx => ctx.selected);
21
23
  const [expandRow, setExpandRow] = useState(false);
22
- return (_jsxs(_Fragment, { children: [_jsxs(TableRow, { id: hit.howler.id, onClick: ev => onClick(ev, hit), sx: [
24
+ return (_jsxs(_Fragment, { children: [_jsxs(TableRow, { id: record.howler.id, onClick: ev => onClick(ev, record), sx: [
23
25
  {
24
26
  transition: theme.transitions.create('background-color'),
25
27
  '&:hover': {
@@ -27,10 +29,10 @@ const HitRow = ({ hit, analyticIds, columns, columnWidths, collapseMainColumn, o
27
29
  backgroundColor: theme.palette.background.paper
28
30
  }
29
31
  },
30
- selectedHits.some(_hit => _hit.howler.id === hit.howler.id) && {
32
+ selectedHits.some(_hit => _hit.howler.id === record.howler.id) && {
31
33
  backgroundColor: lighten(theme.palette.background.paper, 0.15)
32
34
  },
33
- selected === hit.howler.id && {
35
+ selected === record.howler.id && {
34
36
  backgroundColor: lighten(theme.palette.background.paper, 0.25)
35
37
  }
36
38
  ], children: [_jsx(TableCell, { sx: {
@@ -45,6 +47,6 @@ const HitRow = ({ hit, analyticIds, columns, columnWidths, collapseMainColumn, o
45
47
  e.preventDefault();
46
48
  e.stopPropagation();
47
49
  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] }), hit.howler.assignment !== 'unassigned' && _jsx(Assigned, { 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 }) }) }) }) })] }));
50
+ }, children: _jsx(KeyboardArrowUp, {}) }), _jsx(Collapse, { in: !collapseMainColumn, orientation: "horizontal", unmountOnExit: true, children: _jsxs(Stack, { direction: "row", spacing: 1, flexWrap: "nowrap", children: [isHit(record) && _jsx(EscalationChip, { hit: record, layout: HitLayout.DENSE, hideLabel: true }), _jsxs(Typography, { sx: { textWrap: 'nowrap', whiteSpace: 'nowrap', fontSize: 'inherit' }, children: [analyticIds[record.howler.analytic] ? (_jsx(Link, { to: `/analytics/${analyticIds[record.howler.analytic]}`, onClick: e => e.stopPropagation(), children: record.howler.analytic })) : (record.howler.analytic), record.howler.detection && ': ', record.howler.detection] }), isHit(record) && record.howler.assignment !== 'unassigned' && (_jsx(Assigned, { hit: record, layout: HitLayout.DENSE, hideLabel: true }))] }) })] }) }), columns.map(col => (_jsx(EnhancedCell, { record: record, className: `col-${col.replaceAll('.', '-')}`, value: get(record, col) ?? t('none'), sx: columnWidths[col] ? { width: columnWidths[col] } : { width: '220px', maxWidth: '300px' }, field: col }, col)))] }, record.howler.id), _jsx(TableRow, { onClick: ev => onClick(ev, record), 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: isHit(record) ? (_jsx(HitCard, { id: record.howler.id, layout: HitLayout.NORMAL })) : (_jsx(ObservableCard, { id: record.howler.id, observable: record })) }) }) }) })] }));
49
51
  };
50
- export default memo(HitRow);
52
+ export default memo(RecordRow);
@@ -0,0 +1,2 @@
1
+ declare const _default: import("react").NamedExoticComponent<{}>;
2
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { FilterList } from '@mui/icons-material';
3
+ import { Autocomplete, TextField } from '@mui/material';
4
+ import { ParameterContext } from '@cccsaurora/howler-ui/components/app/providers/ParameterProvider';
5
+ import ChipPopper from '@cccsaurora/howler-ui/components/elements/display/ChipPopper';
6
+ import { memo } from 'react';
7
+ import { useTranslation } from 'react-i18next';
8
+ import { useContextSelector } from 'use-context-selector';
9
+ const FILTER_OPTIONS = [
10
+ { label: 'hit.search.index.hit', value: 'hit' },
11
+ { label: 'hit.search.index.observable', value: 'observable' }
12
+ ];
13
+ const IndexPicker = () => {
14
+ const { t } = useTranslation();
15
+ const indexes = useContextSelector(ParameterContext, ctx => ctx.indexes);
16
+ const setIndexes = useContextSelector(ParameterContext, ctx => ctx.setIndexes);
17
+ const selectedOptions = FILTER_OPTIONS.filter(opt => indexes.includes(opt.value));
18
+ return (_jsx(ChipPopper, { icon: _jsx(FilterList, { fontSize: "small" }), label: selectedOptions.map(opt => t(opt.label)).join(', '), minWidth: "225px", slotProps: { chip: { size: 'small' } }, children: _jsx(Autocomplete, { size: "small", multiple: true, options: FILTER_OPTIONS, value: selectedOptions, onChange: (_ev, values) => values.length > 0 && setIndexes(values.map(val => val.value)), isOptionEqualToValue: (opt, val) => opt.value === val.value, getOptionLabel: opt => t(opt.label), renderInput: params => _jsx(TextField, { ...params }) }) }));
19
+ };
20
+ export default memo(IndexPicker);
@@ -4,23 +4,22 @@ import { Code, Comment, DataObject, History, LinkSharp, QueryStats, ViewAgenda }
4
4
  import { Badge, Box, CardContent, Collapse, IconButton, Skeleton, Stack, Tab, Tabs, Tooltip, useMediaQuery, useTheme } from '@mui/material';
5
5
  import PageCenter from '@cccsaurora/howler-ui/commons/components/pages/PageCenter';
6
6
  import useMatchers from '@cccsaurora/howler-ui/components/app/hooks/useMatchers';
7
- import { HitContext } from '@cccsaurora/howler-ui/components/app/providers/HitProvider';
7
+ import { RecordContext } from '@cccsaurora/howler-ui/components/app/providers/RecordProvider';
8
8
  import FlexOne from '@cccsaurora/howler-ui/components/elements/addons/layout/FlexOne';
9
9
  import HowlerCard from '@cccsaurora/howler-ui/components/elements/display/HowlerCard';
10
- import BundleButton from '@cccsaurora/howler-ui/components/elements/display/icons/BundleButton';
11
10
  import SocketBadge from '@cccsaurora/howler-ui/components/elements/display/icons/SocketBadge';
12
11
  import JSONViewer from '@cccsaurora/howler-ui/components/elements/display/json/JSONViewer';
13
12
  import HitActions from '@cccsaurora/howler-ui/components/elements/hit/HitActions';
14
13
  import HitBanner from '@cccsaurora/howler-ui/components/elements/hit/HitBanner';
15
- import HitComments from '@cccsaurora/howler-ui/components/elements/hit/HitComments';
16
- import HitDetails from '@cccsaurora/howler-ui/components/elements/hit/HitDetails';
17
14
  import HitLabels from '@cccsaurora/howler-ui/components/elements/hit/HitLabels';
18
15
  import { HitLayout } from '@cccsaurora/howler-ui/components/elements/hit/HitLayout';
19
16
  import HitLinks from '@cccsaurora/howler-ui/components/elements/hit/HitLinks';
20
17
  import HitOutline from '@cccsaurora/howler-ui/components/elements/hit/HitOutline';
21
18
  import HitOverview from '@cccsaurora/howler-ui/components/elements/hit/HitOverview';
22
- import HitRelated from '@cccsaurora/howler-ui/components/elements/hit/HitRelated';
23
- import HitWorklog from '@cccsaurora/howler-ui/components/elements/hit/HitWorklog';
19
+ import ObjectDetails from '@cccsaurora/howler-ui/components/elements/ObjectDetails';
20
+ import RecordComments from '@cccsaurora/howler-ui/components/elements/record/RecordComments';
21
+ import RecordRelated from '@cccsaurora/howler-ui/components/elements/record/RecordRelated';
22
+ import RecordWorklog from '@cccsaurora/howler-ui/components/elements/record/RecordWorklog';
24
23
  import { useMyLocalStorageItem } from '@cccsaurora/howler-ui/components/hooks/useMyLocalStorage';
25
24
  import useMyUserList from '@cccsaurora/howler-ui/components/hooks/useMyUserList';
26
25
  import { useCallback, useEffect, useMemo, useState } from 'react';
@@ -44,8 +43,8 @@ const HitViewer = () => {
44
43
  const isUnderLg = useMediaQuery(theme.breakpoints.down('lg'));
45
44
  const [orientation, setOrientation] = useMyLocalStorageItem(StorageKey.VIEWER_ORIENTATION, Orientation.VERTICAL);
46
45
  const { getMatchingOverview, getMatchingDossiers, getMatchingAnalytic } = useMatchers();
47
- const getHit = useContextSelector(HitContext, ctx => ctx.getHit);
48
- const hit = useContextSelector(HitContext, ctx => ctx.hits[params.id]);
46
+ const getHit = useContextSelector(RecordContext, ctx => ctx.getRecord);
47
+ const hit = useContextSelector(RecordContext, ctx => ctx.records[params.id]);
49
48
  const [userIds, setUserIds] = useState(new Set());
50
49
  const users = useMyUserList(userIds);
51
50
  const [tab, setTab] = useState('details');
@@ -94,12 +93,12 @@ const HitViewer = () => {
94
93
  }
95
94
  return {
96
95
  overview: () => _jsx(HitOverview, { hit: hit }),
97
- details: () => _jsx(HitDetails, { hit: hit }),
98
- hit_comments: () => _jsx(HitComments, { hit: hit, users: users }),
96
+ details: () => _jsx(ObjectDetails, { obj: hit }),
97
+ hit_comments: () => _jsx(RecordComments, { record: hit, users: users }),
99
98
  hit_raw: () => _jsx(JSONViewer, { data: hit }),
100
99
  hit_data: () => _jsx(JSONViewer, { data: hit?.howler?.data?.map(entry => tryParse(entry)), collapse: false }),
101
- hit_worklog: () => _jsx(HitWorklog, { hit: hit, users: users }),
102
- hit_related: () => _jsx(HitRelated, { hit: hit }),
100
+ hit_worklog: () => _jsx(RecordWorklog, { record: hit, users: users }),
101
+ hit_related: () => _jsx(RecordRelated, { record: hit }),
103
102
  ...Object.fromEntries(hit?.howler.dossier?.map((lead, index) => ['lead:' + index, () => _jsx(LeadRenderer, { lead: lead, hit: hit })]) ?? []),
104
103
  ...Object.fromEntries(dossiers.flatMap((_dossier, dossierIndex) => (_dossier.leads ?? []).map((_lead, leadIndex) => [
105
104
  `external-lead:${dossierIndex}:${leadIndex}`,
@@ -132,7 +131,7 @@ const HitViewer = () => {
132
131
  position: 'absolute',
133
132
  top: theme.spacing(2),
134
133
  right: theme.spacing(-6)
135
- }, children: [_jsx(Tooltip, { title: t('hit.panel.view.layout'), children: _jsx(IconButton, { onClick: onOrientationChange, children: _jsx(ViewAgenda, { sx: { transition: 'rotate 250ms', rotate: orientation === 'vertical' ? '90deg' : '0deg' } }) }) }), _jsx(SocketBadge, { size: "medium" }), analytic && (_jsx(Tooltip, { title: t('hit.panel.analytic.open'), children: _jsx(IconButton, { onClick: () => navigate(`/analytics/${analytic.analytic_id}`), children: _jsx(QueryStats, {}) }) })), hit?.howler.bundles?.length > 0 && _jsx(BundleButton, { ids: hit.howler.bundles })] }))] }), _jsx(HowlerCard, { sx: [orientation === 'horizontal' && { height: '0px' }], children: _jsx(CardContent, { sx: { padding: 1, position: 'relative' }, children: _jsx(HitActions, { hit: hit, orientation: "vertical" }) }) }), _jsx(Box, { sx: { gridColumn: '1 / span 2', mb: 1 }, children: _jsxs(Tabs, { value: tab === 'overview' && !hasOverview ? 'details' : tab, sx: { display: 'flex', flexDirection: 'row', pr: 2, alignItems: 'center' }, children: [hit?.howler?.is_bundle && (_jsx(Tab, { label: t('hit.viewer.aggregate'), value: "hit_aggregate", onClick: () => setTab('hit_aggregate') })), hasOverview && (_jsx(Tab, { label: t('hit.viewer.overview'), value: "overview", onClick: () => setTab('overview') })), _jsx(Tab, { label: t('hit.viewer.details'), value: "details", onClick: () => setTab('details') }), hit?.howler.dossier?.map((lead, index) => (_jsx(Tab
134
+ }, children: [_jsx(Tooltip, { title: t('hit.panel.view.layout'), children: _jsx(IconButton, { onClick: onOrientationChange, children: _jsx(ViewAgenda, { sx: { transition: 'rotate 250ms', rotate: orientation === 'vertical' ? '90deg' : '0deg' } }) }) }), _jsx(SocketBadge, { size: "medium" }), analytic && (_jsx(Tooltip, { title: t('analytic.open'), children: _jsx(IconButton, { onClick: () => navigate(`/analytics/${analytic.analytic_id}`), children: _jsx(QueryStats, {}) }) }))] }))] }), _jsx(HowlerCard, { sx: [orientation === 'horizontal' && { height: '0px' }], children: _jsx(CardContent, { sx: { padding: 1, position: 'relative' }, children: _jsx(HitActions, { hit: hit, orientation: "vertical" }) }) }), _jsx(Box, { sx: { gridColumn: '1 / span 2', mb: 1 }, children: _jsxs(Tabs, { value: tab === 'overview' && !hasOverview ? 'details' : tab, sx: { display: 'flex', flexDirection: 'row', pr: 2, alignItems: 'center' }, children: [hasOverview && (_jsx(Tab, { label: t('hit.viewer.overview'), value: "overview", onClick: () => setTab('overview') })), _jsx(Tab, { label: t('hit.viewer.details'), value: "details", onClick: () => setTab('details') }), hit?.howler.dossier?.map((lead, index) => (_jsx(Tab
136
135
  // eslint-disable-next-line react/no-array-index-key
137
136
  , { label: _jsxs(Stack, { direction: "row", spacing: 0.5, children: [lead.icon && _jsx(Icon, { icon: lead.icon }), _jsx("span", { children: i18n.language === 'en' ? lead.label.en : lead.label.fr })] }), value: 'lead:' + index, onClick: () => setTab('lead:' + index) }, 'lead:' + index))), dossiers.flatMap((_dossier, dossierIndex) => (_dossier.leads ?? []).map((_lead, leadIndex) => (_jsx(Tab
138
137
  // eslint-disable-next-line react/no-array-index-key