@cccsaurora/howler-ui 3.1.0-dev.1466 → 3.1.0-dev.1602
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 +10 -20
- 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/shared/PluginViewing.d.ts +10 -0
- package/components/routes/hits/shared/PluginViewing.js +13 -0
- package/components/routes/hits/view/HitViewer.js +52 -52
- package/components/routes/hits/view/HitViewer.test.js +8 -6
- 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 -117
- package/plugins/HowlerPlugin.d.ts +9 -50
- package/plugins/HowlerPlugin.js +7 -113
- package/plugins/clue/Provider.js +1 -1
- 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
|
@@ -2,15 +2,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { iconExists } from '@iconify/react';
|
|
3
3
|
import { Language, Person, Save } from '@mui/icons-material';
|
|
4
4
|
import { Box, CircularProgress, Fab, Paper, Stack, Tab, Tabs, TextField, ToggleButton, ToggleButtonGroup, Tooltip, Typography, useMediaQuery } from '@mui/material';
|
|
5
|
+
import { PageCenter } from '@tui/core';
|
|
5
6
|
import api from '@cccsaurora/howler-ui/api';
|
|
6
|
-
import PageCenter from '@cccsaurora/howler-ui/commons/components/pages/PageCenter';
|
|
7
7
|
import { ParameterContext } from '@cccsaurora/howler-ui/components/app/providers/ParameterProvider';
|
|
8
|
+
import { MembershipManagement } from '@cccsaurora/howler-ui/components/elements/membership/MembershipManagement';
|
|
8
9
|
import useMyApi from '@cccsaurora/howler-ui/components/hooks/useMyApi';
|
|
9
10
|
import useMySnackbar from '@cccsaurora/howler-ui/components/hooks/useMySnackbar';
|
|
10
11
|
import { isEqual, omit, uniqBy } from 'lodash-es';
|
|
11
12
|
import { memo, useCallback, useEffect, useMemo, useState } from 'react';
|
|
12
13
|
import { useTranslation } from 'react-i18next';
|
|
13
|
-
import { useNavigate, useParams, useSearchParams } from 'react-router
|
|
14
|
+
import { useNavigate, useParams, useSearchParams } from 'react-router';
|
|
14
15
|
import { useContextSelector } from 'use-context-selector';
|
|
15
16
|
import QueryResultText from '../../elements/display/QueryResultText';
|
|
16
17
|
import RecordQuery from '../hits/search/RecordQuery';
|
|
@@ -23,6 +24,7 @@ const DossierEditor = () => {
|
|
|
23
24
|
const { showSuccessMessage } = useMySnackbar();
|
|
24
25
|
const navigate = useNavigate();
|
|
25
26
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
27
|
+
const dossierId = params.id;
|
|
26
28
|
const setQuery = useContextSelector(ParameterContext, ctx => ctx.setQuery);
|
|
27
29
|
const isNarrow = useMediaQuery(`(max-width: ${i18n.language === 'en' ? 1275 : 1375}px)`);
|
|
28
30
|
const [originalDossier, setOriginalDossier] = useState();
|
|
@@ -37,6 +39,7 @@ const DossierEditor = () => {
|
|
|
37
39
|
const [loading, setLoading] = useState(false);
|
|
38
40
|
const dirty = useMemo(() => !isEqual(originalDossier, dossier), [dossier, originalDossier]);
|
|
39
41
|
const validationError = useMemo(() => {
|
|
42
|
+
const language = i18n.language;
|
|
40
43
|
if (!dossier) {
|
|
41
44
|
return t('route.dossiers.manager.validation.error');
|
|
42
45
|
}
|
|
@@ -70,15 +73,21 @@ const DossierEditor = () => {
|
|
|
70
73
|
}
|
|
71
74
|
if (!lead.format) {
|
|
72
75
|
// You have not set the format for the lead with label <label>
|
|
73
|
-
return t('route.dossiers.manager.validation.error.leads.format', {
|
|
76
|
+
return t('route.dossiers.manager.validation.error.leads.format', {
|
|
77
|
+
label: lead.label[language]
|
|
78
|
+
});
|
|
74
79
|
}
|
|
75
80
|
if (!lead.content) {
|
|
76
81
|
// You have not set the content for the lead with label <label>
|
|
77
|
-
return t('route.dossiers.manager.validation.error.leads.content', {
|
|
82
|
+
return t('route.dossiers.manager.validation.error.leads.content', {
|
|
83
|
+
label: lead.label[language]
|
|
84
|
+
});
|
|
78
85
|
}
|
|
79
86
|
if (!lead.icon || !iconExists(lead.icon)) {
|
|
80
87
|
// You are missing an icon, or the specified icon does not exist for lead with label <label>
|
|
81
|
-
return t('route.dossiers.manager.validation.error.leads.icon', {
|
|
88
|
+
return t('route.dossiers.manager.validation.error.leads.icon', {
|
|
89
|
+
label: lead.label[language]
|
|
90
|
+
});
|
|
82
91
|
}
|
|
83
92
|
}
|
|
84
93
|
for (const pivot of dossier.pivots ?? []) {
|
|
@@ -96,30 +105,42 @@ const DossierEditor = () => {
|
|
|
96
105
|
}
|
|
97
106
|
if (!pivot.format) {
|
|
98
107
|
// You have not set the format for the pivot with label <label>
|
|
99
|
-
return t('route.dossiers.manager.validation.error.pivots.format', {
|
|
108
|
+
return t('route.dossiers.manager.validation.error.pivots.format', {
|
|
109
|
+
label: pivot.label[language]
|
|
110
|
+
});
|
|
100
111
|
}
|
|
101
112
|
if (!pivot.value) {
|
|
102
113
|
// You have not set the value for the pivot with label <label>
|
|
103
|
-
return t('route.dossiers.manager.validation.error.pivots.value', {
|
|
114
|
+
return t('route.dossiers.manager.validation.error.pivots.value', {
|
|
115
|
+
label: pivot.label[language]
|
|
116
|
+
});
|
|
104
117
|
}
|
|
105
118
|
if (!pivot.icon || !iconExists(pivot.icon)) {
|
|
106
119
|
// You are missing an icon, or the specified icon does not exist for pivot with label <label>
|
|
107
|
-
return t('route.dossiers.manager.validation.error.pivots.icon', {
|
|
120
|
+
return t('route.dossiers.manager.validation.error.pivots.icon', {
|
|
121
|
+
label: pivot.label[language]
|
|
122
|
+
});
|
|
108
123
|
}
|
|
109
124
|
if (!pivot.mappings || pivot.mappings.length < 1) {
|
|
110
125
|
continue;
|
|
111
126
|
}
|
|
112
127
|
if ((pivot.mappings ?? []).length !== uniqBy(pivot.mappings ?? [], 'key').length) {
|
|
113
128
|
// You have a duplicate for pivot with label <label>
|
|
114
|
-
return t('route.dossiers.manager.validation.error.pivots.duplicate', {
|
|
129
|
+
return t('route.dossiers.manager.validation.error.pivots.duplicate', {
|
|
130
|
+
label: pivot.label[language]
|
|
131
|
+
});
|
|
115
132
|
}
|
|
116
133
|
if (pivot.mappings?.some(mapping => !mapping.key)) {
|
|
117
134
|
// You have not configured a key for a mapping for pivot with label <label>
|
|
118
|
-
return t('route.dossiers.manager.validation.error.pivots.key', {
|
|
135
|
+
return t('route.dossiers.manager.validation.error.pivots.key', {
|
|
136
|
+
label: pivot.label[language]
|
|
137
|
+
});
|
|
119
138
|
}
|
|
120
139
|
if (pivot.mappings?.some(mapping => !mapping.field || (mapping.field === 'custom' && !mapping.custom_value))) {
|
|
121
140
|
// You have not configured a field or custom value for a mapping for pivot with label <label>
|
|
122
|
-
return t('route.dossiers.manager.validation.error.pivots.field', {
|
|
141
|
+
return t('route.dossiers.manager.validation.error.pivots.field', {
|
|
142
|
+
label: pivot.label[i18n.language]
|
|
143
|
+
});
|
|
123
144
|
}
|
|
124
145
|
}
|
|
125
146
|
return null;
|
|
@@ -127,41 +148,56 @@ const DossierEditor = () => {
|
|
|
127
148
|
const save = useCallback(async () => {
|
|
128
149
|
setLoading(true);
|
|
129
150
|
try {
|
|
130
|
-
if (!
|
|
151
|
+
if (!dossierId) {
|
|
131
152
|
const result = await dispatchApi(api.dossier.post(dossier));
|
|
153
|
+
if (!result?.dossier_id) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
132
156
|
showSuccessMessage(t('route.dossiers.manager.create.success'));
|
|
133
|
-
navigate(`/dossiers/${result.dossier_id}/edit`);
|
|
157
|
+
void navigate(`/dossiers/${result.dossier_id}/edit`);
|
|
134
158
|
}
|
|
135
159
|
else {
|
|
136
|
-
|
|
160
|
+
const result = await dispatchApi(api.dossier.put(dossierId, omit(dossier, ['dossier_id', 'id', 'owner', 'admins', 'members'])));
|
|
161
|
+
if (!result) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
setDossier(result);
|
|
137
165
|
showSuccessMessage(t('route.dossiers.manager.edit.success'));
|
|
138
166
|
}
|
|
139
167
|
}
|
|
140
168
|
finally {
|
|
141
169
|
setLoading(false);
|
|
142
170
|
}
|
|
143
|
-
}, [dispatchApi, dossier,
|
|
171
|
+
}, [dispatchApi, dossier, dossierId, navigate, showSuccessMessage, t]);
|
|
144
172
|
useEffect(() => {
|
|
145
|
-
if (!
|
|
173
|
+
if (!dossierId) {
|
|
146
174
|
return;
|
|
147
175
|
}
|
|
148
176
|
setLoading(true);
|
|
149
|
-
void dispatchApi(api.dossier.get(
|
|
150
|
-
.then(
|
|
151
|
-
|
|
152
|
-
|
|
177
|
+
void dispatchApi(api.dossier.get(dossierId))
|
|
178
|
+
.then(fetchedDossier => {
|
|
179
|
+
if (!fetchedDossier) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
setOriginalDossier(fetchedDossier);
|
|
183
|
+
setDossier(fetchedDossier);
|
|
153
184
|
})
|
|
154
185
|
.finally(() => setLoading(false));
|
|
155
|
-
}, [dispatchApi,
|
|
186
|
+
}, [dispatchApi, dossierId]);
|
|
156
187
|
useEffect(() => {
|
|
157
|
-
|
|
188
|
+
const query = dossier.query;
|
|
189
|
+
if (!query) {
|
|
158
190
|
return;
|
|
159
191
|
}
|
|
160
|
-
setQuery(
|
|
192
|
+
setQuery(query);
|
|
161
193
|
void (async () => {
|
|
162
194
|
setLoading(true);
|
|
163
195
|
try {
|
|
164
|
-
const result = await dispatchApi(api.search.hit.post({ query
|
|
196
|
+
const result = await dispatchApi(api.search.hit.post({ query, rows: 0 }));
|
|
197
|
+
if (!result) {
|
|
198
|
+
setSearchTotal(-1);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
165
201
|
setSearchTotal(result.total);
|
|
166
202
|
}
|
|
167
203
|
finally {
|
|
@@ -183,7 +219,7 @@ const DossierEditor = () => {
|
|
|
183
219
|
whiteSpace: 'nowrap',
|
|
184
220
|
pointerEvents: 'initial !important',
|
|
185
221
|
...(isNarrow ? { bottom: theme.spacing(1) } : { top: 0 })
|
|
186
|
-
}), onClick: save, children: [loading ? _jsx(CircularProgress, { size: 24, sx: { mr: 1 } }) : _jsx(Save, { sx: { mr: 1 } }), _jsx(Typography, { children: t('save') })] }) }) }), _jsxs(Stack, { spacing: 1, height: "100%", children: [_jsx(Paper, { sx: { p: 1 }, children: _jsxs(Stack, { spacing: 1, children: [_jsxs(Stack, { spacing: 1, direction: "row", children: [_jsx(TextField, { id: "dossier-title", disabled: !dossier || loading, label: "Title", size: "small", value: dossier.title ?? '', onChange: ev => setDossier(_dossier => ({ ..._dossier, title: ev.target.value })), fullWidth: true }), _jsxs(ToggleButtonGroup, { disabled: !dossier || loading, exclusive: true, value: dossier.type ?? 'global', onChange: (_ev, type) => setDossier(_dossier => ({ ..._dossier, type })), children: [_jsx(Tooltip, { title: t('route.dossiers.manager.global'), children: _jsx(ToggleButton, { value: "global", size: "small", children: _jsx(Language, { fontSize: "small" }) }) }), _jsx(Tooltip, { title: t('route.dossiers.manager.personal'), children: _jsx(ToggleButton, { value: "personal", size: "small", children: _jsx(Person, { fontSize: "small" }) }) })] })] }), _jsx(Typography, { sx: theme => ({
|
|
222
|
+
}), onClick: save, children: [loading ? _jsx(CircularProgress, { size: 24, sx: { mr: 1 } }) : _jsx(Save, { sx: { mr: 1 } }), _jsx(Typography, { children: t('save') })] }) }) }), _jsxs(Stack, { spacing: 1, height: "100%", children: [_jsx(Paper, { sx: { p: 1 }, children: _jsxs(Stack, { spacing: 1, children: [_jsxs(Stack, { spacing: 1, direction: "row", alignItems: "center", children: [_jsx(TextField, { id: "dossier-title", disabled: !dossier || loading, label: "Title", size: "small", value: dossier.title ?? '', onChange: ev => setDossier(_dossier => ({ ..._dossier, title: ev.target.value })), fullWidth: true }), _jsxs(ToggleButtonGroup, { disabled: !dossier || loading, exclusive: true, value: dossier.type ?? 'global', onChange: (_ev, type) => setDossier(_dossier => ({ ..._dossier, type })), children: [_jsx(Tooltip, { title: t('route.dossiers.manager.global'), children: _jsx(ToggleButton, { value: "global", size: "small", children: _jsx(Language, { fontSize: "small" }) }) }), _jsx(Tooltip, { title: t('route.dossiers.manager.personal'), children: _jsx(ToggleButton, { value: "personal", size: "small", children: _jsx(Person, { fontSize: "small" }) }) })] }), _jsx(MembershipManagement, { type: "dossier", entity: dossier, onChange: _dossier => setDossier(_dossier) })] }), _jsx(Typography, { sx: theme => ({
|
|
187
223
|
color: theme.palette.text.secondary,
|
|
188
224
|
fontSize: '0.9em',
|
|
189
225
|
fontStyle: 'italic',
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// @ts-nocheck
|
|
2
3
|
import { render, screen, waitFor } from '@testing-library/react';
|
|
3
4
|
import userEvent from '@testing-library/user-event';
|
|
5
|
+
import { UserListContext } from '@cccsaurora/howler-ui/components/app/providers/UserListProvider';
|
|
4
6
|
import omit from 'lodash-es/omit';
|
|
5
7
|
import { act } from 'react';
|
|
6
8
|
import { setupContextSelectorMock, setupReactRouterMock } from '@cccsaurora/howler-ui/tests/mocks';
|
|
@@ -55,9 +57,13 @@ vi.mock('@mui/material', async () => {
|
|
|
55
57
|
};
|
|
56
58
|
});
|
|
57
59
|
// Mock child components
|
|
58
|
-
vi.mock('
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
vi.mock('@tui/core', async () => {
|
|
61
|
+
const actual = await vi.importActual('@tui/core');
|
|
62
|
+
return {
|
|
63
|
+
...actual,
|
|
64
|
+
PageCenter: ({ children, ...props }) => (_jsx("div", { id: "page-center", ...omit(props, ['textAlign', 'maxWidth']), children: children }))
|
|
65
|
+
};
|
|
66
|
+
});
|
|
61
67
|
vi.mock('../../elements/display/QueryResultText', () => ({
|
|
62
68
|
default: ({ count, query }) => (_jsxs("div", { id: "query-result-text", children: [count, " ", ' results for ', " ", query] }))
|
|
63
69
|
}));
|
|
@@ -76,7 +82,7 @@ import ApiConfigProvider from '@cccsaurora/howler-ui/components/app/providers/Ap
|
|
|
76
82
|
import { ParameterContext } from '@cccsaurora/howler-ui/components/app/providers/ParameterProvider';
|
|
77
83
|
import i18n from '@cccsaurora/howler-ui/i18n';
|
|
78
84
|
import { I18nextProvider } from 'react-i18next';
|
|
79
|
-
import { useNavigate, useParams, useSearchParams } from 'react-router
|
|
85
|
+
import { useNavigate, useParams, useSearchParams } from 'react-router';
|
|
80
86
|
import DossierEditor from './DossierEditor';
|
|
81
87
|
const mockUseParams = vi.mocked(useParams);
|
|
82
88
|
const mockUseSearchParams = vi.mocked(useSearchParams);
|
|
@@ -119,16 +125,17 @@ const Wrapper = ({ children }) => {
|
|
|
119
125
|
configuration: {},
|
|
120
126
|
c12nDef: {},
|
|
121
127
|
mapping: {}
|
|
122
|
-
}, children: _jsx(ParameterContext.Provider, { value: mockParameterContext, children: children }) }) }));
|
|
128
|
+
}, children: _jsx(ParameterContext.Provider, { value: mockParameterContext, children: _jsx(UserListContext.Provider, { value: { users: {}, fetchUsers: vi.fn(), searchUsers: vi.fn() }, children: children }) }) }) }));
|
|
123
129
|
};
|
|
124
130
|
describe('DossierEditor', () => {
|
|
125
131
|
beforeEach(() => {
|
|
126
|
-
mockApiSearchHitPost.
|
|
127
|
-
mockApiDossierGet.
|
|
128
|
-
mockApiDossierPost.
|
|
129
|
-
mockApiDossierPut.
|
|
132
|
+
mockApiSearchHitPost.mockReset();
|
|
133
|
+
mockApiDossierGet.mockReset();
|
|
134
|
+
mockApiDossierPost.mockReset();
|
|
135
|
+
mockApiDossierPut.mockReset();
|
|
130
136
|
mockNavigate.mockClear();
|
|
131
137
|
mockSetQuery.mockClear();
|
|
138
|
+
mockUseParams.mockReturnValue({ id: undefined });
|
|
132
139
|
// Reset mock context
|
|
133
140
|
mockParameterContext.setQuery = mockSetQuery;
|
|
134
141
|
// Default mock implementations
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const Dossiers: () => import("react
|
|
1
|
+
declare const Dossiers: () => import("react").JSX.Element;
|
|
2
2
|
export default Dossiers;
|
|
@@ -3,7 +3,7 @@ import { Topic } from '@mui/icons-material';
|
|
|
3
3
|
import { Typography } from '@mui/material';
|
|
4
4
|
import api from '@cccsaurora/howler-ui/api';
|
|
5
5
|
import { ModalContext } from '@cccsaurora/howler-ui/components/app/providers/ModalProvider';
|
|
6
|
-
import SearchResponseProvider, {
|
|
6
|
+
import SearchResponseProvider, { createSearchResponseContext, useSearchResponseContext } from '@cccsaurora/howler-ui/components/app/providers/SearchResponseProvider';
|
|
7
7
|
import { TuiListProvider } from '@cccsaurora/howler-ui/components/elements/addons/lists';
|
|
8
8
|
import { TuiListMethodContext } from '@cccsaurora/howler-ui/components/elements/addons/lists/TuiListProvider';
|
|
9
9
|
import ItemManager from '@cccsaurora/howler-ui/components/elements/display/ItemManager';
|
|
@@ -12,9 +12,10 @@ import { useMyLocalStorageItem } from '@cccsaurora/howler-ui/components/hooks/us
|
|
|
12
12
|
import useMySnackbar from '@cccsaurora/howler-ui/components/hooks/useMySnackbar';
|
|
13
13
|
import { useCallback, useContext, useEffect, useState } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import { useNavigate, useSearchParams } from 'react-router
|
|
15
|
+
import { useNavigate, useSearchParams } from 'react-router';
|
|
16
16
|
import { StorageKey } from '@cccsaurora/howler-ui/utils/constants';
|
|
17
17
|
import DossierCard from './DossierCard';
|
|
18
|
+
const SearchResponseContext = createSearchResponseContext();
|
|
18
19
|
const DossiersBase = () => {
|
|
19
20
|
const { t } = useTranslation();
|
|
20
21
|
const navigate = useNavigate();
|
|
@@ -24,7 +25,7 @@ const DossiersBase = () => {
|
|
|
24
25
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
25
26
|
const { load } = useContext(TuiListMethodContext);
|
|
26
27
|
const pageCount = useMyLocalStorageItem(StorageKey.PAGE_COUNT, 25)[0];
|
|
27
|
-
const { response, request, remove, getSearchRequestData } =
|
|
28
|
+
const { response, request, remove, getSearchRequestData } = useSearchResponseContext(SearchResponseContext);
|
|
28
29
|
const [phrase, setPhrase] = useState('');
|
|
29
30
|
const [offset, setOffset] = useState(parseInt(searchParams.get('offset')) || 0);
|
|
30
31
|
const [hasError, setHasError] = useState(false);
|
|
@@ -101,7 +102,7 @@ const DossiersBase = () => {
|
|
|
101
102
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
102
103
|
}, []);
|
|
103
104
|
useEffect(() => {
|
|
104
|
-
if (response?.total <= offset) {
|
|
105
|
+
if ((response?.total ?? 0) <= offset) {
|
|
105
106
|
setOffset(0);
|
|
106
107
|
searchParams.set('offset', '0');
|
|
107
108
|
setSearchParams(searchParams, { replace: true });
|
|
@@ -117,6 +118,6 @@ const DossiersBase = () => {
|
|
|
117
118
|
return (_jsx(ItemManager, { onSearch: onSearch, onPageChange: onPageChange, phrase: phrase, setPhrase: setPhrase, hasError: hasError, searching: loading, aboveSearch: _jsx(Typography, { sx: theme => ({ fontStyle: 'italic', color: theme.palette.text.disabled, mb: 0.5 }), variant: "body2", children: t('route.dossiers.search.prompt') }), renderer: ({ item }, classRenderer) => renderer(item.item, classRenderer()), response: response, onSelect: (item) => navigate(`/dossiers/${item.id}/edit`), onCreate: () => navigate('/dossiers/create'), createPrompt: "route.dossiers.create", searchPrompt: "route.dossiers.manager.search", createIcon: _jsx(Topic, { sx: { mr: 1 } }) }));
|
|
118
119
|
};
|
|
119
120
|
const Dossiers = () => {
|
|
120
|
-
return (_jsx(TuiListProvider, { children: _jsx(SearchResponseProvider, { idField: "dossier_id", children: _jsx(DossiersBase, {}) }) }));
|
|
121
|
+
return (_jsx(TuiListProvider, { children: _jsx(SearchResponseProvider, { context: SearchResponseContext, idField: "dossier_id", children: _jsx(DossiersBase, {}) }) }));
|
|
121
122
|
};
|
|
122
123
|
export default Dossiers;
|
|
@@ -16,7 +16,7 @@ const LeadEditor = ({ lead, update }) => {
|
|
|
16
16
|
const pluginStore = usePluginStore();
|
|
17
17
|
const icon = useMemo(() => lead?.icon ?? 'material-symbols:find-in-page', [lead?.icon]);
|
|
18
18
|
const metadata = useMemo(() => JSON.parse(lead?.metadata ?? '{}'), [lead?.metadata]);
|
|
19
|
-
const updateMetadata = useCallback(_metadata => {
|
|
19
|
+
const updateMetadata = useCallback((_metadata) => {
|
|
20
20
|
update({ metadata: JSON.stringify(merge({}, metadata, _metadata)) });
|
|
21
21
|
}, [metadata, update]);
|
|
22
22
|
useEffect(() => {
|
|
@@ -25,7 +25,7 @@ const LeadEditor = ({ lead, update }) => {
|
|
|
25
25
|
}
|
|
26
26
|
monaco.editor.getModels().forEach(model => model.setEOL(monaco.editor.EndOfLineSequence.LF));
|
|
27
27
|
}, [monaco]);
|
|
28
|
-
return (_jsxs(Stack, { spacing: 2, pt: 2, sx: { flex: 1 }, id: "lead-editor", children: [_jsxs(Stack, { direction: "row", alignItems: "center", position: "relative", children: [_jsx(TextField, { size: "small", label: t('route.dossiers.manager.icon'), value: icon, disabled: !lead, fullWidth: true, error: !iconExists(icon), sx: { '& input': { paddingLeft: '2.25rem' } }, onChange: ev => update({ icon: ev.target.value }) }), _jsx(Icon, { fontSize: "1.75rem", icon: icon, style: { position: 'absolute', left: '0.5rem' } }), _jsx(Button, { variant: "outlined", color: "error", disabled: !lead, sx: { minWidth: '0 !important', ml: 1 }, onClick: () => update(null), children: _jsx(Delete, {}) })] }), _jsxs(Stack, { direction: "row", spacing: 0.5, alignItems: "center", sx: { mt: `${theme.spacing(0.5)} !important` }, children: [_jsx(Typography, { color: "text.secondary", children: t('route.dossiers.manager.icon.description') }), _jsx(IconButton, { size: "small", component: "a", href: "https://icon-sets.iconify.design/", children: _jsx(OpenInNew, { fontSize: "small" }) })] }), _jsxs(Stack, { direction: "row", spacing: 2, children: [_jsx(TextField, { size: "small", label: t('route.dossiers.manager.label.en'), disabled: !lead, value: lead?.label?.en ?? '', fullWidth: true, onChange: ev => update({ label: { en: ev.target.value } }) }), _jsx(TextField, { size: "small", label: t('route.dossiers.manager.label.fr'), disabled: !lead, value: lead?.label?.fr ?? '', fullWidth: true, onChange: ev => update({ label: { fr: ev.target.value } }) })] }), _jsx(Autocomplete, { disabled: !lead, options: ['markdown', ...howlerPluginStore.leadFormats], id: "lead-format", renderInput: params => _jsx(TextField, { ...params, size: "small", label: t('route.dossiers.manager.format') }), value: lead?.format ?? null, onChange: (_ev, format) => update({ format, metadata: '{}', content: '' }) }), !!lead?.format &&
|
|
28
|
+
return (_jsxs(Stack, { spacing: 2, pt: 2, sx: { flex: 1 }, id: "lead-editor", children: [_jsxs(Stack, { direction: "row", alignItems: "center", position: "relative", children: [_jsx(TextField, { size: "small", label: t('route.dossiers.manager.icon'), value: icon, disabled: !lead, fullWidth: true, error: !iconExists(icon), sx: { '& input': { paddingLeft: '2.25rem' } }, onChange: ev => update({ icon: ev.target.value }) }), _jsx(Icon, { fontSize: "1.75rem", icon: icon, style: { position: 'absolute', left: '0.5rem' } }), _jsx(Button, { variant: "outlined", color: "error", disabled: !lead, sx: { minWidth: '0 !important', ml: 1 }, onClick: () => update(null), children: _jsx(Delete, {}) })] }), _jsxs(Stack, { direction: "row", spacing: 0.5, alignItems: "center", sx: { mt: `${theme.spacing(0.5)} !important` }, children: [_jsx(Typography, { color: "text.secondary", children: t('route.dossiers.manager.icon.description') }), _jsx(IconButton, { size: "small", component: "a", href: "https://icon-sets.iconify.design/", children: _jsx(OpenInNew, { fontSize: "small" }) })] }), _jsxs(Stack, { direction: "row", spacing: 2, children: [_jsx(TextField, { size: "small", label: t('route.dossiers.manager.label.en'), disabled: !lead, value: lead?.label?.en ?? '', fullWidth: true, onChange: ev => update({ label: { en: ev.target.value } }) }), _jsx(TextField, { size: "small", label: t('route.dossiers.manager.label.fr'), disabled: !lead, value: lead?.label?.fr ?? '', fullWidth: true, onChange: ev => update({ label: { fr: ev.target.value } }) })] }), _jsx(Autocomplete, { disabled: !lead, options: ['markdown', ...howlerPluginStore.leadFormats], id: "lead-format", renderInput: params => _jsx(TextField, { ...params, size: "small", label: t('route.dossiers.manager.format') }), value: lead?.format ?? null, onChange: (_ev, format) => update({ format: format ?? undefined, metadata: '{}', content: '' }) }), !!lead?.format &&
|
|
29
29
|
(lead.format === 'markdown' ? (_jsx(ThemedEditor, { id: "lead-markdown", height: "100%", width: "100%", language: "markdown", theme: theme.palette.mode === 'light' ? 'howler' : 'howler-dark', value: lead?.content ?? '', onChange: content => update({ content }), options: {} })) : (pluginStore.executeFunction(`lead.${lead.format}.form`, {
|
|
30
30
|
lead,
|
|
31
31
|
metadata,
|
|
@@ -6,7 +6,7 @@ import isNull from 'lodash-es/isNull';
|
|
|
6
6
|
import merge from 'lodash-es/merge';
|
|
7
7
|
import { useEffect, useState } from 'react';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
|
-
import { useSearchParams } from 'react-router
|
|
9
|
+
import { useSearchParams } from 'react-router';
|
|
10
10
|
import LeadEditor from './LeadEditor';
|
|
11
11
|
const LeadForm = ({ dossier, setDossier, loading }) => {
|
|
12
12
|
const { t, i18n } = useTranslation();
|
|
@@ -34,7 +34,7 @@ const LeadForm = ({ dossier, setDossier, loading }) => {
|
|
|
34
34
|
'& .MuiAlert-message': {
|
|
35
35
|
py: 0.7
|
|
36
36
|
}
|
|
37
|
-
}, children: t('route.dossiers.manager.lead.create') })) : (_jsx(Tabs, { value: tab, onChange: (_, _tab) => setTab(_tab), sx: { minHeight: '0 !important' }, children: dossier.leads?.map((lead, index) => (_jsx(Tab, { disabled: !dossier || loading, sx: { py: 1, minHeight: '0 !important' }, label: _jsxs(Stack, { direction: "row", spacing: 0.5, children: [lead.icon && _jsx(Icon, { icon: lead.icon }), _jsx("span", { children: i18n.language === 'en' ? lead.label
|
|
37
|
+
}, children: t('route.dossiers.manager.lead.create') })) : (_jsx(Tabs, { value: tab, onChange: (_, _tab) => setTab(_tab), sx: { minHeight: '0 !important' }, children: dossier.leads?.map((lead, index) => (_jsx(Tab, { disabled: !dossier || loading, sx: { py: 1, minHeight: '0 !important' }, label: _jsxs(Stack, { direction: "row", spacing: 0.5, children: [lead.icon && _jsx(Icon, { icon: lead.icon }), _jsx("span", { children: i18n.language === 'en' ? lead.label?.en : lead.label?.fr })] }), value: index }, (lead.label?.en ?? '') + (lead.content ?? '')))) })), _jsx(Button, { id: "add-lead", sx: { ml: 'auto', alignSelf: 'end', minWidth: '0 !important' }, size: "small", variant: "contained", onClick: () => {
|
|
38
38
|
setTab(dossier.leads?.length ?? 0);
|
|
39
39
|
setDossier(_dossier => ({
|
|
40
40
|
..._dossier,
|
|
@@ -3,7 +3,7 @@ import type { Pivot } from '@cccsaurora/howler-ui/models/entities/generated/Pivo
|
|
|
3
3
|
import { type Dispatch, type FC, type SetStateAction } from 'react';
|
|
4
4
|
export interface PivotFormProps {
|
|
5
5
|
pivot: Pivot;
|
|
6
|
-
update: (pivot
|
|
6
|
+
update: (pivot?: Partial<Pivot>) => void;
|
|
7
7
|
}
|
|
8
8
|
declare const PivotForm: FC<{
|
|
9
9
|
dossier: Dossier;
|
|
@@ -3,20 +3,21 @@ import { Icon, iconExists } from '@iconify/react';
|
|
|
3
3
|
import { Add, Delete, OpenInNew, Remove } from '@mui/icons-material';
|
|
4
4
|
import { Alert, Autocomplete, Button, Divider, IconButton, Paper, Stack, Tab, Tabs, TextField, Typography, useTheme } from '@mui/material';
|
|
5
5
|
import { ApiConfigContext } from '@cccsaurora/howler-ui/components/app/providers/ApiConfigProvider';
|
|
6
|
-
import
|
|
6
|
+
import { isNil } from 'lodash-es';
|
|
7
7
|
import merge from 'lodash-es/merge';
|
|
8
8
|
import howlerPluginStore from '@cccsaurora/howler-ui/plugins/store';
|
|
9
9
|
import { Fragment, useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
10
10
|
import { useTranslation } from 'react-i18next';
|
|
11
11
|
import { usePluginStore } from 'react-pluggable';
|
|
12
|
-
import { useSearchParams } from 'react-router
|
|
12
|
+
import { useSearchParams } from 'react-router';
|
|
13
|
+
import { notNil } from '@cccsaurora/howler-ui/utils/utils';
|
|
13
14
|
const LinkForm = ({ pivot, update }) => {
|
|
14
15
|
const { t } = useTranslation();
|
|
15
16
|
const { config } = useContext(ApiConfigContext);
|
|
16
17
|
return (_jsxs(_Fragment, { children: [_jsx(TextField, { size: "small", label: t('route.dossiers.manager.pivot.value'), disabled: !pivot, value: pivot?.value ?? '', fullWidth: true, onChange: ev => update({ value: ev.target.value }) }), _jsx(Divider, { flexItem: true }), _jsx(Typography, { children: t('route.dossiers.manager.pivot.mappings') }), pivot?.mappings?.map((_mapping, index) => (_jsxs(Fragment, { children: [_jsxs(Stack, { direction: "row", spacing: 1, children: [_jsx(TextField, { size: "small", label: t('route.dossiers.manager.pivot.mapping.key'), disabled: !pivot, value: _mapping?.key ?? '', onChange: ev => update({
|
|
17
18
|
mappings: pivot.mappings.map((_m, _index) => index === _index ? { ..._m, key: ev.target.value } : _m)
|
|
18
|
-
}) }), _jsx(Autocomplete, { fullWidth: true, disabled: !pivot, options: ['custom', ...Object.keys(config.indexes
|
|
19
|
-
mappings: pivot.mappings.map((_m, _index) =>
|
|
19
|
+
}) }), _jsx(Autocomplete, { fullWidth: true, disabled: !pivot, options: ['custom', ...Object.keys(config.indexes?.hit ?? {})], renderInput: params => (_jsx(TextField, { ...params, size: "small", fullWidth: true, label: t('route.dossiers.manager.pivot.mapping.field'), sx: { minWidth: '150px' } })), getOptionLabel: opt => t(opt), value: _mapping.field ?? '', onChange: (_ev, field) => update({
|
|
20
|
+
mappings: pivot.mappings.map((_m, _index) => index === _index ? { ..._m, field: field ?? undefined } : _m)
|
|
20
21
|
}) }), _jsx(IconButton, { onClick: () => update({
|
|
21
22
|
mappings: pivot.mappings.filter((_m, _index) => index !== _index)
|
|
22
23
|
}), children: _jsx(Remove, {}) })] }), _mapping.field === 'custom' && (_jsx(TextField, { size: "small", label: t('route.dossiers.manager.pivot.mapping.custom'), disabled: !pivot, value: _mapping?.custom_value ?? '', onChange: ev => update({
|
|
@@ -40,8 +41,8 @@ const PivotForm = ({ dossier, setDossier, loading }) => {
|
|
|
40
41
|
if (tab !== _index) {
|
|
41
42
|
return pivot;
|
|
42
43
|
}
|
|
43
|
-
if (
|
|
44
|
-
return
|
|
44
|
+
if (isNil(data)) {
|
|
45
|
+
return;
|
|
45
46
|
}
|
|
46
47
|
const merged = merge({}, pivot, data);
|
|
47
48
|
if (data.mappings) {
|
|
@@ -49,9 +50,9 @@ const PivotForm = ({ dossier, setDossier, loading }) => {
|
|
|
49
50
|
}
|
|
50
51
|
return merged;
|
|
51
52
|
})
|
|
52
|
-
.filter(
|
|
53
|
+
.filter(notNil)
|
|
53
54
|
})), [setDossier, tab]);
|
|
54
|
-
const pivot = useMemo(() => dossier.pivots?.[tab]
|
|
55
|
+
const pivot = useMemo(() => dossier.pivots?.[tab], [dossier.pivots, tab]);
|
|
55
56
|
const icon = useMemo(() => pivot?.icon ?? 'material-symbols:find-in-page', [pivot?.icon]);
|
|
56
57
|
useEffect(() => {
|
|
57
58
|
searchParams.delete('lead');
|
|
@@ -84,7 +85,7 @@ const PivotForm = ({ dossier, setDossier, loading }) => {
|
|
|
84
85
|
{ icon: 'material-symbols:add-ad', label: { en: 'New Pivot', fr: 'Nouvelle pivot' }, mappings: [] }
|
|
85
86
|
]
|
|
86
87
|
}));
|
|
87
|
-
}, disabled: !dossier || loading, children: _jsx(Add, {}) })] }), _jsxs(Stack, { spacing: 2, children: [_jsxs(Stack, { direction: "row", alignItems: "center", position: "relative", children: [_jsx(TextField, { size: "small", label: t('route.dossiers.manager.pivot.icon'), value: icon, disabled: !pivot, fullWidth: true, error: !iconExists(icon), sx: { '& input': { paddingLeft: '2.25rem' } }, onChange: ev => update({ icon: ev.target.value }) }), _jsx(Icon, { fontSize: "1.75rem", icon: icon, style: { position: 'absolute', left: '0.5rem' } }), _jsx(Button, { variant: "outlined", color: "error", disabled: !pivot, sx: { minWidth: '0 !important', ml: 1 }, onClick: () => update(
|
|
88
|
+
}, disabled: !dossier || loading, children: _jsx(Add, {}) })] }), _jsxs(Stack, { spacing: 2, children: [_jsxs(Stack, { direction: "row", alignItems: "center", position: "relative", children: [_jsx(TextField, { size: "small", label: t('route.dossiers.manager.pivot.icon'), value: icon, disabled: !pivot, fullWidth: true, error: !iconExists(icon), sx: { '& input': { paddingLeft: '2.25rem' } }, onChange: ev => update({ icon: ev.target.value }) }), _jsx(Icon, { fontSize: "1.75rem", icon: icon, style: { position: 'absolute', left: '0.5rem' } }), _jsx(Button, { variant: "outlined", color: "error", disabled: !pivot, sx: { minWidth: '0 !important', ml: 1 }, onClick: () => update(undefined), children: _jsx(Delete, {}) })] }), _jsxs(Stack, { direction: "row", spacing: 0.5, alignItems: "center", sx: { mt: `${theme.spacing(0.5)} !important` }, children: [_jsx(Typography, { color: "text.secondary", children: t('route.dossiers.manager.icon.description') }), _jsx(IconButton, { size: "small", component: "a", href: "https://icon-sets.iconify.design/", children: _jsx(OpenInNew, { fontSize: "small" }) })] }), _jsxs(Stack, { direction: "row", spacing: 2, children: [_jsx(TextField, { size: "small", label: t('route.dossiers.manager.pivot.label.en'), disabled: !pivot, value: pivot?.label?.en ?? '', fullWidth: true, onChange: ev => update({ label: { en: ev.target.value } }) }), _jsx(TextField, { size: "small", label: t('route.dossiers.manager.pivot.label.fr'), disabled: !pivot, value: pivot?.label?.fr ?? '', fullWidth: true, onChange: ev => update({ label: { fr: ev.target.value } }) })] }), _jsx(Autocomplete, { disabled: !pivot, options: ['link', ...howlerPluginStore.pivotFormats], renderInput: params => (_jsx(TextField, { ...params, size: "small", label: t('route.dossiers.manager.pivot.format') })), value: pivot?.format ?? null, onChange: (_ev, format) => update({ format: format ?? undefined, value: '', mappings: [] }) }), !!pivot?.format &&
|
|
88
89
|
(pivot.format === 'link' ? (_jsx(LinkForm, { pivot: pivot, update: update })) : (pluginStore.executeFunction(`pivot.${pivot.format}.form`, { pivot, update })))] })] }) }));
|
|
89
90
|
};
|
|
90
91
|
export default PivotForm;
|
|
@@ -16,7 +16,7 @@ const EventViewer = ({ event: provided, eventId }) => {
|
|
|
16
16
|
if (eventId) {
|
|
17
17
|
void dispatchApi(api.v2.search.post('event', { query: `howler.id:${eventId}`, rows: 1 }), {
|
|
18
18
|
throwError: false
|
|
19
|
-
}).then(res => setEvent(res
|
|
19
|
+
}).then(res => setEvent(res?.items[0] ?? null));
|
|
20
20
|
}
|
|
21
21
|
}, [dispatchApi, eventId]);
|
|
22
22
|
return _jsx(Box, { p: 1, children: event ? _jsx(ObjectDetails, { obj: event }) : _jsx(Skeleton, { height: 120 }) });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PageCenter } from '@tui/core';
|
|
2
3
|
import { Box, Stack, Tab, Typography, useMediaQuery, useTheme } from '@mui/material';
|
|
3
|
-
import PageCenter from '@cccsaurora/howler-ui/commons/components/pages/PageCenter';
|
|
4
4
|
import { useScrollRestoration } from '@cccsaurora/howler-ui/components/hooks/useScrollRestoration';
|
|
5
5
|
import howlerPluginStore from '@cccsaurora/howler-ui/plugins/store';
|
|
6
6
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import { usePluginStore } from 'react-pluggable';
|
|
9
|
-
import { useSearchParams } from 'react-router
|
|
9
|
+
import { useSearchParams } from 'react-router';
|
|
10
10
|
import ActionIntroductionDocumentation from './ActionIntroductionDocumentation';
|
|
11
11
|
import HelpTabs from './components/HelpTabs';
|
|
12
12
|
const ActionDocumentation = () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useAppUser } from '@tui/core';
|
|
2
3
|
import { Close, Search } from '@mui/icons-material';
|
|
3
4
|
import { IconButton, ListItemText, MenuItem, Select, Stack } from '@mui/material';
|
|
4
5
|
import api from '@cccsaurora/howler-ui/api';
|
|
5
|
-
import { useAppUser } from '@cccsaurora/howler-ui/commons/components/app/hooks';
|
|
6
6
|
import Phrase from '@cccsaurora/howler-ui/components/elements/addons/search/phrase/Phrase';
|
|
7
7
|
import Markdown from '@cccsaurora/howler-ui/components/elements/display/Markdown';
|
|
8
8
|
import { difference } from 'lodash-es';
|
|
@@ -25,7 +25,7 @@ const ActionIntroductionDocumentation = () => {
|
|
|
25
25
|
useEffect(() => {
|
|
26
26
|
api.action.operations
|
|
27
27
|
.get()
|
|
28
|
-
.then(_operations => _operations.filter(a => difference(a.roles, user.roles).length < a.roles.length))
|
|
28
|
+
.then(_operations => _operations.filter(a => difference(a.roles, user.roles ?? []).length < a.roles.length))
|
|
29
29
|
.then(setOperations)
|
|
30
30
|
// eslint-disable-next-line no-console
|
|
31
31
|
.catch(console.debug);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Help } from '@mui/icons-material';
|
|
3
3
|
import { Chip, Paper, Stack, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Tooltip, Typography, useMediaQuery, useTheme } 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 Markdown from '@cccsaurora/howler-ui/components/elements/display/Markdown';
|
|
8
7
|
import useMyApi from '@cccsaurora/howler-ui/components/hooks/useMyApi';
|
|
9
8
|
import { useScrollRestoration } from '@cccsaurora/howler-ui/components/hooks/useScrollRestoration';
|
|
@@ -23,7 +22,7 @@ const ApiDocumentation = () => {
|
|
|
23
22
|
const theme = useTheme();
|
|
24
23
|
useScrollRestoration();
|
|
25
24
|
const isLg = useMediaQuery(theme.breakpoints.down('lg'));
|
|
26
|
-
const [data, setData] = useState(
|
|
25
|
+
const [data, setData] = useState();
|
|
27
26
|
useEffect(() => {
|
|
28
27
|
void dispatchApi(api.help.get()).then(setData);
|
|
29
28
|
}, [dispatchApi]);
|
|
@@ -49,7 +48,7 @@ const ApiDocumentation = () => {
|
|
|
49
48
|
.replace(/(\S+)\s+=>\s+(.+)/g, '\n`$1`: $2\n')
|
|
50
49
|
.replace(/(Data Block:\n)([\s\S]+)(Result Example:)/, (__, p1, p2, p3) => `${p1}\`\`\`\n${p2.trim()}\n\`\`\`\n${p3}`)
|
|
51
50
|
.replace(/(Result Example:\n)([\s\S]+)$/, (__, p1, p2) => `${p1}\`\`\`\n${p2.trim()}\n\`\`\``) }));
|
|
52
|
-
return (_jsxs(Fragment, { children: [_jsxs(TableRow, { style: { marginBottom: '1rem' }, sx: [isLg && { '& > td': { borderBottom: 0 } }], children: [_jsx(TableCell, { children: _jsxs(Stack, { direction: "column", spacing: 1, alignItems: "start", children: [_jsx(Typography, { children: endpoint.name }), _jsx("code", { children: endpoint.path }), _jsxs(Stack, { direction: "row", spacing: 1, children: [endpoint.complete ? (_jsx(Chip, { label: "Stable", color: "success" })) : (_jsx(Chip, { label: "Unstable", color: "error" })), endpoint.protected ? (_jsx(Chip, { label: "Protected", color: "warning" })) : (_jsx(Chip, { label: "Unprotected" }))] }), _jsx(Stack, { spacing: 1, direction: "row", children: endpoint.methods.map(m => (_jsx(Chip, { size: "small", label: m }, m))) }), endpoint.ui_only && _jsx(Chip, { label: "UI Only" })] }) }), _jsx(TableCell, { children: _jsx(Stack, { spacing: 1, direction: "row", children: endpoint.required_type.map(type => (_jsx(Chip, { size: "small", label: type, color: user.roles?.includes(type) ? 'success' : 'default' }, type))) }) }), _jsx(TableCell, { children: _jsx(Stack, { spacing: 1, direction: "row", children: endpoint.required_priv.map(
|
|
51
|
+
return (_jsxs(Fragment, { children: [_jsxs(TableRow, { style: { marginBottom: '1rem' }, sx: [isLg && { '& > td': { borderBottom: 0 } }], children: [_jsx(TableCell, { children: _jsxs(Stack, { direction: "column", spacing: 1, alignItems: "start", children: [_jsx(Typography, { children: endpoint.name }), _jsx("code", { children: endpoint.path }), _jsxs(Stack, { direction: "row", spacing: 1, children: [endpoint.complete ? (_jsx(Chip, { label: "Stable", color: "success" })) : (_jsx(Chip, { label: "Unstable", color: "error" })), endpoint.protected ? (_jsx(Chip, { label: "Protected", color: "warning" })) : (_jsx(Chip, { label: "Unprotected" }))] }), _jsx(Stack, { spacing: 1, direction: "row", children: endpoint.methods.map(m => (_jsx(Chip, { size: "small", label: m }, m))) }), endpoint.ui_only && _jsx(Chip, { label: "UI Only" })] }) }), _jsx(TableCell, { children: _jsx(Stack, { spacing: 1, direction: "row", children: endpoint.required_type.map(type => (_jsx(Chip, { size: "small", label: type, color: user.roles?.includes(type) ? 'success' : 'default' }, type))) }) }), _jsx(TableCell, { children: _jsx(Stack, { spacing: 1, direction: "row", children: endpoint.required_priv.map(p => (_jsx(Chip, { size: "small", label: t(APIKEY_LABELS[p]) }, p))) }) }), !isLg && _jsx(TableCell, { children: documentationCell })] }), isLg && (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 3, sx: { '& pre': { whiteSpace: 'pre-wrap' } }, children: documentationCell }) }))] }, endpoint.id));
|
|
53
52
|
}) })] }) })] }) }));
|
|
54
53
|
};
|
|
55
54
|
export default ApiDocumentation;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import PageCenter from '@
|
|
2
|
+
import { PageCenter } from '@tui/core';
|
|
3
3
|
import Markdown from '@cccsaurora/howler-ui/components/elements/display/Markdown';
|
|
4
4
|
import { useScrollRestoration } from '@cccsaurora/howler-ui/components/hooks/useScrollRestoration';
|
|
5
5
|
import { useMemo } from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import PageCenter from '@
|
|
2
|
+
import { PageCenter } from '@tui/core';
|
|
3
3
|
import Markdown from '@cccsaurora/howler-ui/components/elements/display/Markdown';
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const HelpDashboard: () => import("react
|
|
1
|
+
declare const HelpDashboard: () => import("react").JSX.Element;
|
|
2
2
|
export default HelpDashboard;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { HelpCenter, OpenInNew } from '@mui/icons-material';
|
|
3
3
|
import { Button, Card, CardActions, CardContent, CardHeader, Divider, Grid, IconButton, Stack, Typography } from '@mui/material';
|
|
4
|
-
import PageCenter from '@
|
|
4
|
+
import { PageCenter } from '@tui/core';
|
|
5
5
|
import useMyPreferences from '@cccsaurora/howler-ui/components/hooks/useMyPreferences';
|
|
6
6
|
import { useScrollRestoration } from '@cccsaurora/howler-ui/components/hooks/useScrollRestoration';
|
|
7
7
|
import howlerPluginStore from '@cccsaurora/howler-ui/plugins/store';
|
|
8
8
|
import { useMemo } from 'react';
|
|
9
9
|
import { useTranslation } from 'react-i18next';
|
|
10
10
|
import { usePluginStore } from 'react-pluggable';
|
|
11
|
-
import { Link } from 'react-router
|
|
11
|
+
import { Link } from 'react-router';
|
|
12
12
|
const HelpDashboard = () => {
|
|
13
13
|
const { t } = useTranslation(['translation', 'helpMain']);
|
|
14
14
|
const { leftnav } = useMyPreferences();
|
|
@@ -18,7 +18,8 @@ const HelpDashboard = () => {
|
|
|
18
18
|
'help.hit': ['schema', 'header', 'bundle', 'links'],
|
|
19
19
|
'help.actions': ['introduction', ...howlerPluginStore.operations]
|
|
20
20
|
}), []);
|
|
21
|
-
const links =
|
|
22
|
-
|
|
21
|
+
const links = (leftnav?.menus?.find(menu => menu.id === 'help')?.items?.filter(_item => _item.id !== 'help.main') ??
|
|
22
|
+
[]);
|
|
23
|
+
return (_jsx(PageCenter, { margin: 4, width: "100%", maxWidth: "1750px", textAlign: "left", children: _jsxs(Stack, { spacing: 1, children: [_jsxs(Typography, { variant: "h3", sx: { display: 'flex', flexDirection: 'row', alignItems: 'center' }, children: [_jsx(HelpCenter, { fontSize: "inherit", sx: { mr: 1 } }), _jsx("span", { children: t('page.help.title') })] }), _jsx(Divider, { sx: theme => ({ marginLeft: `${theme.spacing(1)} !important` }) }), _jsx(Grid, { container: true, spacing: 1, sx: { pr: 1 }, children: links.map(link => (_jsx(Grid, { size: { xs: 12, md: 3 }, sx: { display: 'flex' }, children: _jsxs(Card, { sx: { flex: 1, display: 'flex', flexDirection: 'column' }, children: [_jsx(CardHeader, { title: _jsxs(Stack, { direction: "row", alignItems: "center", sx: { '& svg': { fontSize: 'inherit' }, '& > span': { ml: 1 } }, children: [link.icon, link.i18nKey && _jsx("span", { children: t(link.i18nKey) }), _jsx(IconButton, { component: Link, to: link.route, sx: { ml: 'auto' }, children: _jsx(OpenInNew, { color: "primary", fontSize: "inherit" }) })] }) }), _jsx(CardContent, { sx: { flex: 1 }, children: _jsx(Typography, { children: t(`helpMain:${link.i18nKey}.description`) }) }), tabs[link.id] && (_jsx(CardActions, { children: tabs[link.id].map((tab) => (_jsx(Button, { size: "small", component: Link, to: `${link.route}?tab=${tab}`, children: tab }, tab))) }))] }) }, link.id))) }), howlerPluginStore.plugins.map(plugin => pluginStore.executeFunction(`${plugin}.help`))] }) }));
|
|
23
24
|
};
|
|
24
25
|
export default HelpDashboard;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Stack, Tab, Typography, useMediaQuery, useTheme } from '@mui/material';
|
|
3
|
-
import PageCenter from '@
|
|
3
|
+
import { PageCenter } from '@tui/core';
|
|
4
4
|
import { useScrollRestoration } from '@cccsaurora/howler-ui/components/hooks/useScrollRestoration';
|
|
5
5
|
import { useCallback, useState } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { useSearchParams } from 'react-router
|
|
7
|
+
import { useSearchParams } from 'react-router';
|
|
8
8
|
import HelpTabs from './components/HelpTabs';
|
|
9
9
|
import HitBannerDocumentation from './HitBannerDocumentation';
|
|
10
10
|
import HitLabelsDocumentation from './HitLabelsDocumentation';
|
|
@@ -16,7 +16,7 @@ const HitDocumentation = () => {
|
|
|
16
16
|
const useHorizontal = useMediaQuery(theme.breakpoints.down(1700));
|
|
17
17
|
useScrollRestoration();
|
|
18
18
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
19
|
-
const [tab, setTab] = useState(searchParams.get('tab') ?? 'schema');
|
|
19
|
+
const [tab, setTab] = useState((searchParams.get('tab') ?? 'schema'));
|
|
20
20
|
const onChange = useCallback((_tab) => {
|
|
21
21
|
setTab(_tab);
|
|
22
22
|
searchParams.set('tab', _tab);
|