@cccsaurora/howler-ui 2.14.0-dev.259 → 2.14.0-dev.264
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 +19 -0
- package/api/action/index.ts +36 -0
- package/api/action/operations.ts +11 -0
- package/api/analytic/comments/index.ts +27 -0
- package/api/analytic/comments/react.ts +14 -0
- package/api/analytic/favourite.ts +14 -0
- package/api/analytic/index.ts +27 -0
- package/api/analytic/notebooks/index.ts +15 -0
- package/api/analytic/owner.ts +11 -0
- package/api/analytic/rules.ts +13 -0
- package/api/auth/apikey.ts +20 -0
- package/api/auth/index.ts +9 -0
- package/api/auth/login.ts +35 -0
- package/api/configs/index.ts +10 -0
- package/api/dossier/hit.ts +10 -0
- package/api/dossier/index.ts +26 -0
- package/api/help.ts +71 -0
- package/api/hit/assign.ts +11 -0
- package/api/hit/comments/index.ts +27 -0
- package/api/hit/comments/react.ts +15 -0
- package/api/hit/index.ts +56 -0
- package/api/hit/labels.ts +16 -0
- package/api/hit/overwrite.ts +11 -0
- package/api/hit/transition.ts +12 -0
- package/api/index.ts +301 -0
- package/api/notebook/environments.ts +14 -0
- package/api/notebook/index.ts +20 -0
- package/api/overview/index.ts +22 -0
- package/api/search/action.ts +12 -0
- package/api/search/analytic.ts +12 -0
- package/api/search/count/hit.ts +11 -0
- package/api/search/count/index.ts +18 -0
- package/api/search/dossier.ts +12 -0
- package/api/search/eql/hit.ts +12 -0
- package/api/search/facet/hit.ts +11 -0
- package/api/search/facet/index.ts +19 -0
- package/api/search/fields/hit.ts +12 -0
- package/api/search/fields/index.ts +29 -0
- package/api/search/fields/user.ts +14 -0
- package/api/search/grouped/hit.ts +15 -0
- package/api/search/grouped/index.ts +34 -0
- package/api/search/grouped/user.ts +30 -0
- package/api/search/histogram/hit.ts +11 -0
- package/api/search/histogram/index.ts +20 -0
- package/api/search/hit.ts +17 -0
- package/api/search/index.ts +63 -0
- package/api/search/overview.ts +12 -0
- package/api/search/sigma/hit.ts +12 -0
- package/api/search/template.ts +12 -0
- package/api/search/user.ts +21 -0
- package/api/search/view.ts +12 -0
- package/api/template/index.ts +22 -0
- package/api/user/avatar/index.ts +10 -0
- package/api/user/groups.ts +12 -0
- package/api/user/index.ts +20 -0
- package/api/user/whoami.ts +11 -0
- package/api/view/favourite.ts +14 -0
- package/api/view/index.ts +25 -0
- package/branding/AppBrand.tsx +161 -0
- package/commons/components/app/AppConfigs.ts +179 -0
- package/commons/components/app/AppConstants.ts +11 -0
- package/commons/components/app/AppContexts.ts +142 -0
- package/commons/components/app/AppDefaults.ts +52 -0
- package/commons/components/app/AppNotificationService.ts +7 -0
- package/commons/components/app/AppProvider.tsx +86 -0
- package/commons/components/app/AppSearchService.ts +33 -0
- package/commons/components/app/AppSkeleton.tsx +321 -0
- package/commons/components/app/AppUserService.ts +21 -0
- package/commons/components/app/hooks/index.ts +18 -0
- package/commons/components/app/hooks/useApp.tsx +6 -0
- package/commons/components/app/hooks/useAppBanner.tsx +7 -0
- package/commons/components/app/hooks/useAppBar.tsx +6 -0
- package/commons/components/app/hooks/useAppBarHeight.tsx +27 -0
- package/commons/components/app/hooks/useAppBarScrollTrigger.tsx +8 -0
- package/commons/components/app/hooks/useAppBreadcrumbs.tsx +6 -0
- package/commons/components/app/hooks/useAppConfigs.tsx +54 -0
- package/commons/components/app/hooks/useAppLanguage.tsx +29 -0
- package/commons/components/app/hooks/useAppLayout.tsx +6 -0
- package/commons/components/app/hooks/useAppLeftNav.tsx +6 -0
- package/commons/components/app/hooks/useAppLogo.tsx +9 -0
- package/commons/components/app/hooks/useAppNotification.tsx +6 -0
- package/commons/components/app/hooks/useAppQuickSearch.tsx +6 -0
- package/commons/components/app/hooks/useAppSearchService.tsx +7 -0
- package/commons/components/app/hooks/useAppSitemap.tsx +84 -0
- package/commons/components/app/hooks/useAppSwitcher.tsx +6 -0
- package/commons/components/app/hooks/useAppTheme.tsx +23 -0
- package/commons/components/app/hooks/useAppUser.tsx +7 -0
- package/commons/components/app/providers/AppBarProvider.tsx +48 -0
- package/commons/components/app/providers/AppBreadcrumbsProvider.tsx +53 -0
- package/commons/components/app/providers/AppLayoutProvider.tsx +114 -0
- package/commons/components/app/providers/AppLeftNavProvider.tsx +30 -0
- package/commons/components/app/providers/AppNotificationProvider.tsx +49 -0
- package/commons/components/app/providers/AppQuickSearchProvider.tsx +32 -0
- package/commons/components/app/providers/AppSearchServiceProvider.tsx +65 -0
- package/commons/components/app/providers/AppSnackbarProvider.tsx +16 -0
- package/commons/components/app/providers/AppSwitcherProvider.tsx +16 -0
- package/commons/components/app/providers/AppUserProvider.tsx +22 -0
- package/commons/components/breadcrumbs/BreadcrumbIcon.tsx +21 -0
- package/commons/components/breadcrumbs/BreadcrumbLastItem.tsx +40 -0
- package/commons/components/breadcrumbs/BreadcrumbLinkItem.tsx +43 -0
- package/commons/components/breadcrumbs/BreadcrumbList.tsx +87 -0
- package/commons/components/breadcrumbs/Breadcrumbs.tsx +40 -0
- package/commons/components/display/AppAvatar.tsx +34 -0
- package/commons/components/display/AppInfoPanel.tsx +30 -0
- package/commons/components/display/AppListEmpty.tsx +5 -0
- package/commons/components/display/AppToc.tsx +160 -0
- package/commons/components/display/hooks/useAppColor.tsx +21 -0
- package/commons/components/leftnav/LeftNavDrawer.tsx +172 -0
- package/commons/components/leftnav/LeftNavGroup.tsx +144 -0
- package/commons/components/leftnav/LeftNavItem.tsx +73 -0
- package/commons/components/notification/FeedModels.ts +163 -0
- package/commons/components/notification/Notification.tsx +152 -0
- package/commons/components/notification/elements/NotificationCloseButton.tsx +14 -0
- package/commons/components/notification/elements/NotificationContainer.tsx +87 -0
- package/commons/components/notification/elements/NotificationEndOfPage.tsx +48 -0
- package/commons/components/notification/elements/NotificationError.tsx +24 -0
- package/commons/components/notification/elements/NotificationHeader.tsx +41 -0
- package/commons/components/notification/elements/NotificationItems.tsx +47 -0
- package/commons/components/notification/elements/NotificationSkeleton.tsx +59 -0
- package/commons/components/notification/elements/NotificationTopNavButton.tsx +27 -0
- package/commons/components/notification/elements/item/NotificationItem.tsx +44 -0
- package/commons/components/notification/elements/item/NotificationItemAuthor.tsx +72 -0
- package/commons/components/notification/elements/item/NotificationItemContent.tsx +29 -0
- package/commons/components/notification/elements/item/NotificationItemDate.tsx +14 -0
- package/commons/components/notification/elements/item/NotificationItemImage.tsx +19 -0
- package/commons/components/notification/elements/item/NotificationItemTag.tsx +18 -0
- package/commons/components/notification/elements/item/NotificationItemTitle.tsx +38 -0
- package/commons/components/notification/index.tsx +2 -0
- package/commons/components/pages/PageCardCentered.tsx +32 -0
- package/commons/components/pages/PageCenter.tsx +46 -0
- package/commons/components/pages/PageContent.tsx +13 -0
- package/commons/components/pages/PageFullScreen.tsx +74 -0
- package/commons/components/pages/PageFullWidth.tsx +30 -0
- package/commons/components/pages/PageHeader.tsx +117 -0
- package/commons/components/pages/hooks/usePageProps.tsx +41 -0
- package/commons/components/search/AppSearch.tsx +256 -0
- package/commons/components/search/AppSearchInput.tsx +104 -0
- package/commons/components/search/AppSearchResult.tsx +66 -0
- package/commons/components/topnav/AppBar.tsx +137 -0
- package/commons/components/topnav/AppName.tsx +53 -0
- package/commons/components/topnav/AppSwitcher.tsx +116 -0
- package/commons/components/topnav/Notifications.tsx +16 -0
- package/commons/components/topnav/ThemeSelection.tsx +143 -0
- package/commons/components/topnav/ThemeSelectionIcon.tsx +39 -0
- package/commons/components/topnav/UserProfile.tsx +196 -0
- package/commons/components/utils/hooks/useClipboard.tsx +31 -0
- package/commons/components/utils/hooks/useEnv.tsx +13 -0
- package/commons/components/utils/hooks/useFullscreenStatus.tsx +47 -0
- package/commons/components/utils/hooks/useGravatar.tsx +13 -0
- package/commons/components/utils/hooks/useLocalStorage.ts +75 -0
- package/commons/components/utils/hooks/useLocalStorageItem.tsx +45 -0
- package/commons/components/utils/hooks/useThemeBuilder.tsx +55 -0
- package/commons/components/utils/keyboard.ts +61 -0
- package/components/app/App.tsx +434 -0
- package/components/app/AppContainer.tsx +19 -0
- package/components/app/drawers/ApiKeyDrawer.tsx +173 -0
- package/components/app/drawers/AppDrawerType.ts +7 -0
- package/components/app/drawers/AssignUserDrawer.tsx +126 -0
- package/components/app/drawers/ViewGroupsDrawer.tsx +24 -0
- package/components/app/hooks/useMatchers.test.ts +328 -0
- package/components/app/hooks/useMatchers.tsx +107 -0
- package/components/app/hooks/useTitle.tsx +77 -0
- package/components/app/providers/AnalyticProvider.tsx +87 -0
- package/components/app/providers/ApiConfigProvider.tsx +31 -0
- package/components/app/providers/AppDrawerProvider.tsx +54 -0
- package/components/app/providers/AvatarProvider.tsx +47 -0
- package/components/app/providers/CustomPluginProvider.tsx +19 -0
- package/components/app/providers/FavouritesProvider.tsx +157 -0
- package/components/app/providers/FieldProvider.tsx +34 -0
- package/components/app/providers/HitProvider.tsx +164 -0
- package/components/app/providers/HitSearchProvider.tsx +248 -0
- package/components/app/providers/LocalStorageProvider.tsx +67 -0
- package/components/app/providers/ModalProvider.tsx +57 -0
- package/components/app/providers/OverviewProvider.tsx +90 -0
- package/components/app/providers/ParameterProvider.tsx +270 -0
- package/components/app/providers/SocketProvider.tsx +329 -0
- package/components/app/providers/UserListProvider.tsx +56 -0
- package/components/app/providers/ViewProvider.test.tsx +244 -0
- package/components/app/providers/ViewProvider.tsx +207 -0
- package/components/elements/Comment.tsx +315 -0
- package/components/elements/EditRow.tsx +268 -0
- package/components/elements/PluginChip.tsx +32 -0
- package/components/elements/PluginTypography.tsx +31 -0
- package/components/elements/ThemedEditor.tsx +130 -0
- package/components/elements/UserList.tsx +79 -0
- package/components/elements/addons/buttons/CustomButton.tsx +93 -0
- package/components/elements/addons/buttons/CustomIconButton.tsx +122 -0
- package/components/elements/addons/buttons/index.ts +7 -0
- package/components/elements/addons/layout/FlexOne.tsx +6 -0
- package/components/elements/addons/layout/FlexPort.tsx +39 -0
- package/components/elements/addons/layout/FlexVertical.tsx +28 -0
- package/components/elements/addons/layout/vsbox/VSBox.tsx +52 -0
- package/components/elements/addons/layout/vsbox/VSBoxContent.tsx +13 -0
- package/components/elements/addons/layout/vsbox/VSBoxElement.tsx +60 -0
- package/components/elements/addons/layout/vsbox/VSBoxHeader.tsx +41 -0
- package/components/elements/addons/lists/TuiList.tsx +31 -0
- package/components/elements/addons/lists/TuiListBase.tsx +98 -0
- package/components/elements/addons/lists/TuiListElement.tsx +51 -0
- package/components/elements/addons/lists/TuiListMenu.tsx +61 -0
- package/components/elements/addons/lists/TuiListProvider.tsx +162 -0
- package/components/elements/addons/lists/hooks/useTuiListKeyboard.tsx +60 -0
- package/components/elements/addons/lists/index.tsx +25 -0
- package/components/elements/addons/lists/table/TuiTable.tsx +151 -0
- package/components/elements/addons/lists/table/TuiTableBody.tsx +77 -0
- package/components/elements/addons/lists/table/TuiTableHead.tsx +29 -0
- package/components/elements/addons/lists/table/TuiTableHeader.tsx +15 -0
- package/components/elements/addons/lists/table/TuiTableLayout.ts +53 -0
- package/components/elements/addons/lists/table/index.tsx +24 -0
- package/components/elements/addons/search/SearchPagination.tsx +26 -0
- package/components/elements/addons/search/SearchTotal.tsx +35 -0
- package/components/elements/addons/search/phrase/Phrase.tsx +175 -0
- package/components/elements/addons/search/phrase/PhraseConsumer.ts +35 -0
- package/components/elements/addons/search/phrase/PhraseLexer.ts +167 -0
- package/components/elements/addons/search/phrase/index.ts +86 -0
- package/components/elements/addons/search/phrase/word/WordLexer.ts +10 -0
- package/components/elements/addons/search/phrase/word/WordSuggester.ts +9 -0
- package/components/elements/addons/search/phrase/word/consumers/WhitespaceConsumer.ts +21 -0
- package/components/elements/addons/search/phrase/word/consumers/WordConsumer.ts +21 -0
- package/components/elements/display/ActionButton.tsx +40 -0
- package/components/elements/display/Classification.tsx +29 -0
- package/components/elements/display/DocumentationButton.tsx +46 -0
- package/components/elements/display/DynamicTabs.tsx +52 -0
- package/components/elements/display/HandlebarsMarkdown.tsx +105 -0
- package/components/elements/display/HowlerAvatar.tsx +66 -0
- package/components/elements/display/HowlerAvatarHeader.tsx +37 -0
- package/components/elements/display/HowlerCard.tsx +10 -0
- package/components/elements/display/Image.tsx +43 -0
- package/components/elements/display/ItemManager.tsx +146 -0
- package/components/elements/display/Markdown.tsx +200 -0
- package/components/elements/display/Modal.tsx +44 -0
- package/components/elements/display/Notebook.tsx +7 -0
- package/components/elements/display/QueryResultText.tsx +25 -0
- package/components/elements/display/TextDivider.tsx +48 -0
- package/components/elements/display/TypingIndicator.tsx +41 -0
- package/components/elements/display/UserPageWrapper.tsx +20 -0
- package/components/elements/display/features/DevelopmentBanner.tsx +24 -0
- package/components/elements/display/features/DevelopmentIcon.tsx +24 -0
- package/components/elements/display/handlebars/helpers.tsx +276 -0
- package/components/elements/display/icons/BundleButton.tsx +77 -0
- package/components/elements/display/icons/Iconified.tsx +16 -0
- package/components/elements/display/icons/SocketBadge.tsx +82 -0
- package/components/elements/display/icons/svg/howler-icon-darkmode.svg +1 -0
- package/components/elements/display/icons/svg/howler-icon-lightmode.svg +1 -0
- package/components/elements/display/icons/svg/howler-logo-full.svg +1 -0
- package/components/elements/display/icons/svg/howler-logo.svg +1 -0
- package/components/elements/display/json/JSONViewer.tsx +98 -0
- package/components/elements/display/markdownPlugins/tabs.ts +81 -0
- package/components/elements/display/modals/ConfirmDeleteModal.tsx +32 -0
- package/components/elements/display/modals/ConfirmNotebookModal.tsx +32 -0
- package/components/elements/display/modals/CreateActionModal.tsx +63 -0
- package/components/elements/display/modals/LoginErrorModal.tsx +31 -0
- package/components/elements/display/modals/RationaleModal.tsx +59 -0
- package/components/elements/hit/HitActions.tsx +298 -0
- package/components/elements/hit/HitBanner.tsx +367 -0
- package/components/elements/hit/HitBannerTooltip.tsx +41 -0
- package/components/elements/hit/HitCard.tsx +42 -0
- package/components/elements/hit/HitComments.tsx +372 -0
- package/components/elements/hit/HitDetails.tsx +324 -0
- package/components/elements/hit/HitLabels.tsx +265 -0
- package/components/elements/hit/HitLayout.ts +5 -0
- package/components/elements/hit/HitNotebooks.tsx +264 -0
- package/components/elements/hit/HitOutline.tsx +56 -0
- package/components/elements/hit/HitOverview.tsx +53 -0
- package/components/elements/hit/HitQuickSearch.tsx +111 -0
- package/components/elements/hit/HitRelated.tsx +18 -0
- package/components/elements/hit/HitShortcuts.ts +5 -0
- package/components/elements/hit/HitSummary.tsx +301 -0
- package/components/elements/hit/HitWorklog.tsx +201 -0
- package/components/elements/hit/actions/ButtonActions.tsx +269 -0
- package/components/elements/hit/actions/DropdownActions.tsx +157 -0
- package/components/elements/hit/actions/SharedComponents.tsx +40 -0
- package/components/elements/hit/aggregate/HitGraph.tsx +351 -0
- package/components/elements/hit/elements/Assigned.tsx +71 -0
- package/components/elements/hit/elements/EscalationChip.tsx +26 -0
- package/components/elements/hit/elements/HitTimestamp.tsx +81 -0
- package/components/elements/hit/outlines/DefaultOutline.tsx +107 -0
- package/components/elements/hit/outlines/al/AssemblyLineRules.tsx +130 -0
- package/components/elements/hit/related/PivotLink.tsx +67 -0
- package/components/elements/hit/related/RelatedIcon.tsx +51 -0
- package/components/elements/hit/related/RelatedLink.tsx +43 -0
- package/components/elements/view/ViewTitle.tsx +61 -0
- package/components/hooks/useHitActions.tsx +276 -0
- package/components/hooks/useHitSelection.tsx +102 -0
- package/components/hooks/useMyApi.tsx +64 -0
- package/components/hooks/useMyChart.tsx +164 -0
- package/components/hooks/useMyLocalStorage.ts +20 -0
- package/components/hooks/useMyPreferences.tsx +309 -0
- package/components/hooks/useMySearch.tsx +77 -0
- package/components/hooks/useMySitemap.tsx +248 -0
- package/components/hooks/useMySnackbar.tsx +67 -0
- package/components/hooks/useMyTheme.tsx +34 -0
- package/components/hooks/useMyUser.tsx +39 -0
- package/components/hooks/useMyUserFunctions.tsx +166 -0
- package/components/hooks/useMyUserList.tsx +15 -0
- package/components/hooks/useMyUtils.tsx +16 -0
- package/components/hooks/useScrollRestoration.tsx +37 -0
- package/components/logins/Login.tsx +62 -0
- package/components/logins/auth/OAuthLogin.tsx +49 -0
- package/components/logins/auth/UserPassLogin.tsx +57 -0
- package/components/logins/hooks/useLogin.tsx +101 -0
- package/components/routes/404.tsx +24 -0
- package/components/routes/ErrorBoundary.tsx +44 -0
- package/components/routes/ErrorOccured.tsx +28 -0
- package/components/routes/Logout.tsx +56 -0
- package/components/routes/action/edit/ActionEditor.tsx +358 -0
- package/components/routes/action/shared/ActionReportDisplay.tsx +84 -0
- package/components/routes/action/shared/OperationEntry.tsx +121 -0
- package/components/routes/action/shared/OperationStep.tsx +219 -0
- package/components/routes/action/useMyActionFunctions.tsx +225 -0
- package/components/routes/action/view/ActionDetails.tsx +205 -0
- package/components/routes/action/view/ActionSearch.tsx +249 -0
- package/components/routes/action/view/Integrations.tsx +49 -0
- package/components/routes/admin/users/UserEditor.tsx +55 -0
- package/components/routes/admin/users/UserSearch.tsx +228 -0
- package/components/routes/advanced/QueryBuilder.tsx +584 -0
- package/components/routes/advanced/QueryEditor.tsx +148 -0
- package/components/routes/advanced/RuleModal.tsx +217 -0
- package/components/routes/advanced/eqlCompletionProvider.ts +94 -0
- package/components/routes/advanced/eqlTokenProvider.ts +110 -0
- package/components/routes/advanced/historyCompletionProvider.ts +61 -0
- package/components/routes/advanced/luceneCompletionProvider.ts +111 -0
- package/components/routes/advanced/luceneTokenProvider.ts +131 -0
- package/components/routes/advanced/yamlCompletionProvider.ts +58 -0
- package/components/routes/analytics/AnalyticComments.tsx +218 -0
- package/components/routes/analytics/AnalyticDetails.tsx +343 -0
- package/components/routes/analytics/AnalyticHitComments.tsx +99 -0
- package/components/routes/analytics/AnalyticNotebooks.tsx +185 -0
- package/components/routes/analytics/AnalyticOverview.tsx +165 -0
- package/components/routes/analytics/AnalyticOverviews.tsx +75 -0
- package/components/routes/analytics/AnalyticSearch.tsx +301 -0
- package/components/routes/analytics/AnalyticTemplates.tsx +77 -0
- package/components/routes/analytics/RuleView.tsx +80 -0
- package/components/routes/analytics/TriageSettings.tsx +146 -0
- package/components/routes/analytics/widgets/Assessment.tsx +71 -0
- package/components/routes/analytics/widgets/Created.tsx +61 -0
- package/components/routes/analytics/widgets/Detection.tsx +11 -0
- package/components/routes/analytics/widgets/Escalation.tsx +65 -0
- package/components/routes/analytics/widgets/Stacked.tsx +109 -0
- package/components/routes/analytics/widgets/Status.tsx +21 -0
- package/components/routes/dossiers/DossierCard.tsx +48 -0
- package/components/routes/dossiers/DossierEditor.tsx +247 -0
- package/components/routes/dossiers/Dossiers.tsx +173 -0
- package/components/routes/dossiers/LeadEditor.tsx +122 -0
- package/components/routes/dossiers/LeadForm.tsx +106 -0
- package/components/routes/dossiers/PivotForm.tsx +311 -0
- package/components/routes/help/ActionDocumentation.tsx +77 -0
- package/components/routes/help/ActionIntroductionDocumentation.tsx +128 -0
- package/components/routes/help/ApiDocumentation.tsx +217 -0
- package/components/routes/help/AuthDocumentation.tsx +26 -0
- package/components/routes/help/BundleDocumentation.tsx +17 -0
- package/components/routes/help/ClientDocumentation.tsx +27 -0
- package/components/routes/help/Help.tsx +96 -0
- package/components/routes/help/HitBannerDocumentation.tsx +71 -0
- package/components/routes/help/HitDocumentation.tsx +77 -0
- package/components/routes/help/HitLabelsDocumentation.tsx +57 -0
- package/components/routes/help/HitLinksDocumentation.tsx +23 -0
- package/components/routes/help/HitSchemaDocumentation.tsx +253 -0
- package/components/routes/help/NotebookDocumentation.tsx +28 -0
- package/components/routes/help/OverviewDocumentation.tsx +21 -0
- package/components/routes/help/RetentionDocumentation.tsx +55 -0
- package/components/routes/help/SearchDocumentation.tsx +700 -0
- package/components/routes/help/TemplateDocumentation.tsx +73 -0
- package/components/routes/help/ViewDocumentation.tsx +32 -0
- package/components/routes/help/components/HelpTabs.tsx +47 -0
- package/components/routes/help/markdown/en/actionIntroduction.md +33 -0
- package/components/routes/help/markdown/en/authentication.md +261 -0
- package/components/routes/help/markdown/en/bundles.md +70 -0
- package/components/routes/help/markdown/en/client.md +213 -0
- package/components/routes/help/markdown/en/links.md +37 -0
- package/components/routes/help/markdown/en/notebook.md +157 -0
- package/components/routes/help/markdown/en/retention.md +15 -0
- package/components/routes/help/markdown/en/schema.md +20 -0
- package/components/routes/help/markdown/en/templates.md +23 -0
- package/components/routes/help/markdown/en/views.md +11 -0
- package/components/routes/help/markdown/fr/actionIntroduction.md +33 -0
- package/components/routes/help/markdown/fr/authentication.md +259 -0
- package/components/routes/help/markdown/fr/bundles.md +70 -0
- package/components/routes/help/markdown/fr/client.md +209 -0
- package/components/routes/help/markdown/fr/links.md +37 -0
- package/components/routes/help/markdown/fr/notebook.md +157 -0
- package/components/routes/help/markdown/fr/retention.md +15 -0
- package/components/routes/help/markdown/fr/schema.md +20 -0
- package/components/routes/help/markdown/fr/templates.md +23 -0
- package/components/routes/help/markdown/fr/views.md +11 -0
- package/components/routes/hits/search/BundleParentMenu.tsx +73 -0
- package/components/routes/hits/search/BundleScroller.tsx +8 -0
- package/components/routes/hits/search/CustomSort.tsx +94 -0
- package/components/routes/hits/search/HitBrowser.tsx +318 -0
- package/components/routes/hits/search/HitContextMenu.tsx +260 -0
- package/components/routes/hits/search/HitQuery.tsx +268 -0
- package/components/routes/hits/search/InformationPane.tsx +430 -0
- package/components/routes/hits/search/SearchPane.tsx +291 -0
- package/components/routes/hits/search/ViewLink.tsx +96 -0
- package/components/routes/hits/search/grid/AddColumnModal.tsx +98 -0
- package/components/routes/hits/search/grid/ColumnHeader.tsx +70 -0
- package/components/routes/hits/search/grid/EnhancedCell.tsx +50 -0
- package/components/routes/hits/search/grid/HitGrid.tsx +342 -0
- package/components/routes/hits/search/grid/HitRow.tsx +121 -0
- package/components/routes/hits/search/shared/CustomSpan.tsx +54 -0
- package/components/routes/hits/search/shared/HitFilter.tsx +110 -0
- package/components/routes/hits/search/shared/HitSort.tsx +111 -0
- package/components/routes/hits/search/shared/QuerySettings.tsx +40 -0
- package/components/routes/hits/search/shared/SearchSpan.tsx +68 -0
- package/components/routes/hits/view/HitViewer.tsx +372 -0
- package/components/routes/hits/view/LeadRenderer.tsx +42 -0
- package/components/routes/home/AddNewCard.tsx +295 -0
- package/components/routes/home/AnalyticCard.tsx +68 -0
- package/components/routes/home/EntryWrapper.tsx +54 -0
- package/components/routes/home/ViewCard.tsx +96 -0
- package/components/routes/home/index.tsx +278 -0
- package/components/routes/overviews/OverviewCard.tsx +51 -0
- package/components/routes/overviews/OverviewEditor.tsx +102 -0
- package/components/routes/overviews/OverviewViewer.tsx +387 -0
- package/components/routes/overviews/Overviews.tsx +179 -0
- package/components/routes/overviews/markdownExtendedTokenProvider.ts +296 -0
- package/components/routes/overviews/startingTemplate.ts +40 -0
- package/components/routes/overviews/template/en.md +167 -0
- package/components/routes/overviews/template/fr.md +167 -0
- package/components/routes/settings/AdminSection.tsx +18 -0
- package/components/routes/settings/LocalSection.tsx +168 -0
- package/components/routes/settings/ProfileSection.tsx +138 -0
- package/components/routes/settings/SecuritySection.tsx +95 -0
- package/components/routes/settings/Settings.tsx +51 -0
- package/components/routes/settings/SettingsSection.tsx +28 -0
- package/components/routes/templates/TemplateCard.tsx +38 -0
- package/components/routes/templates/TemplateDnD.tsx +51 -0
- package/components/routes/templates/TemplateEditor.tsx +121 -0
- package/components/routes/templates/TemplateViewer.tsx +285 -0
- package/components/routes/templates/Templates.tsx +187 -0
- package/components/routes/views/ViewComposer.tsx +317 -0
- package/components/routes/views/Views.tsx +379 -0
- package/globals.d.ts +1 -0
- package/i18n.ts +50 -0
- package/index.tsx +19 -0
- package/locales/en/help/main.json +13 -0
- package/locales/en/help/search.json +186 -0
- package/locales/en/translation.json +799 -0
- package/locales/fr/help/main.json +13 -0
- package/locales/fr/help/search.json +186 -0
- package/locales/fr/translation.json +797 -0
- package/models/ActionTypes.d.ts +50 -0
- package/models/WithMetadata.d.ts +12 -0
- package/models/entities/HowlerUser.d.ts +18 -0
- package/models/entities/generated/Account.d.ts +7 -0
- package/models/entities/generated/Action.d.ts +13 -0
- package/models/entities/generated/Agent.d.ts +9 -0
- package/models/entities/generated/Analytic.d.ts +21 -0
- package/models/entities/generated/Answer.d.ts +10 -0
- package/models/entities/generated/Antivirus.d.ts +9 -0
- package/models/entities/generated/ApiType.d.ts +238 -0
- package/models/entities/generated/Assemblyline.d.ts +22 -0
- package/models/entities/generated/Attachment.d.ts +8 -0
- package/models/entities/generated/Attribution.d.ts +9 -0
- package/models/entities/generated/AutonomousSystems.d.ts +7 -0
- package/models/entities/generated/Aws.d.ts +10 -0
- package/models/entities/generated/Azure.d.ts +10 -0
- package/models/entities/generated/Bcc.d.ts +6 -0
- package/models/entities/generated/Behaviour.d.ts +9 -0
- package/models/entities/generated/Body.d.ts +7 -0
- package/models/entities/generated/Cbs.d.ts +8 -0
- package/models/entities/generated/Cc.d.ts +6 -0
- package/models/entities/generated/Client.d.ts +7 -0
- package/models/entities/generated/Cloud.d.ts +20 -0
- package/models/entities/generated/CloudAccount.d.ts +7 -0
- package/models/entities/generated/CodeSignature.d.ts +14 -0
- package/models/entities/generated/Comment.d.ts +12 -0
- package/models/entities/generated/Container.d.ts +12 -0
- package/models/entities/generated/Created.d.ts +7 -0
- package/models/entities/generated/Dashboard.d.ts +8 -0
- package/models/entities/generated/Data.d.ts +8 -0
- package/models/entities/generated/Destination.d.ts +23 -0
- package/models/entities/generated/Device.d.ts +6 -0
- package/models/entities/generated/Dns.d.ts +16 -0
- package/models/entities/generated/Domain.d.ts +9 -0
- package/models/entities/generated/Dossier.d.ts +15 -0
- package/models/entities/generated/Ecs.d.ts +6 -0
- package/models/entities/generated/Egress.d.ts +6 -0
- package/models/entities/generated/Elf.d.ts +20 -0
- package/models/entities/generated/Email.d.ts +30 -0
- package/models/entities/generated/Enrichment.d.ts +10 -0
- package/models/entities/generated/EntryMeta.d.ts +6 -0
- package/models/entities/generated/Error.d.ts +7 -0
- package/models/entities/generated/Event.d.ts +31 -0
- package/models/entities/generated/Faas.d.ts +13 -0
- package/models/entities/generated/Feed.d.ts +9 -0
- package/models/entities/generated/File.d.ts +12 -0
- package/models/entities/generated/FileHash.d.ts +12 -0
- package/models/entities/generated/From.d.ts +6 -0
- package/models/entities/generated/Gcp.d.ts +10 -0
- package/models/entities/generated/Geo.d.ts +18 -0
- package/models/entities/generated/Group.d.ts +8 -0
- package/models/entities/generated/Hash.d.ts +6 -0
- package/models/entities/generated/Header.d.ts +13 -0
- package/models/entities/generated/Heuristic.d.ts +9 -0
- package/models/entities/generated/Hit.d.ts +102 -0
- package/models/entities/generated/HitFile.d.ts +36 -0
- package/models/entities/generated/HitOrganization.d.ts +7 -0
- package/models/entities/generated/Host.d.ts +11 -0
- package/models/entities/generated/Howler.d.ts +48 -0
- package/models/entities/generated/HowlerComment.d.ts +11 -0
- package/models/entities/generated/HowlerDossier.d.ts +12 -0
- package/models/entities/generated/Http.d.ts +11 -0
- package/models/entities/generated/Image.d.ts +10 -0
- package/models/entities/generated/Incident.d.ts +8 -0
- package/models/entities/generated/Indicator.d.ts +21 -0
- package/models/entities/generated/IndicatorEmail.d.ts +6 -0
- package/models/entities/generated/IndicatorFile.d.ts +36 -0
- package/models/entities/generated/Ingress.d.ts +9 -0
- package/models/entities/generated/Instance.d.ts +7 -0
- package/models/entities/generated/Interface.d.ts +7 -0
- package/models/entities/generated/Label.d.ts +7 -0
- package/models/entities/generated/Labels.d.ts +13 -0
- package/models/entities/generated/Lead.d.ts +12 -0
- package/models/entities/generated/Link.d.ts +8 -0
- package/models/entities/generated/Location.d.ts +7 -0
- package/models/entities/generated/Log.d.ts +13 -0
- package/models/entities/generated/Machine.d.ts +6 -0
- package/models/entities/generated/Mapping.d.ts +8 -0
- package/models/entities/generated/Matched.d.ts +6 -0
- package/models/entities/generated/Mitre.d.ts +10 -0
- package/models/entities/generated/Modified.d.ts +7 -0
- package/models/entities/generated/Nat.d.ts +7 -0
- package/models/entities/generated/Network.d.ts +8 -0
- package/models/entities/generated/Notebook.d.ts +10 -0
- package/models/entities/generated/Observer.d.ts +21 -0
- package/models/entities/generated/Operation.d.ts +7 -0
- package/models/entities/generated/Organization.d.ts +7 -0
- package/models/entities/generated/Original.d.ts +19 -0
- package/models/entities/generated/Os.d.ts +12 -0
- package/models/entities/generated/Outline.d.ts +9 -0
- package/models/entities/generated/Overview.d.ts +10 -0
- package/models/entities/generated/Parent.d.ts +19 -0
- package/models/entities/generated/ParentHash.d.ts +12 -0
- package/models/entities/generated/ParentParent.d.ts +32 -0
- package/models/entities/generated/ParentUser.d.ts +9 -0
- package/models/entities/generated/Pe.d.ts +13 -0
- package/models/entities/generated/Pivot.d.ts +13 -0
- package/models/entities/generated/Process.d.ts +34 -0
- package/models/entities/generated/ProcessHash.d.ts +12 -0
- package/models/entities/generated/ProcessParent.d.ts +34 -0
- package/models/entities/generated/ProcessUser.d.ts +9 -0
- package/models/entities/generated/Project.d.ts +7 -0
- package/models/entities/generated/Question.d.ts +11 -0
- package/models/entities/generated/Registry.d.ts +12 -0
- package/models/entities/generated/Related.d.ts +13 -0
- package/models/entities/generated/ReplyTo.d.ts +6 -0
- package/models/entities/generated/Request.d.ts +13 -0
- package/models/entities/generated/Response.d.ts +11 -0
- package/models/entities/generated/Rule.d.ts +15 -0
- package/models/entities/generated/Section.d.ts +14 -0
- package/models/entities/generated/Segment.d.ts +14 -0
- package/models/entities/generated/Sender.d.ts +6 -0
- package/models/entities/generated/Server.d.ts +8 -0
- package/models/entities/generated/Service.d.ts +6 -0
- package/models/entities/generated/Settings.d.ts +6 -0
- package/models/entities/generated/Sharepoint.d.ts +10 -0
- package/models/entities/generated/Software.d.ts +11 -0
- package/models/entities/generated/Source.d.ts +23 -0
- package/models/entities/generated/SourceOriginal.d.ts +19 -0
- package/models/entities/generated/Tactic.d.ts +9 -0
- package/models/entities/generated/Technique.d.ts +9 -0
- package/models/entities/generated/Template.d.ts +11 -0
- package/models/entities/generated/Threat.d.ts +21 -0
- package/models/entities/generated/ThreatGroup.d.ts +9 -0
- package/models/entities/generated/ThreatIndicator.d.ts +21 -0
- package/models/entities/generated/ThreatTactic.d.ts +8 -0
- package/models/entities/generated/ThreatTechnique.d.ts +8 -0
- package/models/entities/generated/Tls.d.ts +12 -0
- package/models/entities/generated/TlsServer.d.ts +6 -0
- package/models/entities/generated/To.d.ts +6 -0
- package/models/entities/generated/TriageSettings.d.ts +8 -0
- package/models/entities/generated/Trigger.d.ts +7 -0
- package/models/entities/generated/Uri.d.ts +9 -0
- package/models/entities/generated/Url.d.ts +19 -0
- package/models/entities/generated/User.d.ts +15 -0
- package/models/entities/generated/UserAgent.d.ts +13 -0
- package/models/entities/generated/UserUser.d.ts +19 -0
- package/models/entities/generated/View.d.ts +15 -0
- package/models/entities/generated/Votes.d.ts +8 -0
- package/models/entities/generated/Vulnerability.d.ts +12 -0
- package/models/entities/generated/Yara.d.ts +9 -0
- package/models/socket/HitUpdate.d.ts +14 -0
- package/package.json +604 -154
- package/plugins/HowlerPlugin.ts +375 -0
- package/plugins/store.ts +152 -0
- package/rest/AxiosClient.ts +81 -0
- package/rest/FetchClient.ts +27 -0
- package/rest/index.ts +12 -0
- package/setupTests.ts +17 -0
- package/tests/MockLocalStorage.ts +46 -0
- package/tests/server-handlers.ts +114 -0
- package/tests/server.ts +6 -0
- package/utils/Throttler.ts +43 -0
- package/utils/actionUtils.ts +112 -0
- package/utils/constants.tsx +131 -0
- package/utils/hit.json +30356 -0
- package/utils/hitFunctions.ts +10 -0
- package/utils/localStorage.ts +54 -0
- package/utils/menuUtils.ts +274 -0
- package/utils/sessionStorage.ts +59 -0
- package/utils/socketUtils.ts +11 -0
- package/utils/stringUtils.ts +57 -0
- package/utils/utils.ts +222 -0
- package/utils/xsrf.ts +17 -0
- package/vite-env.d.ts +1 -0
- package/assets/abap-DR3EPHcA.js +0 -6
- package/assets/abap-kqcCuNo3.js +0 -1
- package/assets/abnf-0i0y1qLw.js +0 -1
- package/assets/actionscript-CBg9ALMd.js +0 -1
- package/assets/ada-C0C0wsJY.js +0 -1
- package/assets/agda-CxRhcDuf.js +0 -1
- package/assets/al-Dlm67z74.js +0 -1
- package/assets/antlr4-BmA8T_Pf.js +0 -1
- package/assets/apacheconf-Cy80ybHj.js +0 -1
- package/assets/apex-CW6wsJgM.js +0 -6
- package/assets/apex-Sg90mm4u.js +0 -1
- package/assets/apl-EWXH65GD.js +0 -1
- package/assets/applescript-PjHK8QN3.js +0 -1
- package/assets/aql-B5IC4Rcf.js +0 -1
- package/assets/arc-BlYL6j5T.js +0 -1
- package/assets/architecture-O4VJ6CD3-jaQW6ijo.js +0 -1
- package/assets/architectureDiagram-KFL7JDKH-DJeBx9P6.js +0 -36
- package/assets/arduino-C51Narsi.js +0 -1
- package/assets/arff-8aJF8MCW.js +0 -1
- package/assets/asciidoc-YvasCiDo.js +0 -1
- package/assets/asm6502-DNM_ACU3.js +0 -1
- package/assets/asmatmel-B7SjKbvc.js +0 -1
- package/assets/aspnet-BDjjZcvg.js +0 -1
- package/assets/autohotkey-hUSymZ_m.js +0 -1
- package/assets/autoit-z_CsSJmr.js +0 -1
- package/assets/avisynth-lWBoLdVJ.js +0 -1
- package/assets/avro-idl-D8-0MeNx.js +0 -1
- package/assets/azcli-CIONJYq1.js +0 -6
- package/assets/bash-CefCgV5_.js +0 -1
- package/assets/bash-WWuseIss.js +0 -1
- package/assets/basic-5JZah1MP.js +0 -1
- package/assets/basic-DBS9NaGG.js +0 -1
- package/assets/bat-C9Lf3IiR.js +0 -6
- package/assets/batch-CNuZE34T.js +0 -1
- package/assets/bbcode-DUCaeSOc.js +0 -1
- package/assets/bicep-C9cUGcZW.js +0 -1
- package/assets/bicep-D-A_iHuq.js +0 -7
- package/assets/birb-BZmpNpMm.js +0 -1
- package/assets/bison-CywkiQg4.js +0 -1
- package/assets/blockDiagram-ZYB65J3Q-D0Ol2jlv.js +0 -122
- package/assets/bnf-DNey8JGD.js +0 -1
- package/assets/brainfuck-uwCSHc7F.js +0 -1
- package/assets/brightscript-DT7d5-qJ.js +0 -1
- package/assets/bro-CFVRfUbc.js +0 -1
- package/assets/bsl-9S4UgA2J.js +0 -1
- package/assets/c-BgfjASKF.js +0 -1
- package/assets/c-kgVuzdLE.js +0 -1
- package/assets/c4Diagram-AAMF2YG6-v1fpnkx2.js +0 -10
- package/assets/cameligo-v1zEsXLu.js +0 -6
- package/assets/cfscript-49U2aWCh.js +0 -1
- package/assets/chaiscript-4VtsYVpl.js +0 -1
- package/assets/channel-DabOFIhE.js +0 -1
- package/assets/chunk-ANTBXLJU-BBGjDBcL.js +0 -1
- package/assets/chunk-FHKO5MBM-CtXgGiWs.js +0 -1
- package/assets/chunk-GLLZNHP4-CjNMxI4x.js +0 -15
- package/assets/chunk-JBRWN2VN-BIsIHCzN.js +0 -165
- package/assets/chunk-LXBSTHXV-DIuZccqv.js +0 -220
- package/assets/chunk-NRVI72HA-aKshiznA.js +0 -1
- package/assets/chunk-OMD6QJNC-DD9Oy5sh.js +0 -1
- package/assets/chunk-WVR4S24B-B9zmB2Tt.js +0 -1
- package/assets/cil-CIk1nZUD.js +0 -1
- package/assets/classDiagram-3BZAVTQC-CqX7Tp25.js +0 -1
- package/assets/classDiagram-v2-QTMF73CY-CqX7Tp25.js +0 -1
- package/assets/clike-B5tY_8Hg.js +0 -1
- package/assets/clike-CxAeib4_.js +0 -1
- package/assets/clojure-Ck0RXpbo.js +0 -1
- package/assets/clojure-DgNu_ptH.js +0 -6
- package/assets/clone-BDNFedfK.js +0 -1
- package/assets/cmake-C-DeGqDW.js +0 -1
- package/assets/cobol-DB25XrSi.js +0 -1
- package/assets/codicon-B16ygVZF.ttf +0 -0
- package/assets/coffee-DNMvp8RP.js +0 -6
- package/assets/coffeescript-B4nqUg94.js +0 -1
- package/assets/concurnas-Dn9XkZGY.js +0 -1
- package/assets/coq-Cvr3Gn8T.js +0 -1
- package/assets/core-UDSDYEIa.js +0 -8
- package/assets/cpp-BdJVwJpi.js +0 -1
- package/assets/cpp-CKhD-3M2.js +0 -1
- package/assets/cpp-DEDKHd-B.js +0 -6
- package/assets/crystal-CjID7KIv.js +0 -1
- package/assets/csharp-2ALpLYur.js +0 -1
- package/assets/csharp-BoWmgZhk.js +0 -6
- package/assets/csharp-Cd5Udg29.js +0 -1
- package/assets/cshtml-BlacgVaO.js +0 -1
- package/assets/csp-BK5qlsQ9.js +0 -6
- package/assets/csp-HMwJhbi-.js +0 -1
- package/assets/css-B2tK9wdh.js +0 -1
- package/assets/css-CF9HHZb0.js +0 -1
- package/assets/css-D1nB4Vcj.js +0 -8
- package/assets/css-extras-DeVSfTP6.js +0 -1
- package/assets/cssMode-BtnBbnNh.js +0 -9
- package/assets/csv-BD6q7LX1.js +0 -1
- package/assets/cypher-BgMoLKlv.js +0 -1
- package/assets/cypher-Bl5_yQjz.js +0 -6
- package/assets/cytoscape.esm-BQaXIfA_.js +0 -331
- package/assets/d-DbEmK-0B.js +0 -1
- package/assets/dagre-2BBEFEWP-D2XFAJFU.js +0 -4
- package/assets/dart-BVA93hyX.js +0 -6
- package/assets/dart-DkfsI3yC.js +0 -1
- package/assets/dataweave-aZYF5PNL.js +0 -1
- package/assets/dax-V2ts0ypQ.js +0 -1
- package/assets/defaultLocale-C4B-KCzX.js +0 -1
- package/assets/dhall-D3SUU5AE.js +0 -1
- package/assets/diagram-4IRLE6MV-3Ii0VW6l.js +0 -24
- package/assets/diagram-GUPCWM2R-C_bP7Q1P.js +0 -24
- package/assets/diagram-RP2FKANI-BSi4bGof.js +0 -43
- package/assets/diff-CMSY-_TM.js +0 -3
- package/assets/django-DnIhfivE.js +0 -1
- package/assets/dns-zone-file-cve-GUtw.js +0 -1
- package/assets/docker-BNsgT4ys.js +0 -1
- package/assets/dockerfile-fYe1jRYc.js +0 -6
- package/assets/dot-YI_YYuHG.js +0 -1
- package/assets/ebnf-D_RcZu_y.js +0 -1
- package/assets/ecl-Bxo8QmCt.js +0 -6
- package/assets/editorconfig-DUfFHFN4.js +0 -1
- package/assets/eiffel-D62YrVdr.js +0 -1
- package/assets/ejs-B3E9714P.js +0 -1
- package/assets/elixir-BbUoe7nZ.js +0 -6
- package/assets/elixir-wU9BuARX.js +0 -1
- package/assets/elm-GdyPUCRk.js +0 -1
- package/assets/erDiagram-HZWUO2LU-DIXDxlDs.js +0 -60
- package/assets/erb-BLfRgaP8.js +0 -1
- package/assets/erlang-oEvb0Slh.js +0 -1
- package/assets/etlua-B52BFn4o.js +0 -1
- package/assets/excel-formula-DNqVjpMr.js +0 -1
- package/assets/factor-D1OvJ8Qo.js +0 -1
- package/assets/false-Z6QQv6ID.js +0 -1
- package/assets/firestore-security-rules-DTUdd8_9.js +0 -1
- package/assets/flow-1B4ewKvb.js +0 -1
- package/assets/flow9-BKFjllYO.js +0 -6
- package/assets/flowDiagram-THRYKUMA-D3gqWW_d.js +0 -162
- package/assets/fortran-DiWKkvzE.js +0 -1
- package/assets/freemarker2-CwD6ixn2.js +0 -8
- package/assets/fsharp-Dv3_RQKY.js +0 -1
- package/assets/fsharp-ETo-tsZt.js +0 -6
- package/assets/ftl-CaaEO_Z2.js +0 -1
- package/assets/ganttDiagram-WV7ZQ7D5-C-2v9gZQ.js +0 -267
- package/assets/gap-CTp3QxAZ.js +0 -1
- package/assets/gcode-CYwYWCAy.js +0 -1
- package/assets/gdscript-YqSYr01q.js +0 -1
- package/assets/gedcom-DTNpnfmu.js +0 -1
- package/assets/gherkin-RLKHjAi5.js +0 -1
- package/assets/git-0fy9QQAU.js +0 -1
- package/assets/gitGraph-ZV4HHKMB-CjT8UBWJ.js +0 -1
- package/assets/gitGraphDiagram-OJR772UL-DRxxeQJN.js +0 -65
- package/assets/glsl-Df0XRhtW.js +0 -1
- package/assets/gml-rYpCBP8S.js +0 -1
- package/assets/gn-jKfYA_GR.js +0 -1
- package/assets/go-B-SSxtH2.js +0 -1
- package/assets/go-DzbHtIm4.js +0 -6
- package/assets/go-module-DXvSTe3J.js +0 -1
- package/assets/graph-lkROJrYf.js +0 -1
- package/assets/graphql-Btz_aicw.js +0 -1
- package/assets/graphql-k0EsSqLB.js +0 -6
- package/assets/groovy-DTiJadjC.js +0 -1
- package/assets/haml-CcDSAGW3.js +0 -1
- package/assets/handlebars-B7UUNDAM.js +0 -6
- package/assets/handlebars-CTc1FoVV.js +0 -1
- package/assets/haskell-Ba7Fn64p.js +0 -1
- package/assets/haskell-Ds42Eazu.js +0 -1
- package/assets/haxe-BOP5EevR.js +0 -1
- package/assets/hcl-Cq9v6if3.js +0 -6
- package/assets/hcl-D1BwnWLD.js +0 -1
- package/assets/hlsl-CUum5slg.js +0 -1
- package/assets/hoon-QMQpvF33.js +0 -1
- package/assets/hpkp-D6eY57p3.js +0 -1
- package/assets/hsts-C1AgjS7S.js +0 -1
- package/assets/html-D5WIHiP4.js +0 -6
- package/assets/htmlMode-DEpdNVPw.js +0 -9
- package/assets/http-id2mbfvH.js +0 -1
- package/assets/ichigojam-DykLBLF7.js +0 -1
- package/assets/icon-5DLjeVkO.js +0 -1
- package/assets/icu-message-format-BLJSLf7X.js +0 -1
- package/assets/idris-D8W8F3Du.js +0 -1
- package/assets/iecst-DFLR7w9A.js +0 -1
- package/assets/ignore-DApMeS1M.js +0 -1
- package/assets/index-Brc7moWM.js +0 -3412
- package/assets/index-COcBHp7b.css +0 -1
- package/assets/info-63CPKGFF-CMaftaLX.js +0 -1
- package/assets/infoDiagram-6WOFNB3A-DVTxejFg.js +0 -2
- package/assets/inform7-BbmmPtTe.js +0 -1
- package/assets/ini-BscO_0vf.js +0 -6
- package/assets/ini-D-w_ESm3.js +0 -1
- package/assets/init-Gi6I4Gst.js +0 -1
- package/assets/io-CL7TQcwi.js +0 -1
- package/assets/j-uqAhSNfO.js +0 -1
- package/assets/java--eXhSgxg.js +0 -1
- package/assets/java-BxMbkJZ_.js +0 -1
- package/assets/java-CtY9ZHW8.js +0 -6
- package/assets/javadoc-DLDzhXUx.js +0 -1
- package/assets/javadoclike-CcxdcZFw.js +0 -1
- package/assets/javadoclike-myFApC35.js +0 -1
- package/assets/javascript-B2YTQvHv.js +0 -1
- package/assets/javascript-D8vYUPHd.js +0 -1
- package/assets/javascript-DHOrgKX5.js +0 -6
- package/assets/javastacktrace-C2aQ6cZI.js +0 -1
- package/assets/jexl-SUbBpRa5.js +0 -1
- package/assets/jolie-DTTRmX_c.js +0 -1
- package/assets/journeyDiagram-FFXJYRFH-D4P4oZdc.js +0 -139
- package/assets/jq-CNGqc8Wl.js +0 -1
- package/assets/js-extras-BomY8GiL.js +0 -1
- package/assets/js-templates-lvNz8Eo-.js +0 -1
- package/assets/jsdoc-CizF9nqb.js +0 -1
- package/assets/json-BESjz4hO.js +0 -1
- package/assets/json-vpv-MZJY.js +0 -1
- package/assets/json5-Bszym-iC.js +0 -1
- package/assets/jsonMode-BdHvYBEq.js +0 -11
- package/assets/jsonp-K9VXfRN3.js +0 -1
- package/assets/jsstacktrace-5a-l-0QO.js +0 -1
- package/assets/jsx-CWP8P1mH.js +0 -1
- package/assets/jsx-NzQF_8Jf.js +0 -1
- package/assets/julia-DOes61nN.js +0 -6
- package/assets/julia-KpvUUzJF.js +0 -1
- package/assets/kanban-definition-KOZQBZVT-D7tMBarf.js +0 -89
- package/assets/katex-ChWnQ-fc.js +0 -261
- package/assets/keepalived-CKdrdtrU.js +0 -1
- package/assets/keyman-CFPdCbAD.js +0 -1
- package/assets/kotlin-DTDxWyre.js +0 -6
- package/assets/kotlin-tQZl0Xk0.js +0 -1
- package/assets/kumir-DbBBFKAZ.js +0 -1
- package/assets/kusto-Bkg1G97b.js +0 -1
- package/assets/latex-BrfLAxV6.js +0 -1
- package/assets/latte-DsrdWVh6.js +0 -1
- package/assets/layout-C4SVJcQz.js +0 -1
- package/assets/less-CqJAWV1X.js +0 -7
- package/assets/less-Dq-Do1xB.js +0 -1
- package/assets/lexon-BXW1vGDt.js +0 -6
- package/assets/lilypond-BASpUvho.js +0 -1
- package/assets/linear-D84iuv7z.js +0 -1
- package/assets/liquid-Co1yhavg.js +0 -1
- package/assets/liquid-D4hD-XBz.js +0 -6
- package/assets/lisp-ybAJB-FH.js +0 -1
- package/assets/livescript-DLvgD8H_.js +0 -1
- package/assets/llvm-C0anU-7N.js +0 -1
- package/assets/log-D-8B5UAA.js +0 -1
- package/assets/lolcode-OUGz_qsa.js +0 -1
- package/assets/lua-Cc6kp-D4.js +0 -1
- package/assets/lua-DER4jxlW.js +0 -1
- package/assets/lua-DLZgaSX1.js +0 -6
- package/assets/m3-CLtYU2dl.js +0 -6
- package/assets/magma-IaFf4RIf.js +0 -1
- package/assets/makefile-ChKu1MJ1.js +0 -1
- package/assets/markdown-7fQo6M4U.js +0 -6
- package/assets/markdown-DiMlCk4R.js +0 -1
- package/assets/markup-BONeskWm.js +0 -1
- package/assets/markup-CEx1cEoC.js +0 -1
- package/assets/markup-templating-BPwIASy-.js +0 -1
- package/assets/markup-templating-BxAVv-bL.js +0 -1
- package/assets/matlab-C6qGYTR2.js +0 -1
- package/assets/maxscript-CAN0xBDN.js +0 -1
- package/assets/mdx-D6NVpinB.js +0 -6
- package/assets/mel-CRG0vaFw.js +0 -1
- package/assets/mermaid-DTCIS1Vc.js +0 -1
- package/assets/mermaid-parser.core-9OWX7w7H.js +0 -129
- package/assets/min-pXLq1urb.js +0 -1
- package/assets/mindmap-definition-LNHGMQRG-DpNkhLNM.js +0 -95
- package/assets/mips-DcG9r2vI.js +0 -6
- package/assets/mizar-CTjbYK1-.js +0 -1
- package/assets/mongodb-Dwy0e7tV.js +0 -1
- package/assets/monkey-5vs-VaHV.js +0 -1
- package/assets/moonscript-fT7DerrW.js +0 -1
- package/assets/msdax-DN__iVzl.js +0 -6
- package/assets/mysql-05d2lfAy.js +0 -6
- package/assets/n1ql-CyDT-nbG.js +0 -1
- package/assets/n4js-Dmgj3bgd.js +0 -1
- package/assets/nand2tetris-hdl-BPfjS0pS.js +0 -1
- package/assets/naniscript-AIaG6VzF.js +0 -1
- package/assets/nasm-CtaUAK1B.js +0 -1
- package/assets/neon-BGH8Px8Z.js +0 -1
- package/assets/nevod-DKwg2dRw.js +0 -1
- package/assets/nginx-CUZ2OZRs.js +0 -1
- package/assets/nim-DYHpidb8.js +0 -1
- package/assets/nix-DJt2Qxmn.js +0 -1
- package/assets/nsis-Bp97AH1A.js +0 -1
- package/assets/objective-c-B_h_kxCB.js +0 -6
- package/assets/objectivec-DXwXxEEr.js +0 -1
- package/assets/ocaml-alwbEKNU.js +0 -1
- package/assets/opencl-2tlv9GXY.js +0 -1
- package/assets/openqasm-DQQ8Eb1t.js +0 -1
- package/assets/ordinal-Cboi1Yqb.js +0 -1
- package/assets/oz-CmR9PjHE.js +0 -1
- package/assets/packet-HUATNLJX-Df0K9_iv.js +0 -1
- package/assets/parigp-n8ycxTI2.js +0 -1
- package/assets/parser-Bcvfazvc.js +0 -1
- package/assets/pascal-Bc-8SB3K.js +0 -6
- package/assets/pascal-CFHsej71.js +0 -1
- package/assets/pascaligo-C8kSNPDA.js +0 -1
- package/assets/pascaligo-Dcwo06z5.js +0 -6
- package/assets/pcaxis-L1qB_TA8.js +0 -1
- package/assets/peoplecode-B3ZIbHRe.js +0 -1
- package/assets/perl-B4wSx8tF.js +0 -1
- package/assets/perl-BnGpdHsN.js +0 -6
- package/assets/pgsql-DfVleuq_.js +0 -6
- package/assets/php-CH5O-_gG.js +0 -6
- package/assets/php-Cp0BohX-.js +0 -1
- package/assets/php-extras-D_l2V9st.js +0 -1
- package/assets/php-iTdQntIy.js +0 -1
- package/assets/phpdoc-CK9N3DqC.js +0 -1
- package/assets/pie-WTHONI2E-D2V4EPkW.js +0 -1
- package/assets/pieDiagram-DBDJKBY4-CtSiPn-U.js +0 -30
- package/assets/pla-BUVXxyGx.js +0 -6
- package/assets/plsql-C1Z_R7C0.js +0 -1
- package/assets/postiats-DSt55phJ.js +0 -6
- package/assets/powerquery-2KNS9mh4.js +0 -6
- package/assets/powerquery-Cj9zzkL_.js +0 -1
- package/assets/powershell-BMCDkE8B.js +0 -1
- package/assets/powershell-CCS0rx-A.js +0 -6
- package/assets/processing-DOu9EyQL.js +0 -1
- package/assets/prolog-BDx-mKYw.js +0 -1
- package/assets/promql-CyuJUGgC.js +0 -1
- package/assets/properties-Cz9SwuSc.js +0 -1
- package/assets/protobuf-5lyCd6Ku.js +0 -7
- package/assets/protobuf-BCLdPaZg.js +0 -1
- package/assets/psl-BVzbXOmp.js +0 -1
- package/assets/pug-Dg4O54Js.js +0 -6
- package/assets/pug-PBVvhxsU.js +0 -1
- package/assets/puppet-Bp5J_Xf6.js +0 -1
- package/assets/pure-BEODe8Ty.js +0 -1
- package/assets/purebasic-g8QwRKk9.js +0 -1
- package/assets/purescript-UFsBai8q.js +0 -1
- package/assets/python-BEpwHjuW.js +0 -6
- package/assets/python-cW1cr4Xe.js +0 -1
- package/assets/q-CuXsyoDM.js +0 -1
- package/assets/qml-NgPknFa-.js +0 -1
- package/assets/qore-C0g-7ava.js +0 -1
- package/assets/qsharp-BHSA_OC9.js +0 -6
- package/assets/qsharp-BrQJYopz.js +0 -1
- package/assets/quadrantDiagram-YPSRARAO-fpN7laT8.js +0 -7
- package/assets/r-DBvxNhD8.js +0 -6
- package/assets/r-ivB35FJi.js +0 -1
- package/assets/racket-D6952iA-.js +0 -1
- package/assets/radar-NJJJXTRR-Bh0TcAtk.js +0 -1
- package/assets/razor-COaKzAih.js +0 -6
- package/assets/reason-BxyJj1Wv.js +0 -1
- package/assets/redis-mBNZiS5I.js +0 -6
- package/assets/redshift-gtd9hS2x.js +0 -6
- package/assets/reduce-CEguFi6x.js +0 -1
- package/assets/regex-UCZUa98R.js +0 -1
- package/assets/rego-D5bYSBEk.js +0 -1
- package/assets/renpy-DTdz45My.js +0 -1
- package/assets/requirementDiagram-EGVEC5DT-C2aVrzw7.js +0 -64
- package/assets/rest-BxrDSOtP.js +0 -1
- package/assets/restructuredtext-45Xf76JB.js +0 -6
- package/assets/rip-CvJDF04l.js +0 -1
- package/assets/roboconf-DpPdQtT6.js +0 -1
- package/assets/robotframework-CvzHhnGx.js +0 -1
- package/assets/roboto-cyrillic-400-normal-C5q4FMUG.woff +0 -0
- package/assets/roboto-cyrillic-400-normal-DAIM1_dR.woff2 +0 -0
- package/assets/roboto-cyrillic-ext-400-normal-5IDvadIC.woff +0 -0
- package/assets/roboto-cyrillic-ext-400-normal-DzMWdK87.woff2 +0 -0
- package/assets/roboto-greek-400-normal-DwVopRQH.woff +0 -0
- package/assets/roboto-greek-400-normal-jFM2czAU.woff2 +0 -0
- package/assets/roboto-latin-400-normal-BX2H0A0_.woff +0 -0
- package/assets/roboto-latin-400-normal-CNwBRw8h.woff2 +0 -0
- package/assets/roboto-latin-ext-400-normal-BG57dRWO.woff +0 -0
- package/assets/roboto-latin-ext-400-normal-ZYmyxeOy.woff2 +0 -0
- package/assets/roboto-math-400-normal-B3wgz80t.woff2 +0 -0
- package/assets/roboto-math-400-normal-BRMeFL5Z.woff +0 -0
- package/assets/roboto-symbols-400-normal-B2LMqLB2.woff +0 -0
- package/assets/roboto-symbols-400-normal-fF1SLJBj.woff2 +0 -0
- package/assets/roboto-vietnamese-400-normal-BYP5tVVv.woff +0 -0
- package/assets/roboto-vietnamese-400-normal-CDDxGrUb.woff2 +0 -0
- package/assets/ruby-BYts9dao.js +0 -1
- package/assets/ruby-CEgcCkh9.js +0 -6
- package/assets/ruby-DYsn9XfW.js +0 -1
- package/assets/rust-BChN5uNh.js +0 -6
- package/assets/rust-DhU6TFsm.js +0 -1
- package/assets/sankeyDiagram-HRAUVNP4-4oZDeCaD.js +0 -10
- package/assets/sas-ChhKHWGM.js +0 -1
- package/assets/sass-C57bJt_A.js +0 -1
- package/assets/sb-5vPrUWN-.js +0 -6
- package/assets/scala-BQOorN7X.js +0 -6
- package/assets/scala-Cg28kNry.js +0 -1
- package/assets/scheme-Bpk-KLc_.js +0 -1
- package/assets/scheme-Cscf027c.js +0 -1
- package/assets/scheme-DkJ87xtR.js +0 -6
- package/assets/scss-BeU7qozo.js +0 -1
- package/assets/scss-CpPOP9XS.js +0 -8
- package/assets/sequenceDiagram-WFGC7UMF-BS5S-iIx.js +0 -122
- package/assets/shell-BHhUv290.js +0 -6
- package/assets/shell-session-N4BUyO5b.js +0 -1
- package/assets/smali-OZwkp_pU.js +0 -1
- package/assets/smalltalk-Bgd8uXdt.js +0 -1
- package/assets/smarty-BbqdJT5w.js +0 -1
- package/assets/sml-DbDOAWsQ.js +0 -1
- package/assets/solidity-BFcLIl1x.js +0 -6
- package/assets/solidity-DkQCaL_X.js +0 -1
- package/assets/solution-file-DFlRPhIk.js +0 -1
- package/assets/sophia-z0tjJxhY.js +0 -6
- package/assets/soy-CqM5aRME.js +0 -1
- package/assets/sparql-B1GALy7V.js +0 -1
- package/assets/sparql-BTJymgeb.js +0 -6
- package/assets/splunk-spl-DrNqni3-.js +0 -1
- package/assets/sqf-BeBvdmXG.js +0 -1
- package/assets/sql-BFyYaP5s.js +0 -6
- package/assets/sql-CJATM1Qp.js +0 -1
- package/assets/sql-CtDLgxfq.js +0 -1
- package/assets/squirrel-COkcd8Tr.js +0 -1
- package/assets/st-DZS1F9ME.js +0 -6
- package/assets/stan-C1_hogQu.js +0 -1
- package/assets/stateDiagram-UUKSUZ4H-Cb3qH3Cy.js +0 -1
- package/assets/stateDiagram-v2-EYPG3UTE-BzEwA6K7.js +0 -1
- package/assets/stylus-Dw8891LS.js +0 -1
- package/assets/swift-B97O9HHR.js +0 -1
- package/assets/swift-BwlyOzQq.js +0 -8
- package/assets/systemd-CUtXAwEb.js +0 -2
- package/assets/systemverilog-DJsb8r0W.js +0 -6
- package/assets/t4-cs-CyYMVAUn.js +0 -1
- package/assets/t4-templating-B5EzSFYT.js +0 -1
- package/assets/t4-templating-Du1KIrkv.js +0 -1
- package/assets/t4-vb-Pwd8zhQY.js +0 -1
- package/assets/tap-C5-eahra.js +0 -1
- package/assets/tcl-CQrWCRuJ.js +0 -1
- package/assets/tcl-CjHYkh5E.js +0 -6
- package/assets/textile-CyJk6SWo.js +0 -1
- package/assets/timeline-definition-3HZDQTIS-DaBjiVZ7.js +0 -61
- package/assets/toml-Cact8Vna.js +0 -1
- package/assets/treemap-75Q7IDZK-BZoUJEBa.js +0 -1
- package/assets/tremor-BBmidx_C.js +0 -1
- package/assets/tsMode-DjkyL1AP.js +0 -16
- package/assets/tsx-BFgSfn5D.js +0 -1
- package/assets/tt2-CG-UIBmK.js +0 -1
- package/assets/turtle-DigfRE97.js +0 -1
- package/assets/turtle-Ro1R6Je7.js +0 -1
- package/assets/twig-CmYTg8Iu.js +0 -6
- package/assets/twig-PmY_cDoq.js +0 -1
- package/assets/typescript-CVO-8GEc.js +0 -1
- package/assets/typescript-Da47IE7f.js +0 -1
- package/assets/typescript-DgKm9t07.js +0 -6
- package/assets/typespec-Dwv00aWl.js +0 -6
- package/assets/typoscript-CgZr5jEZ.js +0 -1
- package/assets/unrealscript-BI_pn0rK.js +0 -1
- package/assets/uorazor-C7IhUkD6.js +0 -1
- package/assets/uri-BP2d8Ze2.js +0 -1
- package/assets/v-B9O-tbsS.js +0 -1
- package/assets/vala-CS5ZRPeA.js +0 -1
- package/assets/vb-BjPEumh4.js +0 -6
- package/assets/vbnet-B0hx3qRp.js +0 -1
- package/assets/vbnet-BhrUc4aD.js +0 -1
- package/assets/velocity-QemisC16.js +0 -1
- package/assets/verilog-jjjMAm_Y.js +0 -1
- package/assets/vhdl-B9EszVuj.js +0 -1
- package/assets/vim-CxDlf-dr.js +0 -1
- package/assets/visual-basic-CfhBm1gF.js +0 -1
- package/assets/warpscript-DL5ToBao.js +0 -1
- package/assets/wasm-C5WawCVZ.js +0 -1
- package/assets/web-idl-DWKDo7hm.js +0 -1
- package/assets/wgsl-Bp8RP3jd.js +0 -303
- package/assets/wiki-BHpSxg4K.js +0 -1
- package/assets/wolfram-C_oBzCJW.js +0 -1
- package/assets/wren-CA1nFGqi.js +0 -1
- package/assets/xeora-BtUuVarv.js +0 -1
- package/assets/xml-BBqGkZMk.js +0 -6
- package/assets/xml-doc-DhUg29aH.js +0 -1
- package/assets/xojo-BmgifBv1.js +0 -1
- package/assets/xquery-7FfNXUZg.js +0 -1
- package/assets/xychartDiagram-FDP5SA34-DlWJl-YC.js +0 -7
- package/assets/yaml-BOp0Lh0S.js +0 -1
- package/assets/yaml-C8j_iwGJ.js +0 -6
- package/assets/yaml-pHjxJgpq.js +0 -1
- package/assets/yang-CLUWUZcf.js +0 -1
- package/assets/zig-DdXASuyK.js +0 -1
- package/branding/howler/favicon.svg +0 -38
- package/branding/howler/name-dark.svg +0 -21
- package/branding/howler/name-light.svg +0 -21
- package/branding/howler/noswoosh-dark.svg +0 -24
- package/branding/howler/noswoosh-light.svg +0 -28
- package/branding/howler/swoosh-dark.svg +0 -41
- package/branding/howler/swoosh-light.svg +0 -45
- package/components/routes/help/markdown/en/actionIntroduction.md.js +0 -1
- package/components/routes/help/markdown/en/authentication.md.js +0 -1
- package/components/routes/help/markdown/en/bundles.md.js +0 -1
- package/components/routes/help/markdown/en/client.md.js +0 -1
- package/components/routes/help/markdown/en/links.md.js +0 -1
- package/components/routes/help/markdown/en/notebook.md.js +0 -1
- package/components/routes/help/markdown/en/retention.md.js +0 -1
- package/components/routes/help/markdown/en/schema.md.js +0 -1
- package/components/routes/help/markdown/en/templates.md.js +0 -1
- package/components/routes/help/markdown/en/views.md.js +0 -1
- package/components/routes/help/markdown/fr/actionIntroduction.md.js +0 -1
- package/components/routes/help/markdown/fr/authentication.md.js +0 -1
- package/components/routes/help/markdown/fr/bundles.md.js +0 -1
- package/components/routes/help/markdown/fr/client.md.js +0 -1
- package/components/routes/help/markdown/fr/links.md.js +0 -1
- package/components/routes/help/markdown/fr/notebook.md.js +0 -1
- package/components/routes/help/markdown/fr/retention.md.js +0 -1
- package/components/routes/help/markdown/fr/schema.md.js +0 -1
- package/components/routes/help/markdown/fr/templates.md.js +0 -1
- package/components/routes/help/markdown/fr/views.md.js +0 -1
- package/components/routes/overviews/template/en.md.js +0 -1
- package/components/routes/overviews/template/fr.md.js +0 -1
- package/images/doggie.png +0 -0
- package/index.html +0 -24
- package/manifest.json +0 -16
- package/robots.txt +0 -3
- package/scripts/background.js +0 -14
- package/serve.json +0 -14
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import type { RenderHookResult } from '@testing-library/react';
|
|
2
|
+
import { act, renderHook, waitFor } from '@testing-library/react';
|
|
3
|
+
import { hget, hpost, hput } from 'api';
|
|
4
|
+
import MockLocalStorage from 'tests/MockLocalStorage';
|
|
5
|
+
import { MOCK_RESPONSES } from 'tests/server-handlers';
|
|
6
|
+
import { useContextSelector } from 'use-context-selector';
|
|
7
|
+
import { MY_LOCAL_STORAGE_PREFIX, StorageKey } from 'utils/constants';
|
|
8
|
+
import ViewProvider, { ViewContext, type ViewContextType } from './ViewProvider';
|
|
9
|
+
|
|
10
|
+
let mockUser = {
|
|
11
|
+
favourite_views: ['favourited_view_id']
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
vi.mock('api', { spy: true });
|
|
15
|
+
vi.mock('react-router-dom', () => ({
|
|
16
|
+
useLocation: vi.fn(() => ({ pathname: '/views/searched_view_id' })),
|
|
17
|
+
useParams: vi.fn(() => ({ id: 'searched_view_id' }))
|
|
18
|
+
}));
|
|
19
|
+
vi.mock('commons/components/app/hooks', () => ({
|
|
20
|
+
useAppUser: () => ({
|
|
21
|
+
user: mockUser,
|
|
22
|
+
setUser: _user => (mockUser = _user)
|
|
23
|
+
})
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
const mockLocalStorage: Storage = new MockLocalStorage() as any;
|
|
27
|
+
|
|
28
|
+
// Replace localStorage in global scope
|
|
29
|
+
Object.defineProperty(window, 'localStorage', {
|
|
30
|
+
value: mockLocalStorage,
|
|
31
|
+
writable: true
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const Wrapper = ({ children }) => {
|
|
35
|
+
return <ViewProvider>{children}</ViewProvider>;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
beforeEach(() => {
|
|
39
|
+
mockLocalStorage.clear();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
describe('ViewContext', () => {
|
|
43
|
+
it('should fetch the defaultView on initialization', async () => {
|
|
44
|
+
mockLocalStorage.setItem(
|
|
45
|
+
`${MY_LOCAL_STORAGE_PREFIX}.${StorageKey.DEFAULT_VIEW}`,
|
|
46
|
+
JSON.stringify('searched_view_id')
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
let hook = await act(async () =>
|
|
50
|
+
renderHook(() => useContextSelector(ViewContext, ctx => ctx.views), { wrapper: Wrapper })
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
await waitFor(() => expect(hook.result.current.searched_view_id).not.toBeFalsy());
|
|
54
|
+
|
|
55
|
+
expect(hook.result.current.searched_view_id).toEqual(MOCK_RESPONSES['/api/v1/search/view'].items[0]);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('should allow the user to add and remove a favourite view', async () => {
|
|
59
|
+
interface HookResult {
|
|
60
|
+
addFavourite: ViewContextType['addFavourite'];
|
|
61
|
+
removeFavourite: ViewContextType['removeFavourite'];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const hook: RenderHookResult<HookResult, any> = await act(async () => {
|
|
65
|
+
return renderHook(
|
|
66
|
+
() =>
|
|
67
|
+
useContextSelector(ViewContext, ctx => ({
|
|
68
|
+
addFavourite: ctx.addFavourite,
|
|
69
|
+
removeFavourite: ctx.removeFavourite
|
|
70
|
+
})),
|
|
71
|
+
{ wrapper: Wrapper }
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
await hook.result.current.addFavourite('example_view_id');
|
|
76
|
+
|
|
77
|
+
expect(mockUser.favourite_views).toEqual(['favourited_view_id', 'example_view_id']);
|
|
78
|
+
|
|
79
|
+
await hook.result.current.removeFavourite('example_view_id');
|
|
80
|
+
|
|
81
|
+
expect(mockUser.favourite_views).toEqual(['favourited_view_id']);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('should allow the user to add and remove views', async () => {
|
|
85
|
+
interface HookResult {
|
|
86
|
+
addView: ViewContextType['addView'];
|
|
87
|
+
removeView: ViewContextType['removeView'];
|
|
88
|
+
views: ViewContextType['views'];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const hook: RenderHookResult<HookResult, any> = await act(async () => {
|
|
92
|
+
return renderHook(
|
|
93
|
+
() =>
|
|
94
|
+
useContextSelector(ViewContext, ctx => ({
|
|
95
|
+
addView: ctx.addView,
|
|
96
|
+
removeView: ctx.removeView,
|
|
97
|
+
views: ctx.views
|
|
98
|
+
})),
|
|
99
|
+
{ wrapper: Wrapper }
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const result = await act(async () =>
|
|
104
|
+
hook.result.current.addView({
|
|
105
|
+
owner: 'user',
|
|
106
|
+
settings: {
|
|
107
|
+
advance_on_triage: false
|
|
108
|
+
},
|
|
109
|
+
view_id: 'example_created_view',
|
|
110
|
+
query: 'howler.id:*',
|
|
111
|
+
sort: 'event.created desc',
|
|
112
|
+
title: 'Example View',
|
|
113
|
+
type: 'personal',
|
|
114
|
+
span: 'date.range.1.month'
|
|
115
|
+
})
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
hook.rerender();
|
|
119
|
+
|
|
120
|
+
expect(hook.result.current.views[result.view_id]).toEqual(result);
|
|
121
|
+
|
|
122
|
+
await act(async () => hook.result.current.removeView(result.view_id));
|
|
123
|
+
|
|
124
|
+
hook.rerender();
|
|
125
|
+
|
|
126
|
+
expect(hook.result.current.views[result.view_id]).toBeFalsy();
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
describe('fetchViews', () => {
|
|
130
|
+
let hook: RenderHookResult<ViewContextType['fetchViews'], any>;
|
|
131
|
+
beforeEach(async () => {
|
|
132
|
+
hook = await act(async () => {
|
|
133
|
+
return renderHook(() => useContextSelector(ViewContext, ctx => ctx.fetchViews), { wrapper: Wrapper });
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
vi.mocked(hpost).mockClear();
|
|
137
|
+
vi.mocked(hget).mockClear();
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('Should fetch all views when no ids are provided', async () => {
|
|
141
|
+
const result = await act(async () => hook.result.current());
|
|
142
|
+
|
|
143
|
+
expect(result.length).toBe(2);
|
|
144
|
+
expect(result[0].view_id).toBe('example_view_id');
|
|
145
|
+
expect(result[1].view_id).toBe('another_view_id');
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it('Should search for specified views when ids are provided', async () => {
|
|
149
|
+
const result = await act(async () => hook.result.current(['searched_view_id']));
|
|
150
|
+
|
|
151
|
+
expect(hpost).toHaveBeenCalledOnce();
|
|
152
|
+
expect(hpost).toBeCalledWith('/api/v1/search/view', {
|
|
153
|
+
query: 'view_id:(searched_view_id)',
|
|
154
|
+
rows: 1,
|
|
155
|
+
sort: 'title asc'
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
expect(result).toEqual(MOCK_RESPONSES['/api/v1/search/view'].items);
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it('Should search only for new views when ids are provided', async () => {
|
|
162
|
+
await act(async () => hook.result.current(['searched_view_id']));
|
|
163
|
+
|
|
164
|
+
expect(hpost).toHaveBeenCalledOnce();
|
|
165
|
+
expect(hpost).toBeCalledWith('/api/v1/search/view', {
|
|
166
|
+
query: 'view_id:(searched_view_id)',
|
|
167
|
+
rows: 1,
|
|
168
|
+
sort: 'title asc'
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
vi.mocked(hpost).mockClear();
|
|
172
|
+
await act(async () => hook.result.current(['searched_view_id', 'searched_view_id_2']));
|
|
173
|
+
|
|
174
|
+
expect(hpost).toHaveBeenCalledOnce();
|
|
175
|
+
expect(hpost).toBeCalledWith('/api/v1/search/view', {
|
|
176
|
+
query: 'view_id:(searched_view_id_2)',
|
|
177
|
+
rows: 1,
|
|
178
|
+
sort: 'title asc'
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
it('Should provide cached instances as a response when the same views are requested', async () => {
|
|
183
|
+
let result = await act(async () => hook.result.current(['searched_view_id']));
|
|
184
|
+
|
|
185
|
+
expect(result).toEqual(MOCK_RESPONSES['/api/v1/search/view'].items);
|
|
186
|
+
|
|
187
|
+
result = await act(async () => hook.result.current(['searched_view_id']));
|
|
188
|
+
|
|
189
|
+
expect(result).toEqual(MOCK_RESPONSES['/api/v1/search/view'].items);
|
|
190
|
+
|
|
191
|
+
expect(hpost).toHaveBeenCalledOnce();
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
describe('getCurrentView', () => {
|
|
196
|
+
let hook: RenderHookResult<ViewContextType['getCurrentView'], any>;
|
|
197
|
+
beforeEach(async () => {
|
|
198
|
+
hook = await act(async () => {
|
|
199
|
+
return renderHook(() => useContextSelector(ViewContext, ctx => ctx.getCurrentView), { wrapper: Wrapper });
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it('should allow the user to fetch their current view based on the location', async () => {
|
|
204
|
+
// lazy load should return nothing
|
|
205
|
+
await expect(hook.result.current({ lazy: true })).resolves.toBeFalsy();
|
|
206
|
+
|
|
207
|
+
const result = await act(async () => hook.result.current());
|
|
208
|
+
|
|
209
|
+
expect(result).toEqual(MOCK_RESPONSES['/api/v1/search/view'].items[0]);
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
it('should allow the user to fetch their current view based on the view ID', async () => {
|
|
213
|
+
// lazy load should return nothing
|
|
214
|
+
await expect(hook.result.current({ lazy: true })).resolves.toBeFalsy();
|
|
215
|
+
|
|
216
|
+
const result = await act(async () => hook.result.current({ viewId: 'searched_view_id' }));
|
|
217
|
+
|
|
218
|
+
expect(result).toEqual(MOCK_RESPONSES['/api/v1/search/view'].items[0]);
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
describe('editView', () => {
|
|
223
|
+
let hook: RenderHookResult<ViewContextType['editView'], any>;
|
|
224
|
+
beforeAll(async () => {
|
|
225
|
+
hook = await act(async () => {
|
|
226
|
+
return renderHook(() => useContextSelector(ViewContext, ctx => ctx.editView), { wrapper: Wrapper });
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
beforeEach(() => {
|
|
231
|
+
vi.mocked(hput).mockClear();
|
|
232
|
+
vi.mocked(hpost).mockClear();
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
it('should allow users to edit views', async () => {
|
|
236
|
+
const result = await act(async () => hook.result.current('example_view_id', { query: 'howler.id:*' }));
|
|
237
|
+
|
|
238
|
+
expect(hput).toHaveBeenCalledOnce();
|
|
239
|
+
expect(hput).toBeCalledWith('/api/v1/view/example_view_id', { query: 'howler.id:*' });
|
|
240
|
+
|
|
241
|
+
expect(result).toEqual(MOCK_RESPONSES['/api/v1/view/example_view_id']);
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
});
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import api from 'api';
|
|
2
|
+
import { useAppUser } from 'commons/components/app/hooks';
|
|
3
|
+
import useMyApi from 'components/hooks/useMyApi';
|
|
4
|
+
import { useMyLocalStorageItem } from 'components/hooks/useMyLocalStorage';
|
|
5
|
+
import { has, omit } from 'lodash-es';
|
|
6
|
+
import type { HowlerUser } from 'models/entities/HowlerUser';
|
|
7
|
+
import type { View } from 'models/entities/generated/View';
|
|
8
|
+
import { useCallback, useEffect, useState, type FC, type PropsWithChildren } from 'react';
|
|
9
|
+
import { useLocation, useParams } from 'react-router-dom';
|
|
10
|
+
import { createContext, useContextSelector } from 'use-context-selector';
|
|
11
|
+
import { StorageKey } from 'utils/constants';
|
|
12
|
+
|
|
13
|
+
export interface ViewContextType {
|
|
14
|
+
defaultView: string;
|
|
15
|
+
setDefaultView: (viewId: string) => void;
|
|
16
|
+
views: { [viewId: string]: View };
|
|
17
|
+
addFavourite: (id: string) => Promise<void>;
|
|
18
|
+
removeFavourite: (id: string) => Promise<void>;
|
|
19
|
+
fetchViews: (ids?: string[]) => Promise<View[]>;
|
|
20
|
+
addView: (v: View) => Promise<View>;
|
|
21
|
+
editView: (id: string, newView: Partial<Omit<View, 'view_id' | 'owner'>>) => Promise<View>;
|
|
22
|
+
removeView: (id: string) => Promise<void>;
|
|
23
|
+
getCurrentView: (config?: { viewId?: string; lazy?: boolean }) => Promise<View>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const ViewContext = createContext<ViewContextType>(null);
|
|
27
|
+
|
|
28
|
+
const ViewProvider: FC<PropsWithChildren> = ({ children }) => {
|
|
29
|
+
const { dispatchApi } = useMyApi();
|
|
30
|
+
const appUser = useAppUser<HowlerUser>();
|
|
31
|
+
const [defaultView, setDefaultView] = useMyLocalStorageItem<string>(StorageKey.DEFAULT_VIEW);
|
|
32
|
+
const location = useLocation();
|
|
33
|
+
const routeParams = useParams();
|
|
34
|
+
|
|
35
|
+
const [views, setViews] = useState<{ [viewId: string]: View }>({});
|
|
36
|
+
|
|
37
|
+
const fetchViews: ViewContextType['fetchViews'] = useCallback(
|
|
38
|
+
async (ids?: string[]) => {
|
|
39
|
+
if (!ids) {
|
|
40
|
+
const newViews = (await dispatchApi(api.view.get(), { throwError: false })) ?? [];
|
|
41
|
+
|
|
42
|
+
setViews(_views => ({
|
|
43
|
+
..._views,
|
|
44
|
+
...Object.fromEntries(newViews.map(_view => [_view.view_id, _view]))
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
return newViews;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const missingIds = ids.filter(_id => !has(views, _id));
|
|
51
|
+
|
|
52
|
+
if (missingIds.length < 1) {
|
|
53
|
+
return ids.map(id => views[id]);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
const response = await dispatchApi(
|
|
58
|
+
api.search.view.post({
|
|
59
|
+
query: `view_id:(${missingIds.join(' OR ')})`,
|
|
60
|
+
rows: missingIds.length,
|
|
61
|
+
sort: 'title asc'
|
|
62
|
+
})
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
const newViews = Object.fromEntries(response.items.map(_view => [_view.view_id, _view]));
|
|
66
|
+
|
|
67
|
+
setViews(_views => ({
|
|
68
|
+
..._views,
|
|
69
|
+
...Object.fromEntries(missingIds.map(_view_id => [_view_id, null])),
|
|
70
|
+
...newViews
|
|
71
|
+
}));
|
|
72
|
+
|
|
73
|
+
return ids.map(id => views[id] ?? newViews[id]);
|
|
74
|
+
} catch (e) {
|
|
75
|
+
// eslint-disable-next-line no-console
|
|
76
|
+
console.warn(e);
|
|
77
|
+
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
[dispatchApi, views]
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (!defaultView || has(views, defaultView)) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
(async () => {
|
|
90
|
+
const result = await fetchViews([defaultView]);
|
|
91
|
+
|
|
92
|
+
if (!result.length) {
|
|
93
|
+
setDefaultView(undefined);
|
|
94
|
+
}
|
|
95
|
+
})();
|
|
96
|
+
}, [defaultView, fetchViews, setDefaultView, views]);
|
|
97
|
+
|
|
98
|
+
const getCurrentView: ViewContextType['getCurrentView'] = useCallback(
|
|
99
|
+
async ({ viewId, lazy = false } = {}) => {
|
|
100
|
+
if (!viewId) {
|
|
101
|
+
viewId = location.pathname.startsWith('/views') ? routeParams.id : defaultView;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (!viewId) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (!has(views, viewId) && !lazy) {
|
|
109
|
+
return (await fetchViews([viewId]))[0];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return views[viewId];
|
|
113
|
+
},
|
|
114
|
+
[defaultView, fetchViews, location.pathname, routeParams.id, views]
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
const editView: ViewContextType['editView'] = useCallback(
|
|
118
|
+
async (id, partialView) => {
|
|
119
|
+
const result = await dispatchApi(api.view.put(id, partialView));
|
|
120
|
+
|
|
121
|
+
setViews(_views => ({
|
|
122
|
+
..._views,
|
|
123
|
+
[id]: { ...(_views[id] ?? {}), ...partialView }
|
|
124
|
+
}));
|
|
125
|
+
|
|
126
|
+
return result;
|
|
127
|
+
},
|
|
128
|
+
[dispatchApi]
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
const addFavourite: ViewContextType['addFavourite'] = useCallback(
|
|
132
|
+
async (id: string) => {
|
|
133
|
+
await dispatchApi(api.view.favourite.post(id));
|
|
134
|
+
|
|
135
|
+
appUser.setUser({
|
|
136
|
+
...appUser.user,
|
|
137
|
+
favourite_views: [...appUser.user.favourite_views, id]
|
|
138
|
+
});
|
|
139
|
+
},
|
|
140
|
+
[appUser, dispatchApi]
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
const addView: ViewContextType['addView'] = useCallback(
|
|
144
|
+
async (view: View) => {
|
|
145
|
+
const newView = await dispatchApi(api.view.post(view));
|
|
146
|
+
|
|
147
|
+
setViews(_views => ({ ..._views, [newView.view_id]: newView }));
|
|
148
|
+
|
|
149
|
+
addFavourite(newView.view_id);
|
|
150
|
+
|
|
151
|
+
return newView;
|
|
152
|
+
},
|
|
153
|
+
[addFavourite, dispatchApi]
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
const removeFavourite: ViewContextType['removeFavourite'] = useCallback(
|
|
157
|
+
async (id: string) => {
|
|
158
|
+
await dispatchApi(api.view.favourite.del(id));
|
|
159
|
+
|
|
160
|
+
appUser.setUser({
|
|
161
|
+
...appUser.user,
|
|
162
|
+
favourite_views: appUser.user.favourite_views.filter(v => v !== id)
|
|
163
|
+
});
|
|
164
|
+
},
|
|
165
|
+
[appUser, dispatchApi]
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
const removeView: ViewContextType['removeView'] = useCallback(
|
|
169
|
+
async (id: string) => {
|
|
170
|
+
const result = await dispatchApi(api.view.del(id));
|
|
171
|
+
|
|
172
|
+
setViews(_views => omit(_views, id));
|
|
173
|
+
|
|
174
|
+
if (appUser.user?.favourite_views.includes(id)) {
|
|
175
|
+
removeFavourite(id);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return result;
|
|
179
|
+
},
|
|
180
|
+
[appUser.user?.favourite_views, dispatchApi, removeFavourite]
|
|
181
|
+
);
|
|
182
|
+
|
|
183
|
+
return (
|
|
184
|
+
<ViewContext.Provider
|
|
185
|
+
value={{
|
|
186
|
+
views,
|
|
187
|
+
addFavourite,
|
|
188
|
+
removeFavourite,
|
|
189
|
+
fetchViews,
|
|
190
|
+
addView,
|
|
191
|
+
editView,
|
|
192
|
+
removeView,
|
|
193
|
+
defaultView,
|
|
194
|
+
setDefaultView,
|
|
195
|
+
getCurrentView
|
|
196
|
+
}}
|
|
197
|
+
>
|
|
198
|
+
{children}
|
|
199
|
+
</ViewContext.Provider>
|
|
200
|
+
);
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export const useViewContextSelector = <Selected,>(selector: (value: ViewContextType) => Selected): Selected => {
|
|
204
|
+
return useContextSelector<ViewContextType, Selected>(ViewContext, selector);
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export default ViewProvider;
|