@cccsaurora/howler-ui 3.1.0-dev.1493 → 3.1.0-dev.1607
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.d.ts +1 -1
- package/api/action/index.d.ts +10 -6
- package/api/action/index.js +5 -9
- package/api/action/operations.js +2 -2
- package/api/analytic/comments/index.d.ts +4 -6
- package/api/analytic/comments/react.d.ts +2 -2
- package/api/analytic/favourite.d.ts +2 -4
- package/api/analytic/index.d.ts +7 -4
- package/api/analytic/index.js +2 -2
- package/api/analytic/notebooks/index.d.ts +2 -4
- package/api/analytic/owner.d.ts +1 -1
- package/api/auth/apikey.d.ts +2 -2
- package/api/auth/login.d.ts +2 -2
- package/api/configs/index.d.ts +1 -1
- package/api/dossier.d.ts +16 -0
- package/api/{dossier/index.js → dossier.js} +6 -4
- package/api/help.d.ts +2 -2
- package/api/hit/assign.d.ts +6 -2
- package/api/hit/comments/index.d.ts +4 -6
- package/api/hit/comments/react.d.ts +2 -2
- package/api/hit/index.d.ts +3 -8
- package/api/hit/labels.d.ts +2 -2
- package/api/hit/overwrite.d.ts +1 -1
- package/api/hit/transition.d.ts +1 -1
- package/api/index.d.ts +6 -6
- package/api/index.js +7 -6
- package/api/notebook/environments.d.ts +1 -1
- package/api/notebook/index.d.ts +1 -1
- package/api/overview/index.d.ts +4 -4
- package/api/search/action.d.ts +1 -1
- package/api/search/analytic.d.ts +1 -1
- package/api/search/case.d.ts +1 -1
- package/api/search/count/hit.d.ts +1 -1
- package/api/search/dossier.d.ts +1 -1
- package/api/search/eql/hit.d.ts +1 -1
- package/api/search/explain/hit.d.ts +1 -1
- package/api/search/facet/hit.d.ts +1 -1
- package/api/search/fields/hit.js +1 -2
- package/api/search/fields/user.js +2 -4
- package/api/search/grouped/hit.d.ts +1 -1
- package/api/search/grouped/user.js +3 -0
- package/api/search/histogram/hit.d.ts +1 -1
- package/api/search/hit.d.ts +1 -1
- package/api/search/overview.d.ts +1 -1
- package/api/search/sigma/hit.d.ts +1 -1
- package/api/search/template.d.ts +1 -1
- package/api/search/user.d.ts +30 -2
- package/api/search/user.js +3 -0
- package/api/search/view.d.ts +1 -1
- package/api/socket/viewers.d.ts +1 -1
- package/api/socket/viewers.js +1 -1
- package/api/template/index.d.ts +3 -3
- package/api/template/index.js +2 -2
- package/api/user/avatar/index.d.ts +1 -1
- package/api/user/groups.d.ts +1 -1
- package/api/user/index.d.ts +2 -2
- package/api/user/whoami.d.ts +1 -1
- package/api/utils/createPermissionsApi.d.ts +10 -0
- package/api/utils/createPermissionsApi.js +10 -0
- package/api/v2/case/index.d.ts +4 -4
- package/api/v2/case/items.d.ts +3 -3
- package/api/v2/case/rules.d.ts +3 -3
- package/api/v2/fuzzy.d.ts +1 -1
- package/api/v2/search/facet.d.ts +1 -1
- package/api/v2/search/index.d.ts +1 -1
- package/api/view/favourite.d.ts +2 -4
- package/api/view/index.d.ts +9 -5
- package/api/view/index.js +3 -1
- package/branding/AppBrand.d.ts +2 -2
- package/branding/AppBrand.js +4 -6
- package/components/app/App.js +248 -51
- package/components/app/AppContainer.js +1 -1
- package/components/app/drawers/ApiKeyDrawer.js +13 -5
- package/components/app/drawers/AssignUserDrawer.js +11 -4
- package/components/app/hooks/useMatchers.d.ts +3 -3
- package/components/app/hooks/useMatchers.js +12 -12
- package/components/app/hooks/useMatchers.test.js +15 -14
- package/components/app/hooks/useTitle.js +8 -7
- package/components/app/providers/AnalyticProvider.d.ts +1 -1
- package/components/app/providers/AnalyticProvider.js +7 -4
- package/components/app/providers/ApiConfigProvider.d.ts +2 -1
- package/components/app/providers/ApiConfigProvider.js +12 -10
- package/components/app/providers/AppDrawerProvider.js +2 -2
- package/components/app/providers/AvatarProvider.js +18 -11
- package/components/app/providers/FavouritesProvider.js +56 -86
- package/components/app/providers/FieldProvider.js +1 -1
- package/components/app/providers/GridColumnsProvider.d.ts +1 -1
- package/components/app/providers/GridColumnsProvider.js +17 -4
- package/components/app/providers/GridColumnsProvider.test.js +2 -1
- package/components/app/providers/LocalStorageProvider.d.ts +2 -2
- package/components/app/providers/LocalStorageProvider.js +4 -3
- package/components/app/providers/ModalProvider.js +8 -1
- package/components/app/providers/OverviewProvider.js +10 -2
- package/components/app/providers/ParameterProvider.d.ts +7 -7
- package/components/app/providers/ParameterProvider.js +42 -5
- package/components/app/providers/ParameterProvider.test.js +1 -0
- package/components/app/providers/RecordProvider.js +7 -1
- package/components/app/providers/RecordSearchProvider.d.ts +1 -2
- package/components/app/providers/RecordSearchProvider.js +32 -23
- package/components/app/providers/RecordSearchProvider.test.js +2 -1
- package/components/app/providers/SearchResponseProvider.d.ts +9 -6
- package/components/app/providers/SearchResponseProvider.js +37 -19
- package/components/app/providers/SearchResponseProvider.test.js +37 -11
- package/components/app/providers/SocketProvider.js +6 -4
- package/components/app/providers/UserListProvider.d.ts +1 -1
- package/components/app/providers/ViewProvider.d.ts +2 -2
- package/components/app/providers/ViewProvider.js +22 -12
- package/components/app/providers/ViewProvider.test.js +2 -2
- package/components/app/providers/contextUtils.d.ts +1 -0
- package/components/app/providers/contextUtils.js +3 -0
- package/components/elements/Comment.d.ts +1 -1
- package/components/elements/Comment.js +11 -9
- package/components/elements/ContextMenu.js +1 -1
- package/components/elements/ContextMenu.test.js +2 -2
- package/components/elements/EditRow.d.ts +9 -4
- package/components/elements/EditRow.js +5 -4
- package/components/elements/MarkdownEditor.js +1 -1
- package/components/elements/MembershipManagement.test.js +178 -0
- package/components/elements/ObjectDetails.js +6 -6
- package/components/elements/ThemedEditor.js +17 -17
- package/components/elements/UserList.d.ts +2 -0
- package/components/elements/UserList.js +26 -18
- package/components/elements/UserList.test.js +24 -1
- package/components/elements/addons/buttons/CustomButton.d.ts +1 -1
- package/components/elements/addons/buttons/CustomButton.js +2 -2
- package/components/elements/addons/buttons/CustomIconButton.d.ts +1 -1
- package/components/elements/addons/buttons/CustomIconButton.js +3 -3
- package/components/elements/addons/buttons/index.d.ts +1 -1
- package/components/elements/addons/layout/FlexOne.d.ts +2 -2
- package/components/elements/addons/layout/FlexOne.test.js +1 -0
- package/components/elements/addons/layout/FlexPort.d.ts +1 -1
- package/components/elements/addons/layout/FlexPort.js +9 -2
- package/components/elements/addons/layout/FlexVertical.d.ts +2 -2
- package/components/elements/addons/layout/FlexVertical.js +1 -1
- package/components/elements/addons/layout/vsbox/VSBox.d.ts +2 -2
- package/components/elements/addons/layout/vsbox/VSBox.js +5 -4
- package/components/elements/addons/layout/vsbox/VSBoxElement.d.ts +1 -1
- package/components/elements/addons/layout/vsbox/VSBoxHeader.js +4 -3
- package/components/elements/addons/lists/TuiList.d.ts +2 -2
- package/components/elements/addons/lists/TuiList.js +1 -1
- package/components/elements/addons/lists/TuiListBase.d.ts +2 -2
- package/components/elements/addons/lists/TuiListBase.js +4 -4
- package/components/elements/addons/lists/TuiListElement.d.ts +2 -2
- package/components/elements/addons/lists/TuiListElement.js +2 -2
- package/components/elements/addons/lists/TuiListMenu.d.ts +13 -37
- package/components/elements/addons/lists/TuiListMenu.js +8 -8
- package/components/elements/addons/lists/TuiListProvider.d.ts +2 -2
- package/components/elements/addons/lists/TuiListProvider.js +4 -4
- package/components/elements/addons/lists/hooks/useTuiListKeyboard.js +1 -1
- package/components/elements/addons/lists/table/TuiTable.d.ts +1 -1
- package/components/elements/addons/lists/table/TuiTable.js +1 -1
- package/components/elements/addons/lists/table/TuiTableBody.d.ts +1 -1
- package/components/elements/addons/lists/table/TuiTableBody.js +1 -1
- package/components/elements/addons/lists/table/TuiTableHead.d.ts +1 -1
- package/components/elements/addons/lists/table/TuiTableHead.js +1 -1
- package/components/elements/addons/lists/table/TuiTableHeader.d.ts +1 -1
- package/components/elements/addons/lists/table/TuiTableLayout.js +1 -1
- package/components/elements/addons/search/SearchPagination.d.ts +1 -1
- package/components/elements/addons/search/SearchPagination.test.js +1 -1
- package/components/elements/addons/search/SearchTotal.d.ts +1 -1
- package/components/elements/addons/search/phrase/Phrase.d.ts +2 -2
- package/components/elements/addons/search/phrase/Phrase.js +7 -7
- package/components/elements/addons/search/phrase/PhraseConsumer.d.ts +2 -2
- package/components/elements/addons/search/phrase/PhraseLexer.d.ts +1 -1
- package/components/elements/addons/search/phrase/PhraseLexer.js +6 -6
- package/components/elements/addons/search/phrase/WordLexer.test.js +1 -0
- package/components/elements/addons/search/phrase/index.d.ts +2 -2
- package/components/elements/addons/search/phrase/index.js +3 -2
- package/components/elements/addons/search/phrase/word/consumers/WhitespaceConsumer.d.ts +1 -1
- package/components/elements/addons/search/phrase/word/consumers/WhitespaceConsumer.js +1 -1
- package/components/elements/addons/search/phrase/word/consumers/WordConsumer.d.ts +1 -1
- package/components/elements/case/CaseCard.js +10 -4
- package/components/elements/case/CasePreview.js +1 -1
- package/components/elements/display/ActionButton.js +3 -1
- package/components/elements/display/ChipPopper.js +1 -1
- package/components/elements/display/ChipPopper.test.js +1 -0
- package/components/elements/display/Classification.js +6 -5
- package/components/elements/display/ClassificationChip.d.ts +2 -4
- package/components/elements/display/ClassificationChip.js +5 -3
- package/components/elements/display/DocumentationButton.js +1 -1
- package/components/elements/display/DocumentationButton.test.js +1 -1
- package/components/elements/display/HandlebarsMarkdown.js +2 -2
- package/components/elements/display/HowlerAvatar.d.ts +1 -0
- package/components/elements/display/HowlerAvatar.js +5 -4
- package/components/elements/display/HowlerAvatarHeader.js +2 -2
- package/components/elements/display/Image.test.js +1 -0
- package/components/elements/display/ItemManager.d.ts +6 -6
- package/components/elements/display/ItemManager.js +1 -1
- package/components/elements/display/Markdown.js +9 -3
- package/components/elements/display/Modal.js +3 -3
- package/components/elements/display/QueryResultText.js +1 -1
- package/components/elements/display/TextDivider.test.js +1 -0
- package/components/elements/display/TypingIndicator.d.ts +1 -1
- package/components/elements/display/UserPageWrapper.js +2 -2
- package/components/elements/display/handlebars/helpers.js +1 -1
- package/components/elements/display/json/JSONViewer.js +2 -2
- package/components/elements/display/markdownPlugins/tabs.js +4 -0
- package/components/elements/display/modals/CreateActionModal.js +1 -1
- package/components/elements/display/modals/RationaleModal.js +1 -2
- package/components/elements/display/modals/RationaleModal.test.js +9 -5
- package/components/elements/event/EventPreview.js +1 -1
- package/components/elements/hit/HitActions.js +5 -7
- package/components/elements/hit/HitBanner.js +4 -16
- package/components/elements/hit/HitBanner.test.js +11 -20
- package/components/elements/hit/HitLabels.js +23 -13
- package/components/elements/hit/HitLinks.js +4 -4
- package/components/elements/hit/HitNotebooks.js +28 -10
- package/components/elements/hit/HitOutline.js +9 -15
- package/components/elements/hit/HitOutline.test.js +5 -5
- package/components/elements/hit/HitOverview.js +3 -3
- package/components/elements/hit/HitPreview.d.ts +1 -1
- package/components/elements/hit/HitPreview.js +6 -7
- package/components/elements/hit/HitSummary.js +8 -8
- package/components/elements/hit/PivotTooltip.js +1 -1
- package/components/elements/hit/actions/ButtonActions.js +2 -2
- package/components/elements/hit/actions/DropdownActions.js +4 -4
- package/components/elements/hit/aggregate/HitGraph.js +28 -11
- package/components/elements/hit/elements/AnalyticLink.js +2 -2
- package/components/elements/hit/elements/AnalyticLink.test.js +1 -1
- package/components/elements/hit/elements/Assigned.js +1 -1
- package/components/elements/hit/elements/Assigned.test.js +1 -1
- package/components/elements/hit/elements/EscalationChip.js +2 -2
- package/components/elements/hit/elements/HitTimestamp.js +2 -2
- package/components/elements/hit/grid/AddColumnModal.js +2 -2
- package/components/elements/hit/grid/ColumnHeader.js +1 -1
- package/components/elements/hit/grid/RecordRow.js +1 -1
- package/components/elements/hit/grid/RecordTable.d.ts +4 -3
- package/components/elements/hit/grid/RecordTable.js +6 -6
- package/components/elements/hit/related/PivotLink.js +2 -2
- package/components/elements/hit/related/RelatedIcon.js +2 -2
- package/components/elements/hit/related/RelatedLink.js +1 -1
- package/components/elements/hit/related/RelatedRecords.js +1 -1
- package/components/elements/membership/Members.d.ts +6 -0
- package/components/elements/membership/Members.js +14 -0
- package/components/elements/membership/MembershipManagement.d.ts +9 -0
- package/components/elements/membership/MembershipManagement.js +119 -0
- package/components/elements/membership/types.d.ts +7 -0
- package/components/elements/membership/utils.d.ts +2 -0
- package/components/elements/membership/utils.js +6 -0
- package/components/elements/record/RecordComments.js +16 -10
- package/components/elements/record/RecordContextMenu.d.ts +2 -2
- package/components/elements/record/RecordContextMenu.js +11 -5
- package/components/elements/record/RecordContextMenu.test.js +14 -6
- package/components/elements/record/RecordRelated.js +2 -2
- package/components/elements/search/FuzzySearchBar.js +1 -1
- package/components/elements/view/LayoutToggle.d.ts +1 -1
- package/components/elements/view/ViewTitle.js +3 -4
- package/components/hooks/useHitActions.d.ts +1 -1
- package/components/hooks/useHitActions.js +25 -15
- package/components/hooks/useLocalStorage.d.ts +1 -1
- package/components/hooks/useLocalStorage.js +1 -1
- package/components/hooks/useLocalStorageItem.d.ts +11 -1
- package/components/hooks/useLocalStorageItem.js +7 -5
- package/components/hooks/useLocalStorageItem.test.js +23 -0
- package/components/hooks/useMyAccessibility.d.ts +7 -0
- package/components/hooks/useMyAccessibility.js +21 -0
- package/components/hooks/useMyApi.d.ts +1 -1
- package/components/hooks/useMyApi.js +4 -4
- package/components/hooks/useMyChart.d.ts +46 -48
- package/components/hooks/useMyChart.js +30 -9
- package/components/hooks/useMyCookies.d.ts +3 -0
- package/components/hooks/useMyCookies.js +8 -0
- package/components/hooks/useMyLocalStorage.d.ts +8 -2
- package/components/hooks/useMyLocalStorage.js +1 -1
- package/components/hooks/useMyPreferences.d.ts +1 -1
- package/components/hooks/useMyPreferences.js +93 -127
- package/components/hooks/useMyRouter.d.ts +2 -0
- package/components/hooks/useMyRouter.js +24 -0
- package/components/hooks/useMySearch.d.ts +1 -1
- package/components/hooks/useMySearch.js +17 -7
- package/components/hooks/useMySnackbar.js +1 -1
- package/components/hooks/useMyTheme.d.ts +1 -1
- package/components/hooks/useMyTheme.js +13 -8
- package/components/hooks/useMyTheme.test.js +11 -6
- package/components/hooks/useMyUser.d.ts +1 -1
- package/components/hooks/useMyUser.js +6 -5
- package/components/hooks/useMyUserFunctions.d.ts +2 -2
- package/components/hooks/useMyUserFunctions.js +14 -10
- package/components/hooks/useMyUserList.d.ts +1 -1
- package/components/hooks/useMyUtils.js +1 -1
- package/components/hooks/useParamState.js +5 -3
- package/components/hooks/useParamState.test.js +1 -1
- package/components/hooks/useRecordSelection.d.ts +4 -3
- package/components/hooks/useRecordSelection.js +5 -5
- package/components/hooks/useScrollRestoration.js +3 -3
- package/components/logins/Login.d.ts +1 -1
- package/components/logins/Login.js +4 -6
- package/components/logins/auth/OAuthLogin.js +1 -1
- package/components/logins/auth/UserPassLogin.d.ts +1 -1
- package/components/logins/hooks/useLogin.js +10 -6
- package/components/routes/403.js +1 -1
- package/components/routes/403.test.js +7 -3
- package/components/routes/404.js +1 -1
- package/components/routes/404.test.js +7 -3
- package/components/routes/ErrorBoundary.d.ts +2 -2
- package/components/routes/ErrorBoundary.js +2 -2
- package/components/routes/ErrorBoundary.test.js +1 -4
- package/components/routes/ErrorOccured.js +1 -1
- package/components/routes/ErrorOccured.test.js +7 -3
- package/components/routes/Logout.js +3 -4
- package/components/routes/Logout.test.js +12 -11
- package/components/routes/action/edit/ActionEditor.js +38 -30
- package/components/routes/action/shared/ActionReportDisplay.js +1 -1
- package/components/routes/action/shared/OperationEntry.js +2 -2
- package/components/routes/action/shared/OperationStep.js +12 -10
- package/components/routes/action/useMyActionFunctions.d.ts +3 -3
- package/components/routes/action/useMyActionFunctions.js +13 -13
- package/components/routes/action/view/ActionDetails.d.ts +1 -1
- package/components/routes/action/view/ActionDetails.js +46 -26
- package/components/routes/action/view/ActionSearch.js +11 -10
- package/components/routes/action/view/Integrations.js +2 -2
- package/components/routes/action/view/markdown/integrations.en.md.js +1 -1
- package/components/routes/action/view/markdown/integrations.fr.md.js +1 -1
- package/components/routes/admin/users/UserEditor.js +21 -8
- package/components/routes/admin/users/UserSearch.js +10 -9
- package/components/routes/advanced/QueryBuilder.js +17 -11
- package/components/routes/advanced/luceneCompletionProvider.js +42 -21
- package/components/routes/analytics/AnalyticComments.js +19 -14
- package/components/routes/analytics/AnalyticDetails.d.ts +1 -1
- package/components/routes/analytics/AnalyticDetails.js +20 -16
- package/components/routes/analytics/AnalyticHitComments.js +13 -6
- package/components/routes/analytics/AnalyticHitComments.test.js +5 -4
- package/components/routes/analytics/AnalyticNotebooks.js +5 -5
- package/components/routes/analytics/AnalyticOverview.js +28 -15
- package/components/routes/analytics/AnalyticOverviews.js +2 -2
- package/components/routes/analytics/AnalyticSearch.js +11 -10
- package/components/routes/analytics/AnalyticTemplates.js +3 -3
- package/components/routes/analytics/TriageSettings.d.ts +1 -1
- package/components/routes/analytics/TriageSettings.js +1 -1
- package/components/routes/analytics/widgets/Assessment.js +1 -1
- package/components/routes/analytics/widgets/Created.js +9 -9
- package/components/routes/analytics/widgets/Escalation.js +3 -3
- package/components/routes/analytics/widgets/Stacked.js +5 -5
- package/components/routes/analytics/widgets/Status.js +2 -2
- package/components/routes/cases/CaseViewer.js +1 -1
- package/components/routes/cases/CaseViewer.test.js +2 -2
- package/components/routes/cases/Cases.d.ts +1 -1
- package/components/routes/cases/Cases.js +8 -7
- package/components/routes/cases/constants.d.ts +3 -3
- package/components/routes/cases/detail/AlertPanel.js +1 -1
- package/components/routes/cases/detail/AlertPanel.test.js +4 -6
- package/components/routes/cases/detail/CaseDashboard.js +8 -4
- package/components/routes/cases/detail/CaseDashboard.test.js +2 -2
- package/components/routes/cases/detail/CaseDetails.js +7 -2
- package/components/routes/cases/detail/CaseDetails.test.js +1 -1
- package/components/routes/cases/detail/CaseObservables.js +5 -4
- package/components/routes/cases/detail/CaseObservables.test.js +1 -1
- package/components/routes/cases/detail/CaseOverview.js +2 -2
- package/components/routes/cases/detail/CaseRules.js +10 -6
- package/components/routes/cases/detail/CaseRules.test.js +2 -2
- package/components/routes/cases/detail/CaseSearch.js +5 -5
- package/components/routes/cases/detail/CaseSearch.test.js +2 -2
- package/components/routes/cases/detail/CaseSidebar.js +12 -7
- package/components/routes/cases/detail/CaseSidebar.test.js +5 -6
- package/components/routes/cases/detail/CaseTask.js +27 -15
- package/components/routes/cases/detail/CaseTask.test.js +8 -1
- package/components/routes/cases/detail/CaseTimeline.js +8 -8
- package/components/routes/cases/detail/CaseTimeline.test.js +6 -6
- package/components/routes/cases/detail/CreateRuleDialog.js +4 -4
- package/components/routes/cases/detail/CreateRuleDialog.test.js +2 -2
- package/components/routes/cases/detail/ItemPage.js +3 -3
- package/components/routes/cases/detail/MarkdownPage.test.js +0 -4
- package/components/routes/cases/detail/RelatedCasePanel.js +1 -1
- package/components/routes/cases/detail/RelatedCasePanel.test.js +4 -6
- package/components/routes/cases/detail/TaskPanel.js +8 -8
- package/components/routes/cases/detail/TaskPanel.test.js +3 -3
- package/components/routes/cases/detail/aggregates/CaseAggregate.js +1 -1
- package/components/routes/cases/detail/aggregates/SourceAggregate.js +3 -3
- package/components/routes/cases/detail/observables/Observable.js +4 -5
- package/components/routes/cases/detail/observables/Observable.test.js +1 -1
- package/components/routes/cases/detail/observables/ObservableTable.js +3 -3
- package/components/routes/cases/detail/observables/ObservableTable.test.js +1 -1
- package/components/routes/cases/detail/sidebar/CaseFolder.js +24 -20
- package/components/routes/cases/detail/sidebar/CaseFolder.test.js +1 -1
- package/components/routes/cases/detail/sidebar/CaseFolderContextMenu.js +4 -2
- package/components/routes/cases/detail/sidebar/CaseFolderContextMenu.test.js +3 -2
- package/components/routes/cases/detail/sidebar/FolderEntry.js +3 -3
- package/components/routes/cases/detail/sidebar/FolderEntry.test.js +3 -3
- package/components/routes/cases/detail/sidebar/types.d.ts +1 -1
- package/components/routes/cases/detail/sidebar/utils.js +1 -1
- package/components/routes/cases/detail/sidebar/utils.test.js +8 -8
- package/components/routes/cases/detail/utils.d.ts +1 -1
- package/components/routes/cases/detail/utils.js +3 -2
- package/components/routes/cases/hooks/useCase.js +14 -2
- package/components/routes/cases/modals/AddRecordToCaseModal.test.js +1 -1
- package/components/routes/cases/modals/AddToCaseModal.d.ts +1 -1
- package/components/routes/cases/modals/AddToCaseModal.js +2 -2
- package/components/routes/cases/modals/CreateCaseModal.test.js +1 -1
- package/components/routes/cases/modals/ResolveModal.js +8 -5
- package/components/routes/cases/modals/ResolveModal.test.js +5 -5
- package/components/routes/cases/modals/hooks.js +1 -2
- package/components/routes/cases/modals/types.d.ts +1 -1
- package/components/routes/cases/search/CaseAssigneeFilter.js +1 -1
- package/components/routes/cases/search/CaseAssigneeFilter.test.js +8 -3
- package/components/routes/cases/search/CaseStatusFilter.test.js +1 -0
- package/components/routes/cases/utils.d.ts +0 -1
- package/components/routes/cases/utils.js +4 -13
- package/components/routes/dossiers/DossierCard.js +3 -3
- package/components/routes/dossiers/DossierCard.test.js +6 -6
- package/components/routes/dossiers/DossierEditor.js +61 -25
- package/components/routes/dossiers/DossierEditor.test.js +16 -9
- package/components/routes/dossiers/Dossiers.d.ts +1 -1
- package/components/routes/dossiers/Dossiers.js +6 -5
- package/components/routes/dossiers/LeadEditor.d.ts +1 -1
- package/components/routes/dossiers/LeadEditor.js +2 -2
- package/components/routes/dossiers/LeadForm.js +2 -2
- package/components/routes/dossiers/PivotForm.d.ts +1 -1
- package/components/routes/dossiers/PivotForm.js +10 -9
- package/components/routes/events/EventViewer.js +1 -1
- package/components/routes/help/ActionDocumentation.js +2 -2
- package/components/routes/help/ActionIntroductionDocumentation.js +2 -2
- package/components/routes/help/ApiDocumentation.js +3 -4
- package/components/routes/help/AuthDocumentation.js +1 -1
- package/components/routes/help/ClientDocumentation.js +1 -1
- package/components/routes/help/Help.d.ts +1 -1
- package/components/routes/help/Help.js +5 -4
- package/components/routes/help/HitDocumentation.js +3 -3
- package/components/routes/help/HitLabelsDocumentation.js +12 -12
- package/components/routes/help/HitLinksDocumentation.js +2 -2
- package/components/routes/help/HitSchemaDocumentation.js +14 -8
- package/components/routes/help/NotebookDocumentation.js +1 -1
- package/components/routes/help/OverviewDocumentation.js +1 -1
- package/components/routes/help/RetentionDocumentation.js +3 -3
- package/components/routes/help/SearchDocumentation.js +6 -4
- package/components/routes/help/TemplateDocumentation.js +2 -2
- package/components/routes/help/ViewDocumentation.js +1 -1
- package/components/routes/help/markdown/en/views.md.js +1 -1
- package/components/routes/help/markdown/fr/views.md.js +1 -1
- package/components/routes/hits/search/InformationPane.js +8 -8
- package/components/routes/hits/search/QuerySettings.js +1 -1
- package/components/routes/hits/search/QuerySettings.test.js +8 -4
- package/components/routes/hits/search/RecordBrowser.js +12 -9
- package/components/routes/hits/search/RecordQuery.js +13 -10
- package/components/routes/hits/search/SearchPane.js +2 -3
- package/components/routes/hits/search/ViewLink.js +4 -4
- package/components/routes/hits/search/ViewLink.test.js +1 -0
- package/components/routes/hits/search/grid/RecordGrid.js +1 -1
- package/components/routes/hits/search/shared/CustomSort.js +3 -2
- package/components/routes/hits/search/shared/CustomSpan.js +9 -1
- package/components/routes/hits/search/shared/HitFilter.js +8 -3
- package/components/routes/hits/search/shared/HitSort.js +8 -6
- package/components/routes/hits/search/shared/IndexPicker.js +1 -1
- package/components/routes/hits/search/shared/LayoutSettings.js +1 -1
- package/components/routes/hits/search/shared/SearchActionMenu.d.ts +1 -1
- package/components/routes/hits/search/shared/SearchActionMenu.js +1 -1
- package/components/routes/hits/search/shared/SearchSpan.js +1 -1
- package/components/routes/hits/view/HitViewer.js +21 -11
- package/components/routes/hits/view/HitViewer.test.js +2 -2
- package/components/routes/home/AddNewCard.d.ts +2 -1
- package/components/routes/home/AddNewCard.js +7 -4
- package/components/routes/home/AnalyticCard.js +3 -3
- package/components/routes/home/EntryWrapper.js +1 -1
- package/components/routes/home/ViewCard.js +11 -7
- package/components/routes/home/ViewCard.test.js +3 -6
- package/components/routes/home/index.js +20 -17
- package/components/routes/overviews/OverviewCard.js +6 -2
- package/components/routes/overviews/OverviewViewer.d.ts +1 -1
- package/components/routes/overviews/OverviewViewer.js +48 -39
- package/components/routes/overviews/Overviews.d.ts +1 -1
- package/components/routes/overviews/Overviews.js +7 -6
- package/components/routes/overviews/markdownExtendedTokenProvider.test.js +1 -0
- package/components/routes/overviews/startingTemplate.js +1 -1
- package/components/routes/settings/ProfileSection.d.ts +1 -1
- package/components/routes/settings/ProfileSection.js +2 -2
- package/components/routes/settings/SecuritySection.d.ts +1 -1
- package/components/routes/settings/SecuritySection.js +2 -2
- package/components/routes/settings/Settings.js +6 -6
- package/components/routes/templates/TemplateCard.js +1 -1
- package/components/routes/templates/TemplateEditor.d.ts +1 -1
- package/components/routes/templates/TemplateEditor.js +3 -3
- package/components/routes/templates/TemplateViewer.d.ts +1 -1
- package/components/routes/templates/TemplateViewer.js +54 -52
- package/components/routes/templates/Templates.d.ts +1 -1
- package/components/routes/templates/Templates.js +10 -9
- package/components/routes/views/ViewComposer.js +38 -30
- package/components/routes/views/Views.d.ts +2 -1
- package/components/routes/views/Views.js +20 -14
- package/i18n.js +4 -0
- package/locales/en/translation.json +10 -0
- package/locales/fr/translation.json +10 -0
- package/models/entities/HowlerUser.d.ts +1 -1
- package/models/entities/generated/Action.d.ts +3 -1
- package/models/entities/generated/ApiType.d.ts +2 -3
- package/models/entities/generated/Dossier.d.ts +2 -0
- package/models/entities/generated/HowlerDossier.d.ts +2 -0
- package/models/entities/generated/Item.d.ts +2 -2
- package/models/entities/generated/Settings.d.ts +1 -1
- package/models/entities/generated/View.d.ts +2 -0
- package/package.json +102 -118
- package/plugins/HowlerPlugin.d.ts +9 -50
- package/plugins/HowlerPlugin.js +7 -113
- package/plugins/clue/Provider.js +2 -2
- package/plugins/clue/components/ClueLeadForm.js +2 -2
- package/plugins/clue/components/CluePivot.js +6 -7
- package/plugins/clue/components/CluePivotForm.js +26 -15
- package/plugins/clue/components/ClueTypography.js +2 -2
- package/plugins/clue/helpers.js +5 -5
- package/plugins/clue/index.d.ts +2 -2
- package/plugins/clue/index.js +1 -1
- package/plugins/clue/setup.js +1 -1
- package/plugins/clue/utils.d.ts +1 -1
- package/plugins/store.d.ts +26 -43
- package/plugins/store.js +2 -15
- package/rest/AxiosClient.js +3 -3
- package/rest/FetchClient.d.ts +1 -1
- package/rest/FetchClient.js +8 -5
- package/rest/FetchClient.test.js +7 -4
- package/rest/index.d.ts +4 -3
- package/setupTests.d.ts +3 -0
- package/tests/MockLocalStorage.js +2 -1
- package/tests/mocks.d.ts +2 -2
- package/tests/mocks.js +3 -3
- package/tests/server-handlers.js +1 -1
- package/utils/Throttler.js +1 -1
- package/utils/actionUtils.d.ts +1 -1
- package/utils/actionUtils.js +10 -6
- package/utils/classificationParser.js +56 -63
- package/utils/constants.d.ts +0 -17
- package/utils/constants.js +1 -18
- package/utils/exampleHit.d.ts +2 -0
- package/utils/exampleHit.js +18 -0
- package/utils/localStorage.d.ts +2 -2
- package/utils/localStorage.js +1 -1
- package/utils/menuUtils.d.ts +3 -89
- package/utils/menuUtils.js +66 -227
- package/utils/menuUtils.test.js +45 -181
- package/utils/sessionStorage.js +1 -1
- package/utils/sessionStorage.test.js +1 -0
- package/utils/stringUtils.d.ts +1 -1
- package/utils/utils.d.ts +30 -6
- package/utils/utils.js +66 -9
- package/utils/utils.test.js +1 -0
- package/utils/xsrf.d.ts +1 -1
- package/utils/xsrf.js +5 -10
- package/api/dossier/hit.d.ts +0 -2
- package/api/dossier/hit.js +0 -7
- package/api/dossier/index.d.ts +0 -9
- package/commons/components/app/AppConfigs.d.ts +0 -137
- package/commons/components/app/AppConstants.d.ts +0 -10
- package/commons/components/app/AppConstants.js +0 -10
- package/commons/components/app/AppContexts.d.ts +0 -105
- package/commons/components/app/AppContexts.js +0 -21
- package/commons/components/app/AppDefaults.d.ts +0 -6
- package/commons/components/app/AppDefaults.js +0 -40
- package/commons/components/app/AppNotificationService.d.ts +0 -6
- package/commons/components/app/AppNotificationService.js +0 -1
- package/commons/components/app/AppProvider.d.ts +0 -15
- package/commons/components/app/AppProvider.js +0 -41
- package/commons/components/app/AppSearchService.d.ts +0 -21
- package/commons/components/app/AppSearchService.js +0 -1
- package/commons/components/app/AppSkeleton.d.ts +0 -5
- package/commons/components/app/AppSkeleton.js +0 -152
- package/commons/components/app/AppUserService.d.ts +0 -17
- package/commons/components/app/AppUserService.js +0 -1
- package/commons/components/app/hooks/index.d.ts +0 -18
- package/commons/components/app/hooks/index.js +0 -18
- package/commons/components/app/hooks/useApp.d.ts +0 -1
- package/commons/components/app/hooks/useApp.js +0 -5
- package/commons/components/app/hooks/useAppBanner.d.ts +0 -1
- package/commons/components/app/hooks/useAppBanner.js +0 -6
- package/commons/components/app/hooks/useAppBar.d.ts +0 -1
- package/commons/components/app/hooks/useAppBar.js +0 -5
- package/commons/components/app/hooks/useAppBarHeight.d.ts +0 -2
- package/commons/components/app/hooks/useAppBarHeight.js +0 -22
- package/commons/components/app/hooks/useAppBarScrollTrigger.d.ts +0 -1
- package/commons/components/app/hooks/useAppBarScrollTrigger.js +0 -7
- package/commons/components/app/hooks/useAppBreadcrumbs.d.ts +0 -1
- package/commons/components/app/hooks/useAppBreadcrumbs.js +0 -5
- package/commons/components/app/hooks/useAppConfigs.d.ts +0 -59
- package/commons/components/app/hooks/useAppConfigs.js +0 -44
- package/commons/components/app/hooks/useAppLanguage.d.ts +0 -6
- package/commons/components/app/hooks/useAppLanguage.js +0 -17
- package/commons/components/app/hooks/useAppLayout.d.ts +0 -1
- package/commons/components/app/hooks/useAppLayout.js +0 -5
- package/commons/components/app/hooks/useAppLeftNav.d.ts +0 -1
- package/commons/components/app/hooks/useAppLeftNav.js +0 -5
- package/commons/components/app/hooks/useAppLogo.d.ts +0 -1
- package/commons/components/app/hooks/useAppLogo.js +0 -8
- package/commons/components/app/hooks/useAppNotification.d.ts +0 -1
- package/commons/components/app/hooks/useAppNotification.js +0 -5
- package/commons/components/app/hooks/useAppQuickSearch.d.ts +0 -1
- package/commons/components/app/hooks/useAppQuickSearch.js +0 -5
- package/commons/components/app/hooks/useAppSearchService.d.ts +0 -2
- package/commons/components/app/hooks/useAppSearchService.js +0 -5
- package/commons/components/app/hooks/useAppSitemap.d.ts +0 -16
- package/commons/components/app/hooks/useAppSitemap.js +0 -70
- package/commons/components/app/hooks/useAppSwitcher.d.ts +0 -1
- package/commons/components/app/hooks/useAppSwitcher.js +0 -5
- package/commons/components/app/hooks/useAppTheme.d.ts +0 -8
- package/commons/components/app/hooks/useAppTheme.js +0 -12
- package/commons/components/app/hooks/useAppUser.d.ts +0 -2
- package/commons/components/app/hooks/useAppUser.js +0 -5
- package/commons/components/app/providers/AppBarProvider.d.ts +0 -10
- package/commons/components/app/providers/AppBarProvider.js +0 -24
- package/commons/components/app/providers/AppBreadcrumbsProvider.d.ts +0 -6
- package/commons/components/app/providers/AppBreadcrumbsProvider.js +0 -43
- package/commons/components/app/providers/AppLayoutProvider.d.ts +0 -6
- package/commons/components/app/providers/AppLayoutProvider.js +0 -73
- package/commons/components/app/providers/AppLeftNavProvider.d.ts +0 -6
- package/commons/components/app/providers/AppLeftNavProvider.js +0 -22
- package/commons/components/app/providers/AppNotificationProvider.d.ts +0 -6
- package/commons/components/app/providers/AppNotificationProvider.js +0 -31
- package/commons/components/app/providers/AppQuickSearchProvider.d.ts +0 -8
- package/commons/components/app/providers/AppQuickSearchProvider.js +0 -19
- package/commons/components/app/providers/AppSearchServiceProvider.d.ts +0 -6
- package/commons/components/app/providers/AppSearchServiceProvider.js +0 -46
- package/commons/components/app/providers/AppSnackbarProvider.d.ts +0 -3
- package/commons/components/app/providers/AppSnackbarProvider.js +0 -15
- package/commons/components/app/providers/AppSwitcherProvider.d.ts +0 -6
- package/commons/components/app/providers/AppSwitcherProvider.js +0 -10
- package/commons/components/app/providers/AppUserProvider.d.ts +0 -8
- package/commons/components/app/providers/AppUserProvider.js +0 -12
- package/commons/components/breadcrumbs/BreadcrumbIcon.d.ts +0 -6
- package/commons/components/breadcrumbs/BreadcrumbIcon.js +0 -9
- package/commons/components/breadcrumbs/BreadcrumbLastItem.d.ts +0 -7
- package/commons/components/breadcrumbs/BreadcrumbLastItem.js +0 -19
- package/commons/components/breadcrumbs/BreadcrumbLinkItem.d.ts +0 -7
- package/commons/components/breadcrumbs/BreadcrumbLinkItem.js +0 -20
- package/commons/components/breadcrumbs/BreadcrumbList.d.ts +0 -11
- package/commons/components/breadcrumbs/BreadcrumbList.js +0 -44
- package/commons/components/breadcrumbs/Breadcrumbs.d.ts +0 -5
- package/commons/components/breadcrumbs/Breadcrumbs.js +0 -31
- package/commons/components/display/AppAvatar.d.ts +0 -8
- package/commons/components/display/AppAvatar.js +0 -18
- package/commons/components/display/AppInfoPanel.d.ts +0 -5
- package/commons/components/display/AppInfoPanel.js +0 -17
- package/commons/components/display/AppListEmpty.d.ts +0 -2
- package/commons/components/display/AppListEmpty.js +0 -5
- package/commons/components/display/AppToc.d.ts +0 -20
- package/commons/components/display/AppToc.js +0 -98
- package/commons/components/display/hooks/useAppColor.d.ts +0 -5
- package/commons/components/display/hooks/useAppColor.js +0 -10
- package/commons/components/leftnav/LeftNavDrawer.d.ts +0 -3
- package/commons/components/leftnav/LeftNavDrawer.js +0 -99
- package/commons/components/leftnav/LeftNavGroup.d.ts +0 -8
- package/commons/components/leftnav/LeftNavGroup.js +0 -55
- package/commons/components/leftnav/LeftNavItem.d.ts +0 -11
- package/commons/components/leftnav/LeftNavItem.js +0 -29
- package/commons/components/notification/FeedModels.d.ts +0 -64
- package/commons/components/notification/FeedModels.js +0 -94
- package/commons/components/notification/Notification.d.ts +0 -10
- package/commons/components/notification/Notification.js +0 -95
- package/commons/components/notification/elements/NotificationCloseButton.d.ts +0 -3
- package/commons/components/notification/elements/NotificationCloseButton.js +0 -6
- package/commons/components/notification/elements/NotificationContainer.d.ts +0 -16
- package/commons/components/notification/elements/NotificationContainer.js +0 -29
- package/commons/components/notification/elements/NotificationEndOfPage.d.ts +0 -5
- package/commons/components/notification/elements/NotificationEndOfPage.js +0 -36
- package/commons/components/notification/elements/NotificationError.d.ts +0 -2
- package/commons/components/notification/elements/NotificationError.js +0 -10
- package/commons/components/notification/elements/NotificationHeader.d.ts +0 -8
- package/commons/components/notification/elements/NotificationHeader.js +0 -18
- package/commons/components/notification/elements/NotificationItems.d.ts +0 -12
- package/commons/components/notification/elements/NotificationItems.js +0 -12
- package/commons/components/notification/elements/NotificationSkeleton.d.ts +0 -2
- package/commons/components/notification/elements/NotificationSkeleton.js +0 -12
- package/commons/components/notification/elements/NotificationTopNavButton.d.ts +0 -9
- package/commons/components/notification/elements/NotificationTopNavButton.js +0 -9
- package/commons/components/notification/elements/item/NotificationItem.d.ts +0 -5
- package/commons/components/notification/elements/item/NotificationItem.js +0 -25
- package/commons/components/notification/elements/item/NotificationItemAuthor.d.ts +0 -5
- package/commons/components/notification/elements/item/NotificationItemAuthor.js +0 -31
- package/commons/components/notification/elements/item/NotificationItemContent.d.ts +0 -3
- package/commons/components/notification/elements/item/NotificationItemContent.js +0 -9
- package/commons/components/notification/elements/item/NotificationItemDate.d.ts +0 -3
- package/commons/components/notification/elements/item/NotificationItemDate.js +0 -10
- package/commons/components/notification/elements/item/NotificationItemImage.d.ts +0 -4
- package/commons/components/notification/elements/item/NotificationItemImage.js +0 -8
- package/commons/components/notification/elements/item/NotificationItemTag.d.ts +0 -4
- package/commons/components/notification/elements/item/NotificationItemTag.js +0 -12
- package/commons/components/notification/elements/item/NotificationItemTitle.d.ts +0 -3
- package/commons/components/notification/elements/item/NotificationItemTitle.js +0 -15
- package/commons/components/notification/index.d.ts +0 -2
- package/commons/components/notification/index.js +0 -2
- package/commons/components/pages/PageCardCentered.d.ts +0 -5
- package/commons/components/pages/PageCardCentered.js +0 -30
- package/commons/components/pages/PageCenter.d.ts +0 -9
- package/commons/components/pages/PageCenter.js +0 -20
- package/commons/components/pages/PageContent.d.ts +0 -8
- package/commons/components/pages/PageContent.js +0 -8
- package/commons/components/pages/PageFullScreen.d.ts +0 -11
- package/commons/components/pages/PageFullScreen.js +0 -40
- package/commons/components/pages/PageFullWidth.d.ts +0 -11
- package/commons/components/pages/PageFullWidth.js +0 -7
- package/commons/components/pages/PageHeader.d.ts +0 -23
- package/commons/components/pages/PageHeader.js +0 -27
- package/commons/components/pages/hooks/usePageProps.d.ts +0 -24
- package/commons/components/pages/hooks/usePageProps.js +0 -19
- package/commons/components/search/AppSearch.d.ts +0 -1
- package/commons/components/search/AppSearch.js +0 -135
- package/commons/components/search/AppSearchInput.d.ts +0 -12
- package/commons/components/search/AppSearchInput.js +0 -35
- package/commons/components/search/AppSearchResult.d.ts +0 -5
- package/commons/components/search/AppSearchResult.js +0 -28
- package/commons/components/topnav/AppBar.d.ts +0 -6
- package/commons/components/topnav/AppBar.js +0 -80
- package/commons/components/topnav/AppName.d.ts +0 -5
- package/commons/components/topnav/AppName.js +0 -31
- package/commons/components/topnav/AppSwitcher.d.ts +0 -3
- package/commons/components/topnav/AppSwitcher.js +0 -44
- package/commons/components/topnav/Notifications.d.ts +0 -2
- package/commons/components/topnav/Notifications.js +0 -8
- package/commons/components/topnav/ThemeSelection.d.ts +0 -3
- package/commons/components/topnav/ThemeSelection.js +0 -33
- package/commons/components/topnav/ThemeSelectionIcon.d.ts +0 -2
- package/commons/components/topnav/ThemeSelectionIcon.js +0 -16
- package/commons/components/topnav/UserProfile.d.ts +0 -6
- package/commons/components/topnav/UserProfile.js +0 -71
- package/commons/components/utils/hooks/useClipboard.d.ts +0 -3
- package/commons/components/utils/hooks/useClipboard.js +0 -29
- package/commons/components/utils/hooks/useEnv.d.ts +0 -1
- package/commons/components/utils/hooks/useEnv.js +0 -11
- package/commons/components/utils/hooks/useFullscreenStatus.d.ts +0 -2
- package/commons/components/utils/hooks/useFullscreenStatus.js +0 -41
- package/commons/components/utils/hooks/useGravatar.d.ts +0 -2
- package/commons/components/utils/hooks/useGravatar.js +0 -9
- package/commons/components/utils/hooks/useLocalStorage.d.ts +0 -12
- package/commons/components/utils/hooks/useLocalStorage.js +0 -52
- package/commons/components/utils/hooks/useLocalStorageItem.d.ts +0 -14
- package/commons/components/utils/hooks/useLocalStorageItem.js +0 -39
- package/commons/components/utils/hooks/useThemeBuilder.d.ts +0 -7
- package/commons/components/utils/hooks/useThemeBuilder.js +0 -48
- package/commons/components/utils/keyboard.d.ts +0 -30
- package/commons/components/utils/keyboard.js +0 -50
- package/components/hooks/useMySitemap.d.ts +0 -3
- package/components/hooks/useMySitemap.js +0 -219
- /package/{commons/components/app/AppConfigs.js → components/elements/MembershipManagement.test.d.ts} +0 -0
|
@@ -10,8 +10,8 @@ const ClueLeadForm = ({ lead, metadata, update, updateMetadata }) => {
|
|
|
10
10
|
const { config } = useContext(ApiConfigContext);
|
|
11
11
|
const fetchers = useClueFetcherSelector(ctx => ctx.fetchers);
|
|
12
12
|
const [showCustom, setShowCustom] = useState(false);
|
|
13
|
-
return (_jsxs(_Fragment, { children: [_jsx(Divider, { orientation: "horizontal" }), _jsx(Autocomplete, { disabled: !lead, options: Object.keys(fetchers), renderInput: params => _jsx(TextField, { ...params, size: "small", label: t('route.dossiers.manager.clue') }), value: Object.keys(fetchers).includes(lead
|
|
14
|
-
uniq(Object.values(fetchers).flatMap(fetcher => fetcher.supported_types)), renderInput: params => _jsx(TextField, { ...params, size: "small", label: t('route.dossiers.manager.clue.type') }), value: metadata?.type ?? null, onChange: (_ev, type) => updateMetadata({ type }) }), _jsx(Autocomplete, { options: ['custom', ...Object.keys(config.indexes
|
|
13
|
+
return (_jsxs(_Fragment, { children: [_jsx(Divider, { orientation: "horizontal" }), _jsx(Autocomplete, { disabled: !lead, options: Object.keys(fetchers), renderInput: params => _jsx(TextField, { ...params, size: "small", label: t('route.dossiers.manager.clue') }), value: lead?.content && Object.keys(fetchers).includes(lead.content) ? lead.content : undefined, onChange: (_ev, content) => update({ content: content ?? undefined, metadata: '{}' }), renderOption: ({ key, ...props }, option) => (_jsx(ListItemText, { ...props, sx: { flexDirection: 'column', alignItems: 'start !important' }, primary: _jsx("code", { children: option }), secondary: fetchers[option].description }, key)) }), _jsx(Autocomplete, { options: fetchers[lead?.content ?? '']?.supported_types ??
|
|
14
|
+
uniq(Object.values(fetchers).flatMap(fetcher => fetcher.supported_types)), renderInput: params => _jsx(TextField, { ...params, size: "small", label: t('route.dossiers.manager.clue.type') }), value: metadata?.type ?? null, onChange: (_ev, type) => updateMetadata({ type }) }), _jsx(Autocomplete, { options: ['custom', ...Object.keys(config.indexes?.hit ?? {})], disabled: !metadata?.type, renderInput: params => _jsx(TextField, { ...params, size: "small", label: t('route.dossiers.manager.clue.value') }), getOptionLabel: opt => t(opt), value: metadata?.value ?? null, onChange: (_ev, value) => {
|
|
15
15
|
if (value === 'custom') {
|
|
16
16
|
setShowCustom(true);
|
|
17
17
|
}
|
|
@@ -11,6 +11,7 @@ import isBoolean from 'lodash-es/isBoolean';
|
|
|
11
11
|
import isNil from 'lodash-es/isNil';
|
|
12
12
|
import { memo, useCallback, useContext, useState } from 'react';
|
|
13
13
|
import { useTranslation } from 'react-i18next';
|
|
14
|
+
import { notNil } from '@cccsaurora/howler-ui/utils/utils';
|
|
14
15
|
const CluePivot = ({ pivot, hit, compact }) => {
|
|
15
16
|
const guessType = useClueEnrichSelector(ctx => ctx?.guessType);
|
|
16
17
|
const { showErrorMessage } = useMySnackbar();
|
|
@@ -30,7 +31,7 @@ const CluePivot = ({ pivot, hit, compact }) => {
|
|
|
30
31
|
}
|
|
31
32
|
return mapping.custom_value;
|
|
32
33
|
}
|
|
33
|
-
if (!Object.keys(config.indexes.hit).includes(mapping.field)) {
|
|
34
|
+
if (!config.indexes || !Object.keys(config.indexes.hit).includes(mapping.field)) {
|
|
34
35
|
return mapping.field;
|
|
35
36
|
}
|
|
36
37
|
const hitData = get(hit, mapping.field);
|
|
@@ -60,7 +61,7 @@ const CluePivot = ({ pivot, hit, compact }) => {
|
|
|
60
61
|
}
|
|
61
62
|
// We have a single object and that's what they want
|
|
62
63
|
return hitData;
|
|
63
|
-
}, [actions, config.indexes
|
|
64
|
+
}, [actions, config.indexes, hit]);
|
|
64
65
|
const onClueClick = useCallback(async (event, forceMenu = false) => {
|
|
65
66
|
event.preventDefault();
|
|
66
67
|
event.stopPropagation();
|
|
@@ -81,9 +82,7 @@ const CluePivot = ({ pivot, hit, compact }) => {
|
|
|
81
82
|
if (Array.isArray(value)) {
|
|
82
83
|
return [
|
|
83
84
|
_mapping.key,
|
|
84
|
-
value
|
|
85
|
-
.filter(val => !isNil(val))
|
|
86
|
-
.map(val => ({
|
|
85
|
+
value.filter(notNil).map(val => ({
|
|
87
86
|
type: config.configuration?.mapping?.[_mapping.field] || guessType(val.toString()),
|
|
88
87
|
value: val
|
|
89
88
|
}))
|
|
@@ -101,7 +100,7 @@ const CluePivot = ({ pivot, hit, compact }) => {
|
|
|
101
100
|
}));
|
|
102
101
|
const selectors = (actions[pivot.value].accept_multiple ? [data.selectors] : [data.selector])
|
|
103
102
|
.flat()
|
|
104
|
-
.filter(
|
|
103
|
+
.filter(notNil);
|
|
105
104
|
delete data.selector;
|
|
106
105
|
delete data.selectors;
|
|
107
106
|
try {
|
|
@@ -123,7 +122,7 @@ const CluePivot = ({ pivot, hit, compact }) => {
|
|
|
123
122
|
t
|
|
124
123
|
]);
|
|
125
124
|
if (!actions[pivot.value]) {
|
|
126
|
-
return;
|
|
125
|
+
return null;
|
|
127
126
|
}
|
|
128
127
|
return (_jsx(HowlerCard, { variant: compact ? 'outlined' : 'elevation', onClick: e => onClueClick(e), sx: [
|
|
129
128
|
theme => ({
|
|
@@ -26,6 +26,9 @@ const WRAPPED_RENDERERS = materialRenderers.map(value => ({
|
|
|
26
26
|
...value,
|
|
27
27
|
renderer: ({ ...props }) => (_jsx(ErrorBoundary, { children: _jsx(value.renderer, { ...props }) }))
|
|
28
28
|
}));
|
|
29
|
+
const acceptsEmpty = (action) => {
|
|
30
|
+
return Object.getOwnPropertyDescriptor(action, 'accept_empty')?.value === true;
|
|
31
|
+
};
|
|
29
32
|
/**
|
|
30
33
|
* CluePivotForm Component
|
|
31
34
|
*
|
|
@@ -72,15 +75,16 @@ const CluePivotForm = ({ pivot, update }) => {
|
|
|
72
75
|
...actions[value].extra_schema
|
|
73
76
|
});
|
|
74
77
|
// Enhance string properties with hit index options for better UX
|
|
75
|
-
Object.entries(clueAdaptedSchema.properties).forEach(([key, prop]) => {
|
|
78
|
+
Object.entries(clueAdaptedSchema.properties ?? {}).forEach(([key, prop]) => {
|
|
79
|
+
const hitFields = Object.keys(config.indexes?.hit ?? {});
|
|
76
80
|
// Handle boolean properties by converting to enum with hit indexes
|
|
77
81
|
if (typeof prop === 'boolean') {
|
|
78
|
-
clueAdaptedSchema.properties[key] = { enum:
|
|
82
|
+
clueAdaptedSchema.properties[key] = { enum: hitFields };
|
|
79
83
|
return;
|
|
80
84
|
}
|
|
81
85
|
if (prop.type === 'array') {
|
|
82
86
|
if (isBoolean(prop.items)) {
|
|
83
|
-
clueAdaptedSchema.properties[key] = { enum:
|
|
87
|
+
clueAdaptedSchema.properties[key] = { enum: hitFields };
|
|
84
88
|
return;
|
|
85
89
|
}
|
|
86
90
|
else if (!Array.isArray(prop.items)) {
|
|
@@ -98,11 +102,11 @@ const CluePivotForm = ({ pivot, update }) => {
|
|
|
98
102
|
}
|
|
99
103
|
// Add hit index options to string properties without existing enums
|
|
100
104
|
if (!prop.enum && !prop.oneOf) {
|
|
101
|
-
prop.enum =
|
|
105
|
+
prop.enum = hitFields;
|
|
102
106
|
}
|
|
103
107
|
});
|
|
104
108
|
return clueAdaptedSchema;
|
|
105
|
-
}, [actions, config.indexes
|
|
109
|
+
}, [actions, config.indexes, pivot?.value]);
|
|
106
110
|
/**
|
|
107
111
|
* Generates the UI schema for JsonForms based on the form schema.
|
|
108
112
|
* This defines the layout and rendering options for each form field.
|
|
@@ -123,7 +127,7 @@ const CluePivotForm = ({ pivot, update }) => {
|
|
|
123
127
|
}
|
|
124
128
|
else {
|
|
125
129
|
// Required fields appear first
|
|
126
|
-
return +formSchema?.required.includes(a_key) - +formSchema?.required.includes(b_key);
|
|
130
|
+
return +(formSchema?.required ?? []).includes(a_key) - +(formSchema?.required ?? []).includes(b_key);
|
|
127
131
|
}
|
|
128
132
|
})
|
|
129
133
|
.map(([key, value]) => ({
|
|
@@ -151,12 +155,15 @@ const CluePivotForm = ({ pivot, update }) => {
|
|
|
151
155
|
*/
|
|
152
156
|
const onUpdate = useCallback((value) => {
|
|
153
157
|
const mappings = [];
|
|
154
|
-
// TODO: Fix type hints and remove the any cast
|
|
155
158
|
// For actions that don't accept empty inputs, add selector mapping
|
|
156
|
-
|
|
159
|
+
const action = actions[value];
|
|
160
|
+
if (!action) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (!acceptsEmpty(action)) {
|
|
157
164
|
// Use 'selectors' for multiple selection, 'selector' for single selection
|
|
158
165
|
mappings.push({
|
|
159
|
-
key:
|
|
166
|
+
key: action.accept_multiple ? 'selectors' : 'selector',
|
|
160
167
|
field: 'howler.id'
|
|
161
168
|
});
|
|
162
169
|
}
|
|
@@ -209,9 +216,9 @@ const CluePivotForm = ({ pivot, update }) => {
|
|
|
209
216
|
padding: theme.spacing(0.5),
|
|
210
217
|
borderRadius: theme.shape.borderRadius
|
|
211
218
|
}, children: actionId })] }), _jsx(Typography, { variant: "body2", color: "text.secondary", alignSelf: "start", children: definition.summary })] }, key));
|
|
212
|
-
}, getOptionLabel: opt => actions[opt]?.name ?? '', renderInput: params => (_jsx(TextField, { ...params, size: "small", fullWidth: true, label: t('route.dossiers.manager.pivot.value') })), value: pivot?.value ?? '', onChange: (_ev, value) => onUpdate(value) }), _jsx(Divider, { flexItem: true }), _jsx(Typography, { children: t('route.dossiers.manager.pivot.mappings') }), selectorMapping && (_jsxs(_Fragment, { children: [_jsx(Autocomplete, { fullWidth: true, options: ['custom', ...Object.keys(config.indexes
|
|
213
|
-
mappings: pivot.mappings.map(_mapping => _mapping.key === selectorMapping.key ? { ..._mapping, field } : _mapping)
|
|
214
|
-
}) }), selectorMapping.field === 'custom' && (_jsx(TextField, { size: "small", label: t('route.dossiers.manager.pivot.mapping.custom'), disabled: !pivot, value: selectorMapping?.custom_value ??
|
|
219
|
+
}, getOptionLabel: opt => actions[opt]?.name ?? '', renderInput: params => (_jsx(TextField, { ...params, size: "small", fullWidth: true, label: t('route.dossiers.manager.pivot.value') })), value: pivot?.value ?? '', onChange: (_ev, value) => onUpdate(value) }), _jsx(Divider, { flexItem: true }), _jsx(Typography, { children: t('route.dossiers.manager.pivot.mappings') }), selectorMapping && (_jsxs(_Fragment, { children: [_jsx(Autocomplete, { fullWidth: true, options: ['custom', ...Object.keys(config.indexes?.hit ?? {})], renderInput: params => (_jsx(TextField, { ...params, size: "small", fullWidth: true, label: capitalize(selectorMapping.key), sx: { minWidth: '150px' } })), value: selectorMapping.field ?? '', onChange: (_ev, field) => update({
|
|
220
|
+
mappings: pivot.mappings.map(_mapping => _mapping.key === selectorMapping.key ? { ..._mapping, field: field } : _mapping)
|
|
221
|
+
}) }), selectorMapping.field === 'custom' && (_jsx(TextField, { size: "small", label: t('route.dossiers.manager.pivot.mapping.custom'), disabled: !pivot, value: selectorMapping?.custom_value ?? '', onChange: ev => update({
|
|
215
222
|
mappings: pivot.mappings.map(_mapping => _mapping.key === selectorMapping.key ? { ..._mapping, custom_value: ev.target.value } : _mapping)
|
|
216
223
|
}) }))] })), formSchema && (_jsx(ThemeProvider, { theme: _theme => createTheme({
|
|
217
224
|
..._theme,
|
|
@@ -252,14 +259,18 @@ const CluePivotForm = ({ pivot, update }) => {
|
|
|
252
259
|
// {key.1: 'howler.status', key.2: 'howler.id'}
|
|
253
260
|
//
|
|
254
261
|
// This is very confusing - ask Matt R if you need a better explanation.
|
|
255
|
-
const fullData = {
|
|
262
|
+
const fullData = {
|
|
263
|
+
...nestedData,
|
|
264
|
+
...flatData,
|
|
265
|
+
...pick(pivot.mappings ?? [], ['selector', 'selectors'])
|
|
266
|
+
};
|
|
256
267
|
// Convert form data back to mappings format
|
|
257
268
|
const newMappings = Object.entries(fullData).map(([key, val]) => ({
|
|
258
269
|
key,
|
|
259
270
|
// Use 'custom' field type if value is not a standard hit index
|
|
260
|
-
field: val in config.indexes
|
|
271
|
+
field: val in (config.indexes?.hit ?? {}) ? val : 'custom',
|
|
261
272
|
// Store custom values separately from field names
|
|
262
|
-
custom_value: val in config.indexes
|
|
273
|
+
custom_value: val in (config.indexes?.hit ?? {}) ? null : val
|
|
263
274
|
}));
|
|
264
275
|
// Only update if mappings have actually changed (performance optimization)
|
|
265
276
|
if (!isEqual(newMappings, pivot.mappings)) {
|
|
@@ -25,13 +25,13 @@ const ClueTypography = ({ children, value, context, field, obj, ...props }) => {
|
|
|
25
25
|
slotProps: {
|
|
26
26
|
stack: {
|
|
27
27
|
sx: { mr: 'auto' },
|
|
28
|
-
onClick: e => {
|
|
28
|
+
onClick: (e) => {
|
|
29
29
|
e.preventDefault();
|
|
30
30
|
e.stopPropagation();
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
popover: {
|
|
34
|
-
onClick: e => {
|
|
34
|
+
onClick: (e) => {
|
|
35
35
|
e.preventDefault();
|
|
36
36
|
e.stopPropagation();
|
|
37
37
|
}
|
package/plugins/clue/helpers.js
CHANGED
|
@@ -15,10 +15,10 @@ import { useState } from 'react';
|
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
16
|
const MarkdownTypography = ({ type, value, ...props }) => {
|
|
17
17
|
const { t } = useTranslation();
|
|
18
|
+
const guessType = useClueEnrichSelector(ctx => ctx?.guessType);
|
|
18
19
|
try {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
type = guessType(value.toString());
|
|
20
|
+
if (guessType && (!type || type?.toString().toLowerCase() === 'guess')) {
|
|
21
|
+
type = guessType(value.toString()) ?? undefined;
|
|
22
22
|
}
|
|
23
23
|
if (!type) {
|
|
24
24
|
return _jsx("span", { children: value });
|
|
@@ -26,7 +26,7 @@ const MarkdownTypography = ({ type, value, ...props }) => {
|
|
|
26
26
|
return _jsx(EnrichedTypography, { ...props, type: type, value: value });
|
|
27
27
|
}
|
|
28
28
|
catch (err) {
|
|
29
|
-
return (_jsxs(Stack, { children: [_jsx("strong", { style: { color: 'red' }, children: t('markdown.error') }), _jsx("strong", { children: err.toString() }), _jsx("code", { style: { fontSize: '0.8rem' }, children: _jsx("pre", { children: err.stack }) })] }));
|
|
29
|
+
return (_jsxs(Stack, { children: [_jsx("strong", { style: { color: 'red' }, children: t('markdown.error') }), _jsx("strong", { children: err instanceof Error ? err.toString() : String(err) }), _jsx("code", { style: { fontSize: '0.8rem' }, children: _jsx("pre", { children: err instanceof Error ? err.stack : undefined }) })] }));
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
const ClueGroup = props => {
|
|
@@ -58,7 +58,7 @@ const HELPERS = [
|
|
|
58
58
|
if (typeof type !== 'string' || typeof value !== 'string') {
|
|
59
59
|
return (_jsxs(Stack, { spacing: 1, children: [_jsx("strong", { style: { color: 'red' }, children: i18nInstance.t('markdown.error') }), _jsx("code", { style: { fontSize: '0.8rem' }, children: i18nInstance.t('markdown.helpers.clue.arguments') })] }));
|
|
60
60
|
}
|
|
61
|
-
return (_jsx(MarkdownTypography, { slotProps: { stack: { component: 'span', sx: { width: 'fit-content' } } }, component: "span", type: type, value:
|
|
61
|
+
return (_jsx(MarkdownTypography, { slotProps: { stack: { component: 'span', sx: { width: 'fit-content' } } }, component: "span", type: type, value: value }));
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
{
|
package/plugins/clue/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ declare class CluePlugin extends HowlerPlugin {
|
|
|
16
16
|
setup(): typeof useSetup;
|
|
17
17
|
localization(i18nInstance: I18N): void;
|
|
18
18
|
helpers(): HowlerHelper[];
|
|
19
|
-
typography(_props: PluginTypographyProps): import("react
|
|
20
|
-
chip(_props: PluginChipProps): import("react
|
|
19
|
+
typography(_props: PluginTypographyProps): import("react").JSX.Element;
|
|
20
|
+
chip(_props: PluginChipProps): import("react").JSX.Element;
|
|
21
21
|
}
|
|
22
22
|
export default CluePlugin;
|
package/plugins/clue/index.js
CHANGED
|
@@ -22,7 +22,7 @@ class CluePlugin extends HowlerPlugin {
|
|
|
22
22
|
description = 'This plugin enables clue enrichment in Howler.';
|
|
23
23
|
activate() {
|
|
24
24
|
super.activate();
|
|
25
|
-
const leadForm = props => _jsx(ClueLeadForm, { ...props });
|
|
25
|
+
const leadForm = (props) => _jsx(ClueLeadForm, { ...props });
|
|
26
26
|
const leadRenderer = (content, metadata, hit) => {
|
|
27
27
|
const parsedProps = JSON.parse(metadata);
|
|
28
28
|
const value = get(hit, parsedProps.value);
|
package/plugins/clue/setup.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { useAppUser } from '@tui/core';
|
|
1
2
|
import { SNACKBAR_EVENT_ID } from '@cccsaurora/clue-ui/data/event';
|
|
2
3
|
import useClue from '@cccsaurora/clue-ui/hooks/useClue';
|
|
3
|
-
import { useAppUser } from '@cccsaurora/howler-ui/commons/components/app/hooks/useAppUser';
|
|
4
4
|
import { ApiConfigContext } from '@cccsaurora/howler-ui/components/app/providers/ApiConfigProvider';
|
|
5
5
|
import useMySnackbar from '@cccsaurora/howler-ui/components/hooks/useMySnackbar';
|
|
6
6
|
import { useContext, useEffect } from 'react';
|
package/plugins/clue/utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Event } from '@cccsaurora/howler-ui/models/entities/generated/Event';
|
|
2
2
|
import type { Hit } from '@cccsaurora/howler-ui/models/entities/generated/Hit';
|
|
3
|
-
export declare const useType: (hit?: Hit | Event, field?: string, value?: string) =>
|
|
3
|
+
export declare const useType: (hit?: Hit | Event, field?: string, value?: string) => string | null;
|
package/plugins/store.d.ts
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
|
+
import type { LeftNavMenuItem } from '@tui/core';
|
|
1
2
|
import type { Hit } from '@cccsaurora/howler-ui/models/entities/generated/Hit';
|
|
3
|
+
import type { ReactElement } from 'react';
|
|
2
4
|
import { Event } from 'react-pluggable';
|
|
3
|
-
import type { AppLeftNavElement } from '../commons/components/app/AppConfigs';
|
|
4
5
|
import type HowlerPlugin from './HowlerPlugin';
|
|
5
6
|
export declare class HitEvent extends Event {
|
|
6
7
|
hit: Hit;
|
|
7
8
|
constructor(type: string, hit: Hit);
|
|
8
9
|
}
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
10
|
+
export type MainMenuOperation = {
|
|
11
|
+
type: 'append';
|
|
12
|
+
parentId: string;
|
|
13
|
+
item: LeftNavMenuItem;
|
|
14
|
+
} | {
|
|
15
|
+
type: 'insertRelative';
|
|
16
|
+
anchorId: string;
|
|
17
|
+
position: 'before' | 'after';
|
|
18
|
+
item: LeftNavMenuItem;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'remove';
|
|
21
|
+
targetId: string;
|
|
22
|
+
};
|
|
23
|
+
export type MainMenuItemOperation = Exclude<MainMenuOperation, {
|
|
24
|
+
type: 'remove';
|
|
25
|
+
}>;
|
|
14
26
|
declare class HowlerPluginStore {
|
|
15
27
|
private _pluginStore;
|
|
16
28
|
plugins: string[];
|
|
@@ -21,40 +33,25 @@ declare class HowlerPluginStore {
|
|
|
21
33
|
private _adminMenuItems;
|
|
22
34
|
private _mainMenuOperations;
|
|
23
35
|
private _routes;
|
|
24
|
-
private _sitemaps;
|
|
25
36
|
install(plugin: HowlerPlugin): void;
|
|
26
37
|
addLead(format: string): boolean;
|
|
27
38
|
addPivot(format: string): boolean;
|
|
28
39
|
addUserMenuItem(menuItem: {
|
|
29
40
|
i18nKey: string;
|
|
30
41
|
route: string;
|
|
31
|
-
icon:
|
|
42
|
+
icon: ReactElement;
|
|
32
43
|
}): void;
|
|
33
44
|
addAdminMenuItem(menuItem: {
|
|
34
45
|
i18nKey: string;
|
|
35
46
|
route: string;
|
|
36
|
-
icon:
|
|
37
|
-
}): void;
|
|
38
|
-
addMainMenuItem(menuOperation: {
|
|
39
|
-
operation: string;
|
|
40
|
-
targetId: string;
|
|
41
|
-
item: AppLeftNavElement;
|
|
47
|
+
icon: ReactElement;
|
|
42
48
|
}): void;
|
|
49
|
+
addMainMenuOperation(menuOperation: MainMenuOperation): void;
|
|
43
50
|
addRoute(route: {
|
|
44
51
|
path: string;
|
|
45
|
-
element:
|
|
52
|
+
element: ReactElement;
|
|
46
53
|
children?: [];
|
|
47
54
|
}): void;
|
|
48
|
-
addSitemap(sitemap: {
|
|
49
|
-
path: string;
|
|
50
|
-
title: string;
|
|
51
|
-
icon?: JSX.Element;
|
|
52
|
-
isRoot?: boolean;
|
|
53
|
-
isLeaf?: boolean;
|
|
54
|
-
excluded?: boolean;
|
|
55
|
-
breadcrumbs?: string[];
|
|
56
|
-
textWidth?: number;
|
|
57
|
-
}): void;
|
|
58
55
|
addOperation(format: string): boolean;
|
|
59
56
|
get leadFormats(): string[];
|
|
60
57
|
get pivotFormats(): string[];
|
|
@@ -62,33 +59,19 @@ declare class HowlerPluginStore {
|
|
|
62
59
|
get userMenuItems(): {
|
|
63
60
|
i18nKey: string;
|
|
64
61
|
route: string;
|
|
65
|
-
icon:
|
|
62
|
+
icon: ReactElement;
|
|
66
63
|
}[];
|
|
67
64
|
get adminMenuItems(): {
|
|
68
65
|
i18nKey: string;
|
|
69
66
|
route: string;
|
|
70
|
-
icon:
|
|
71
|
-
}[];
|
|
72
|
-
get mainMenuOperations(): {
|
|
73
|
-
operation: string;
|
|
74
|
-
targetId: string;
|
|
75
|
-
item: AppLeftNavElement;
|
|
67
|
+
icon: ReactElement;
|
|
76
68
|
}[];
|
|
69
|
+
get mainMenuOperations(): readonly MainMenuOperation[];
|
|
77
70
|
get routes(): {
|
|
78
71
|
path: string;
|
|
79
|
-
element:
|
|
72
|
+
element: ReactElement;
|
|
80
73
|
children?: [];
|
|
81
74
|
}[];
|
|
82
|
-
get sitemaps(): {
|
|
83
|
-
path: string;
|
|
84
|
-
title: string;
|
|
85
|
-
icon?: JSX.Element;
|
|
86
|
-
isRoot?: boolean;
|
|
87
|
-
isLeaf?: boolean;
|
|
88
|
-
excluded?: boolean;
|
|
89
|
-
breadcrumbs?: string[];
|
|
90
|
-
textWidth?: number;
|
|
91
|
-
}[];
|
|
92
75
|
get pluginStore(): import("react-pluggable").PluginStore;
|
|
93
76
|
}
|
|
94
77
|
declare const howlerPluginStore: HowlerPluginStore;
|
package/plugins/store.js
CHANGED
|
@@ -6,12 +6,6 @@ export class HitEvent extends Event {
|
|
|
6
6
|
this.hit = hit;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
export var MainMenuInsertOperation;
|
|
10
|
-
(function (MainMenuInsertOperation) {
|
|
11
|
-
MainMenuInsertOperation["Insert"] = "INSERT";
|
|
12
|
-
MainMenuInsertOperation["InsertAfter"] = "AFTER";
|
|
13
|
-
MainMenuInsertOperation["InsertBefore"] = "BEFORE";
|
|
14
|
-
})(MainMenuInsertOperation || (MainMenuInsertOperation = {}));
|
|
15
9
|
class HowlerPluginStore {
|
|
16
10
|
_pluginStore = createPluginStore();
|
|
17
11
|
plugins = [];
|
|
@@ -22,7 +16,6 @@ class HowlerPluginStore {
|
|
|
22
16
|
_adminMenuItems = [];
|
|
23
17
|
_mainMenuOperations = [];
|
|
24
18
|
_routes = [];
|
|
25
|
-
_sitemaps = [];
|
|
26
19
|
install(plugin) {
|
|
27
20
|
if (this.plugins.includes(plugin.name)) {
|
|
28
21
|
return;
|
|
@@ -51,15 +44,12 @@ class HowlerPluginStore {
|
|
|
51
44
|
addAdminMenuItem(menuItem) {
|
|
52
45
|
this._adminMenuItems.push(menuItem);
|
|
53
46
|
}
|
|
54
|
-
|
|
47
|
+
addMainMenuOperation(menuOperation) {
|
|
55
48
|
this._mainMenuOperations.push(menuOperation);
|
|
56
49
|
}
|
|
57
50
|
addRoute(route) {
|
|
58
51
|
this._routes.push(route);
|
|
59
52
|
}
|
|
60
|
-
addSitemap(sitemap) {
|
|
61
|
-
this._sitemaps.push(sitemap);
|
|
62
|
-
}
|
|
63
53
|
addOperation(format) {
|
|
64
54
|
if (this._operations.includes(format)) {
|
|
65
55
|
return false;
|
|
@@ -83,14 +73,11 @@ class HowlerPluginStore {
|
|
|
83
73
|
return this._adminMenuItems;
|
|
84
74
|
}
|
|
85
75
|
get mainMenuOperations() {
|
|
86
|
-
return this._mainMenuOperations;
|
|
76
|
+
return [...this._mainMenuOperations];
|
|
87
77
|
}
|
|
88
78
|
get routes() {
|
|
89
79
|
return this._routes;
|
|
90
80
|
}
|
|
91
|
-
get sitemaps() {
|
|
92
|
-
return this._sitemaps;
|
|
93
|
-
}
|
|
94
81
|
get pluginStore() {
|
|
95
82
|
return this._pluginStore;
|
|
96
83
|
}
|
package/rest/AxiosClient.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AxiosError, create } from 'axios';
|
|
2
2
|
import axiosRetry, { exponentialDelay, isNetworkError } from 'axios-retry';
|
|
3
3
|
import { getAxiosCache, setAxiosCache } from '@cccsaurora/howler-ui/utils/sessionStorage';
|
|
4
4
|
class AxiosCache {
|
|
@@ -23,7 +23,7 @@ export default class AxiosClient {
|
|
|
23
23
|
cache;
|
|
24
24
|
client;
|
|
25
25
|
constructor() {
|
|
26
|
-
this.client =
|
|
26
|
+
this.client = create({
|
|
27
27
|
validateStatus: status => (status >= 200 && status < 300) || status === 304
|
|
28
28
|
});
|
|
29
29
|
this.cache = new AxiosCache(this.client);
|
|
@@ -32,7 +32,7 @@ export default class AxiosClient {
|
|
|
32
32
|
retryCondition: err => {
|
|
33
33
|
return (
|
|
34
34
|
// Don't retry 502s, as we assume the server handles retries in those cases
|
|
35
|
-
isNetworkError(err) || (err?.response?.status >= 500 && err?.response?.status !== 502));
|
|
35
|
+
isNetworkError(err) || ((err?.response?.status ?? 0) >= 500 && err?.response?.status !== 502));
|
|
36
36
|
},
|
|
37
37
|
retryDelay: exponentialDelay
|
|
38
38
|
});
|
package/rest/FetchClient.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import type RestClient from '@cccsaurora/howler-ui/rest';
|
|
|
3
3
|
export default class FetchClient implements RestClient {
|
|
4
4
|
fetch<R>(url: string, method?: 'get' | 'post' | 'put' | 'delete', body?: any, params?: URLSearchParams, headers?: HeadersInit): Promise<[HowlerResponse<R>, number, {
|
|
5
5
|
[index: string]: any;
|
|
6
|
-
}]>;
|
|
6
|
+
}] | undefined>;
|
|
7
7
|
}
|
package/rest/FetchClient.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
export default class FetchClient {
|
|
2
2
|
async fetch(url, method = 'get', body, params, headers) {
|
|
3
3
|
const _url = `${url}${params ? `?${params.toString()}` : ''}`;
|
|
4
|
-
const
|
|
4
|
+
const request = {
|
|
5
5
|
method,
|
|
6
6
|
credentials: 'same-origin',
|
|
7
|
-
headers: headers
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
headers: headers
|
|
8
|
+
};
|
|
9
|
+
if (method !== 'get' && body) {
|
|
10
|
+
request.body = JSON.stringify(body);
|
|
11
|
+
}
|
|
12
|
+
const response = await fetch(_url, request);
|
|
10
13
|
if (response.status === 204) {
|
|
11
|
-
return
|
|
14
|
+
return;
|
|
12
15
|
}
|
|
13
16
|
const json = (await response.json());
|
|
14
17
|
return [json, response.status, response.headers];
|
package/rest/FetchClient.test.js
CHANGED
|
@@ -38,6 +38,9 @@ describe('FetchClient', () => {
|
|
|
38
38
|
const payload = { api_response: { items: [] } };
|
|
39
39
|
mockFetch(200, payload);
|
|
40
40
|
const result = await client.fetch('/api/v1/hit');
|
|
41
|
+
if (!result) {
|
|
42
|
+
throw new Error('Expected a response body.');
|
|
43
|
+
}
|
|
41
44
|
expect(result[0]).toEqual(payload);
|
|
42
45
|
expect(result[1]).toBe(200);
|
|
43
46
|
});
|
|
@@ -47,11 +50,11 @@ describe('FetchClient', () => {
|
|
|
47
50
|
const callArgs = spy.mock.calls[0][1];
|
|
48
51
|
expect(callArgs.body).toBe(JSON.stringify({ key: 'val' }));
|
|
49
52
|
});
|
|
50
|
-
it('
|
|
53
|
+
it('omits the body when no body is provided', async () => {
|
|
51
54
|
const spy = mockFetch(200, {});
|
|
52
55
|
await client.fetch('/api/v1/hit', 'get');
|
|
53
56
|
const callArgs = spy.mock.calls[0][1];
|
|
54
|
-
expect(callArgs.body).
|
|
57
|
+
expect(callArgs.body).toBeUndefined();
|
|
55
58
|
});
|
|
56
59
|
it('forwards custom headers to fetch', async () => {
|
|
57
60
|
const spy = mockFetch(200, {});
|
|
@@ -59,10 +62,10 @@ describe('FetchClient', () => {
|
|
|
59
62
|
const callArgs = spy.mock.calls[0][1];
|
|
60
63
|
expect(callArgs.headers.Authorization).toBe('******');
|
|
61
64
|
});
|
|
62
|
-
it('returns
|
|
65
|
+
it('returns undefined for a 204 No Content response', async () => {
|
|
63
66
|
mockFetch(204, null);
|
|
64
67
|
const result = await client.fetch('/api/v1/hit', 'delete');
|
|
65
|
-
expect(result).
|
|
68
|
+
expect(result).toBeUndefined();
|
|
66
69
|
});
|
|
67
70
|
it('works with a PUT method', async () => {
|
|
68
71
|
const spy = mockFetch(200, {});
|
package/rest/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { HowlerResponse } from '@cccsaurora/howler-ui/api';
|
|
2
|
+
export type RestResponse<R> = [HowlerResponse<R>, number, {
|
|
3
|
+
[index: string]: any;
|
|
4
|
+
}];
|
|
2
5
|
export default interface RestClient {
|
|
3
|
-
fetch<R>(url: string, method: 'get' | 'post' | 'put' | 'delete', body?: any, params?: URLSearchParams, headers?: HeadersInit): Promise<
|
|
4
|
-
[index: string]: any;
|
|
5
|
-
}]>;
|
|
6
|
+
fetch<R>(url: string, method: 'get' | 'post' | 'put' | 'delete', body?: any, params?: URLSearchParams, headers?: HeadersInit): Promise<RestResponse<R> | undefined>;
|
|
6
7
|
}
|
package/setupTests.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
export default class MockLocalStorage {
|
|
2
3
|
constructor() {
|
|
3
4
|
Object.defineProperty(this, 'getItem', {
|
|
4
5
|
enumerable: false,
|
|
5
|
-
value: vi.fn(key => (this[key] !== undefined ? this[key] : null))
|
|
6
|
+
value: vi.fn(key => (this[key] !== undefined && this[key] !== null ? this[key] : null))
|
|
6
7
|
});
|
|
7
8
|
Object.defineProperty(this, 'setItem', {
|
|
8
9
|
enumerable: false,
|
package/tests/mocks.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const setupContextSelectorMock: () => void;
|
|
6
6
|
/**
|
|
7
|
-
* Sets up a mock for react-router
|
|
7
|
+
* Sets up a mock for react-router with common defaults
|
|
8
8
|
* @param options - Override specific router behavior
|
|
9
9
|
*/
|
|
10
10
|
export declare const setupReactRouterMock: () => {
|
|
@@ -15,7 +15,7 @@ export declare const setupReactRouterMock: () => {
|
|
|
15
15
|
search: string;
|
|
16
16
|
};
|
|
17
17
|
mockParams: {
|
|
18
|
-
id:
|
|
18
|
+
id: undefined;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
/**
|
package/tests/mocks.js
CHANGED
|
@@ -22,7 +22,7 @@ export const setupContextSelectorMock = () => {
|
|
|
22
22
|
afterAll(() => vi.resetModules());
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
|
-
* Sets up a mock for react-router
|
|
25
|
+
* Sets up a mock for react-router with common defaults
|
|
26
26
|
* @param options - Override specific router behavior
|
|
27
27
|
*/
|
|
28
28
|
export const setupReactRouterMock = () => {
|
|
@@ -31,8 +31,8 @@ export const setupReactRouterMock = () => {
|
|
|
31
31
|
const mockSearchParams = vi.hoisted(() => new URLSearchParams());
|
|
32
32
|
const mockSetParams = vi.hoisted(() => vi.fn());
|
|
33
33
|
beforeAll(() => {
|
|
34
|
-
vi.mock('react-router
|
|
35
|
-
const actual = await vi.importActual('react-router
|
|
34
|
+
vi.mock('react-router', async () => {
|
|
35
|
+
const actual = await vi.importActual('react-router');
|
|
36
36
|
return {
|
|
37
37
|
...actual,
|
|
38
38
|
Link: forwardRef(({ to, children, ...props }, ref) => (_jsx("a", { ref: ref, href: to, ...props, children: children }))),
|
package/tests/server-handlers.js
CHANGED
|
@@ -92,7 +92,7 @@ const handlers = [
|
|
|
92
92
|
]
|
|
93
93
|
})),
|
|
94
94
|
http.post('/api/v1/search/facet/hit', async ({ request }) => {
|
|
95
|
-
const payload = await request.json();
|
|
95
|
+
const payload = (await request.json());
|
|
96
96
|
let facetResponse = Object.fromEntries(payload.fields.map(field => [field, { 'facet 1': 1, 'facet 2': 2 }]));
|
|
97
97
|
if (payload.filters?.[0]?.includes('analytic')) {
|
|
98
98
|
facetResponse = Object.fromEntries(payload.fields.map(field => [field, { 'Analytic 1': 1, 'Analytic 2': 2 }]));
|
package/utils/Throttler.js
CHANGED
package/utils/actionUtils.d.ts
CHANGED
|
@@ -28,4 +28,4 @@ export declare const getArgsByContext: (args: ActionOperationStep['args'], value
|
|
|
28
28
|
* @param action The action to validate
|
|
29
29
|
* @returns whether the action is ready to execute
|
|
30
30
|
*/
|
|
31
|
-
export declare const operationReady: (data
|
|
31
|
+
export declare const operationReady: (data?: Operation['data_json'], action?: ActionOperation) => boolean;
|