@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
|
@@ -5,9 +5,13 @@ import i18n from '@cccsaurora/howler-ui/i18n';
|
|
|
5
5
|
import { I18nextProvider } from 'react-i18next';
|
|
6
6
|
import { describe, expect, it, vi } from 'vitest';
|
|
7
7
|
import ErrorOccured from './ErrorOccured';
|
|
8
|
-
vi.mock('
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
vi.mock('@tui/core', async () => {
|
|
9
|
+
const actual = await vi.importActual('@tui/core');
|
|
10
|
+
return {
|
|
11
|
+
...actual,
|
|
12
|
+
PageCenter: ({ children }) => _jsx("div", { id: "page-center", children: children })
|
|
13
|
+
};
|
|
14
|
+
});
|
|
11
15
|
const mockExecuteFunction = vi.fn(() => null);
|
|
12
16
|
vi.mock('react-pluggable', () => ({
|
|
13
17
|
usePluginStore: () => ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Container, Stack, Typography, styled } from '@mui/material';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { PageCardCentered, useAppLayout } from '@tui/core';
|
|
4
|
+
import { AppBrand } from '@cccsaurora/howler-ui/branding/AppBrand';
|
|
5
5
|
import useMyLocalStorage from '@cccsaurora/howler-ui/components/hooks/useMyLocalStorage';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
const LogWrap = styled('div')(() => ({
|
|
@@ -22,7 +22,6 @@ const InjectCss = styled(Stack)(({ theme }) => ({
|
|
|
22
22
|
}));
|
|
23
23
|
const Logout = () => {
|
|
24
24
|
const { t } = useTranslation();
|
|
25
|
-
const banner = useAppBanner();
|
|
26
25
|
const layout = useAppLayout();
|
|
27
26
|
const localStorage = useMyLocalStorage();
|
|
28
27
|
// hide topnav and leftnav on logout.
|
|
@@ -32,6 +31,6 @@ const Logout = () => {
|
|
|
32
31
|
localStorage.clear();
|
|
33
32
|
window.location.replace('/');
|
|
34
33
|
}, 2000);
|
|
35
|
-
return (_jsx(Container, { component: "main", maxWidth: "xs", children: _jsx(InjectCss, { direction: "column", alignItems: "center", children: _jsx(PageCardCentered, { children: _jsxs(LogWrap, { children: [banner, _jsx(Box, { m: 2 }), _jsx(Typography, { children: t('page.logout') })] }) }) }) }));
|
|
34
|
+
return (_jsx(Container, { component: "main", maxWidth: "xs", children: _jsx(InjectCss, { direction: "column", alignItems: "center", children: _jsx(PageCardCentered, { children: _jsxs(LogWrap, { children: [_jsx(AppBrand, { application: "howler", variant: "banner-vertical", size: "large" }), _jsx(Box, { m: 2 }), _jsx(Typography, { children: t('page.logout') })] }) }) }) }));
|
|
36
35
|
};
|
|
37
36
|
export default Logout;
|
|
@@ -7,20 +7,21 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
|
7
7
|
import Logout from './Logout';
|
|
8
8
|
const mockHideMenus = vi.fn();
|
|
9
9
|
const mockClear = vi.fn();
|
|
10
|
-
vi.mock('
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
vi.mock('@tui/core', async () => {
|
|
11
|
+
const actual = await vi.importActual('@tui/core');
|
|
12
|
+
return {
|
|
13
|
+
...actual,
|
|
14
|
+
useAppLayout: () => ({
|
|
15
|
+
hideMenus: mockHideMenus
|
|
16
|
+
}),
|
|
17
|
+
PageCardCentered: ({ children }) => _jsx("div", { children: children })
|
|
18
|
+
};
|
|
19
|
+
});
|
|
16
20
|
vi.mock('components/hooks/useMyLocalStorage', () => ({
|
|
17
21
|
default: () => ({
|
|
18
22
|
clear: mockClear
|
|
19
23
|
})
|
|
20
24
|
}));
|
|
21
|
-
vi.mock('commons/components/pages/PageCardCentered', () => ({
|
|
22
|
-
default: ({ children }) => _jsx("div", { children: children })
|
|
23
|
-
}));
|
|
24
25
|
const Wrapper = ({ children }) => (_jsx(I18nextProvider, { i18n: i18n, children: children }));
|
|
25
26
|
describe('Logout', () => {
|
|
26
27
|
const originalLocation = window.location;
|
|
@@ -41,9 +42,9 @@ describe('Logout', () => {
|
|
|
41
42
|
render(_jsx(Logout, {}), { wrapper: Wrapper });
|
|
42
43
|
expect(screen.getByText(/Logging out current user/)).toBeInTheDocument();
|
|
43
44
|
});
|
|
44
|
-
it('should render the
|
|
45
|
+
it('should render the application brand', () => {
|
|
45
46
|
render(_jsx(Logout, {}), { wrapper: Wrapper });
|
|
46
|
-
expect(screen.
|
|
47
|
+
expect(screen.getByAltText('howler logo')).toBeInTheDocument();
|
|
47
48
|
});
|
|
48
49
|
it('should hide menus on mount', () => {
|
|
49
50
|
render(_jsx(Logout, {}), { wrapper: Wrapper });
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Add, PlayCircleOutline, Save } from '@mui/icons-material';
|
|
3
3
|
import { Button, Card, CardContent, Checkbox, CircularProgress, FormControlLabel, FormGroup, IconButton, LinearProgress, Stack, TextField, Tooltip, Typography } from '@mui/material';
|
|
4
|
+
import { PageCenter, useAppUser } from '@tui/core';
|
|
4
5
|
import api from '@cccsaurora/howler-ui/api';
|
|
5
|
-
import { useAppUser } from '@cccsaurora/howler-ui/commons/components/app/hooks';
|
|
6
|
-
import PageCenter from '@cccsaurora/howler-ui/commons/components/pages/PageCenter';
|
|
7
6
|
import { FieldContext } from '@cccsaurora/howler-ui/components/app/providers/FieldProvider';
|
|
8
7
|
import SocketBadge from '@cccsaurora/howler-ui/components/elements/display/icons/SocketBadge';
|
|
9
8
|
import useMyApi from '@cccsaurora/howler-ui/components/hooks/useMyApi';
|
|
@@ -13,7 +12,7 @@ import howlerPluginStore from '@cccsaurora/howler-ui/plugins/store';
|
|
|
13
12
|
import { useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
14
13
|
import { useTranslation } from 'react-i18next';
|
|
15
14
|
import { usePluginStore } from 'react-pluggable';
|
|
16
|
-
import { useLocation, useParams, useSearchParams } from 'react-router
|
|
15
|
+
import { useLocation, useParams, useSearchParams } from 'react-router';
|
|
17
16
|
import { operationReady } from '@cccsaurora/howler-ui/utils/actionUtils';
|
|
18
17
|
import QueryResultText from '../../../elements/display/QueryResultText';
|
|
19
18
|
import ActionReportDisplay from '../shared/ActionReportDisplay';
|
|
@@ -33,15 +32,17 @@ const ActionEditor = () => {
|
|
|
33
32
|
const [name, setName] = useState('');
|
|
34
33
|
const [userOperations, setUserOperations] = useState([]);
|
|
35
34
|
const [triggers, setTriggers] = useState([]);
|
|
35
|
+
const canManageTriggers = (user.roles ?? []).includes('automation_advanced');
|
|
36
36
|
const availableOperations = useMemo(() => operations.filter(o => !userOperations.some(uo => uo.operation_id === o.id)), [operations, userOperations]);
|
|
37
|
+
const userOperationsReady = useMemo(() => userOperations.every(userOperation => operationReady(userOperation?.data_json, operations.find(candidate => candidate.id === userOperation.operation_id))), [operations, userOperations]);
|
|
37
38
|
const onActionChange = useCallback((index) => (a) => {
|
|
38
39
|
setUserOperations(_userActions => {
|
|
39
40
|
_userActions.splice(index, 1, a);
|
|
40
41
|
return [..._userActions];
|
|
41
42
|
});
|
|
42
43
|
const newOperation = operations.find(op => op.id === a.operation_id);
|
|
43
|
-
setTriggers(
|
|
44
|
-
}, [operations
|
|
44
|
+
setTriggers(currentTriggers => newOperation ? currentTriggers.filter(trigger => newOperation.triggers.includes(trigger)) : []);
|
|
45
|
+
}, [operations]);
|
|
45
46
|
const onActionDelete = useCallback((index) => () => setUserOperations(_userActions => _userActions.filter((__, _index) => _index !== index)), []);
|
|
46
47
|
const _submitAction = useCallback(() => submitAction(responseQuery, userOperations), [responseQuery, submitAction, userOperations]);
|
|
47
48
|
const onTriggerChange = useCallback(async (e) => {
|
|
@@ -54,7 +55,7 @@ const ActionEditor = () => {
|
|
|
54
55
|
}, [triggers]);
|
|
55
56
|
useEffect(() => {
|
|
56
57
|
void dispatchApi(api.action.operations.get())
|
|
57
|
-
.then(_operations => _operations.filter(a => difference(a.roles, user.roles).length < a.roles.length))
|
|
58
|
+
.then(_operations => (_operations ?? []).filter(a => difference(a.roles, user.roles ?? []).length < a.roles.length))
|
|
58
59
|
.then(setOperations);
|
|
59
60
|
if (responseQuery) {
|
|
60
61
|
void onSearch(responseQuery);
|
|
@@ -79,30 +80,32 @@ const ActionEditor = () => {
|
|
|
79
80
|
return;
|
|
80
81
|
}
|
|
81
82
|
const existingAction = result.items[0];
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
if (!existingAction) {
|
|
84
|
+
setLoading(false);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const query = existingAction.query ?? '';
|
|
88
|
+
setName(existingAction.name ?? '');
|
|
89
|
+
searchParams.set('query', query);
|
|
84
90
|
setSearchParams(new URLSearchParams(searchParams), { replace: true });
|
|
85
|
-
setUserOperations(existingAction.operations);
|
|
91
|
+
setUserOperations(existingAction.operations ?? []);
|
|
86
92
|
setLoading(false);
|
|
87
|
-
void onSearch(
|
|
93
|
+
void onSearch(query);
|
|
88
94
|
});
|
|
89
95
|
}
|
|
90
96
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
91
97
|
}, [dispatchApi, params.id]);
|
|
92
|
-
return (_jsxs(PageCenter, { maxWidth: "1500px", textAlign: "left", height: "100%", children: [_jsxs(Stack, { spacing: 1, children: [_jsxs(Stack, { direction: "row", spacing: 1, children: [_jsx(TextField, { label: t('route.actions.name'), size: "small", disabled: loading, value: name, onChange: e => setName(e.target.value), fullWidth: true }), _jsx(Button, { variant: "outlined", size: "small", startIcon: loading ? _jsx(CircularProgress, { size: 16 }) : _jsx(Save, {}), sx: { minWidth: '150px' }, disabled: !name ||
|
|
93
|
-
|
|
94
|
-
userOperations.length < 1 ||
|
|
95
|
-
userOperations.some(a => !operationReady(a?.data_json, operations.find(_a => _a.id === a.operation_id))), onClick: () => saveAction(name, responseQuery, userOperations, triggers), children: t('route.actions.save') })] }), _jsx(FormGroup, { children: _jsx(Stack, { direction: "row", spacing: 1, ml: -1, mr: -1, children: uniq(operations.flatMap(op => op.triggers)).map(trigger => {
|
|
96
|
-
const disabled = !user.roles.includes('automation_advanced') ||
|
|
98
|
+
return (_jsxs(PageCenter, { maxWidth: "1500px", textAlign: "left", height: "100%", children: [_jsxs(Stack, { spacing: 1, children: [_jsxs(Stack, { direction: "row", spacing: 1, children: [_jsx(TextField, { label: t('route.actions.name'), size: "small", disabled: loading, value: name, onChange: e => setName(e.target.value), fullWidth: true }), _jsx(Button, { variant: "outlined", size: "small", startIcon: loading ? _jsx(CircularProgress, { size: 16 }) : _jsx(Save, {}), sx: { minWidth: '150px' }, disabled: !name || loading || userOperations.length < 1 || !userOperationsReady, onClick: () => saveAction(name, responseQuery, userOperations, triggers), children: t('route.actions.save') })] }), _jsx(FormGroup, { children: _jsx(Stack, { direction: "row", spacing: 1, ml: -1, mr: -1, children: uniq(operations.flatMap(op => op.triggers)).map(trigger => {
|
|
99
|
+
const disabled = !canManageTriggers ||
|
|
97
100
|
userOperations.length < 1 ||
|
|
98
101
|
!userOperations.every(userOperation => operations.find(operation => operation.id === userOperation.operation_id)?.triggers.includes(trigger));
|
|
99
102
|
const component = (_jsx(FormControlLabel, { disabled: disabled, control: _jsx(Checkbox, { sx: { mr: 0.5 }, name: trigger, onChange: onTriggerChange, checked: triggers?.includes(trigger) ?? false }), label: t(`route.actions.trigger.${trigger}`) }, trigger));
|
|
100
|
-
return (_jsx(Tooltip, { title: !
|
|
103
|
+
return (_jsx(Tooltip, { title: !canManageTriggers
|
|
101
104
|
? t('route.actions.trigger.disabled.permissions')
|
|
102
105
|
: disabled && userOperations.length > 0
|
|
103
106
|
? t('route.actions.trigger.disabled.explanation')
|
|
104
107
|
: null, children: component }, trigger));
|
|
105
|
-
}) }) }), _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "end", sx: { mb: -1 }, children: [_jsx(Typography, { sx: theme => ({ color: theme.palette.text.disabled, fontStyle: 'italic', mb: 0.5 }), variant: "body2", children: t('hit.search.prompt') }), _jsx(SocketBadge, { size: "small" })] }), _jsx(RecordQuery, { triggerSearch: onSearch }), response ? (_jsx(QueryResultText, { count: response.total, query: responseQuery })) : (_jsx(Typography, { sx: theme => ({
|
|
108
|
+
}) }) }), _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "end", sx: { mb: -1 }, children: [_jsx(Typography, { sx: theme => ({ color: theme.palette.text.disabled, fontStyle: 'italic', mb: 0.5 }), variant: "body2", children: t('hit.search.prompt') }), _jsx(SocketBadge, { size: "small" })] }), _jsx(RecordQuery, { triggerSearch: onSearch }), response ? (_jsx(QueryResultText, { count: response.total ?? 0, query: responseQuery })) : (_jsx(Typography, { sx: theme => ({
|
|
106
109
|
color: theme.palette.text.secondary,
|
|
107
110
|
fontSize: '0.9em',
|
|
108
111
|
fontStyle: 'italic',
|
|
@@ -111,8 +114,11 @@ const ActionEditor = () => {
|
|
|
111
114
|
}), variant: "body2", children: t('route.actions.search.warning') })), loading &&
|
|
112
115
|
(progress[1] > 0 ? (_jsx(LinearProgress, { variant: "determinate", value: (progress[0] / progress[1]) * 100, valueBuffer: ((progress[0] + 10) / progress[1]) * 100 })) : (_jsx(LinearProgress, {}))), report && _jsx(ActionReportDisplay, { report: report, operations: operations })] }), operations.length > 0 && (_jsxs(Stack, { spacing: 1, mt: 1, children: [userOperations.map((a, index) => {
|
|
113
116
|
const operation = operations.find(_operation => _operation.id === a.operation_id);
|
|
114
|
-
if (
|
|
115
|
-
return
|
|
117
|
+
if (!operation) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
if (howlerPluginStore.operations.includes(operation.id)) {
|
|
121
|
+
return pluginStore.executeFunction(`operation.${operation.id}`, {
|
|
116
122
|
operation,
|
|
117
123
|
operations: [operation, ...availableOperations],
|
|
118
124
|
query: responseQuery,
|
|
@@ -121,17 +127,19 @@ const ActionEditor = () => {
|
|
|
121
127
|
values: a.data_json
|
|
122
128
|
});
|
|
123
129
|
}
|
|
124
|
-
return (_jsx(OperationEntry, { query: responseQuery, operation: operation, operations: [operation, ...availableOperations], values: a.data_json, onChange: onActionChange(index), onDelete: onActionDelete(index) },
|
|
125
|
-
}), userOperations.length < operations.length && (_jsx(Card, { variant: "outlined", sx: { flex: 1 }, children: _jsx(CardContent, { sx: { paddingBottom: '16px !important' }, children: _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [_jsx(Typography, { variant: "body1", color: !response
|
|
126
|
-
|
|
127
|
-
{
|
|
128
|
-
|
|
129
|
-
data_json: '{}'
|
|
130
|
+
return (_jsx(OperationEntry, { query: responseQuery, operation: operation, operations: [operation, ...availableOperations], values: a.data_json, onChange: onActionChange(index), onDelete: onActionDelete(index) }, operation.id));
|
|
131
|
+
}), userOperations.length < operations.length && (_jsx(Card, { variant: "outlined", sx: { flex: 1 }, children: _jsx(CardContent, { sx: { paddingBottom: '16px !important' }, children: _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [_jsx(Typography, { variant: "body1", color: !response ? 'text.secondary' : undefined, children: t('route.actions.operation.add') }), _jsx(IconButton, { size: "small", disabled: !response, onClick: () => {
|
|
132
|
+
const nextOperation = operations.find(operation => !userOperations.some(userOperation => userOperation.operation_id === operation.id));
|
|
133
|
+
if (!nextOperation) {
|
|
134
|
+
return;
|
|
130
135
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
+
setUserOperations(currentUserOperations => [
|
|
137
|
+
...currentUserOperations,
|
|
138
|
+
{
|
|
139
|
+
operation_id: nextOperation.id,
|
|
140
|
+
data_json: '{}'
|
|
141
|
+
}
|
|
142
|
+
]);
|
|
143
|
+
}, children: _jsx(Add, {}) })] }) }) })), operations.length > 0 && !location.pathname.endsWith('/edit') && (_jsx(Button, { variant: "outlined", color: "success", sx: { alignSelf: 'start' }, startIcon: loading ? _jsx(CircularProgress, { size: 16 }) : _jsx(PlayCircleOutline, {}), disabled: !responseQuery || !response || loading || userOperations.length < 1 || !userOperationsReady, onClick: _submitAction, children: t('route.actions.execute') }))] }))] }));
|
|
136
144
|
};
|
|
137
145
|
export default ActionEditor;
|
|
@@ -3,7 +3,7 @@ import { ErrorOutline, ExpandMore, InfoOutlined, TaskAltOutlined } from '@mui/ic
|
|
|
3
3
|
import { Accordion, AccordionDetails, AccordionSummary, Alert, AlertTitle, Divider, Stack, Typography } from '@mui/material';
|
|
4
4
|
import Markdown from '@cccsaurora/howler-ui/components/elements/display/Markdown';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { Link } from 'react-router
|
|
6
|
+
import { Link } from 'react-router';
|
|
7
7
|
const ActionReportDisplay = ({ report, operations }) => {
|
|
8
8
|
const { t } = useTranslation();
|
|
9
9
|
return (_jsxs(Stack, { spacing: 1, children: [_jsxs(Accordion, { variant: "outlined", defaultExpanded: true, children: [_jsx(AccordionSummary, { expandIcon: _jsx(ExpandMore, {}), children: _jsx(Typography, { children: t('route.actions.report') }) }), _jsx(AccordionDetails, { children: Object.entries(report).map(([operationId, _reports]) => {
|
|
@@ -22,8 +22,8 @@ const OperationEntry = ({ operation, operations, onChange, onDelete, query, read
|
|
|
22
22
|
.map(_operation => (_jsx(MenuItem, { value: _operation?.id, children: _jsx(ListItemText, { primary: _operation.i18nKey ? t(_operation.i18nKey) : _operation.title, secondary: _operation.description?.short }) }, _operation?.id))) }), operation.triggers.map(_trigger => (_jsx(Chip, { size: "small", label: t(`route.actions.trigger.${_trigger}`), sx: { alignSelf: 'start' } }, _trigger)))] }), _jsx(Divider, { flexItem: true, orientation: "vertical" }), _jsx(Box, { flex: 1, sx: { '& pre': { whiteSpace: 'normal' } }, children: _jsx(Markdown, { md: operation.description?.long }) }), !readonly && (_jsxs(_Fragment, { children: [_jsx(Divider, { flexItem: true, orientation: "vertical" }), _jsx(IconButton, { onClick: onDelete, children: _jsx(Delete, {}) })] }))] }), _jsx(Divider, { orientation: "horizontal" }), operation.steps
|
|
23
23
|
.filter((_, index, arr) => (index > 0 ? checkArgsAreFilled(arr[index - 1], values) : true))
|
|
24
24
|
.map(step => {
|
|
25
|
-
return (_jsx(OperationStep, { readonly: readonly, step: step, query: query, values: values, setValues: _values => onChange({
|
|
26
|
-
operation_id: operation
|
|
25
|
+
return (_jsx(OperationStep, { readonly: readonly, step: step, query: query, values: values, setValues: _values => onChange?.({
|
|
26
|
+
operation_id: operation.id,
|
|
27
27
|
data_json: _values
|
|
28
28
|
}) }, Object.keys(step.args).join('')));
|
|
29
29
|
})] }) }) }, operation?.id)) : null;
|
|
@@ -5,7 +5,7 @@ import useMyApi from '@cccsaurora/howler-ui/components/hooks/useMyApi';
|
|
|
5
5
|
import { capitalize } from 'lodash-es';
|
|
6
6
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
|
-
import { Link } from 'react-router
|
|
8
|
+
import { Link } from 'react-router';
|
|
9
9
|
import { checkArgsAreFilled, getArgsByContext, getOptionsByContext } from '@cccsaurora/howler-ui/utils/actionUtils';
|
|
10
10
|
import { sanitizeLuceneQuery } from '@cccsaurora/howler-ui/utils/stringUtils';
|
|
11
11
|
import Throttler from '@cccsaurora/howler-ui/utils/Throttler';
|
|
@@ -14,16 +14,16 @@ const OperationStep = ({ step, query, values, setValues, readonly, loading }) =>
|
|
|
14
14
|
const { t } = useTranslation();
|
|
15
15
|
const { dispatchApi } = useMyApi();
|
|
16
16
|
const [validating, setValidating] = useState(false);
|
|
17
|
-
const [warnResponse, setWarnResponse] = useState(
|
|
18
|
-
const [errorResponse, setErrorResponse] = useState(
|
|
17
|
+
const [warnResponse, setWarnResponse] = useState();
|
|
18
|
+
const [errorResponse, setErrorResponse] = useState();
|
|
19
19
|
const filled = useMemo(() => checkArgsAreFilled(step, values), [step, values]);
|
|
20
|
-
const validationStatus =
|
|
20
|
+
const validationStatus = errorResponse?.total
|
|
21
21
|
? 'error'
|
|
22
|
-
: warnResponse?.total
|
|
22
|
+
: warnResponse?.total
|
|
23
23
|
? 'warning'
|
|
24
24
|
: errorResponse || warnResponse
|
|
25
25
|
? 'success'
|
|
26
|
-
: null
|
|
26
|
+
: null;
|
|
27
27
|
const args = useMemo(() => getArgsByContext(step.args, values), [step.args, values]);
|
|
28
28
|
const parsedValues = useMemo(() => JSON.parse(values), [values]);
|
|
29
29
|
/**
|
|
@@ -78,10 +78,10 @@ const OperationStep = ({ step, query, values, setValues, readonly, loading }) =>
|
|
|
78
78
|
return (_jsx(Autocomplete, { disablePortal: true, options: opts, disabled: readonly || loading, value: parsedValues?.[arg] || '', renderInput: params => (_jsx(TextField, { ...params, InputProps: {
|
|
79
79
|
...params.InputProps,
|
|
80
80
|
startAdornment: loading && (_jsx(InputAdornment, { position: "start", children: _jsx(CircularProgress, { size: 24 }) }))
|
|
81
|
-
}, label: getLabel(arg) })), onChange: (_, value) => setValues(JSON.stringify({ ...parsedValues, [arg]: value })) }, arg));
|
|
81
|
+
}, label: getLabel(arg) })), onChange: (_, value) => setValues?.(JSON.stringify({ ...parsedValues, [arg]: value })) }, arg));
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
84
|
-
return (_jsx(TextField, { disabled: readonly, value: parsedValues?.[arg] || '', onChange: e => setValues(JSON.stringify({ ...parsedValues, [arg]: e.target.value })), label: getLabel(arg) }, arg));
|
|
84
|
+
return (_jsx(TextField, { disabled: readonly, value: parsedValues?.[arg] || '', onChange: e => setValues?.(JSON.stringify({ ...parsedValues, [arg]: e.target.value })), label: getLabel(arg) }, arg));
|
|
85
85
|
}
|
|
86
86
|
}), filled && (_jsxs(_Fragment, { children: [validating && _jsx(LinearProgress, {}), validationStatus && (_jsxs(Alert, { variant: "outlined", severity: validationStatus, sx: {
|
|
87
87
|
'& > code': { fontSize: '0.9em' },
|
|
@@ -94,9 +94,11 @@ const OperationStep = ({ step, query, values, setValues, readonly, loading }) =>
|
|
|
94
94
|
}
|
|
95
95
|
}, children: [_jsx(AlertTitle, { children: t((validationStatus === 'error' ? step.validation.error?.message : step.validation.warn?.message) ??
|
|
96
96
|
`route.actions.alert.${validationStatus}`, {
|
|
97
|
-
count: validationStatus === 'error' ? errorResponse.total : warnResponse?.total
|
|
97
|
+
count: validationStatus === 'error' ? (errorResponse.total ?? 0) : warnResponse?.total
|
|
98
98
|
}) }), validationStatus !== 'success' && (_jsx(Link, { to: `/hits?query=${encodeURIComponent(errorResponse?.total
|
|
99
99
|
? substitute(step.validation.error.query)
|
|
100
|
-
: warnResponse?.total
|
|
100
|
+
: warnResponse?.total
|
|
101
|
+
? substitute(step.validation.warn.query)
|
|
102
|
+
: '')}`, children: errorResponse?.total ? (_jsx("code", { children: substitute(step.validation.error.query) })) : (warnResponse?.total && _jsx("code", { children: substitute(step.validation.warn.query) })) }))] }))] }))] }));
|
|
101
103
|
};
|
|
102
104
|
export default OperationStep;
|
|
@@ -5,10 +5,10 @@ import type { Operation } from '@cccsaurora/howler-ui/models/entities/generated/
|
|
|
5
5
|
declare const useMyActionFunctions: () => {
|
|
6
6
|
loading: boolean;
|
|
7
7
|
setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
8
|
-
response: HowlerSearchResponse<Hit
|
|
9
|
-
setResponse: import("react").Dispatch<import("react").SetStateAction<HowlerSearchResponse<Hit
|
|
8
|
+
response: HowlerSearchResponse<Hit> | undefined;
|
|
9
|
+
setResponse: import("react").Dispatch<import("react").SetStateAction<HowlerSearchResponse<Hit> | undefined>>;
|
|
10
10
|
responseQuery: string;
|
|
11
|
-
report: ActionReport;
|
|
11
|
+
report: ActionReport | undefined;
|
|
12
12
|
progress: [number, number];
|
|
13
13
|
onSearch: (query: string) => Promise<void>;
|
|
14
14
|
saveAction: (name: string, query: string, operations: Operation[], triggers: string[]) => Promise<void>;
|
|
@@ -8,7 +8,7 @@ import useMySnackbar from '@cccsaurora/howler-ui/components/hooks/useMySnackbar'
|
|
|
8
8
|
import { useSnackbar } from 'notistack';
|
|
9
9
|
import { useCallback, useContext, useEffect, useState } from 'react';
|
|
10
10
|
import { Trans, useTranslation } from 'react-i18next';
|
|
11
|
-
import { useLocation, useNavigate, useParams } from 'react-router
|
|
11
|
+
import { useLocation, useNavigate, useParams } from 'react-router';
|
|
12
12
|
import { v4 as uuid } from 'uuid';
|
|
13
13
|
const useMyActionFunctions = () => {
|
|
14
14
|
const { t } = useTranslation();
|
|
@@ -20,10 +20,10 @@ const useMyActionFunctions = () => {
|
|
|
20
20
|
const params = useParams();
|
|
21
21
|
const { addListener, removeListener } = useContext(SocketContext);
|
|
22
22
|
const [loading, setLoading] = useState(false);
|
|
23
|
-
const [response, setResponse] = useState(
|
|
23
|
+
const [response, setResponse] = useState();
|
|
24
24
|
const [responseQuery, setResponseQuery] = useState('');
|
|
25
25
|
const [progress, setProgress] = useState([0, 0]);
|
|
26
|
-
const [requestId, setRequestId] = useState(
|
|
26
|
+
const [requestId, setRequestId] = useState();
|
|
27
27
|
const [report, setReport] = useState();
|
|
28
28
|
const handler = useCallback((data) => {
|
|
29
29
|
if (data.type === 'action' && data.request_id === requestId) {
|
|
@@ -67,7 +67,7 @@ const useMyActionFunctions = () => {
|
|
|
67
67
|
operations
|
|
68
68
|
}), { showError: true, throwError: false });
|
|
69
69
|
if (result) {
|
|
70
|
-
navigate(`/action/${params.id}`);
|
|
70
|
+
void navigate(`/action/${params.id}`);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
else {
|
|
@@ -79,7 +79,7 @@ const useMyActionFunctions = () => {
|
|
|
79
79
|
triggers
|
|
80
80
|
}), { showError: true, throwError: false });
|
|
81
81
|
if (newAction) {
|
|
82
|
-
navigate(`/action/${newAction.action_id}`);
|
|
82
|
+
void navigate(`/action/${newAction.action_id}`);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -95,7 +95,7 @@ const useMyActionFunctions = () => {
|
|
|
95
95
|
setLoading(true);
|
|
96
96
|
const reqId = uuid();
|
|
97
97
|
setRequestId(reqId);
|
|
98
|
-
setReport(
|
|
98
|
+
setReport(undefined);
|
|
99
99
|
try {
|
|
100
100
|
setReport(await dispatchApi(api.action.execute.post({
|
|
101
101
|
request_id: reqId,
|
|
@@ -105,7 +105,7 @@ const useMyActionFunctions = () => {
|
|
|
105
105
|
}
|
|
106
106
|
finally {
|
|
107
107
|
setLoading(false);
|
|
108
|
-
setRequestId(
|
|
108
|
+
setRequestId(undefined);
|
|
109
109
|
setProgress([0, 0]);
|
|
110
110
|
void onSearch(query);
|
|
111
111
|
}
|
|
@@ -114,11 +114,12 @@ const useMyActionFunctions = () => {
|
|
|
114
114
|
setLoading(true);
|
|
115
115
|
const reqId = uuid();
|
|
116
116
|
setRequestId(reqId);
|
|
117
|
-
setReport(
|
|
117
|
+
setReport(undefined);
|
|
118
118
|
let key = null;
|
|
119
119
|
try {
|
|
120
|
-
const
|
|
121
|
-
|
|
120
|
+
const actionResponse = await api.search.action.post({ query: `action_id:${actionId}`, rows: 1 });
|
|
121
|
+
const actionName = actionResponse?.items[0]?.name ?? t('unknown');
|
|
122
|
+
key = showInfoMessage(_jsxs(Stack, { spacing: 1, width: "100%", mb: -2, pb: 1, children: [_jsxs(Stack, { direction: "row", spacing: 1, px: "20px", pt: "6px", pb: "2px", children: [_jsx(Terminal, { fontSize: "small", sx: { mr: 2 } }), _jsx("span", { children: _jsx(Trans, { i18nKey: "actions.running", values: { action: actionName } }) })] }), _jsx(LinearProgress, { color: "inherit", sx: theme => ({ borderRadius: theme.shape.borderRadius }) })] }), 0, {
|
|
122
123
|
persist: true,
|
|
123
124
|
hideIconVariant: true,
|
|
124
125
|
style: { padding: 0, display: 'flex', flexDirection: 'column', alignItems: 'stretch' }
|
|
@@ -129,7 +130,6 @@ const useMyActionFunctions = () => {
|
|
|
129
130
|
action_id: actionId
|
|
130
131
|
}), { throwError: false, showError: false });
|
|
131
132
|
setReport(result);
|
|
132
|
-
const actionName = (await action).items[0]?.name || t('unknown');
|
|
133
133
|
if (!result) {
|
|
134
134
|
showErrorMessage(_jsx(Trans, { i18nKey: "actions.error", values: { action: actionName, message: t('unknown') } }));
|
|
135
135
|
return;
|
|
@@ -156,7 +156,7 @@ const useMyActionFunctions = () => {
|
|
|
156
156
|
closeSnackbar(key);
|
|
157
157
|
}
|
|
158
158
|
setLoading(false);
|
|
159
|
-
setRequestId(
|
|
159
|
+
setRequestId(undefined);
|
|
160
160
|
setProgress([0, 0]);
|
|
161
161
|
}
|
|
162
162
|
}, [closeSnackbar, dispatchApi, showInfoMessage, showSuccessMessage, showErrorMessage, t]),
|
|
@@ -168,7 +168,7 @@ const useMyActionFunctions = () => {
|
|
|
168
168
|
throwError: true
|
|
169
169
|
});
|
|
170
170
|
if (detailedActionView) {
|
|
171
|
-
navigate('/action');
|
|
171
|
+
void navigate('/action');
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
finally {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const ActionDetails: () => import("react
|
|
1
|
+
declare const ActionDetails: () => import("react").JSX.Element;
|
|
2
2
|
export default ActionDetails;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Delete, Edit, PlayCircleOutline, Search } from '@mui/icons-material';
|
|
3
3
|
import { Button, Checkbox, FormControlLabel, FormGroup, IconButton, LinearProgress, Stack, Typography } from '@mui/material';
|
|
4
|
+
import { PageCenter, useAppUser } from '@tui/core';
|
|
4
5
|
import api from '@cccsaurora/howler-ui/api';
|
|
5
|
-
import { useAppUser } from '@cccsaurora/howler-ui/commons/components/app/hooks';
|
|
6
|
-
import PageCenter from '@cccsaurora/howler-ui/commons/components/pages/PageCenter';
|
|
7
6
|
import { ModalContext } from '@cccsaurora/howler-ui/components/app/providers/ModalProvider';
|
|
8
7
|
import FlexOne from '@cccsaurora/howler-ui/components/elements/addons/layout/FlexOne';
|
|
9
8
|
import Phrase from '@cccsaurora/howler-ui/components/elements/addons/search/phrase/Phrase';
|
|
10
9
|
import HowlerAvatar from '@cccsaurora/howler-ui/components/elements/display/HowlerAvatar';
|
|
10
|
+
import { MembershipManagement } from '@cccsaurora/howler-ui/components/elements/membership/MembershipManagement';
|
|
11
11
|
import useMyApi from '@cccsaurora/howler-ui/components/hooks/useMyApi';
|
|
12
12
|
import useMySnackbar from '@cccsaurora/howler-ui/components/hooks/useMySnackbar';
|
|
13
13
|
import OperationEntry from '@cccsaurora/howler-ui/components/routes/action/shared/OperationEntry';
|
|
@@ -15,7 +15,7 @@ import howlerPluginStore from '@cccsaurora/howler-ui/plugins/store';
|
|
|
15
15
|
import { useCallback, useContext, useEffect, useState } from 'react';
|
|
16
16
|
import { useTranslation } from 'react-i18next';
|
|
17
17
|
import { usePluginStore } from 'react-pluggable';
|
|
18
|
-
import { Link, useParams } from 'react-router
|
|
18
|
+
import { Link, useParams } from 'react-router';
|
|
19
19
|
import QueryResultText from '../../../elements/display/QueryResultText';
|
|
20
20
|
import ActionReportDisplay from '../shared/ActionReportDisplay';
|
|
21
21
|
import useMyActionFunctions from '../useMyActionFunctions';
|
|
@@ -31,63 +31,83 @@ const ActionDetails = () => {
|
|
|
31
31
|
const { withConfirmDeleteModal } = useContext(ModalContext);
|
|
32
32
|
const { showSuccessMessage } = useMySnackbar();
|
|
33
33
|
const onTriggerChange = useCallback(async (e) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
newTriggers.push(e.target.name);
|
|
34
|
+
if (!action?.action_id) {
|
|
35
|
+
return;
|
|
37
36
|
}
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
let triggers = action.triggers ?? [];
|
|
38
|
+
if (e.target.checked && !triggers.includes(e.target.name)) {
|
|
39
|
+
triggers = [...triggers, e.target.name];
|
|
40
|
+
}
|
|
41
|
+
else if (!e.target.checked && triggers.includes(e.target.name)) {
|
|
42
|
+
triggers = triggers.filter(_t => _t !== e.target.name);
|
|
40
43
|
}
|
|
41
44
|
setLoading(true);
|
|
42
45
|
try {
|
|
43
46
|
await dispatchApi(api.action.patch(action.action_id, {
|
|
44
|
-
triggers
|
|
47
|
+
triggers
|
|
45
48
|
}));
|
|
46
|
-
setAction({ ...action, triggers
|
|
49
|
+
setAction({ ...action, triggers });
|
|
47
50
|
}
|
|
48
51
|
finally {
|
|
49
52
|
setLoading(false);
|
|
50
53
|
}
|
|
51
54
|
}, [action, dispatchApi, setLoading]);
|
|
52
55
|
const onDelete = useCallback(() => withConfirmDeleteModal(async () => {
|
|
53
|
-
|
|
56
|
+
if (!action?.action_id) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
await deleteAction(action.action_id);
|
|
54
60
|
showSuccessMessage(t('route.actions.manager.delete.success'));
|
|
55
61
|
}), [withConfirmDeleteModal, deleteAction, action?.action_id, showSuccessMessage, t]);
|
|
56
62
|
useEffect(() => {
|
|
63
|
+
if (!params.id) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
57
66
|
setLoading(true);
|
|
58
67
|
void Promise.all([
|
|
59
|
-
dispatchApi(api.action.operations.get()).then(setOperations),
|
|
60
|
-
dispatchApi(api.action.get(params.id).then(setAction)
|
|
68
|
+
dispatchApi(api.action.operations.get()).then(result => setOperations(result ?? [])),
|
|
69
|
+
dispatchApi(api.action.get(params.id)).then(setAction)
|
|
61
70
|
]).finally(() => setLoading(false));
|
|
62
71
|
}, [dispatchApi, params.id, setLoading]);
|
|
63
72
|
useEffect(() => {
|
|
64
73
|
if (action?.query) {
|
|
65
|
-
void onSearch(action
|
|
74
|
+
void onSearch(action.query);
|
|
66
75
|
}
|
|
67
76
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
68
77
|
}, [action?.query]);
|
|
69
|
-
const editRoles = user.roles.includes('automation_basic') || user.roles.includes('automation_advanced');
|
|
78
|
+
const editRoles = user.roles && (user.roles.includes('automation_basic') || user.roles.includes('automation_advanced'));
|
|
70
79
|
const execRoles = editRoles ||
|
|
71
|
-
user.roles
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
(user.roles &&
|
|
81
|
+
(user.roles.includes('admin') ||
|
|
82
|
+
user.roles.includes('actionrunner_basic') ||
|
|
83
|
+
user.roles.includes('actionrunner_advanced')));
|
|
84
|
+
const actionId = action?.action_id;
|
|
85
|
+
const adminList = action?.admins ?? [];
|
|
86
|
+
return (_jsx(PageCenter, { maxWidth: "1500px", textAlign: "left", height: "100%", children: _jsxs(Stack, { spacing: 1, children: [_jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [_jsx(Typography, { variant: "h5", children: action?.name }), action?.owner && _jsx(HowlerAvatar, { sx: { width: 32, height: 32 }, userId: action.owner })] }), _jsx(Phrase, { fullWidth: true, value: action?.query ?? '', disabled: true, size: "small", onChange: () => { }, startAdornment: _jsx(IconButton, { onClick: () => onSearch(action?.query ?? ''), children: _jsx(Search, { fontSize: "small" }) }) }), _jsxs(Stack, { direction: "row", alignItems: "center", spacing: 1, children: [response && _jsx(QueryResultText, { count: response.total, query: action?.query ?? '' }), _jsx(FlexOne, {}), ((action?.owner === user.username && editRoles) || user.roles?.includes('admin')) && (_jsx(Button, { startIcon: _jsx(Delete, {}), size: "small", variant: "outlined", color: "error", onClick: onDelete, children: t('button.delete') })), actionId && execRoles && (_jsx(Button, { startIcon: _jsx(PlayCircleOutline, {}), size: "small", variant: "outlined", color: "success", onClick: () => executeAction(actionId), children: t('route.actions.execute') })), ((action?.owner === user.username && editRoles) ||
|
|
87
|
+
(adminList.includes(user.username) && editRoles) ||
|
|
88
|
+
(action?.members?.includes(user.username) && editRoles) ||
|
|
89
|
+
user.roles?.includes('admin')) && (_jsx(Button, { startIcon: _jsx(Edit, {}), size: "small", variant: "outlined", component: Link, to: `/action/${params.id}/edit`, children: t('route.actions.edit') })), _jsx(MembershipManagement, { size: "small", type: "action", entity: action, onChange: _action => setAction(_action) })] }), (user.roles ?? []).includes('automation_advanced') && (_jsx(FormGroup, { children: _jsx(Stack, { direction: "row", spacing: 1, children: (action?.operations ?? [])
|
|
90
|
+
.map(a => operations.find(_action => _action.id === a.operation_id)?.triggers ?? [])
|
|
91
|
+
.reduce((availableTriggers, triggers, index) => index === 0 ? triggers : availableTriggers.filter(trigger => triggers.includes(trigger)), [])
|
|
77
92
|
.map(trigger => (_jsx(FormControlLabel, { control: _jsx(Checkbox, { name: trigger, onChange: onTriggerChange, checked: action?.triggers?.includes(trigger) ?? false }), label: t(`route.actions.trigger.${trigger}`) }, trigger))) }) })), loading &&
|
|
78
93
|
(progress[1] > 0 ? (_jsx(LinearProgress, { variant: "determinate", value: (progress[0] / progress[1]) * 100, valueBuffer: ((progress[0] + 10) / progress[1]) * 100 })) : (_jsx(LinearProgress, {}))), report && _jsx(ActionReportDisplay, { report: report, operations: operations }), operations.length > 0 &&
|
|
79
94
|
action &&
|
|
80
|
-
action.operations
|
|
81
|
-
|
|
95
|
+
action.operations?.map(a => {
|
|
96
|
+
const operationId = a.operation_id;
|
|
97
|
+
const operation = operations.find(_operation => _operation.id === operationId);
|
|
98
|
+
if (!operationId || !operation) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
if (howlerPluginStore.operations.includes(operationId)) {
|
|
82
102
|
return pluginStore.executeFunction(`operation.${a.operation_id}`, {
|
|
83
103
|
readonly: true,
|
|
84
|
-
operation
|
|
104
|
+
operation,
|
|
85
105
|
operations,
|
|
86
|
-
query: action.query,
|
|
106
|
+
query: action.query ?? '',
|
|
87
107
|
values: a.data_json
|
|
88
108
|
});
|
|
89
109
|
}
|
|
90
|
-
return (_jsx(OperationEntry, { readonly: true, operations: operations, query: action.query, values: a.data_json, operation:
|
|
110
|
+
return (_jsx(OperationEntry, { readonly: true, operations: operations, query: action.query ?? '', values: a.data_json, operation: operation }, operationId));
|
|
91
111
|
})] }) }));
|
|
92
112
|
};
|
|
93
113
|
export default ActionDetails;
|