@cccsaurora/howler-ui 2.18.0-dev.667 → 2.18.0-dev.674

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 (230) 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 +6 -0
  8. package/api/v2/case/index.js +18 -0
  9. package/api/v2/index.d.ts +4 -0
  10. package/api/v2/index.js +6 -0
  11. package/api/v2/search/facet.d.ts +3 -0
  12. package/api/v2/search/facet.js +12 -0
  13. package/api/v2/search/index.d.ts +5 -0
  14. package/api/v2/search/index.js +24 -0
  15. package/commons/components/leftnav/LeftNavDrawer.js +1 -1
  16. package/components/app/App.js +34 -7
  17. package/components/app/hooks/useMatchers.js +2 -2
  18. package/components/app/hooks/useMatchers.test.js +22 -22
  19. package/components/app/hooks/useTitle.js +3 -3
  20. package/components/app/providers/FavouritesProvider.js +2 -2
  21. package/components/app/providers/ParameterProvider.d.ts +9 -2
  22. package/components/app/providers/ParameterProvider.js +165 -240
  23. package/components/app/providers/ParameterProvider.test.js +307 -14
  24. package/components/app/providers/RecordProvider.d.ts +23 -0
  25. package/components/app/providers/{HitProvider.js → RecordProvider.js} +41 -41
  26. package/components/app/providers/{HitSearchProvider.d.ts → RecordSearchProvider.d.ts} +6 -6
  27. package/components/app/providers/{HitSearchProvider.js → RecordSearchProvider.js} +12 -17
  28. package/components/app/providers/{HitSearchProvider.test.js → RecordSearchProvider.test.js} +51 -70
  29. package/components/elements/ContextMenu.d.ts +56 -0
  30. package/components/elements/ContextMenu.js +109 -0
  31. package/components/elements/ContextMenu.test.js +215 -0
  32. package/components/{routes/overviews/OverviewEditor.js → elements/MarkdownEditor.js} +3 -3
  33. package/components/elements/ObjectDetails.d.ts +6 -0
  34. package/components/elements/{hit/HitDetails.js → ObjectDetails.js} +17 -17
  35. package/components/elements/PluginTypography.d.ts +2 -1
  36. package/components/elements/PluginTypography.js +3 -2
  37. package/components/elements/UserList.d.ts +5 -2
  38. package/components/elements/UserList.js +14 -5
  39. package/components/elements/addons/search/phrase/Phrase.js +1 -1
  40. package/components/elements/case/CaseCard.d.ts +8 -0
  41. package/components/elements/case/CaseCard.js +39 -0
  42. package/components/elements/case/CasePreview.d.ts +6 -0
  43. package/components/elements/case/CasePreview.js +17 -0
  44. package/components/elements/case/StatusIcon.d.ts +5 -0
  45. package/components/elements/case/StatusIcon.js +13 -0
  46. package/components/elements/display/ChipPopper.d.ts +1 -1
  47. package/components/elements/display/HowlerCard.js +1 -1
  48. package/components/elements/display/Modal.js +1 -0
  49. package/components/elements/hit/HitActions.js +4 -4
  50. package/components/elements/hit/HitBanner.js +28 -48
  51. package/components/elements/hit/HitCard.js +5 -5
  52. package/components/elements/hit/HitLabels.js +2 -2
  53. package/components/elements/hit/{HitQuickSearch.d.ts → HitPreview.d.ts} +3 -3
  54. package/components/elements/hit/{HitQuickSearch.js → HitPreview.js} +10 -4
  55. package/components/elements/hit/HitSummary.d.ts +2 -1
  56. package/components/elements/hit/HitSummary.js +6 -5
  57. package/components/elements/hit/aggregate/HitGraph.js +8 -8
  58. package/components/elements/hit/elements/AnalyticLink.d.ts +8 -0
  59. package/components/elements/hit/elements/AnalyticLink.js +22 -0
  60. package/components/elements/hit/outlines/DefaultOutline.js +1 -1
  61. package/components/elements/hit/related/RelatedRecords.js +63 -0
  62. package/components/elements/observable/ObservableCard.d.ts +6 -0
  63. package/components/elements/observable/ObservableCard.js +23 -0
  64. package/components/elements/observable/ObservablePreview.d.ts +6 -0
  65. package/components/elements/observable/ObservablePreview.js +12 -0
  66. package/components/elements/{hit/HitComments.d.ts → record/RecordComments.d.ts} +5 -4
  67. package/components/elements/{hit/HitComments.js → record/RecordComments.js} +29 -28
  68. package/components/{routes/hits/search/HitContextMenu.d.ts → elements/record/RecordContextMenu.d.ts} +3 -3
  69. package/components/elements/record/RecordContextMenu.js +235 -0
  70. package/components/elements/record/RecordContextMenu.test.d.ts +1 -0
  71. package/components/{routes/hits/search/HitContextMenu.test.js → elements/record/RecordContextMenu.test.js} +39 -39
  72. package/components/elements/record/RecordRelated.d.ts +7 -0
  73. package/components/elements/record/RecordRelated.js +34 -0
  74. package/components/elements/{hit/HitWorklog.d.ts → record/RecordWorklog.d.ts} +4 -3
  75. package/components/elements/{hit/HitWorklog.js → record/RecordWorklog.js} +15 -13
  76. package/components/elements/view/ViewTitle.js +1 -1
  77. package/components/hooks/useHitActions.d.ts +1 -1
  78. package/components/hooks/useHitActions.js +4 -4
  79. package/components/hooks/useMyPreferences.js +10 -1
  80. package/components/hooks/useMySearch.js +2 -2
  81. package/components/hooks/useMySitemap.js +4 -1
  82. package/components/hooks/useMyTheme.js +9 -2
  83. package/components/hooks/useParamState.test.js +3 -4
  84. package/components/hooks/{useHitSelection.d.ts → useRecordSelection.d.ts} +2 -2
  85. package/components/hooks/{useHitSelection.js → useRecordSelection.js} +12 -33
  86. package/components/hooks/useRelatedRecords.d.ts +13 -0
  87. package/components/hooks/useRelatedRecords.js +32 -0
  88. package/components/routes/action/edit/ActionEditor.js +2 -2
  89. package/components/routes/action/view/ActionSearch.js +1 -1
  90. package/components/routes/advanced/QueryBuilder.js +1 -1
  91. package/components/routes/advanced/QueryEditor.js +3 -3
  92. package/components/routes/advanced/historyCompletionProvider.js +3 -3
  93. package/components/routes/analytics/AnalyticDetails.js +2 -2
  94. package/components/routes/analytics/AnalyticSearch.js +1 -1
  95. package/components/routes/cases/CaseViewer.d.ts +2 -0
  96. package/components/routes/cases/CaseViewer.js +22 -0
  97. package/components/routes/cases/Cases.d.ts +2 -0
  98. package/components/routes/cases/Cases.js +101 -0
  99. package/components/routes/cases/constants.d.ts +5 -0
  100. package/components/routes/cases/constants.js +5 -0
  101. package/components/routes/cases/detail/AlertPanel.d.ts +6 -0
  102. package/components/routes/cases/detail/AlertPanel.js +33 -0
  103. package/components/routes/cases/detail/CaseAssets.d.ts +12 -0
  104. package/components/routes/cases/detail/CaseAssets.js +101 -0
  105. package/components/routes/cases/detail/CaseAssets.test.d.ts +1 -0
  106. package/components/routes/cases/detail/CaseAssets.test.js +163 -0
  107. package/components/routes/cases/detail/CaseDashboard.d.ts +7 -0
  108. package/components/routes/cases/detail/CaseDashboard.js +51 -0
  109. package/components/routes/cases/detail/CaseDetails.d.ts +6 -0
  110. package/components/routes/cases/detail/CaseDetails.js +61 -0
  111. package/components/routes/cases/detail/CaseOverview.d.ts +7 -0
  112. package/components/routes/cases/detail/CaseOverview.js +43 -0
  113. package/components/routes/cases/detail/CaseSidebar.d.ts +6 -0
  114. package/components/routes/cases/detail/CaseSidebar.js +61 -0
  115. package/components/routes/cases/detail/CaseTask.d.ts +11 -0
  116. package/components/routes/cases/detail/CaseTask.js +57 -0
  117. package/components/routes/cases/detail/ItemPage.d.ts +6 -0
  118. package/components/routes/cases/detail/ItemPage.js +99 -0
  119. package/components/routes/cases/detail/RelatedCasePanel.d.ts +6 -0
  120. package/components/routes/cases/detail/RelatedCasePanel.js +31 -0
  121. package/components/routes/cases/detail/TaskPanel.d.ts +7 -0
  122. package/components/routes/cases/detail/TaskPanel.js +52 -0
  123. package/components/routes/cases/detail/aggregates/CaseAggregate.d.ts +12 -0
  124. package/components/routes/cases/detail/aggregates/CaseAggregate.js +19 -0
  125. package/components/routes/cases/detail/aggregates/SourceAggregate.d.ts +6 -0
  126. package/components/routes/cases/detail/aggregates/SourceAggregate.js +27 -0
  127. package/components/routes/cases/detail/assets/Asset.d.ts +14 -0
  128. package/components/routes/cases/detail/assets/Asset.js +12 -0
  129. package/components/routes/cases/detail/assets/Asset.test.d.ts +1 -0
  130. package/components/routes/cases/detail/assets/Asset.test.js +72 -0
  131. package/components/routes/cases/detail/sidebar/CaseFolder.d.ts +13 -0
  132. package/components/routes/cases/detail/sidebar/CaseFolder.js +131 -0
  133. package/components/routes/cases/detail/sidebar/types.d.ts +3 -0
  134. package/components/routes/cases/detail/sidebar/utils.d.ts +3 -0
  135. package/components/routes/cases/detail/sidebar/utils.js +25 -0
  136. package/components/routes/cases/hooks/useCase.d.ts +13 -0
  137. package/components/routes/cases/hooks/useCase.js +38 -0
  138. package/components/routes/cases/modals/ResolveModal.d.ts +7 -0
  139. package/components/routes/cases/modals/ResolveModal.js +59 -0
  140. package/components/routes/dossiers/DossierEditor.js +2 -2
  141. package/components/routes/dossiers/DossierEditor.test.js +1 -1
  142. package/components/routes/help/ApiDocumentation.js +1 -1
  143. package/components/routes/help/HitBannerDocumentation.js +1 -0
  144. package/components/routes/help/HitDocumentation.js +1 -3
  145. package/components/routes/hits/search/InformationPane.d.ts +1 -0
  146. package/components/routes/hits/search/InformationPane.js +47 -60
  147. package/components/routes/hits/search/LayoutSettings.js +3 -3
  148. package/components/routes/hits/search/QuerySettings.js +2 -1
  149. package/components/routes/hits/search/QuerySettings.test.js +14 -9
  150. package/components/routes/hits/search/{HitBrowser.js → RecordBrowser.js} +9 -9
  151. package/components/routes/hits/search/{HitQuery.d.ts → RecordQuery.d.ts} +2 -2
  152. package/components/routes/hits/search/{HitQuery.js → RecordQuery.js} +6 -6
  153. package/components/routes/hits/search/SearchPane.js +26 -49
  154. package/components/routes/hits/search/ViewLink.js +3 -3
  155. package/components/routes/hits/search/ViewLink.test.js +8 -8
  156. package/components/routes/hits/search/grid/AddColumnModal.js +5 -4
  157. package/components/routes/hits/search/grid/EnhancedCell.d.ts +2 -1
  158. package/components/routes/hits/search/grid/EnhancedCell.js +2 -2
  159. package/components/routes/hits/search/grid/HitGrid.js +20 -18
  160. package/components/routes/hits/search/grid/{HitRow.d.ts → RecordRow.d.ts} +3 -2
  161. package/components/routes/hits/search/grid/{HitRow.js → RecordRow.js} +10 -8
  162. package/components/routes/hits/search/shared/IndexPicker.d.ts +2 -0
  163. package/components/routes/hits/search/shared/IndexPicker.js +20 -0
  164. package/components/routes/hits/view/HitViewer.js +12 -13
  165. package/components/routes/home/ViewCard.js +4 -4
  166. package/components/routes/observables/ObservableViewer.d.ts +7 -0
  167. package/components/routes/observables/ObservableViewer.js +27 -0
  168. package/components/routes/overviews/OverviewViewer.js +2 -2
  169. package/components/routes/views/ViewComposer.js +4 -4
  170. package/locales/en/translation.json +65 -3
  171. package/locales/fr/translation.json +63 -3
  172. package/models/WithMetadata.d.ts +2 -1
  173. package/models/entities/generated/AttachmentsFile.d.ts +12 -0
  174. package/models/entities/generated/Case.d.ts +28 -0
  175. package/models/entities/generated/DestinationOriginal.d.ts +19 -0
  176. package/models/entities/generated/EmailAttachment.d.ts +8 -0
  177. package/models/entities/generated/EmailParent.d.ts +19 -0
  178. package/models/entities/generated/Enrichments.d.ts +7 -0
  179. package/models/entities/generated/EnrichmentsIndicator.d.ts +21 -0
  180. package/models/entities/generated/Hit.d.ts +1 -0
  181. package/models/entities/generated/Howler.d.ts +0 -4
  182. package/models/entities/generated/HttpResponse.d.ts +11 -0
  183. package/models/entities/generated/Item.d.ts +9 -0
  184. package/models/entities/generated/Observable.d.ts +85 -0
  185. package/models/entities/generated/ObservableCloud.d.ts +20 -0
  186. package/models/entities/generated/ObservableDestination.d.ts +23 -0
  187. package/models/entities/generated/ObservableEmail.d.ts +30 -0
  188. package/models/entities/generated/ObservableFile.d.ts +36 -0
  189. package/models/entities/generated/ObservableHowler.d.ts +43 -0
  190. package/models/entities/generated/ObservableHttp.d.ts +11 -0
  191. package/models/entities/generated/ObservableObserver.d.ts +21 -0
  192. package/models/entities/generated/ObservableOrganization.d.ts +7 -0
  193. package/models/entities/generated/ObservableProcess.d.ts +34 -0
  194. package/models/entities/generated/ObservableSource.d.ts +23 -0
  195. package/models/entities/generated/ObservableThreat.d.ts +21 -0
  196. package/models/entities/generated/ObservableTls.d.ts +12 -0
  197. package/models/entities/generated/ObserverIngress.d.ts +9 -0
  198. package/models/entities/generated/Rule.d.ts +2 -10
  199. package/models/entities/generated/Task.d.ts +10 -0
  200. package/models/entities/generated/Threat.d.ts +2 -2
  201. package/models/entities/generated/{Enrichment.d.ts → ThreatEnrichment.d.ts} +1 -1
  202. package/package.json +18 -1
  203. package/plugins/clue/components/ClueTypography.js +2 -2
  204. package/plugins/clue/utils.d.ts +2 -1
  205. package/tests/utils.d.ts +2 -0
  206. package/tests/utils.js +8 -0
  207. package/utils/constants.d.ts +3 -3
  208. package/utils/hitFunctions.d.ts +2 -1
  209. package/utils/hitFunctions.js +4 -4
  210. package/utils/typeUtils.d.ts +7 -0
  211. package/utils/typeUtils.js +27 -0
  212. package/components/app/providers/HitProvider.d.ts +0 -22
  213. package/components/elements/display/icons/BundleButton.d.ts +0 -6
  214. package/components/elements/display/icons/BundleButton.js +0 -32
  215. package/components/elements/hit/HitRelated.d.ts +0 -6
  216. package/components/elements/hit/HitRelated.js +0 -7
  217. package/components/routes/help/BundleDocumentation.d.ts +0 -3
  218. package/components/routes/help/BundleDocumentation.js +0 -12
  219. package/components/routes/help/markdown/en/bundles.md.js +0 -1
  220. package/components/routes/help/markdown/fr/bundles.md.js +0 -1
  221. package/components/routes/hits/search/BundleParentMenu.d.ts +0 -6
  222. package/components/routes/hits/search/BundleParentMenu.js +0 -32
  223. package/components/routes/hits/search/BundleScroller.d.ts +0 -2
  224. package/components/routes/hits/search/BundleScroller.js +0 -6
  225. package/components/routes/hits/search/HitContextMenu.js +0 -227
  226. /package/components/app/providers/{HitSearchProvider.test.d.ts → RecordSearchProvider.test.d.ts} +0 -0
  227. /package/components/{routes/hits/search/HitContextMenu.test.d.ts → elements/ContextMenu.test.d.ts} +0 -0
  228. /package/components/{routes/overviews/OverviewEditor.d.ts → elements/MarkdownEditor.d.ts} +0 -0
  229. /package/components/elements/hit/{HitDetails.d.ts → related/RelatedRecords.d.ts} +0 -0
  230. /package/components/routes/hits/search/{HitBrowser.d.ts → RecordBrowser.d.ts} +0 -0
@@ -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
@@ -3,12 +3,12 @@ import { OpenInNew } from '@mui/icons-material';
3
3
  import { Card, CardContent, IconButton, Skeleton, Stack, Typography } from '@mui/material';
4
4
  import api from '@cccsaurora/howler-ui/api';
5
5
  import AppListEmpty from '@cccsaurora/howler-ui/commons/components/display/AppListEmpty';
6
- import { useHitContextSelector } from '@cccsaurora/howler-ui/components/app/providers/HitProvider';
6
+ import { useHitContextSelector } from '@cccsaurora/howler-ui/components/app/providers/RecordProvider';
7
7
  import { ViewContext } from '@cccsaurora/howler-ui/components/app/providers/ViewProvider';
8
8
  import HitBanner from '@cccsaurora/howler-ui/components/elements/hit/HitBanner';
9
9
  import { HitLayout } from '@cccsaurora/howler-ui/components/elements/hit/HitLayout';
10
+ import RecordContextMenu from '@cccsaurora/howler-ui/components/elements/record/RecordContextMenu';
10
11
  import useMyApi from '@cccsaurora/howler-ui/components/hooks/useMyApi';
11
- import HitContextMenu from '@cccsaurora/howler-ui/components/routes/hits/search/HitContextMenu';
12
12
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
13
13
  import { useTranslation } from 'react-i18next';
14
14
  import { Link, useNavigate } from 'react-router-dom';
@@ -65,7 +65,7 @@ const ViewCard = ({ viewId, limit, refreshTick, onRefreshComplete }) => {
65
65
  const lastSignature = useRef('');
66
66
  const view = useContextSelector(ViewContext, ctx => ctx.views[viewId]);
67
67
  const fetchViews = useContextSelector(ViewContext, ctx => ctx.fetchViews);
68
- const loadHits = useHitContextSelector(ctx => ctx.loadHits);
68
+ const loadHits = useHitContextSelector(ctx => ctx.loadRecords);
69
69
  // Subscribe to hits from HitProvider cache based on current hitIds in the view
70
70
  // Uses memoized selector to avoid unnecessary re-renders on unrelated hit updates
71
71
  const hits = useSelectHitsByIds(hitIds);
@@ -151,6 +151,6 @@ const ViewCard = ({ viewId, limit, refreshTick, onRefreshComplete }) => {
151
151
  }
152
152
  return selectedElement.id;
153
153
  }, []);
154
- return (_jsx(Card, { variant: "outlined", sx: { height: '100%' }, children: _jsxs(Stack, { spacing: 1, sx: { p: 1, minHeight: 100 }, children: [_jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [_jsx(Typography, { variant: "h6", children: t(view?.title) || _jsx(Skeleton, { variant: "text", height: "2em", width: "100px" }) }), _jsx(IconButton, { size: "small", component: Link, disabled: !view, to: view ? buildViewUrl(view) : '', onClick: () => onClick(view.query), children: _jsx(OpenInNew, { fontSize: "small" }) })] }), loading ? (_jsxs(_Fragment, { children: [_jsx(Skeleton, { height: 150, width: "100%", variant: "rounded" }), _jsx(Skeleton, { height: 160, width: "100%", variant: "rounded" }), _jsx(Skeleton, { height: 140, width: "100%", variant: "rounded" })] })) : hits.length > 0 ? (_jsx(HitContextMenu, { getSelectedId: getSelectedId, children: hits.map(h => (_jsx(Card, { id: h.howler.id, variant: "outlined", sx: { cursor: 'pointer' }, onClick: () => navigate((h.howler.is_bundle ? '/bundles/' : '/hits/') + h.howler.id), children: _jsx(CardContent, { children: _jsx(HitBanner, { layout: HitLayout.DENSE, hit: h }) }) }, h.howler.id))) })) : (_jsx(AppListEmpty, {}))] }) }));
154
+ return (_jsx(Card, { variant: "outlined", sx: { height: '100%' }, children: _jsxs(Stack, { spacing: 1, sx: { p: 1, minHeight: 100 }, children: [_jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [_jsx(Typography, { variant: "h6", children: t(view?.title) || _jsx(Skeleton, { variant: "text", height: "2em", width: "100px" }) }), _jsx(IconButton, { size: "small", component: Link, disabled: !view, to: view ? buildViewUrl(view) : '', onClick: () => onClick(view.query), children: _jsx(OpenInNew, { fontSize: "small" }) })] }), loading ? (_jsxs(_Fragment, { children: [_jsx(Skeleton, { height: 150, width: "100%", variant: "rounded" }), _jsx(Skeleton, { height: 160, width: "100%", variant: "rounded" }), _jsx(Skeleton, { height: 140, width: "100%", variant: "rounded" })] })) : hits.length > 0 ? (_jsx(RecordContextMenu, { getSelectedId: getSelectedId, children: hits.map(h => (_jsx(Card, { id: h.howler.id, variant: "outlined", sx: { cursor: 'pointer' }, onClick: () => navigate(`/hits/${h.howler.id}`), children: _jsx(CardContent, { children: _jsx(HitBanner, { layout: HitLayout.DENSE, hit: h }) }) }, h.howler.id))) })) : (_jsx(AppListEmpty, {}))] }) }));
155
155
  };
156
156
  export default ViewCard;
@@ -0,0 +1,7 @@
1
+ import type { Observable } from '@cccsaurora/howler-ui/models/entities/generated/Observable';
2
+ import { type FC } from 'react';
3
+ declare const ObservableViewer: FC<{
4
+ observable?: Observable;
5
+ observableId?: string;
6
+ }>;
7
+ export default ObservableViewer;
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Box, Skeleton } from '@mui/material';
3
+ import api from '@cccsaurora/howler-ui/api';
4
+ import ObjectDetails from '@cccsaurora/howler-ui/components/elements/ObjectDetails';
5
+ import useMyApi from '@cccsaurora/howler-ui/components/hooks/useMyApi';
6
+ import { useEffect, useState } from 'react';
7
+ const ObservableViewer = ({ observable: provided, observableId }) => {
8
+ const { dispatchApi } = useMyApi();
9
+ const [observable, setObservable] = useState(null);
10
+ useEffect(() => {
11
+ if (provided) {
12
+ setObservable(provided);
13
+ }
14
+ }, [provided]);
15
+ useEffect(() => {
16
+ if (observableId) {
17
+ dispatchApi(api.v2.search.post('observable', { query: `howler.id:${observableId}`, rows: 1 }), {
18
+ throwError: false
19
+ }).then(res => setObservable(res.items[0]));
20
+ }
21
+ }, [dispatchApi, observableId]);
22
+ if (!observable) {
23
+ return;
24
+ }
25
+ return _jsx(Box, { p: 1, children: observable ? _jsx(ObjectDetails, { obj: observable }) : _jsx(Skeleton, { height: 120 }) });
26
+ };
27
+ export default ObservableViewer;
@@ -15,7 +15,7 @@ import useMyTheme from '@cccsaurora/howler-ui/components/hooks/useMyTheme';
15
15
  import { useSearchParams } from 'react-router-dom';
16
16
  import hitsData from '@cccsaurora/howler-ui/utils/hit.json';
17
17
  import { sanitizeLuceneQuery } from '@cccsaurora/howler-ui/utils/stringUtils';
18
- import OverviewEditor from './OverviewEditor';
18
+ import MarkdownEditor from '../../elements/MarkdownEditor';
19
19
  import { useStartingTemplate } from './startingTemplate';
20
20
  const OverviewViewer = () => {
21
21
  const theme = useTheme();
@@ -188,7 +188,7 @@ const OverviewViewer = () => {
188
188
  right: `calc(50% + 7px - ${x}px)`,
189
189
  mr: -2.4,
190
190
  pr: 1.5
191
- }, children: _jsx(OverviewEditor, { height: "100%", content: content, setContent: setContent }) }) }), _jsx(Box, { sx: {
191
+ }, children: _jsx(MarkdownEditor, { height: "100%", content: content, setContent: setContent }) }) }), _jsx(Box, { sx: {
192
192
  position: 'absolute',
193
193
  top: 0,
194
194
  bottom: 0,
@@ -6,8 +6,8 @@ import { Alert, Checkbox, CircularProgress, LinearProgress, Stack, TextField, To
6
6
  import api from '@cccsaurora/howler-ui/api';
7
7
  import AppListEmpty from '@cccsaurora/howler-ui/commons/components/display/AppListEmpty';
8
8
  import PageCenter from '@cccsaurora/howler-ui/commons/components/pages/PageCenter';
9
- import { HitContext } from '@cccsaurora/howler-ui/components/app/providers/HitProvider';
10
9
  import { ParameterContext } from '@cccsaurora/howler-ui/components/app/providers/ParameterProvider';
10
+ import { RecordContext } from '@cccsaurora/howler-ui/components/app/providers/RecordProvider';
11
11
  import { ViewContext } from '@cccsaurora/howler-ui/components/app/providers/ViewProvider';
12
12
  import CustomButton from '@cccsaurora/howler-ui/components/elements/addons/buttons/CustomButton';
13
13
  import FlexPort from '@cccsaurora/howler-ui/components/elements/addons/layout/FlexPort';
@@ -26,7 +26,7 @@ import { DEFAULT_QUERY, StorageKey } from '@cccsaurora/howler-ui/utils/constants
26
26
  import { convertDateToLucene } from '@cccsaurora/howler-ui/utils/utils';
27
27
  import { buildViewUrl } from '@cccsaurora/howler-ui/utils/viewUtils';
28
28
  import ErrorBoundary from '../ErrorBoundary';
29
- import HitQuery from '../hits/search/HitQuery';
29
+ import RecordQuery from '../hits/search/RecordQuery';
30
30
  import HitSort from '../hits/search/shared/HitSort';
31
31
  import SearchSpan from '../hits/search/shared/SearchSpan';
32
32
  const ViewComposer = () => {
@@ -39,7 +39,7 @@ const ViewComposer = () => {
39
39
  const editView = useContextSelector(ViewContext, ctx => ctx.editView);
40
40
  const getCurrentViews = useContextSelector(ViewContext, ctx => ctx.getCurrentViews);
41
41
  const pageCount = useMyLocalStorageItem(StorageKey.PAGE_COUNT, 25)[0];
42
- const loadHits = useContextSelector(HitContext, ctx => ctx.loadHits);
42
+ const loadHits = useContextSelector(RecordContext, ctx => ctx.loadRecords);
43
43
  // view state
44
44
  const [title, setTitle] = useState('');
45
45
  const [type, setType] = useState('global');
@@ -172,6 +172,6 @@ const ViewComposer = () => {
172
172
  fontSize: '0.9em',
173
173
  fontStyle: 'italic',
174
174
  mb: 0.5
175
- }), variant: "body2", children: t('hit.search.prompt') }), _jsx(HitQuery, { triggerSearch: search, searching: searching, onChange: (_query, isDirty) => setIsSearchDirty(isDirty) }), _jsxs(Stack, { direction: "row", spacing: 1, children: [_jsx(HitSort, {}), _jsx(SearchSpan, { omitCustom: true }), _jsx("div", { style: { flex: 1 } }), _jsxs(Stack, { spacing: 1, direction: "row", alignItems: "center", sx: { flex: '0 !important', minWidth: '300px' }, children: [_jsx(Typography, { component: "span", children: t('view.settings.advance_on_triage') }), _jsx(Tooltip, { title: t('view.settings.advance_on_triage.description'), children: _jsx(HelpOutline, { sx: { fontSize: '16px' } }) }), _jsx(Checkbox, { size: "small", checked: advanceOnTriage, onChange: (_event, checked) => setAdvanceOnTriage(checked) })] })] }), response?.total ? (_jsx(SearchTotal, { total: response.total, pageLength: response.items.length, offset: response.offset, sx: theme => ({ color: theme.palette.text.secondary, fontSize: '0.9em', fontStyle: 'italic' }) })) : null, _jsx(LinearProgress, { sx: [!searching && { opacity: 0 }] })] }) }), _jsx(VSBoxContent, { children: _jsxs(Stack, { spacing: 1, children: [!response?.total && _jsx(AppListEmpty, {}), response?.items.map(hit => (_jsx(HitCard, { id: hit.howler.id, layout: HitLayout.DENSE }, hit.howler.id)))] }) })] }) }) }) }));
175
+ }), variant: "body2", children: t('hit.search.prompt') }), _jsx(RecordQuery, { triggerSearch: search, searching: searching, onChange: (_query, isDirty) => setIsSearchDirty(isDirty) }), _jsxs(Stack, { direction: "row", spacing: 1, children: [_jsx(HitSort, {}), _jsx(SearchSpan, { omitCustom: true }), _jsx("div", { style: { flex: 1 } }), _jsxs(Stack, { spacing: 1, direction: "row", alignItems: "center", sx: { flex: '0 !important', minWidth: '300px' }, children: [_jsx(Typography, { component: "span", children: t('view.settings.advance_on_triage') }), _jsx(Tooltip, { title: t('view.settings.advance_on_triage.description'), children: _jsx(HelpOutline, { sx: { fontSize: '16px' } }) }), _jsx(Checkbox, { size: "small", checked: advanceOnTriage, onChange: (_event, checked) => setAdvanceOnTriage(checked) })] })] }), response?.total ? (_jsx(SearchTotal, { total: response.total, pageLength: response.items.length, offset: response.offset, sx: theme => ({ color: theme.palette.text.secondary, fontSize: '0.9em', fontStyle: 'italic' }) })) : null, _jsx(LinearProgress, { sx: [!searching && { opacity: 0 }] })] }) }), _jsx(VSBoxContent, { children: _jsxs(Stack, { spacing: 1, children: [!response?.total && _jsx(AppListEmpty, {}), response?.items.map(hit => (_jsx(HitCard, { id: hit.howler.id, layout: HitLayout.DENSE }, hit.howler.id)))] }) })] }) }) }) }));
176
176
  };
177
177
  export default ViewComposer;