@cccsaurora/howler-ui 2.14.0-dev.264 → 2.14.0-dev.265
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/action/execute.ts +3 -3
- package/api/action/index.ts +5 -5
- package/api/action/operations.ts +3 -3
- package/api/analytic/comments/index.ts +4 -4
- package/api/analytic/comments/react.ts +2 -2
- package/api/analytic/favourite.ts +2 -2
- package/api/analytic/index.ts +7 -7
- package/api/analytic/notebooks/index.ts +3 -3
- package/api/analytic/owner.ts +3 -3
- package/api/analytic/rules.ts +3 -3
- package/api/auth/apikey.ts +2 -2
- package/api/auth/index.ts +3 -3
- package/api/auth/login.ts +3 -3
- package/api/configs/index.ts +2 -2
- package/api/dossier/hit.ts +2 -2
- package/api/dossier/index.ts +2 -2
- package/api/help.ts +1 -1
- package/api/hit/assign.ts +3 -3
- package/api/hit/comments/index.ts +4 -4
- package/api/hit/comments/react.ts +2 -2
- package/api/hit/index.ts +7 -7
- package/api/hit/labels.ts +4 -4
- package/api/hit/overwrite.ts +3 -3
- package/api/hit/transition.ts +4 -4
- package/api/index.ts +18 -18
- package/api/notebook/environments.ts +2 -2
- package/api/notebook/index.ts +4 -4
- package/api/overview/index.ts +2 -2
- package/api/search/action.ts +4 -4
- package/api/search/analytic.ts +4 -4
- package/api/search/count/hit.ts +3 -3
- package/api/search/count/index.ts +3 -3
- package/api/search/dossier.ts +4 -4
- package/api/search/eql/hit.ts +4 -4
- package/api/search/facet/hit.ts +3 -3
- package/api/search/facet/index.ts +3 -3
- package/api/search/fields/hit.ts +3 -3
- package/api/search/fields/index.ts +4 -4
- package/api/search/fields/user.ts +4 -4
- package/api/search/grouped/hit.ts +4 -4
- package/api/search/grouped/index.ts +4 -4
- package/api/search/grouped/user.ts +4 -4
- package/api/search/histogram/hit.ts +3 -3
- package/api/search/histogram/index.ts +3 -3
- package/api/search/hit.ts +6 -6
- package/api/search/index.ts +14 -14
- package/api/search/overview.ts +4 -4
- package/api/search/sigma/hit.ts +4 -4
- package/api/search/template.ts +4 -4
- package/api/search/user.ts +4 -4
- package/api/search/view.ts +4 -4
- package/api/template/index.ts +2 -2
- package/api/user/avatar/index.ts +2 -2
- package/api/user/groups.ts +2 -2
- package/api/user/index.ts +5 -5
- package/api/user/whoami.ts +3 -3
- package/api/view/favourite.ts +2 -2
- package/api/view/index.ts +3 -3
- package/commons/components/app/AppConfigs.ts +2 -2
- package/commons/components/app/AppContexts.ts +5 -5
- package/commons/components/app/AppDefaults.ts +1 -1
- package/commons/components/app/AppNotificationService.ts +1 -1
- package/commons/components/app/AppProvider.tsx +14 -14
- package/commons/components/app/AppSearchService.ts +1 -1
- package/commons/components/app/AppSkeleton.tsx +3 -3
- package/commons/components/app/hooks/useApp.tsx +1 -1
- package/commons/components/app/hooks/useAppBanner.tsx +1 -1
- package/commons/components/app/hooks/useAppBar.tsx +1 -1
- package/commons/components/app/hooks/useAppBreadcrumbs.tsx +1 -1
- package/commons/components/app/hooks/useAppConfigs.tsx +2 -2
- package/commons/components/app/hooks/useAppLanguage.tsx +2 -2
- package/commons/components/app/hooks/useAppLayout.tsx +1 -1
- package/commons/components/app/hooks/useAppLeftNav.tsx +1 -1
- package/commons/components/app/hooks/useAppLogo.tsx +2 -2
- package/commons/components/app/hooks/useAppNotification.tsx +1 -1
- package/commons/components/app/hooks/useAppQuickSearch.tsx +1 -1
- package/commons/components/app/hooks/useAppSearchService.tsx +2 -2
- package/commons/components/app/hooks/useAppSitemap.tsx +3 -3
- package/commons/components/app/hooks/useAppSwitcher.tsx +1 -1
- package/commons/components/app/hooks/useAppTheme.tsx +1 -1
- package/commons/components/app/hooks/useAppUser.tsx +2 -2
- package/commons/components/app/providers/AppBarProvider.tsx +9 -9
- package/commons/components/app/providers/AppBreadcrumbsProvider.tsx +5 -5
- package/commons/components/app/providers/AppLayoutProvider.tsx +7 -7
- package/commons/components/app/providers/AppLeftNavProvider.tsx +5 -5
- package/commons/components/app/providers/AppNotificationProvider.tsx +1 -1
- package/commons/components/app/providers/AppQuickSearchProvider.tsx +6 -6
- package/commons/components/app/providers/AppSearchServiceProvider.tsx +3 -3
- package/commons/components/app/providers/AppSwitcherProvider.tsx +3 -3
- package/commons/components/app/providers/AppUserProvider.tsx +2 -2
- package/commons/components/breadcrumbs/BreadcrumbIcon.tsx +1 -1
- package/commons/components/breadcrumbs/BreadcrumbLastItem.tsx +2 -2
- package/commons/components/breadcrumbs/BreadcrumbLinkItem.tsx +2 -2
- package/commons/components/breadcrumbs/BreadcrumbList.tsx +3 -3
- package/commons/components/breadcrumbs/Breadcrumbs.tsx +2 -2
- package/commons/components/display/AppAvatar.tsx +1 -1
- package/commons/components/display/AppListEmpty.tsx +1 -1
- package/commons/components/display/AppToc.tsx +3 -3
- package/commons/components/display/hooks/useAppColor.tsx +1 -1
- package/commons/components/leftnav/LeftNavDrawer.tsx +4 -4
- package/commons/components/leftnav/LeftNavGroup.tsx +3 -3
- package/commons/components/leftnav/LeftNavItem.tsx +2 -2
- package/commons/components/notification/Notification.tsx +4 -4
- package/commons/components/notification/elements/NotificationCloseButton.tsx +1 -1
- package/commons/components/notification/elements/NotificationContainer.tsx +5 -5
- package/commons/components/notification/elements/NotificationEndOfPage.tsx +1 -1
- package/commons/components/notification/elements/NotificationItems.tsx +2 -2
- package/commons/components/notification/elements/item/NotificationItem.tsx +7 -7
- package/commons/components/notification/elements/item/NotificationItemAuthor.tsx +1 -1
- package/commons/components/notification/elements/item/NotificationItemContent.tsx +1 -1
- package/commons/components/notification/elements/item/NotificationItemDate.tsx +1 -1
- package/commons/components/notification/elements/item/NotificationItemTitle.tsx +1 -1
- package/commons/components/pages/PageContent.tsx +1 -1
- package/commons/components/pages/PageFullScreen.tsx +3 -3
- package/commons/components/pages/PageHeader.tsx +1 -1
- package/commons/components/search/AppSearch.tsx +4 -4
- package/commons/components/search/AppSearchResult.tsx +4 -4
- package/commons/components/topnav/AppBar.tsx +9 -9
- package/commons/components/topnav/AppName.tsx +1 -1
- package/commons/components/topnav/AppSwitcher.tsx +1 -1
- package/commons/components/topnav/Notifications.tsx +2 -2
- package/commons/components/topnav/ThemeSelection.tsx +2 -2
- package/commons/components/topnav/ThemeSelectionIcon.tsx +2 -2
- package/commons/components/topnav/UserProfile.tsx +3 -3
- package/commons/components/utils/hooks/useLocalStorageItem.tsx +1 -1
- package/commons/components/utils/hooks/useThemeBuilder.tsx +2 -2
- package/components/app/App.tsx +57 -57
- package/components/app/AppContainer.tsx +1 -1
- package/components/app/drawers/ApiKeyDrawer.tsx +5 -5
- package/components/app/drawers/AssignUserDrawer.tsx +6 -6
- package/components/app/drawers/ViewGroupsDrawer.tsx +1 -1
- package/components/app/hooks/useMatchers.tsx +2 -2
- package/components/app/hooks/useTitle.tsx +1 -1
- package/components/app/providers/AnalyticProvider.tsx +5 -5
- package/components/app/providers/ApiConfigProvider.tsx +1 -1
- package/components/app/providers/AppDrawerProvider.tsx +1 -1
- package/components/app/providers/AvatarProvider.tsx +2 -2
- package/components/app/providers/CustomPluginProvider.tsx +1 -1
- package/components/app/providers/FavouritesProvider.tsx +3 -3
- package/components/app/providers/FieldProvider.tsx +3 -3
- package/components/app/providers/HitProvider.tsx +5 -5
- package/components/app/providers/HitSearchProvider.tsx +12 -12
- package/components/app/providers/LocalStorageProvider.tsx +2 -2
- package/components/app/providers/OverviewProvider.tsx +3 -3
- package/components/app/providers/ParameterProvider.tsx +1 -1
- package/components/app/providers/SocketProvider.tsx +5 -5
- package/components/app/providers/UserListProvider.tsx +3 -3
- package/components/app/providers/ViewProvider.tsx +7 -7
- package/components/elements/Comment.tsx +7 -7
- package/components/elements/EditRow.tsx +1 -1
- package/components/elements/PluginChip.tsx +1 -1
- package/components/elements/PluginTypography.tsx +1 -1
- package/components/elements/ThemedEditor.tsx +3 -3
- package/components/elements/UserList.tsx +1 -1
- package/components/elements/addons/layout/FlexPort.tsx +1 -1
- package/components/elements/addons/layout/FlexVertical.tsx +2 -2
- package/components/elements/addons/layout/vsbox/VSBox.tsx +1 -1
- package/components/elements/addons/lists/TuiList.tsx +1 -1
- package/components/elements/addons/lists/TuiListBase.tsx +2 -2
- package/components/elements/addons/lists/hooks/useTuiListKeyboard.tsx +2 -2
- package/components/elements/addons/lists/table/TuiTable.tsx +1 -1
- package/components/elements/addons/lists/table/TuiTableBody.tsx +1 -1
- package/components/elements/addons/lists/table/TuiTableHead.tsx +1 -1
- package/components/elements/addons/search/phrase/Phrase.tsx +1 -1
- package/components/elements/display/ActionButton.tsx +4 -4
- package/components/elements/display/Classification.tsx +1 -1
- package/components/elements/display/HandlebarsMarkdown.tsx +2 -2
- package/components/elements/display/HowlerAvatar.tsx +3 -3
- package/components/elements/display/HowlerAvatarHeader.tsx +1 -1
- package/components/elements/display/ItemManager.tsx +7 -7
- package/components/elements/display/Markdown.tsx +1 -1
- package/components/elements/display/Modal.tsx +1 -1
- package/components/elements/display/UserPageWrapper.tsx +2 -2
- package/components/elements/display/features/DevelopmentBanner.tsx +2 -2
- package/components/elements/display/features/DevelopmentIcon.tsx +2 -2
- package/components/elements/display/handlebars/helpers.tsx +4 -4
- package/components/elements/display/icons/BundleButton.tsx +1 -1
- package/components/elements/display/icons/SocketBadge.tsx +2 -2
- package/components/elements/display/json/JSONViewer.tsx +7 -7
- package/components/elements/display/modals/ConfirmDeleteModal.tsx +1 -1
- package/components/elements/display/modals/ConfirmNotebookModal.tsx +1 -1
- package/components/elements/display/modals/CreateActionModal.tsx +3 -3
- package/components/elements/display/modals/RationaleModal.tsx +2 -2
- package/components/elements/hit/HitActions.tsx +13 -13
- package/components/elements/hit/HitBanner.tsx +6 -6
- package/components/elements/hit/HitBannerTooltip.tsx +1 -1
- package/components/elements/hit/HitCard.tsx +1 -1
- package/components/elements/hit/HitComments.tsx +11 -11
- package/components/elements/hit/HitDetails.tsx +2 -2
- package/components/elements/hit/HitLabels.tsx +6 -6
- package/components/elements/hit/HitNotebooks.tsx +8 -8
- package/components/elements/hit/HitOutline.tsx +4 -4
- package/components/elements/hit/HitOverview.tsx +4 -4
- package/components/elements/hit/HitQuickSearch.tsx +4 -4
- package/components/elements/hit/HitRelated.tsx +1 -1
- package/components/elements/hit/HitSummary.tsx +13 -13
- package/components/elements/hit/HitWorklog.tsx +7 -7
- package/components/elements/hit/actions/DropdownActions.tsx +1 -1
- package/components/elements/hit/aggregate/HitGraph.tsx +8 -8
- package/components/elements/hit/elements/Assigned.tsx +4 -4
- package/components/elements/hit/elements/EscalationChip.tsx +2 -2
- package/components/elements/hit/elements/HitTimestamp.tsx +3 -3
- package/components/elements/hit/outlines/DefaultOutline.tsx +4 -4
- package/components/elements/hit/outlines/al/AssemblyLineRules.tsx +2 -2
- package/components/elements/hit/related/PivotLink.tsx +3 -3
- package/components/elements/hit/related/RelatedIcon.tsx +2 -2
- package/components/elements/hit/related/RelatedLink.tsx +1 -1
- package/components/elements/view/ViewTitle.tsx +1 -1
- package/components/hooks/useHitActions.tsx +12 -12
- package/components/hooks/useHitSelection.tsx +7 -7
- package/components/hooks/useMyApi.tsx +2 -2
- package/components/hooks/useMyLocalStorage.ts +5 -5
- package/components/hooks/useMyPreferences.tsx +6 -6
- package/components/hooks/useMySearch.tsx +7 -7
- package/components/hooks/useMySitemap.tsx +2 -2
- package/components/hooks/useMyTheme.tsx +1 -1
- package/components/hooks/useMyUser.tsx +2 -2
- package/components/hooks/useMyUserFunctions.tsx +8 -8
- package/components/hooks/useMyUserList.tsx +1 -1
- package/components/hooks/useMyUtils.tsx +1 -1
- package/components/logins/Login.tsx +4 -4
- package/components/logins/auth/OAuthLogin.tsx +3 -3
- package/components/logins/hooks/useLogin.tsx +11 -11
- package/components/routes/404.tsx +1 -1
- package/components/routes/ErrorOccured.tsx +2 -2
- package/components/routes/Logout.tsx +3 -3
- package/components/routes/action/edit/ActionEditor.tsx +13 -13
- package/components/routes/action/shared/ActionReportDisplay.tsx +2 -2
- package/components/routes/action/shared/OperationEntry.tsx +4 -4
- package/components/routes/action/shared/OperationStep.tsx +8 -8
- package/components/routes/action/useMyActionFunctions.tsx +9 -9
- package/components/routes/action/view/ActionDetails.tsx +12 -12
- package/components/routes/action/view/ActionSearch.tsx +14 -14
- package/components/routes/action/view/Integrations.tsx +2 -2
- package/components/routes/admin/users/UserEditor.tsx +8 -8
- package/components/routes/admin/users/UserSearch.tsx +19 -19
- package/components/routes/advanced/QueryBuilder.tsx +14 -14
- package/components/routes/advanced/QueryEditor.tsx +3 -3
- package/components/routes/advanced/RuleModal.tsx +10 -10
- package/components/routes/advanced/eqlCompletionProvider.ts +1 -1
- package/components/routes/advanced/historyCompletionProvider.ts +2 -2
- package/components/routes/advanced/luceneCompletionProvider.ts +3 -3
- package/components/routes/advanced/yamlCompletionProvider.ts +1 -1
- package/components/routes/analytics/AnalyticComments.tsx +9 -9
- package/components/routes/analytics/AnalyticDetails.tsx +12 -12
- package/components/routes/analytics/AnalyticHitComments.tsx +8 -8
- package/components/routes/analytics/AnalyticNotebooks.tsx +9 -9
- package/components/routes/analytics/AnalyticOverview.tsx +6 -6
- package/components/routes/analytics/AnalyticOverviews.tsx +3 -3
- package/components/routes/analytics/AnalyticSearch.tsx +15 -15
- package/components/routes/analytics/AnalyticTemplates.tsx +5 -5
- package/components/routes/analytics/RuleView.tsx +4 -4
- package/components/routes/analytics/TriageSettings.tsx +6 -6
- package/components/routes/analytics/widgets/Assessment.tsx +5 -5
- package/components/routes/analytics/widgets/Created.tsx +4 -4
- package/components/routes/analytics/widgets/Detection.tsx +2 -2
- package/components/routes/analytics/widgets/Escalation.tsx +5 -5
- package/components/routes/analytics/widgets/Stacked.tsx +3 -3
- package/components/routes/analytics/widgets/Status.tsx +2 -2
- package/components/routes/dossiers/DossierCard.tsx +3 -3
- package/components/routes/dossiers/DossierEditor.tsx +5 -5
- package/components/routes/dossiers/Dossiers.tsx +10 -10
- package/components/routes/dossiers/LeadEditor.tsx +3 -3
- package/components/routes/dossiers/LeadForm.tsx +1 -1
- package/components/routes/dossiers/PivotForm.tsx +4 -4
- package/components/routes/help/ActionDocumentation.tsx +3 -3
- package/components/routes/help/ActionIntroductionDocumentation.tsx +7 -7
- package/components/routes/help/ApiDocumentation.tsx +8 -8
- package/components/routes/help/AuthDocumentation.tsx +3 -3
- package/components/routes/help/BundleDocumentation.tsx +1 -1
- package/components/routes/help/ClientDocumentation.tsx +3 -3
- package/components/routes/help/Help.tsx +5 -5
- package/components/routes/help/HitBannerDocumentation.tsx +5 -5
- package/components/routes/help/HitDocumentation.tsx +2 -2
- package/components/routes/help/HitLabelsDocumentation.tsx +1 -1
- package/components/routes/help/HitLinksDocumentation.tsx +2 -2
- package/components/routes/help/HitSchemaDocumentation.tsx +3 -3
- package/components/routes/help/NotebookDocumentation.tsx +3 -3
- package/components/routes/help/OverviewDocumentation.tsx +3 -3
- package/components/routes/help/RetentionDocumentation.tsx +7 -7
- package/components/routes/help/SearchDocumentation.tsx +6 -6
- package/components/routes/help/TemplateDocumentation.tsx +5 -5
- package/components/routes/help/ViewDocumentation.tsx +3 -3
- package/components/routes/hits/search/BundleParentMenu.tsx +5 -5
- package/components/routes/hits/search/BundleScroller.tsx +1 -1
- package/components/routes/hits/search/CustomSort.tsx +2 -2
- package/components/routes/hits/search/HitBrowser.tsx +10 -10
- package/components/routes/hits/search/HitContextMenu.tsx +11 -11
- package/components/routes/hits/search/HitQuery.tsx +5 -5
- package/components/routes/hits/search/InformationPane.tsx +35 -35
- package/components/routes/hits/search/SearchPane.tsx +21 -21
- package/components/routes/hits/search/ViewLink.tsx +3 -3
- package/components/routes/hits/search/grid/AddColumnModal.tsx +3 -3
- package/components/routes/hits/search/grid/ColumnHeader.tsx +2 -2
- package/components/routes/hits/search/grid/EnhancedCell.tsx +1 -1
- package/components/routes/hits/search/grid/HitGrid.tsx +12 -12
- package/components/routes/hits/search/grid/HitRow.tsx +7 -7
- package/components/routes/hits/search/shared/CustomSpan.tsx +1 -1
- package/components/routes/hits/search/shared/HitFilter.tsx +4 -4
- package/components/routes/hits/search/shared/HitSort.tsx +2 -2
- package/components/routes/hits/search/shared/QuerySettings.tsx +2 -2
- package/components/routes/hits/search/shared/SearchSpan.tsx +3 -3
- package/components/routes/hits/view/HitViewer.tsx +28 -28
- package/components/routes/hits/view/LeadRenderer.tsx +3 -3
- package/components/routes/home/AddNewCard.tsx +5 -5
- package/components/routes/home/AnalyticCard.tsx +3 -3
- package/components/routes/home/ViewCard.tsx +7 -7
- package/components/routes/home/index.tsx +9 -9
- package/components/routes/overviews/OverviewCard.tsx +3 -3
- package/components/routes/overviews/OverviewEditor.tsx +2 -2
- package/components/routes/overviews/OverviewViewer.tsx +13 -13
- package/components/routes/overviews/Overviews.tsx +10 -10
- package/components/routes/overviews/startingTemplate.ts +1 -1
- package/components/routes/settings/AdminSection.tsx +1 -1
- package/components/routes/settings/LocalSection.tsx +4 -4
- package/components/routes/settings/ProfileSection.tsx +4 -4
- package/components/routes/settings/SecuritySection.tsx +5 -5
- package/components/routes/settings/Settings.tsx +6 -6
- package/components/routes/templates/TemplateCard.tsx +1 -1
- package/components/routes/templates/TemplateEditor.tsx +4 -4
- package/components/routes/templates/TemplateViewer.tsx +10 -10
- package/components/routes/templates/Templates.tsx +11 -11
- package/components/routes/views/ViewComposer.tsx +21 -21
- package/components/routes/views/Views.tsx +16 -16
- package/index.tsx +3 -3
- package/models/entities/HowlerUser.d.ts +1 -1
- package/models/socket/HitUpdate.d.ts +1 -1
- package/package.json +4 -32
- package/plugins/HowlerPlugin.ts +12 -12
- package/plugins/store.ts +1 -1
- package/rest/AxiosClient.ts +3 -3
- package/rest/FetchClient.ts +2 -2
- package/rest/index.ts +1 -1
- package/utils/actionUtils.ts +2 -2
- package/utils/hitFunctions.ts +1 -1
- package/utils/localStorage.ts +1 -1
- package/utils/sessionStorage.ts +1 -1
- package/utils/socketUtils.ts +2 -2
- package/components/app/hooks/useMatchers.test.ts +0 -328
- package/components/app/providers/ViewProvider.test.tsx +0 -244
- package/tests/MockLocalStorage.ts +0 -46
- package/tests/server-handlers.ts +0 -114
- package/tests/server.ts +0 -6
package/package.json
CHANGED
|
@@ -97,14 +97,11 @@
|
|
|
97
97
|
"internal-slot": "1.0.7"
|
|
98
98
|
},
|
|
99
99
|
"type": "module",
|
|
100
|
-
"version": "2.14.0-dev.
|
|
100
|
+
"version": "2.14.0-dev.265",
|
|
101
101
|
"exports": {
|
|
102
102
|
"globals": "./globals.d.ts",
|
|
103
|
-
"setupTests": "./setupTests.ts",
|
|
104
|
-
".": "./index.tsx",
|
|
105
|
-
"vite-env": "./vite-env.d.ts",
|
|
106
|
-
"index.css": "./index.css",
|
|
107
103
|
"i18n": "./i18n.ts",
|
|
104
|
+
"package": "./package.json",
|
|
108
105
|
"api": "./api/index.ts",
|
|
109
106
|
"api/help": "./api/help.ts",
|
|
110
107
|
"models/WithMetadata": "./models/WithMetadata.d.ts",
|
|
@@ -127,9 +124,6 @@
|
|
|
127
124
|
"rest/AxiosClient": "./rest/AxiosClient.ts",
|
|
128
125
|
"plugins/HowlerPlugin": "./plugins/HowlerPlugin.ts",
|
|
129
126
|
"plugins/store": "./plugins/store.ts",
|
|
130
|
-
"tests/server-handlers": "./tests/server-handlers.ts",
|
|
131
|
-
"tests/server": "./tests/server.ts",
|
|
132
|
-
"tests/MockLocalStorage": "./tests/MockLocalStorage.ts",
|
|
133
127
|
"api/analytic": "./api/analytic/index.ts",
|
|
134
128
|
"api/analytic/owner": "./api/analytic/owner.ts",
|
|
135
129
|
"api/analytic/rules": "./api/analytic/rules.ts",
|
|
@@ -360,10 +354,10 @@
|
|
|
360
354
|
"components/routes/ErrorOccured": "./components/routes/ErrorOccured.tsx",
|
|
361
355
|
"components/routes/ErrorBoundary": "./components/routes/ErrorBoundary.tsx",
|
|
362
356
|
"components/routes/Logout": "./components/routes/Logout.tsx",
|
|
363
|
-
"components/app/hooks/useMatchers": "./components/app/hooks/useMatchers.
|
|
357
|
+
"components/app/hooks/useMatchers": "./components/app/hooks/useMatchers.tsx",
|
|
364
358
|
"components/app/hooks/useTitle": "./components/app/hooks/useTitle.tsx",
|
|
365
|
-
"components/app/providers/ViewProvider": "./components/app/providers/ViewProvider.tsx",
|
|
366
359
|
"components/app/providers/OverviewProvider": "./components/app/providers/OverviewProvider.tsx",
|
|
360
|
+
"components/app/providers/ViewProvider": "./components/app/providers/ViewProvider.tsx",
|
|
367
361
|
"components/app/providers/ParameterProvider": "./components/app/providers/ParameterProvider.tsx",
|
|
368
362
|
"components/app/providers/HitProvider": "./components/app/providers/HitProvider.tsx",
|
|
369
363
|
"components/app/providers/FieldProvider": "./components/app/providers/FieldProvider.tsx",
|
|
@@ -579,26 +573,6 @@
|
|
|
579
573
|
"components/routes/analytics/widgets/Status": "./components/routes/analytics/widgets/Status.tsx",
|
|
580
574
|
"components/routes/analytics/widgets/Escalation": "./components/routes/analytics/widgets/Escalation.tsx",
|
|
581
575
|
"components/routes/help/components/HelpTabs": "./components/routes/help/components/HelpTabs.tsx",
|
|
582
|
-
"components/routes/help/markdown/en/notebook.md": "./components/routes/help/markdown/en/notebook.md",
|
|
583
|
-
"components/routes/help/markdown/en/templates.md": "./components/routes/help/markdown/en/templates.md",
|
|
584
|
-
"components/routes/help/markdown/en/authentication.md": "./components/routes/help/markdown/en/authentication.md",
|
|
585
|
-
"components/routes/help/markdown/en/links.md": "./components/routes/help/markdown/en/links.md",
|
|
586
|
-
"components/routes/help/markdown/en/schema.md": "./components/routes/help/markdown/en/schema.md",
|
|
587
|
-
"components/routes/help/markdown/en/bundles.md": "./components/routes/help/markdown/en/bundles.md",
|
|
588
|
-
"components/routes/help/markdown/en/actionIntroduction.md": "./components/routes/help/markdown/en/actionIntroduction.md",
|
|
589
|
-
"components/routes/help/markdown/en/client.md": "./components/routes/help/markdown/en/client.md",
|
|
590
|
-
"components/routes/help/markdown/en/retention.md": "./components/routes/help/markdown/en/retention.md",
|
|
591
|
-
"components/routes/help/markdown/en/views.md": "./components/routes/help/markdown/en/views.md",
|
|
592
|
-
"components/routes/help/markdown/fr/notebook.md": "./components/routes/help/markdown/fr/notebook.md",
|
|
593
|
-
"components/routes/help/markdown/fr/templates.md": "./components/routes/help/markdown/fr/templates.md",
|
|
594
|
-
"components/routes/help/markdown/fr/authentication.md": "./components/routes/help/markdown/fr/authentication.md",
|
|
595
|
-
"components/routes/help/markdown/fr/links.md": "./components/routes/help/markdown/fr/links.md",
|
|
596
|
-
"components/routes/help/markdown/fr/schema.md": "./components/routes/help/markdown/fr/schema.md",
|
|
597
|
-
"components/routes/help/markdown/fr/bundles.md": "./components/routes/help/markdown/fr/bundles.md",
|
|
598
|
-
"components/routes/help/markdown/fr/actionIntroduction.md": "./components/routes/help/markdown/fr/actionIntroduction.md",
|
|
599
|
-
"components/routes/help/markdown/fr/client.md": "./components/routes/help/markdown/fr/client.md",
|
|
600
|
-
"components/routes/help/markdown/fr/retention.md": "./components/routes/help/markdown/fr/retention.md",
|
|
601
|
-
"components/routes/help/markdown/fr/views.md": "./components/routes/help/markdown/fr/views.md",
|
|
602
576
|
"components/routes/action/view/ActionSearch": "./components/routes/action/view/ActionSearch.tsx",
|
|
603
577
|
"components/routes/action/view/ActionDetails": "./components/routes/action/view/ActionDetails.tsx",
|
|
604
578
|
"components/routes/action/view/Integrations": "./components/routes/action/view/Integrations.tsx",
|
|
@@ -606,8 +580,6 @@
|
|
|
606
580
|
"components/routes/action/shared/OperationEntry": "./components/routes/action/shared/OperationEntry.tsx",
|
|
607
581
|
"components/routes/action/shared/ActionReportDisplay": "./components/routes/action/shared/ActionReportDisplay.tsx",
|
|
608
582
|
"components/routes/action/edit/ActionEditor": "./components/routes/action/edit/ActionEditor.tsx",
|
|
609
|
-
"components/routes/overviews/template/en.md": "./components/routes/overviews/template/en.md",
|
|
610
|
-
"components/routes/overviews/template/fr.md": "./components/routes/overviews/template/fr.md",
|
|
611
583
|
"commons/components/utils/keyboard": "./commons/components/utils/keyboard.ts",
|
|
612
584
|
"commons/components/leftnav/LeftNavItem": "./commons/components/leftnav/LeftNavItem.tsx",
|
|
613
585
|
"commons/components/leftnav/LeftNavGroup": "./commons/components/leftnav/LeftNavGroup.tsx",
|
package/plugins/HowlerPlugin.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { HowlerHelper } from 'components/elements/display/handlebars/helpers';
|
|
2
|
-
import type { ActionButton } from 'components/elements/hit/actions/SharedComponents';
|
|
3
|
-
import type { StatusProps } from 'components/elements/hit/HitBanner';
|
|
4
|
-
import type { PivotLinkProps } from 'components/elements/hit/related/PivotLink';
|
|
5
|
-
import type { PluginChipProps } from 'components/elements/PluginChip';
|
|
6
|
-
import type { PluginTypographyProps } from 'components/elements/PluginTypography';
|
|
7
|
-
import type { CustomActionProps } from 'components/routes/action/edit/ActionEditor';
|
|
8
|
-
import type { LeadFormProps } from 'components/routes/dossiers/LeadEditor';
|
|
9
|
-
import type { PivotFormProps } from 'components/routes/dossiers/PivotForm';
|
|
10
|
-
import type { PluginDocumentation } from 'components/routes/help/ActionDocumentation';
|
|
11
|
-
import i18nInstance from 'i18n';
|
|
1
|
+
import type { HowlerHelper } from '@cccsaurora/howler-ui/components/elements/display/handlebars/helpers';
|
|
2
|
+
import type { ActionButton } from '@cccsaurora/howler-ui/components/elements/hit/actions/SharedComponents';
|
|
3
|
+
import type { StatusProps } from '@cccsaurora/howler-ui/components/elements/hit/HitBanner';
|
|
4
|
+
import type { PivotLinkProps } from '@cccsaurora/howler-ui/components/elements/hit/related/PivotLink';
|
|
5
|
+
import type { PluginChipProps } from '@cccsaurora/howler-ui/components/elements/PluginChip';
|
|
6
|
+
import type { PluginTypographyProps } from '@cccsaurora/howler-ui/components/elements/PluginTypography';
|
|
7
|
+
import type { CustomActionProps } from '@cccsaurora/howler-ui/components/routes/action/edit/ActionEditor';
|
|
8
|
+
import type { LeadFormProps } from '@cccsaurora/howler-ui/components/routes/dossiers/LeadEditor';
|
|
9
|
+
import type { PivotFormProps } from '@cccsaurora/howler-ui/components/routes/dossiers/PivotForm';
|
|
10
|
+
import type { PluginDocumentation } from '@cccsaurora/howler-ui/components/routes/help/ActionDocumentation';
|
|
11
|
+
import i18nInstance from '@cccsaurora/howler-ui/i18n';
|
|
12
12
|
import type { i18n as I18N } from 'i18next';
|
|
13
13
|
import { difference } from 'lodash-es';
|
|
14
|
-
import type { Hit } from 'models/entities/generated/Hit';
|
|
14
|
+
import type { Hit } from '@cccsaurora/howler-ui/models/entities/generated/Hit';
|
|
15
15
|
import type React from 'react';
|
|
16
16
|
import type { PropsWithChildren } from 'react';
|
|
17
17
|
import type { IPlugin, PluginStore } from 'react-pluggable';
|
package/plugins/store.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import type { Hit } from 'models/entities/generated/Hit';
|
|
2
|
+
import type { Hit } from '@cccsaurora/howler-ui/models/entities/generated/Hit';
|
|
3
3
|
import { createPluginStore, Event } from 'react-pluggable';
|
|
4
4
|
import type HowlerPlugin from './HowlerPlugin';
|
|
5
5
|
import type { AppLeftNavElement } from '../commons/components/app/AppConfigs';
|
package/rest/AxiosClient.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { HowlerResponse } from 'api';
|
|
1
|
+
import type { HowlerResponse } from '@cccsaurora/howler-ui/api';
|
|
2
2
|
import type { AxiosInstance, AxiosRequestConfig, AxiosRequestHeaders } from 'axios';
|
|
3
3
|
import axios, { AxiosError } from 'axios';
|
|
4
4
|
import axiosRetry, { exponentialDelay, isNetworkError } from 'axios-retry';
|
|
5
|
-
import type RestClient from 'rest';
|
|
6
|
-
import { getAxiosCache, setAxiosCache } from 'utils/sessionStorage';
|
|
5
|
+
import type RestClient from '@cccsaurora/howler-ui/rest';
|
|
6
|
+
import { getAxiosCache, setAxiosCache } from '@cccsaurora/howler-ui/utils/sessionStorage';
|
|
7
7
|
|
|
8
8
|
class AxiosCache {
|
|
9
9
|
constructor(_axios: AxiosInstance) {
|
package/rest/FetchClient.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { HowlerResponse } from 'api';
|
|
2
|
-
import type RestClient from 'rest';
|
|
1
|
+
import type { HowlerResponse } from '@cccsaurora/howler-ui/api';
|
|
2
|
+
import type RestClient from '@cccsaurora/howler-ui/rest';
|
|
3
3
|
|
|
4
4
|
export default class FetchClient implements RestClient {
|
|
5
5
|
public async fetch<R>(
|
package/rest/index.ts
CHANGED
package/utils/actionUtils.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ActionOperation, ActionOperationStep } from 'models/ActionTypes';
|
|
2
|
-
import type { Operation } from 'models/entities/generated/Operation';
|
|
1
|
+
import type { ActionOperation, ActionOperationStep } from '@cccsaurora/howler-ui/models/ActionTypes';
|
|
2
|
+
import type { Operation } from '@cccsaurora/howler-ui/models/entities/generated/Operation';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A simple validation function to ensure we have all the necessary arguments filled out.
|
package/utils/hitFunctions.ts
CHANGED
package/utils/localStorage.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LoginResponse } from 'api/auth/login';
|
|
1
|
+
import type { LoginResponse } from '@cccsaurora/howler-ui/api/auth/login';
|
|
2
2
|
import { MY_LOCAL_STORAGE_PREFIX, StorageKey } from './constants';
|
|
3
3
|
|
|
4
4
|
const buildName = (name: string) => `${MY_LOCAL_STORAGE_PREFIX}.${name}`;
|
package/utils/sessionStorage.ts
CHANGED
package/utils/socketUtils.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RecievedDataType } from 'components/app/providers/SocketProvider';
|
|
2
|
-
import type { HitUpdate } from 'models/socket/HitUpdate';
|
|
1
|
+
import type { RecievedDataType } from '@cccsaurora/howler-ui/components/app/providers/SocketProvider';
|
|
2
|
+
import type { HitUpdate } from '@cccsaurora/howler-ui/models/socket/HitUpdate';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Checks to see if the data recieved from the socket is a hit update
|
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
import { renderHook } from '@testing-library/react';
|
|
2
|
-
import type { Dossier } from 'models/entities/generated/Dossier';
|
|
3
|
-
import type { Hit } from 'models/entities/generated/Hit';
|
|
4
|
-
import type { Overview } from 'models/entities/generated/Overview';
|
|
5
|
-
import type { Template } from 'models/entities/generated/Template';
|
|
6
|
-
import type { WithMetadata } from 'models/WithMetadata';
|
|
7
|
-
import { useContextSelector } from 'use-context-selector';
|
|
8
|
-
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
9
|
-
import { HitContext } from '../providers/HitProvider';
|
|
10
|
-
import useMatchers from './useMatchers';
|
|
11
|
-
|
|
12
|
-
// Mock the useContextSelector hook
|
|
13
|
-
vi.mock('use-context-selector', () => ({
|
|
14
|
-
useContextSelector: vi.fn(),
|
|
15
|
-
createContext: vi.fn()
|
|
16
|
-
}));
|
|
17
|
-
|
|
18
|
-
// Mock lodash-es has function
|
|
19
|
-
vi.mock('lodash-es', () => ({
|
|
20
|
-
has: vi.fn()
|
|
21
|
-
}));
|
|
22
|
-
|
|
23
|
-
// Create mock data
|
|
24
|
-
const mockTemplate: Template = {
|
|
25
|
-
name: 'test-template',
|
|
26
|
-
template: 'Test template content'
|
|
27
|
-
} as Template;
|
|
28
|
-
|
|
29
|
-
const mockOverview: Overview = {
|
|
30
|
-
name: 'test-overview',
|
|
31
|
-
overview: 'Test overview content'
|
|
32
|
-
} as Overview;
|
|
33
|
-
|
|
34
|
-
const mockDossiers: Dossier[] = [
|
|
35
|
-
{
|
|
36
|
-
name: 'test-dossier',
|
|
37
|
-
description: 'Test dossier content'
|
|
38
|
-
} as Dossier
|
|
39
|
-
];
|
|
40
|
-
|
|
41
|
-
const mockHit: Hit = {
|
|
42
|
-
howler: {
|
|
43
|
-
id: 'test-hit-id',
|
|
44
|
-
analytic: 'test-analytic',
|
|
45
|
-
data: {}
|
|
46
|
-
}
|
|
47
|
-
} as Hit;
|
|
48
|
-
|
|
49
|
-
const mockHitWithMetadata: WithMetadata<Hit> = {
|
|
50
|
-
...mockHit,
|
|
51
|
-
__template: mockTemplate,
|
|
52
|
-
__overview: mockOverview,
|
|
53
|
-
__dossiers: mockDossiers
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const mockGetHit = vi.fn();
|
|
57
|
-
|
|
58
|
-
describe('useMatchers', () => {
|
|
59
|
-
beforeEach(() => {
|
|
60
|
-
vi.clearAllMocks();
|
|
61
|
-
|
|
62
|
-
// Mock useContextSelector to return our mock getHit function
|
|
63
|
-
(useContextSelector as any).mockImplementation((context: any, selector: any) => {
|
|
64
|
-
if (context === HitContext) {
|
|
65
|
-
return selector({ getHit: mockGetHit });
|
|
66
|
-
}
|
|
67
|
-
return null;
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
describe('getMatchingTemplate', () => {
|
|
72
|
-
it('should return null when hit is null', async () => {
|
|
73
|
-
const { result } = renderHook(() => useMatchers());
|
|
74
|
-
|
|
75
|
-
const template = await result.current.getMatchingTemplate(null);
|
|
76
|
-
|
|
77
|
-
expect(template).toBeNull();
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it('should return null when hit is undefined', async () => {
|
|
81
|
-
const { result } = renderHook(() => useMatchers());
|
|
82
|
-
|
|
83
|
-
const template = await result.current.getMatchingTemplate(undefined);
|
|
84
|
-
|
|
85
|
-
expect(template).toBeNull();
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it('should return template from metadata when it exists', async () => {
|
|
89
|
-
const { has } = await import('lodash-es');
|
|
90
|
-
(has as any).mockReturnValue(true);
|
|
91
|
-
|
|
92
|
-
const { result } = renderHook(() => useMatchers());
|
|
93
|
-
|
|
94
|
-
const template = await result.current.getMatchingTemplate(mockHitWithMetadata);
|
|
95
|
-
|
|
96
|
-
expect(template).toBe(mockTemplate);
|
|
97
|
-
expect(mockGetHit).not.toHaveBeenCalled();
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('should fetch hit with metadata when template is not present', async () => {
|
|
101
|
-
const { has } = await import('lodash-es');
|
|
102
|
-
(has as any).mockReturnValue(false);
|
|
103
|
-
|
|
104
|
-
const hitWithFetchedMetadata = { ...mockHit, __template: mockTemplate };
|
|
105
|
-
mockGetHit.mockResolvedValue(hitWithFetchedMetadata);
|
|
106
|
-
|
|
107
|
-
const { result } = renderHook(() => useMatchers());
|
|
108
|
-
|
|
109
|
-
const template = await result.current.getMatchingTemplate(mockHit);
|
|
110
|
-
|
|
111
|
-
expect(template).toBe(mockTemplate);
|
|
112
|
-
expect(mockGetHit).toHaveBeenCalledWith('test-hit-id', true);
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
it('should handle getHit rejection gracefully', async () => {
|
|
116
|
-
const { has } = await import('lodash-es');
|
|
117
|
-
(has as any).mockReturnValue(false);
|
|
118
|
-
|
|
119
|
-
mockGetHit.mockRejectedValue(new Error('Failed to fetch hit'));
|
|
120
|
-
|
|
121
|
-
const { result } = renderHook(() => useMatchers());
|
|
122
|
-
|
|
123
|
-
await expect(result.current.getMatchingTemplate(mockHit)).resolves.toBeNull();
|
|
124
|
-
expect(mockGetHit).toHaveBeenCalledWith('test-hit-id', true);
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
describe('getMatchingOverview', () => {
|
|
129
|
-
it('should return null when hit is null', async () => {
|
|
130
|
-
const { result } = renderHook(() => useMatchers());
|
|
131
|
-
|
|
132
|
-
const overview = await result.current.getMatchingOverview(null);
|
|
133
|
-
|
|
134
|
-
expect(overview).toBeNull();
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
it('should return null when hit is undefined', async () => {
|
|
138
|
-
const { result } = renderHook(() => useMatchers());
|
|
139
|
-
|
|
140
|
-
const overview = await result.current.getMatchingOverview(undefined);
|
|
141
|
-
|
|
142
|
-
expect(overview).toBeNull();
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
it('should return overview from metadata when it exists', async () => {
|
|
146
|
-
const { has } = await import('lodash-es');
|
|
147
|
-
(has as any).mockReturnValue(true);
|
|
148
|
-
|
|
149
|
-
const { result } = renderHook(() => useMatchers());
|
|
150
|
-
|
|
151
|
-
const overview = await result.current.getMatchingOverview(mockHitWithMetadata);
|
|
152
|
-
|
|
153
|
-
expect(overview).toBe(mockOverview);
|
|
154
|
-
expect(mockGetHit).not.toHaveBeenCalled();
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
it('should fetch hit with metadata when overview is not present', async () => {
|
|
158
|
-
const { has } = await import('lodash-es');
|
|
159
|
-
(has as any).mockReturnValue(false);
|
|
160
|
-
|
|
161
|
-
const hitWithFetchedMetadata = { ...mockHit, __overview: mockOverview };
|
|
162
|
-
mockGetHit.mockResolvedValue(hitWithFetchedMetadata);
|
|
163
|
-
|
|
164
|
-
const { result } = renderHook(() => useMatchers());
|
|
165
|
-
|
|
166
|
-
const overview = await result.current.getMatchingOverview(mockHit);
|
|
167
|
-
|
|
168
|
-
expect(overview).toBe(mockOverview);
|
|
169
|
-
expect(mockGetHit).toHaveBeenCalledWith('test-hit-id', true);
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
it('should handle getHit rejection gracefully', async () => {
|
|
173
|
-
const { has } = await import('lodash-es');
|
|
174
|
-
(has as any).mockReturnValue(false);
|
|
175
|
-
|
|
176
|
-
mockGetHit.mockRejectedValue(new Error('Failed to fetch hit'));
|
|
177
|
-
|
|
178
|
-
const { result } = renderHook(() => useMatchers());
|
|
179
|
-
|
|
180
|
-
await expect(result.current.getMatchingOverview(mockHit)).resolves.toBeNull();
|
|
181
|
-
expect(mockGetHit).toHaveBeenCalledWith('test-hit-id', true);
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
describe('getMatchingDossiers', () => {
|
|
186
|
-
it('should return null when hit is null', async () => {
|
|
187
|
-
const { result } = renderHook(() => useMatchers());
|
|
188
|
-
|
|
189
|
-
const dossiers = await result.current.getMatchingDossiers(null);
|
|
190
|
-
|
|
191
|
-
expect(dossiers).toBeNull();
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
it('should return null when hit is undefined', async () => {
|
|
195
|
-
const { result } = renderHook(() => useMatchers());
|
|
196
|
-
|
|
197
|
-
const dossiers = await result.current.getMatchingDossiers(undefined);
|
|
198
|
-
|
|
199
|
-
expect(dossiers).toBeNull();
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
it('should return dossiers from metadata when they exist', async () => {
|
|
203
|
-
const { has } = await import('lodash-es');
|
|
204
|
-
(has as any).mockReturnValue(true);
|
|
205
|
-
|
|
206
|
-
const { result } = renderHook(() => useMatchers());
|
|
207
|
-
|
|
208
|
-
const dossiers = await result.current.getMatchingDossiers(mockHitWithMetadata);
|
|
209
|
-
|
|
210
|
-
expect(dossiers).toBe(mockDossiers);
|
|
211
|
-
expect(mockGetHit).not.toHaveBeenCalled();
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
it('should fetch hit with metadata when dossiers are not present', async () => {
|
|
215
|
-
const { has } = await import('lodash-es');
|
|
216
|
-
(has as any).mockReturnValue(false);
|
|
217
|
-
|
|
218
|
-
const hitWithFetchedMetadata = { ...mockHit, __dossiers: mockDossiers };
|
|
219
|
-
mockGetHit.mockResolvedValue(hitWithFetchedMetadata);
|
|
220
|
-
|
|
221
|
-
const { result } = renderHook(() => useMatchers());
|
|
222
|
-
|
|
223
|
-
const dossiers = await result.current.getMatchingDossiers(mockHit);
|
|
224
|
-
|
|
225
|
-
expect(dossiers).toBe(mockDossiers);
|
|
226
|
-
expect(mockGetHit).toHaveBeenCalledWith('test-hit-id', true);
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
it('should handle getHit rejection gracefully', async () => {
|
|
230
|
-
const { has } = await import('lodash-es');
|
|
231
|
-
(has as any).mockReturnValue(false);
|
|
232
|
-
|
|
233
|
-
mockGetHit.mockRejectedValue(new Error('Failed to fetch hit'));
|
|
234
|
-
|
|
235
|
-
const { result } = renderHook(() => useMatchers());
|
|
236
|
-
|
|
237
|
-
await expect(result.current.getMatchingDossiers(mockHit)).resolves.toEqual([]);
|
|
238
|
-
expect(mockGetHit).toHaveBeenCalledWith('test-hit-id', true);
|
|
239
|
-
});
|
|
240
|
-
});
|
|
241
|
-
|
|
242
|
-
describe('integration tests', () => {
|
|
243
|
-
it('should correctly handle has function calls for different metadata properties', async () => {
|
|
244
|
-
const { has } = await import('lodash-es');
|
|
245
|
-
|
|
246
|
-
// Mock has to return true for __template, false for others
|
|
247
|
-
(has as any).mockImplementation((_obj: any, prop: string) => {
|
|
248
|
-
return prop === '__template';
|
|
249
|
-
});
|
|
250
|
-
|
|
251
|
-
const hitWithPartialMetadata = {
|
|
252
|
-
...mockHit,
|
|
253
|
-
__template: mockTemplate
|
|
254
|
-
};
|
|
255
|
-
|
|
256
|
-
mockGetHit.mockResolvedValue({
|
|
257
|
-
...mockHit,
|
|
258
|
-
__overview: mockOverview,
|
|
259
|
-
__dossiers: mockDossiers
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
const { result } = renderHook(() => useMatchers());
|
|
263
|
-
|
|
264
|
-
// Should return template from metadata
|
|
265
|
-
const template = await result.current.getMatchingTemplate(hitWithPartialMetadata);
|
|
266
|
-
expect(template).toBe(mockTemplate);
|
|
267
|
-
|
|
268
|
-
// Should fetch overview
|
|
269
|
-
const overview = await result.current.getMatchingOverview(hitWithPartialMetadata);
|
|
270
|
-
expect(overview).toBe(mockOverview);
|
|
271
|
-
|
|
272
|
-
// Should fetch dossiers
|
|
273
|
-
const dossiers = await result.current.getMatchingDossiers(hitWithPartialMetadata);
|
|
274
|
-
expect(dossiers).toBe(mockDossiers);
|
|
275
|
-
|
|
276
|
-
// Verify has was called with correct parameters
|
|
277
|
-
expect(has).toHaveBeenCalledWith(hitWithPartialMetadata, '__template');
|
|
278
|
-
expect(has).toHaveBeenCalledWith(hitWithPartialMetadata, '__overview');
|
|
279
|
-
expect(has).toHaveBeenCalledWith(hitWithPartialMetadata, '__dossiers');
|
|
280
|
-
});
|
|
281
|
-
|
|
282
|
-
it('should handle empty or undefined metadata gracefully', async () => {
|
|
283
|
-
const { has } = await import('lodash-es');
|
|
284
|
-
(has as any).mockReturnValue(false);
|
|
285
|
-
|
|
286
|
-
mockGetHit.mockResolvedValue({
|
|
287
|
-
...mockHit,
|
|
288
|
-
__template: undefined,
|
|
289
|
-
__overview: null,
|
|
290
|
-
__dossiers: []
|
|
291
|
-
});
|
|
292
|
-
|
|
293
|
-
const { result } = renderHook(() => useMatchers());
|
|
294
|
-
|
|
295
|
-
const template = await result.current.getMatchingTemplate(mockHit);
|
|
296
|
-
const overview = await result.current.getMatchingOverview(mockHit);
|
|
297
|
-
const dossiers = await result.current.getMatchingDossiers(mockHit);
|
|
298
|
-
|
|
299
|
-
expect(template).toBeUndefined();
|
|
300
|
-
expect(overview).toBeNull();
|
|
301
|
-
expect(dossiers).toEqual([]);
|
|
302
|
-
expect(mockGetHit).toHaveBeenCalledTimes(3);
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
it('should maintain referential equality of returned functions', () => {
|
|
306
|
-
const { result, rerender } = renderHook(() => useMatchers());
|
|
307
|
-
|
|
308
|
-
const firstRender = {
|
|
309
|
-
getMatchingTemplate: result.current.getMatchingTemplate,
|
|
310
|
-
getMatchingOverview: result.current.getMatchingOverview,
|
|
311
|
-
getMatchingDossiers: result.current.getMatchingDossiers
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
rerender();
|
|
315
|
-
|
|
316
|
-
const secondRender = {
|
|
317
|
-
getMatchingTemplate: result.current.getMatchingTemplate,
|
|
318
|
-
getMatchingOverview: result.current.getMatchingOverview,
|
|
319
|
-
getMatchingDossiers: result.current.getMatchingDossiers
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
// Functions should be the same reference due to useCallback
|
|
323
|
-
expect(firstRender.getMatchingTemplate).toBe(secondRender.getMatchingTemplate);
|
|
324
|
-
expect(firstRender.getMatchingOverview).toBe(secondRender.getMatchingOverview);
|
|
325
|
-
expect(firstRender.getMatchingDossiers).toBe(secondRender.getMatchingDossiers);
|
|
326
|
-
});
|
|
327
|
-
});
|
|
328
|
-
});
|