@topconsultnpm/sdkui-react 6.22.0-t1 → 6.22.0-t3
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/lib/components/NewComponents/ContextMenu/TMContextMenu.js +3 -3
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +1 -1
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +45 -43
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +6 -6
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +80 -73
- package/lib/components/base/Styled.d.ts +92 -76
- package/lib/components/base/Styled.js +7 -5
- package/lib/components/base/TMAccordionNew.js +7 -7
- package/lib/components/base/TMAlert.d.ts +32 -32
- package/lib/components/base/TMAlert.js +6 -8
- package/lib/components/base/TMAreaManager.js +53 -55
- package/lib/components/base/TMButton.d.ts +13 -0
- package/lib/components/base/TMButton.js +139 -7
- package/lib/components/base/TMClosableList.js +3 -3
- package/lib/components/base/TMCustomButton.js +40 -48
- package/lib/components/base/TMDataGrid.d.ts +4 -0
- package/lib/components/base/TMDataGrid.js +292 -12
- package/lib/components/base/TMDataGridExportForm.js +39 -30
- package/lib/components/base/TMDropDownMenu.js +1 -1
- package/lib/components/base/TMEditorBase.d.ts +2 -0
- package/lib/components/base/TMFileManager.js +5 -3
- package/lib/components/base/TMFileManagerDataGridView.js +12 -3
- package/lib/components/base/TMFileManagerThumbnailItems.js +20 -10
- package/lib/components/base/TMFileManagerUtils.d.ts +6 -6
- package/lib/components/base/TMFileManagerUtils.js +37 -1
- package/lib/components/base/TMLayout.d.ts +2 -2
- package/lib/components/base/TMLayout.js +3 -3
- package/lib/components/base/TMList.js +1 -1
- package/lib/components/base/TMListView.js +3 -3
- package/lib/components/base/TMModal.d.ts +11 -0
- package/lib/components/base/TMModal.js +47 -13
- package/lib/components/base/TMPanel.d.ts +6 -0
- package/lib/components/base/TMPanel.js +141 -28
- package/lib/components/base/TMPopUp.js +5 -2
- package/lib/components/base/TMResizableMenu.js +2 -2
- package/lib/components/base/TMRightSidebar.js +1 -1
- package/lib/components/base/TMShowAllOrMaxItemsButton.js +1 -1
- package/lib/components/base/TMSpinner.d.ts +2 -1
- package/lib/components/base/TMSpinner.js +9 -7
- package/lib/components/base/TMTab.js +2 -2
- package/lib/components/base/TMTabControl.d.ts +106 -0
- package/lib/components/base/TMTabControl.js +664 -0
- package/lib/components/base/TMToggleButton.js +2 -2
- package/lib/components/base/TMToolbarCard.js +3 -3
- package/lib/components/base/TMTooltip.d.ts +2 -1
- package/lib/components/base/TMTooltip.js +24 -8
- package/lib/components/base/TMTreeView.d.ts +13 -7
- package/lib/components/base/TMTreeView.js +143 -70
- package/lib/components/base/TMWaitPanel.js +3 -3
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +169 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.js +320 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +53 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.js +274 -0
- package/lib/components/base/waitPanel/index.d.ts +1 -0
- package/lib/components/base/waitPanel/index.js +1 -0
- package/lib/components/choosers/TMCultureIDPicker.js +2 -2
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDataListItemPicker.js +2 -2
- package/lib/components/choosers/TMDcmtTypeChooser.js +5 -4
- package/lib/components/choosers/TMDiskChooser.js +1 -1
- package/lib/components/choosers/TMDistinctValues.d.ts +9 -7
- package/lib/components/choosers/TMDistinctValues.js +157 -141
- package/lib/components/choosers/TMDynDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMImageIDChooser.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.js +3 -3
- package/lib/components/choosers/TMPathChooser.js +17 -34
- package/lib/components/choosers/TMQuickSearchInfo.d.ts +13 -0
- package/lib/components/choosers/TMQuickSearchInfo.js +279 -0
- package/lib/components/choosers/TMQuickSearchSettingsForm.d.ts +16 -0
- package/lib/components/choosers/TMQuickSearchSettingsForm.js +94 -0
- package/lib/components/choosers/TMRelationChooser.js +1 -1
- package/lib/components/choosers/TMSelectedValuesSummary.d.ts +13 -0
- package/lib/components/choosers/TMSelectedValuesSummary.js +89 -0
- package/lib/components/choosers/TMUserChooser.js +1 -1
- package/lib/components/editors/TMCheckBox.js +1 -1
- package/lib/components/editors/TMDateBox.d.ts +16 -1
- package/lib/components/editors/TMDateBox.js +90 -22
- package/lib/components/editors/TMDropDown.d.ts +3 -0
- package/lib/components/editors/TMDropDown.js +197 -5
- package/lib/components/editors/TMEditorStyled.d.ts +21 -43
- package/lib/components/editors/TMFormulaEditor.js +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.js +1 -1
- package/lib/components/editors/TMLocalizedTextBox.js +1 -1
- package/lib/components/editors/TMMetadataEditor.d.ts +5 -1
- package/lib/components/editors/TMMetadataEditor.js +27 -23
- package/lib/components/editors/TMMetadataValues.js +6 -6
- package/lib/components/editors/TMRadioButton.js +2 -2
- package/lib/components/editors/TMSummary.js +3 -3
- package/lib/components/editors/TMTextArea.d.ts +1 -0
- package/lib/components/editors/TMTextArea.js +25 -17
- package/lib/components/editors/TMTextBox.d.ts +2 -0
- package/lib/components/editors/TMTextBox.js +32 -21
- package/lib/components/editors/TMTextExpression.js +1 -1
- package/lib/components/features/archive/TMArchive.js +24 -5
- package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +29 -0
- package/lib/components/features/assistant/TMHelpOnLineChat.js +1384 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +4 -4
- package/lib/components/features/assistant/TMToppySpeechBubble.js +1 -1
- package/lib/components/features/assistant/dataset/Designer-Suggested-Questions.json +102 -0
- package/lib/components/features/assistant/dataset/Login-Suggested-Questions.json +32 -0
- package/lib/components/features/assistant/dataset/Surfer-Suggested-Questions.json +102 -0
- package/lib/components/features/documents/TMBatchUpdateForm.js +22 -9
- package/lib/components/features/documents/TMCopyToFolderForm.js +50 -42
- package/lib/components/features/documents/TMDcmtBlog.d.ts +3 -0
- package/lib/components/features/documents/TMDcmtBlog.js +4 -4
- package/lib/components/features/documents/TMDcmtForm.d.ts +7 -0
- package/lib/components/features/documents/TMDcmtForm.js +281 -113
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +11 -0
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +79 -9
- package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -3
- package/lib/components/features/documents/TMDcmtIcon.js +8 -8
- package/lib/components/features/documents/TMDcmtPreview.d.ts +7 -5
- package/lib/components/features/documents/TMDcmtPreview.js +16 -10
- package/lib/components/features/documents/TMDcmtTasks.js +2 -9
- package/lib/components/features/documents/TMDownloadRelationViewerSection.js +1 -1
- package/lib/components/features/documents/TMFileUploader.js +7 -7
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +95 -108
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +20 -0
- package/lib/components/features/documents/TMMasterInfoFields.js +185 -0
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
- package/lib/components/features/documents/TMMergeToPdfForm.js +83 -56
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +46 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +320 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +370 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +283 -0
- package/lib/components/features/documents/TMRelationViewer.d.ts +29 -9
- package/lib/components/features/documents/TMRelationViewer.js +310 -208
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +1 -1
- package/lib/components/features/documents/relationTreeState.d.ts +32 -0
- package/lib/components/features/documents/relationTreeState.js +89 -0
- package/lib/components/features/search/TMMetadataOutputForm.js +1 -1
- package/lib/components/features/search/TMMetadataSorterForm.js +1 -1
- package/lib/components/features/search/TMSavedQuerySelector.js +2 -2
- package/lib/components/features/search/TMSearch.d.ts +1 -1
- package/lib/components/features/search/TMSearch.js +172 -34
- package/lib/components/features/search/TMSearchQueryEditor.js +7 -5
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +14 -4
- package/lib/components/features/search/TMSearchQueryPanel.js +153 -62
- package/lib/components/features/search/TMSearchResult.d.ts +21 -0
- package/lib/components/features/search/TMSearchResult.js +461 -152
- package/lib/components/features/search/TMSignatureInfoContent.js +1 -1
- package/lib/components/features/search/TMTreeSelector.js +130 -83
- package/lib/components/features/search/TMViewHistoryDcmt.js +14 -25
- package/lib/components/features/tasks/TMTaskForm.js +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.js +3 -3
- package/lib/components/features/tasks/TMTasksAgenda.js +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.js +1 -1
- package/lib/components/features/tasks/TMTasksHeader.js +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.js +1 -1
- package/lib/components/features/tasks/TMTasksView.js +97 -102
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +92 -92
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +10 -0
- package/lib/components/features/workflow/TMWorkflowPopup.js +9 -5
- package/lib/components/features/workflow/diagram/ConnectionComponent.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +1 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +1 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +4 -4
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +3 -1
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +3 -1
- package/lib/components/forms/Login/Menu.js +1 -1
- package/lib/components/forms/Login/OTPReader.js +1 -1
- package/lib/components/forms/Login/PasswordStrengthChecker.js +1 -1
- package/lib/components/forms/Login/RapidAccessLogin.js +2 -2
- package/lib/components/forms/Login/RecoverPasswordFlow.js +2 -2
- package/lib/components/forms/Login/SelectBox.js +1 -1
- package/lib/components/forms/Login/StepIndicator.js +1 -1
- package/lib/components/forms/Login/TMLoginForm.js +7 -7
- package/lib/components/forms/Login/TextBox.js +1 -1
- package/lib/components/forms/TMApplyForm.js +3 -3
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/forms/TMResultDialog.js +1 -1
- package/lib/components/forms/TMSaveForm.js +3 -3
- package/lib/components/grids/TMBlogAttachments.js +14 -3
- package/lib/components/grids/TMBlogHeader.js +5 -1
- package/lib/components/grids/TMBlogsPost.d.ts +2 -0
- package/lib/components/grids/TMBlogsPost.js +122 -99
- package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
- package/lib/components/grids/TMBlogsPostUtils.js +15 -4
- package/lib/components/grids/TMRecentsManager.js +4 -4
- package/lib/components/grids/TMValidationItemsList.js +1 -1
- package/lib/components/index.d.ts +6 -0
- package/lib/components/index.js +5 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +25 -15
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +68 -93
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +4 -5
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +1 -1
- package/lib/components/layout/panelManager/TMPanelWrapper.js +3 -3
- package/lib/components/layout/panelManager/types.d.ts +3 -0
- package/lib/components/layout/panelManager/utils.js +13 -11
- package/lib/components/pages/TMPage.js +30 -32
- package/lib/components/query/TMQueryCountButton.js +1 -1
- package/lib/components/query/TMQueryEditor.d.ts +17 -10
- package/lib/components/query/TMQueryEditor.js +9 -8
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
- package/lib/components/sidebar/TMCommandsPanel.js +1 -1
- package/lib/components/sidebar/TMHeader.d.ts +1 -0
- package/lib/components/sidebar/TMHeader.js +37 -27
- package/lib/components/sidebar/TMSidebar.js +1 -1
- package/lib/components/sidebar/TMSidebarItem.js +1 -1
- package/lib/components/viewers/TMMidViewer.js +6 -3
- package/lib/components/viewers/TMTidViewer.js +89 -28
- package/lib/components/wizard/TMStepIndicator.js +3 -3
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/devextreme-license.d.ts +1 -0
- package/lib/devextreme-license.js +3 -0
- package/lib/helper/Enum_Localizator.d.ts +4 -4
- package/lib/helper/Enum_Localizator.js +1 -0
- package/lib/helper/Globalization.d.ts +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +110 -0
- package/lib/helper/SDKUI_Globals.js +151 -0
- package/lib/helper/SDKUI_Localizator.d.ts +756 -677
- package/lib/helper/SDKUI_Localizator.js +790 -0
- package/lib/helper/TMAppUpdatedModal.d.ts +2 -0
- package/lib/helper/TMAppUpdatedModal.js +134 -0
- package/lib/helper/TMIcons.d.ts +1 -0
- package/lib/helper/TMIcons.js +4 -3
- package/lib/helper/TMPdfViewer.js +1 -1
- package/lib/helper/TMToppyMessage.js +1 -1
- package/lib/helper/TMUtils.d.ts +51 -4
- package/lib/helper/TMUtils.js +273 -12
- package/lib/helper/ZipManager.d.ts +1 -1
- package/lib/helper/ZipManager.js +2 -1
- package/lib/helper/checkinCheckoutManager.d.ts +1 -1
- package/lib/helper/checkinCheckoutManager.js +1 -1
- package/lib/helper/dataGridSearchHelper.d.ts +28 -0
- package/lib/helper/dataGridSearchHelper.js +51 -0
- package/lib/helper/dcmtsHelper.d.ts +22 -0
- package/lib/helper/dcmtsHelper.js +60 -1
- package/lib/helper/helpers.d.ts +24 -2
- package/lib/helper/helpers.js +59 -3
- package/lib/helper/index.d.ts +2 -0
- package/lib/helper/index.js +2 -0
- package/lib/helper/queryHelper.d.ts +6 -1
- package/lib/helper/queryHelper.js +8 -3
- package/lib/hooks/tmDistinctValuesGridHelper.d.ts +16 -0
- package/lib/hooks/tmDistinctValuesGridHelper.js +31 -0
- package/lib/hooks/useArchiveListForm.d.ts +39 -0
- package/lib/hooks/useArchiveListForm.js +46 -0
- package/lib/hooks/useCaseFlowApprove.d.ts +56 -0
- package/lib/hooks/useCaseFlowApprove.js +157 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
- package/lib/hooks/useCheckInOutOperations.js +14 -34
- package/lib/hooks/useDataUserIdItem.d.ts +1 -0
- package/lib/hooks/useDataUserIdItem.js +1 -0
- package/lib/hooks/useDcmtOperations.d.ts +3 -12
- package/lib/hooks/useDcmtOperations.js +187 -179
- package/lib/hooks/useDocumentOperations.d.ts +5 -0
- package/lib/hooks/useDocumentOperations.js +64 -33
- package/lib/hooks/useInputDialog.js +1 -1
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +98 -0
- package/lib/hooks/useMultiMasterDetailDcmts.js +758 -0
- package/lib/hooks/usePreventFileDrop.js +9 -0
- package/lib/hooks/useQueryParametersDialog.js +1 -1
- package/lib/hooks/useRelatedDocuments.d.ts +1 -0
- package/lib/hooks/useRelatedDocuments.js +22 -27
- package/lib/hooks/useShowDossiersV5.d.ts +12 -0
- package/lib/hooks/useShowDossiersV5.js +37 -0
- package/lib/hooks/useTMDistinctValuesMetadataDisplay.d.ts +18 -0
- package/lib/hooks/useTMDistinctValuesMetadataDisplay.js +103 -0
- package/lib/hooks/useTMDistinctValuesQuickSearch.d.ts +49 -0
- package/lib/hooks/useTMDistinctValuesQuickSearch.js +307 -0
- package/lib/hooks/useTMDistinctValuesSelection.d.ts +42 -0
- package/lib/hooks/useTMDistinctValuesSelection.js +103 -0
- package/lib/hooks/useTMDistinctValuesSource.d.ts +29 -0
- package/lib/hooks/useTMDistinctValuesSource.js +105 -0
- package/lib/hooks/useWorkflowApprove.js +33 -17
- package/lib/index.d.ts +2 -0
- package/lib/index.js +5 -2
- package/lib/services/caseflow/CaseFlowService.d.ts +277 -0
- package/lib/services/caseflow/CaseFlowService.js +761 -0
- package/lib/services/caseflow/CaseFlowTemplateCacheService.d.ts +28 -0
- package/lib/services/caseflow/CaseFlowTemplateCacheService.js +121 -0
- package/lib/services/caseflow/caseFlowNameCache.d.ts +32 -0
- package/lib/services/caseflow/caseFlowNameCache.js +116 -0
- package/lib/services/caseflow/caseFlowWorkItemUtils.d.ts +61 -0
- package/lib/services/caseflow/caseFlowWorkItemUtils.js +113 -0
- package/lib/services/index.d.ts +4 -0
- package/lib/services/index.js +4 -0
- package/lib/services/platform_services.d.ts +4 -4
- package/package.json +16 -13
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useState } from "react";
|
|
3
3
|
import { AssignedTab, checkIfNew, createTasksMenuItems, getHeaderPriorityFilterConfig, getHeaderStatusFilterConfig, getMondayOfCurrentWeek, getNewTaskCount, getStatusLocalizatorValue, isTaskAssignedToAnotherUser, LIGTH_CYAN, LIGTH_RED_ORGANGE, TaskView, TEXT_NOT_SELECTED_COLOR } from "./TMTasksUtils";
|
|
4
|
-
import { TabPanel, Item } from 'devextreme-react/tab-panel';
|
|
5
4
|
import { Priorities, ResultTypes, SDK_Globals, Task_States } from "@topconsultnpm/sdk-ts";
|
|
6
5
|
import { calculateNumberOfDays, renderTaskIcons } from "./TMTasksUtilsView";
|
|
7
6
|
import { getPriorityLocalizatorValue } from "../tasks/TMTasksUtils";
|
|
8
|
-
import { getExceptionMessage, SDKUI_Localizator,
|
|
7
|
+
import { getExceptionMessage, SDKUI_Localizator, taskModalSizes, TMCountBadge } from "../../../helper";
|
|
9
8
|
import { useDeviceType } from "../../base/TMDeviceProvider";
|
|
10
9
|
import { FormModes } from "../../../ts";
|
|
11
10
|
import TMDataGrid from "../../base/TMDataGrid";
|
|
12
11
|
import { TMMessageBoxManager, ButtonNames } from "../../base/TMPopUp";
|
|
13
12
|
import TMTooltip from "../../base/TMTooltip";
|
|
14
|
-
import {
|
|
13
|
+
import TMTabControl, { TMTabPanel } from "../../base/TMTabControl";
|
|
14
|
+
import TMLayoutContainer from "../../base/TMLayout";
|
|
15
|
+
import TMWaitPanelManager from "../../base/waitPanel/TMWaitPanelManager";
|
|
15
16
|
import { TMResultManager } from "../../forms/TMResultDialog";
|
|
16
17
|
import TMTasksCalendar from "./TMTasksCalendar";
|
|
17
18
|
import TMTasksAgenda from "./TMTasksAgenda";
|
|
18
19
|
import TMTaskForm from "./TMTaskForm";
|
|
19
|
-
let abortController = new AbortController();
|
|
20
20
|
const TMTasksView = (props) => {
|
|
21
21
|
const { id, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, visualizedTasks, activeComponent, activeTabIndex, setActiveTabIndex, currentTask, setCurrentTask, assignedToMeCount, assignedByMeCount, allTasksFilteredCount, showId, setShowId, showSearch, setShowSearch, showContextualWG, setShowContextualWG, showContextualDossier, setShowContextualDossier, showContextualDocument, setShowContextualDocument, handleNavigateToWGs, handleNavigateToDossiers, taskContext, usersList, onOpenS4TViewerRequest, s4TViewerDialogComponent, afterTaskSaved, } = props;
|
|
22
22
|
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
|
|
@@ -39,18 +39,6 @@ const TMTasksView = (props) => {
|
|
|
39
39
|
const [calendarStartDate, setCalendarStartDate] = useState(undefined);
|
|
40
40
|
/* State to manage the calendar end date */
|
|
41
41
|
const [calendarEndDate, setCalendarEndDate] = useState(undefined);
|
|
42
|
-
// State variable to control the visibility of the wait panel.
|
|
43
|
-
const [showWaitPanel, setShowWaitPanel] = useState(false);
|
|
44
|
-
// State variable to store the title of the wait panel.
|
|
45
|
-
const [waitPanelTitle, setWaitPanelTitle] = useState('');
|
|
46
|
-
// State variable to control the visibility of the primary section of the wait panel.
|
|
47
|
-
const [showPrimary, setShowPrimary] = useState(false);
|
|
48
|
-
// State variable to store the primary text of the wait panel.
|
|
49
|
-
const [waitPanelTextPrimary, setWaitPanelTextPrimary] = useState('');
|
|
50
|
-
// State variable to track the current value of the primary progress indicator in the wait panel.
|
|
51
|
-
const [waitPanelValuePrimary, setWaitPanelValuePrimary] = useState(0);
|
|
52
|
-
// State variable to define the maximum value for the primary progress indicator in the wait panel.
|
|
53
|
-
const [waitPanelMaxValuePrimary, setWaitPanelMaxValuePrimary] = useState(0);
|
|
54
42
|
const [isContextualCreate, setIsContextualCreate] = useState(false);
|
|
55
43
|
// This function open the task form for editing a selected task
|
|
56
44
|
const editTaskAgendaCallback = (rowId) => {
|
|
@@ -158,49 +146,56 @@ const TMTasksView = (props) => {
|
|
|
158
146
|
onButtonClick: async (e) => {
|
|
159
147
|
if (e !== ButtonNames.YES)
|
|
160
148
|
return;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
149
|
+
const waitPanel = TMWaitPanelManager.show({
|
|
150
|
+
title: SDKUI_Localizator.Delete,
|
|
151
|
+
max: rowIds.length,
|
|
152
|
+
cancelable: true,
|
|
153
|
+
});
|
|
154
|
+
try {
|
|
155
|
+
let result = [];
|
|
156
|
+
let i = 0;
|
|
157
|
+
const deletedTaskIds = [];
|
|
158
|
+
for (const key of rowIds) {
|
|
159
|
+
i++;
|
|
160
|
+
const deletedTaskId = Number(key);
|
|
161
|
+
const deletedTask = visualizedTasks.find(task => task.id === deletedTaskId);
|
|
162
|
+
waitPanel.setSubtitle(SDKUI_Localizator.TaskXofY.replaceParams(i, rowIds.length));
|
|
163
|
+
if (waitPanel.aborted) {
|
|
164
|
+
result.push({ rowIndex: i, id1: deletedTaskId, id2: deletedTaskId, resultType: ResultTypes.WARNING, description: `Operazione interrotta. Elaborate ${i - 1} attività` });
|
|
165
|
+
waitPanel.warning();
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
try {
|
|
170
|
+
const deletionNotAllowed = deletedTask?.fromID !== SDK_Globals.tmSession?.SessionDescr?.userID;
|
|
171
|
+
if (deletionNotAllowed) {
|
|
172
|
+
result.push({ rowIndex: key, id1: key, id2: 0, resultType: ResultTypes.ERROR, description: SDKUI_Localizator.OperationNotAllowed });
|
|
173
|
+
waitPanel.error();
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
await SDK_Globals.tmSession?.NewTaskEngine().DeleteAsync(deletedTaskId);
|
|
177
|
+
result.push({ rowIndex: key, id1: key, id2: 0, description: SDKUI_Localizator.DeletionCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
178
|
+
deletedTaskIds.push(deletedTaskId);
|
|
179
|
+
waitPanel.ok();
|
|
180
|
+
}
|
|
184
181
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
deletedTaskIds.push(deletedTaskId);
|
|
182
|
+
catch (err) {
|
|
183
|
+
result.push({ rowIndex: key, id1: key, id2: 0, resultType: ResultTypes.ERROR, description: getExceptionMessage(err) });
|
|
184
|
+
waitPanel.error();
|
|
189
185
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
result.push({ rowIndex: key, id1: key, id2: 0, resultType: ResultTypes.ERROR, description: getExceptionMessage(err) });
|
|
186
|
+
// Avanza a elaborazione conclusa: con una sola attività la barra non parte dal 100%
|
|
187
|
+
await waitPanel.step();
|
|
193
188
|
}
|
|
194
189
|
}
|
|
190
|
+
await deleteTaskByIdsCallback(deletedTaskIds);
|
|
191
|
+
handleSelectionChange([]);
|
|
192
|
+
handleFocusedRowChange(undefined);
|
|
193
|
+
waitPanel.close();
|
|
194
|
+
TMResultManager.show(result, SDKUI_Localizator.Delete, "ID", undefined);
|
|
195
|
+
}
|
|
196
|
+
finally {
|
|
197
|
+
waitPanel.close();
|
|
195
198
|
}
|
|
196
|
-
await deleteTaskByIdsCallback(deletedTaskIds);
|
|
197
|
-
handleSelectionChange([]);
|
|
198
|
-
handleFocusedRowChange(undefined);
|
|
199
|
-
setWaitPanelTextPrimary('');
|
|
200
|
-
setWaitPanelMaxValuePrimary(0);
|
|
201
|
-
setWaitPanelValuePrimary(0);
|
|
202
|
-
setShowWaitPanel(false);
|
|
203
|
-
TMResultManager.show(result, SDKUI_Localizator.Delete, "ID", undefined);
|
|
204
199
|
}
|
|
205
200
|
});
|
|
206
201
|
}, [visualizedTasks]);
|
|
@@ -224,47 +219,53 @@ const TMTasksView = (props) => {
|
|
|
224
219
|
onButtonClick: async (e) => {
|
|
225
220
|
if (e !== ButtonNames.YES)
|
|
226
221
|
return;
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
setWaitPanelTextPrimary(SDKUI_Localizator.TaskXofY.replaceParams(i, rowIds.length));
|
|
247
|
-
try {
|
|
248
|
-
await SDK_Globals.tmSession?.NewTaskEngine().UpdateAsync(selectedTask);
|
|
249
|
-
result.push({ rowIndex: key, id1: key, id2: 0, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
222
|
+
const waitPanel = TMWaitPanelManager.show({
|
|
223
|
+
title: SDKUI_Localizator.MarkAs,
|
|
224
|
+
max: rowIds.length,
|
|
225
|
+
cancelable: true,
|
|
226
|
+
});
|
|
227
|
+
try {
|
|
228
|
+
let result = [];
|
|
229
|
+
let i = 0;
|
|
230
|
+
for (const key of rowIds) {
|
|
231
|
+
i++;
|
|
232
|
+
const selectedTask = visualizedTasks.find(task => task.id === key) || undefined;
|
|
233
|
+
if (selectedTask === undefined)
|
|
234
|
+
return;
|
|
235
|
+
selectedTask.state = status;
|
|
236
|
+
waitPanel.setSubtitle(SDKUI_Localizator.TaskXofY.replaceParams(i, rowIds.length));
|
|
237
|
+
if (waitPanel.aborted) {
|
|
238
|
+
result.push({ rowIndex: i, id1: selectedTask.id, id2: selectedTask.id, resultType: ResultTypes.WARNING, description: `Operazione interrotta. Elaborate ${i - 1} attività` });
|
|
239
|
+
waitPanel.warning();
|
|
240
|
+
break;
|
|
250
241
|
}
|
|
251
|
-
|
|
252
|
-
|
|
242
|
+
else {
|
|
243
|
+
try {
|
|
244
|
+
await SDK_Globals.tmSession?.NewTaskEngine().UpdateAsync(selectedTask);
|
|
245
|
+
result.push({ rowIndex: key, id1: key, id2: 0, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
246
|
+
waitPanel.ok();
|
|
247
|
+
}
|
|
248
|
+
catch (err) {
|
|
249
|
+
result.push({ rowIndex: key, id1: key, id2: 0, resultType: ResultTypes.ERROR, description: getExceptionMessage(err) });
|
|
250
|
+
waitPanel.error();
|
|
251
|
+
}
|
|
252
|
+
// Avanza a elaborazione conclusa: con una sola attività la barra non parte dal 100%
|
|
253
|
+
await waitPanel.step();
|
|
253
254
|
}
|
|
254
255
|
}
|
|
256
|
+
await getAllTasks().then(() => {
|
|
257
|
+
handleSelectionChange([]);
|
|
258
|
+
handleFocusedRowChange(undefined);
|
|
259
|
+
waitPanel.close();
|
|
260
|
+
TMResultManager.show(result, SDKUI_Localizator.MarkAs, "ID", undefined);
|
|
261
|
+
if (afterTaskSaved) {
|
|
262
|
+
afterTaskSaved(undefined, undefined, true);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
finally {
|
|
267
|
+
waitPanel.close();
|
|
255
268
|
}
|
|
256
|
-
await getAllTasks().then(() => {
|
|
257
|
-
handleSelectionChange([]);
|
|
258
|
-
handleFocusedRowChange(undefined);
|
|
259
|
-
setWaitPanelTextPrimary('');
|
|
260
|
-
setWaitPanelMaxValuePrimary(0);
|
|
261
|
-
setWaitPanelValuePrimary(0);
|
|
262
|
-
setShowWaitPanel(false);
|
|
263
|
-
TMResultManager.show(result, SDKUI_Localizator.MarkAs, "ID", undefined);
|
|
264
|
-
if (afterTaskSaved) {
|
|
265
|
-
afterTaskSaved(undefined, undefined, true);
|
|
266
|
-
}
|
|
267
|
-
});
|
|
268
269
|
}
|
|
269
270
|
});
|
|
270
271
|
}, [visualizedTasks]);
|
|
@@ -538,16 +539,10 @@ const TMTasksView = (props) => {
|
|
|
538
539
|
const getFromOrToCalendarElement = (fromOrToDataSource, fromCell = false, toCell = false) => {
|
|
539
540
|
return _jsx("div", { style: { width: '100%', height: '100%', display: 'flex', flexDirection: 'column', overflow: "auto" }, children: _jsx("div", { style: { width: "100%", height: "100%" }, children: _jsx(TMTasksCalendar, { id: id, visualizedTasks: fromOrToDataSource, showId: showId, fromCell: fromCell, toCell: toCell, showSearch: showSearch, currentCalendarDate: currentCalendarDate, setCurrentCalendarDate: setCurrentCalendarDate, openTaskForm: openTaskFormCallback, onDeleteCallback: onDeleteCallback, setCalendarStartDate: setCalendarStartDate, setCalendarEndDate: setCalendarEndDate, focusedRowKey: focusedRowKey, handleFocusedRowChange: handleFocusedRowChange, menuItems: menuItems }) }) });
|
|
540
541
|
};
|
|
541
|
-
return _jsxs("div", { style: { width: '100%', height: '100%' }, onContextMenu: (e) => e.preventDefault(), children: [_jsx(
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
_jsxs(_Fragment, { children: [activeComponent === TaskView.
|
|
545
|
-
return _jsx(StyledTabItem, { "$isSelected": activeTabIndex === AssignedTab.AssignedByMe, children: _jsxs(TMTooltip, { content: SDKUI_Localizator.AssignedByMe, children: [_jsx("i", { className: `dx-icon-${params.icon}` }), "\u00A0", params.title, " ", (assignedByMeCount > 0) ? `(${assignedByMeCount})` : ''] }) });
|
|
546
|
-
}, render: () => activeTabIndex === AssignedTab.AssignedByMe ?
|
|
547
|
-
_jsxs(_Fragment, { children: [activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, false, true), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, false, true), activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, false, true)] }) : '' }), _jsx(Item, { title: SDKUI_Localizator.AllFemale, icon: "fields", tabRender: (params) => {
|
|
548
|
-
return _jsxs(StyledTabItem, { "$isSelected": activeTabIndex === AssignedTab.All, children: [_jsxs(TMTooltip, { content: SDKUI_Localizator.AllFemale, children: [_jsx("i", { className: `dx-icon-${params.icon}` }), "\u00A0", params.title, " ", (allTasksFilteredCount > 0) ? `(${allTasksFilteredCount})` : ''] }), newTaskCount > 0 && (_jsx(TMTooltip, { content: SDKUI_Localizator.NewAssignedActivitiesNumber + ": " + newTaskCount, children: _jsx(TMCountBadge, { children: newTaskCount }) }))] });
|
|
549
|
-
}, render: () => activeTabIndex === AssignedTab.All ?
|
|
550
|
-
_jsxs(_Fragment, { children: [activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, true, true), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, true, true), activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, true, true)] }) : '' })] }) }), showTaskForm && _jsx(TMTaskForm, { id: currentTask?.id ?? -1, width: taskModalSizes(deviceType, formMode ?? FormModes.Create).width, height: taskModalSizes(deviceType, formMode ?? FormModes.Create).height, title: isContextualCreate ? SDKUI_Localizator.ContextualTask : SDKUI_Localizator.Widget_Activities, isModal: true, formMode: formMode ?? FormModes.Create, visualizedTasks: visualizedTasks, currentTask: currentTask, setCurrentTask: setCurrentTask, isContextualCreate: isContextualCreate, selectedRowKeys: selectedRowKeys, handleFocusedRowKeyChange: handleFocusedRowChange, taskContext: taskContext, usersList: usersList, onStatusChanged: () => { }, onClose: closeTaskFormCallback, onCancel: closeTaskFormCallback, showBackButton: false, onSaved: onSavedCallback, startDate: calendarStartDate, endDate: calendarEndDate, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGsWrapper, handleNavigateToDossiers: handleNavigateToDossiersWrapper }), _jsx("button", { style: {
|
|
542
|
+
return _jsxs("div", { style: { width: '100%', height: '100%' }, onContextMenu: (e) => e.preventDefault(), children: [_jsx(TMLayoutContainer, { direction: 'vertical', children: _jsxs(TMTabControl, { variant: 'moduleFilled', contentAnimation: 'none', swipeEnabled: false, selectedId: String(activeTabIndex), onSelectedIdChange: (id) => onSelectedIndexChange(Number(id)), style: { width: '100%', height: '100%' }, contentStyle: { display: 'flex', flex: 1, minHeight: 0 }, children: [_jsx(TMTabPanel, { id: String(AssignedTab.AssignedToMe), label: _jsxs(_Fragment, { children: [_jsxs(TMTooltip, { content: SDKUI_Localizator.AssignedToMe, children: [_jsx("i", { className: 'dx-icon-user' }), "\u00A0", SDKUI_Localizator.AssignedToMe, " ", (assignedToMeCount > 0) ? `(${assignedToMeCount})` : ''] }), newTaskCount > 0 && (_jsx(TMTooltip, { content: SDKUI_Localizator.NewAssignedActivitiesNumber + ": " + newTaskCount, children: _jsx(TMCountBadge, { children: newTaskCount }) }))] }), children: activeTabIndex === AssignedTab.AssignedToMe &&
|
|
543
|
+
_jsxs(_Fragment, { children: [activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, true, false), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, true, false), activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, true, false)] }) }), _jsx(TMTabPanel, { id: String(AssignedTab.AssignedByMe), label: _jsxs(TMTooltip, { content: SDKUI_Localizator.AssignedByMe, children: [_jsx("i", { className: 'dx-icon-login' }), "\u00A0", SDKUI_Localizator.AssignedByMe, " ", (assignedByMeCount > 0) ? `(${assignedByMeCount})` : ''] }), children: activeTabIndex === AssignedTab.AssignedByMe &&
|
|
544
|
+
_jsxs(_Fragment, { children: [activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, false, true), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, false, true), activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, false, true)] }) }), _jsx(TMTabPanel, { id: String(AssignedTab.All), label: _jsxs(_Fragment, { children: [_jsxs(TMTooltip, { content: SDKUI_Localizator.AllFemale, children: [_jsx("i", { className: 'dx-icon-fields' }), "\u00A0", SDKUI_Localizator.AllFemale, " ", (allTasksFilteredCount > 0) ? `(${allTasksFilteredCount})` : ''] }), newTaskCount > 0 && (_jsx(TMTooltip, { content: SDKUI_Localizator.NewAssignedActivitiesNumber + ": " + newTaskCount, children: _jsx(TMCountBadge, { children: newTaskCount }) }))] }), children: activeTabIndex === AssignedTab.All &&
|
|
545
|
+
_jsxs(_Fragment, { children: [activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, true, true), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, true, true), activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, true, true)] }) })] }) }), showTaskForm && _jsx(TMTaskForm, { id: currentTask?.id ?? -1, width: taskModalSizes(deviceType, formMode ?? FormModes.Create).width, height: taskModalSizes(deviceType, formMode ?? FormModes.Create).height, title: isContextualCreate ? SDKUI_Localizator.ContextualTask : SDKUI_Localizator.Widget_Activities, isModal: true, formMode: formMode ?? FormModes.Create, visualizedTasks: visualizedTasks, currentTask: currentTask, setCurrentTask: setCurrentTask, isContextualCreate: isContextualCreate, selectedRowKeys: selectedRowKeys, handleFocusedRowKeyChange: handleFocusedRowChange, taskContext: taskContext, usersList: usersList, onStatusChanged: () => { }, onClose: closeTaskFormCallback, onCancel: closeTaskFormCallback, showBackButton: false, onSaved: onSavedCallback, startDate: calendarStartDate, endDate: calendarEndDate, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGsWrapper, handleNavigateToDossiers: handleNavigateToDossiersWrapper }), _jsx("button", { style: {
|
|
551
546
|
position: 'absolute',
|
|
552
547
|
bottom: hasFilters ? '90px' : '18px',
|
|
553
548
|
right: '20px',
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { ResultTypes, SDK_Globals, WorkingGroupCacheService, WorkingGroupEngine } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { TreeView } from 'devextreme-react';
|
|
5
|
+
import { LoadIndicator } from 'devextreme-react/load-indicator';
|
|
5
6
|
import styled from 'styled-components';
|
|
6
7
|
import { buildFolderHierarchy, findFileItems, setFolderTreeViewItems } from '../../base/TMFileManagerUtils';
|
|
7
|
-
import TMSpinner from '../../base/TMSpinner';
|
|
8
8
|
import { TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
9
9
|
import { useDeviceType } from '../../base/TMDeviceProvider';
|
|
10
10
|
import { SDKUI_Localizator, getExceptionMessage, Globalization, IconUserGroup, IconFolder, calcResponsiveSizes } from '../../../helper';
|
|
@@ -13,7 +13,8 @@ import { FormModes } from '../../../ts';
|
|
|
13
13
|
import { TMColors } from '../../../utils/theme';
|
|
14
14
|
import TMDataGrid from '../../base/TMDataGrid';
|
|
15
15
|
import TMTooltip from '../../base/TMTooltip';
|
|
16
|
-
import
|
|
16
|
+
import TMLayoutContainer from '../../base/TMLayout';
|
|
17
|
+
import TMWaitPanelManager from '../../base/waitPanel/TMWaitPanelManager';
|
|
17
18
|
import { TMResultManager } from '../../forms/TMResultDialog';
|
|
18
19
|
import TMSaveForm from '../../forms/TMSaveForm';
|
|
19
20
|
// Returns a formatted name and optional description based on document type and item DID.
|
|
@@ -34,7 +35,6 @@ export const getDocumentDisplayInfo = (descriptor, item) => {
|
|
|
34
35
|
: '';
|
|
35
36
|
return { name, description };
|
|
36
37
|
};
|
|
37
|
-
let abortController = new AbortController();
|
|
38
38
|
const TMWGsCopyMoveForm = (props) => {
|
|
39
39
|
const { mode, workingGroups, context, folder, onClose, focusedWorkingGroupId = undefined, fetchTreeFileSystemForWorkingGroup, fetchArchivedDocumentsForWorkingGroup } = props;
|
|
40
40
|
// Destructure context to get the current working group descriptor or document type descriptor based on the engine type
|
|
@@ -58,18 +58,10 @@ const TMWGsCopyMoveForm = (props) => {
|
|
|
58
58
|
const [treeViewData, setTreeViewData] = useState([]);
|
|
59
59
|
// State to manage the selected file
|
|
60
60
|
const [selectedFolder, setSelectedFolder] = useState(undefined);
|
|
61
|
-
//
|
|
62
|
-
const [
|
|
63
|
-
//
|
|
64
|
-
const [
|
|
65
|
-
// State variable to control the visibility of the primary section of the wait panel
|
|
66
|
-
const [showPrimary, setShowPrimary] = useState(false);
|
|
67
|
-
// State variable to store the primary text of the wait panel
|
|
68
|
-
const [waitPanelTextPrimary, setWaitPanelTextPrimary] = useState('');
|
|
69
|
-
// State variable to track the current value of the primary progress indicator in the wait panel
|
|
70
|
-
const [waitPanelValuePrimary, setWaitPanelValuePrimary] = useState(0);
|
|
71
|
-
// State variable to define the maximum value for the primary progress indicator in the wait panel
|
|
72
|
-
const [waitPanelMaxValuePrimary, setWaitPanelMaxValuePrimary] = useState(0);
|
|
61
|
+
// True until the list of working groups is ready
|
|
62
|
+
const [isLoadingWgs, setIsLoadingWgs] = useState(true);
|
|
63
|
+
// Id of the working group whose folder tree has been loaded
|
|
64
|
+
const [loadedTreeWgId, setLoadedTreeWgId] = useState(undefined);
|
|
73
65
|
// State to manage the current working group descriptor, initially set to the one from context
|
|
74
66
|
const steps = useMemo(() => {
|
|
75
67
|
return mode === 'copyToWgArchivedDoc'
|
|
@@ -104,7 +96,6 @@ const TMWGsCopyMoveForm = (props) => {
|
|
|
104
96
|
let groupsToUse = workingGroups;
|
|
105
97
|
if (!groupsToUse) {
|
|
106
98
|
try {
|
|
107
|
-
TMSpinner.show({ description: SDKUI_Localizator.LoadingWorkGroups });
|
|
108
99
|
// Clear cache and fetch working groups
|
|
109
100
|
WorkingGroupCacheService.RemoveAll();
|
|
110
101
|
const fetchedGroups = await WorkingGroupCacheService.GetAllAsync();
|
|
@@ -113,9 +104,6 @@ const TMWGsCopyMoveForm = (props) => {
|
|
|
113
104
|
catch (error) {
|
|
114
105
|
TMExceptionBoxManager.show({ exception: error });
|
|
115
106
|
}
|
|
116
|
-
finally {
|
|
117
|
-
TMSpinner.hide();
|
|
118
|
-
}
|
|
119
107
|
}
|
|
120
108
|
if (groupsToUse) {
|
|
121
109
|
const sortedGroups = [...groupsToUse].sort((a, b) => {
|
|
@@ -134,6 +122,7 @@ const TMWGsCopyMoveForm = (props) => {
|
|
|
134
122
|
setCurrentStep(1);
|
|
135
123
|
}
|
|
136
124
|
}
|
|
125
|
+
setIsLoadingWgs(false);
|
|
137
126
|
};
|
|
138
127
|
loadWorkingGroups();
|
|
139
128
|
}, [workingGroups, currentWorkingGroupDescriptor]);
|
|
@@ -154,11 +143,16 @@ const TMWGsCopyMoveForm = (props) => {
|
|
|
154
143
|
catch (error) {
|
|
155
144
|
TMExceptionBoxManager.show({ exception: error });
|
|
156
145
|
}
|
|
146
|
+
finally {
|
|
147
|
+
setLoadedTreeWgId(selectedWg.id);
|
|
148
|
+
}
|
|
157
149
|
};
|
|
158
150
|
if (selectedWg && wgs.length) {
|
|
159
151
|
fetchWgTree();
|
|
160
152
|
}
|
|
161
153
|
}, [selectedWg, wgs]);
|
|
154
|
+
// Loading while the working groups are fetched, or while the folder tree of the selected working group is not loaded yet
|
|
155
|
+
const isLoading = isLoadingWgs || (currentStep === 1 && mode !== 'copyToWgArchivedDoc' && !!selectedWg?.id && loadedTreeWgId !== selectedWg.id);
|
|
162
156
|
// When the current step resets to the first step (index 0), clear the selected folder by setting it to undefined
|
|
163
157
|
useEffect(() => {
|
|
164
158
|
if (currentStep === 0) {
|
|
@@ -235,86 +229,91 @@ const TMWGsCopyMoveForm = (props) => {
|
|
|
235
229
|
if (missingWgOrFolder) {
|
|
236
230
|
return Promise.resolve();
|
|
237
231
|
}
|
|
238
|
-
setWaitPanelTitle(mode !== 'move' ? SDKUI_Localizator.Copy : SDKUI_Localizator.Move);
|
|
239
|
-
setShowWaitPanel(true);
|
|
240
|
-
setShowPrimary(true);
|
|
241
|
-
abortController = new AbortController();
|
|
242
232
|
let result = [];
|
|
243
233
|
const totalDrafts = context.selectedDrafts.length;
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
234
|
+
const waitPanel = TMWaitPanelManager.show({
|
|
235
|
+
title: mode !== 'move' ? SDKUI_Localizator.Copy : SDKUI_Localizator.Move,
|
|
236
|
+
max: totalDrafts,
|
|
237
|
+
cancelable: true,
|
|
238
|
+
});
|
|
239
|
+
try {
|
|
240
|
+
const workingGroupEngine = new WorkingGroupEngine(SDK_Globals.tmSession);
|
|
241
|
+
const selectedFolderId = selectedFolder?.id === -1 ? 0 : selectedFolder?.id ?? 0;
|
|
242
|
+
const isWgEngine = context.engine === 'WorkingGroupEngine';
|
|
243
|
+
const isSearchEngine = context.engine === 'SearchEngine';
|
|
244
|
+
for (let i = 0; i < totalDrafts; i++) {
|
|
245
|
+
if (waitPanel.aborted) {
|
|
246
|
+
result.push({
|
|
247
|
+
rowIndex: i + 1,
|
|
248
|
+
id1: i + 1,
|
|
249
|
+
id2: i + 1,
|
|
250
|
+
resultType: ResultTypes.WARNING,
|
|
251
|
+
description: SDKUI_Localizator.OperationFilesInterrupted.replaceParams(i + 1)
|
|
252
|
+
});
|
|
253
|
+
waitPanel.warning();
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
waitPanel.setSubtitle(`${i + 1}/${totalDrafts}`);
|
|
257
|
+
const item = context.selectedDrafts[i];
|
|
258
|
+
try {
|
|
259
|
+
if (isWgEngine && targetWorkingGroup && targetWorkingGroup.id && currentWorkingGroupDescriptor && currentWorkingGroupDescriptor.id && selectedFolder && item.did) {
|
|
260
|
+
const draft = item;
|
|
261
|
+
const did = draft.did ?? 0;
|
|
262
|
+
if (mode === 'copy') {
|
|
263
|
+
await workingGroupEngine.DraftsCopyAsync(currentWorkingGroupDescriptor.id, did, targetWorkingGroup.id, selectedFolderId);
|
|
264
|
+
if (fetchTreeFileSystemForWorkingGroup) {
|
|
265
|
+
await fetchTreeFileSystemForWorkingGroup(targetWorkingGroup.id);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
else if (mode === 'move') {
|
|
269
|
+
await workingGroupEngine.DraftsMoveAsync(currentWorkingGroupDescriptor.id, did, targetWorkingGroup.id, selectedFolderId);
|
|
270
|
+
if (fetchTreeFileSystemForWorkingGroup) {
|
|
271
|
+
await fetchTreeFileSystemForWorkingGroup(targetWorkingGroup.id);
|
|
272
|
+
await fetchTreeFileSystemForWorkingGroup(currentWorkingGroupDescriptor.id);
|
|
273
|
+
}
|
|
271
274
|
}
|
|
272
275
|
}
|
|
273
|
-
else if (
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
await
|
|
277
|
-
|
|
276
|
+
else if (isSearchEngine) {
|
|
277
|
+
if (mode === 'copyToWgDraft' && targetWorkingGroup && targetWorkingGroup.id && selectedFolder && currentDcmtTypeDescriptor) {
|
|
278
|
+
const documentDisplayInfo = getDocumentDisplayInfo(currentDcmtTypeDescriptor, item);
|
|
279
|
+
await workingGroupEngine.DraftsAddByIDAsync(targetWorkingGroup.id, selectedFolderId, documentDisplayInfo.name, documentDisplayInfo.description, item.TID, item.DID);
|
|
280
|
+
if (fetchTreeFileSystemForWorkingGroup)
|
|
281
|
+
await fetchTreeFileSystemForWorkingGroup(targetWorkingGroup.id);
|
|
282
|
+
}
|
|
283
|
+
else if (mode === 'copyToWgArchivedDoc' && targetWorkingGroup && targetWorkingGroup.id) {
|
|
284
|
+
await workingGroupEngine.DcmtsAddOrRemoveAsync(targetWorkingGroup.id, item.TID, item.DID, false);
|
|
285
|
+
if (fetchArchivedDocumentsForWorkingGroup)
|
|
286
|
+
await fetchArchivedDocumentsForWorkingGroup(targetWorkingGroup.id);
|
|
278
287
|
}
|
|
279
288
|
}
|
|
289
|
+
result.push({
|
|
290
|
+
rowIndex: i + 1,
|
|
291
|
+
id1: item.DID ?? i + 1,
|
|
292
|
+
id2: item.TID ?? i + 1,
|
|
293
|
+
description: SDKUI_Localizator.UpdateCompletedSuccessfully,
|
|
294
|
+
resultType: ResultTypes.SUCCESS
|
|
295
|
+
});
|
|
296
|
+
waitPanel.ok();
|
|
280
297
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
if (fetchArchivedDocumentsForWorkingGroup)
|
|
291
|
-
await fetchArchivedDocumentsForWorkingGroup(targetWorkingGroup.id);
|
|
292
|
-
}
|
|
298
|
+
catch (err) {
|
|
299
|
+
result.push({
|
|
300
|
+
rowIndex: i + 1,
|
|
301
|
+
id1: item.DID ?? i + 1,
|
|
302
|
+
id2: item.TID ?? i + 1,
|
|
303
|
+
resultType: ResultTypes.ERROR,
|
|
304
|
+
description: getExceptionMessage(err)
|
|
305
|
+
});
|
|
306
|
+
waitPanel.error();
|
|
293
307
|
}
|
|
294
|
-
|
|
295
|
-
rowIndex: i + 1,
|
|
296
|
-
id1: item.DID ?? i + 1,
|
|
297
|
-
id2: item.TID ?? i + 1,
|
|
298
|
-
description: SDKUI_Localizator.UpdateCompletedSuccessfully,
|
|
299
|
-
resultType: ResultTypes.SUCCESS
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
catch (err) {
|
|
303
|
-
result.push({
|
|
304
|
-
rowIndex: i + 1,
|
|
305
|
-
id1: item.DID ?? i + 1,
|
|
306
|
-
id2: item.TID ?? i + 1,
|
|
307
|
-
resultType: ResultTypes.ERROR,
|
|
308
|
-
description: getExceptionMessage(err)
|
|
309
|
-
});
|
|
308
|
+
await waitPanel.step();
|
|
310
309
|
}
|
|
311
310
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
setShowWaitPanel(false);
|
|
316
|
-
TMResultManager.show(result, mode !== 'move' ? SDKUI_Localizator.Copy : SDKUI_Localizator.Move, "ID", undefined);
|
|
311
|
+
finally {
|
|
312
|
+
waitPanel.close();
|
|
313
|
+
}
|
|
317
314
|
onClose();
|
|
315
|
+
// Shown after the modal has closed: the alert animation is time-based, so it must not start while the page is still busy re-rendering
|
|
316
|
+
setTimeout(() => TMResultManager.show(result, mode !== 'move' ? SDKUI_Localizator.Copy : SDKUI_Localizator.Move, "ID", undefined), 0);
|
|
318
317
|
}
|
|
319
318
|
catch (e) {
|
|
320
319
|
TMExceptionBoxManager.show({ exception: e });
|
|
@@ -365,7 +364,7 @@ const TMWGsCopyMoveForm = (props) => {
|
|
|
365
364
|
const tooltipContent = _jsxs("div", { style: { textAlign: "center" }, children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "ID" }), ": ", itemData.id] });
|
|
366
365
|
return (_jsxs("div", { style: { whiteSpace: "nowrap", display: "flex", alignItems: "center" }, className: isSelected ? 'treeview-selected-item-manager' : '', children: [_jsx(TMTooltip, { content: tooltipContent, children: _jsx(IconFolder, { fontSize: 24, style: { marginRight: 5, color: TMColors.iconLight } }) }), itemData.text] }));
|
|
367
366
|
};
|
|
368
|
-
return _jsx(TMSaveForm, { title: getTitle(), showTitleFormMode: false, showErrorCount: false, showUndoButton: false, hasNavigation: false, skipIsModifiedCheck: true, isModal: true, width: calcResponsiveSizes(deviceType, '800px', '800px', '95%'), height: '550px', validationItems: validationItems, exception: exception, isModified: isLocalSelectionModified(), showToolbar: false, showSaveButton: false, onClose: onClose, children: _jsxs(
|
|
367
|
+
return _jsx(TMSaveForm, { title: getTitle(), showTitleFormMode: false, showErrorCount: false, showUndoButton: false, hasNavigation: false, skipIsModifiedCheck: true, isModal: true, width: calcResponsiveSizes(deviceType, '800px', '800px', '95%'), height: '550px', validationItems: validationItems, exception: exception, isModified: isLocalSelectionModified(), showToolbar: false, showSaveButton: false, onClose: onClose, children: _jsxs(TMLayoutContainer, { direction: 'vertical', children: [_jsx("div", { style: { width: "100%", height: '48px' }, children: _jsx(TMStepNavigator, { steps: steps, currentStep: adjustedCurrentStep, onStepChange: (stepIndex) => { setCurrentStep(stepIndex); } }) }), _jsxs("div", { style: {
|
|
369
368
|
marginTop: '10px',
|
|
370
369
|
padding: '10px',
|
|
371
370
|
borderRadius: '8px',
|
|
@@ -374,8 +373,9 @@ const TMWGsCopyMoveForm = (props) => {
|
|
|
374
373
|
width: '100%',
|
|
375
374
|
height: 'calc(100% - 113px)',
|
|
376
375
|
overflow: 'auto',
|
|
377
|
-
}, children: [
|
|
378
|
-
|
|
376
|
+
}, children: [isLoading &&
|
|
377
|
+
_jsxs("div", { style: { width: '100%', height: '100%', display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', gap: '10px' }, children: [_jsx(LoadIndicator, { height: 40, width: 40 }), _jsx("div", { children: currentStep === 0 ? SDKUI_Localizator.LoadingWorkGroups : SDKUI_Localizator.Loading })] }), (!isLoading && currentStep === 0 && wgs.length > 0) &&
|
|
378
|
+
_jsx(TMDataGrid, { dataColumns: dataColumns, dataSource: wgs, selection: selection, focusedRowKey: focusedRowKey, onFocusedRowChanged: onFocusedRowChanged, selectedRowKeys: [...selectedRowKeys], onSelectionChanged: onSelectionChanged, onRowClick: onRowClick, onRowDblClick: onRowDblClick, autoNavigateToFocusedRow: true, showColumnHeaders: false }), (!isLoading && currentStep === 1) &&
|
|
379
379
|
_jsx(TreeView, { dataSource: treeViewData, displayExpr: "text", itemRender: renderTreeViewItem, onItemClick: handleTreeViewItemClick })] }), _jsxs("div", { style: {
|
|
380
380
|
width: "100%",
|
|
381
381
|
height: '45px',
|
|
@@ -434,6 +434,6 @@ export const TMStepNavigator = (props) => {
|
|
|
434
434
|
return (_jsx("div", { style: { display: 'flex', justifyContent: 'center' }, children: _jsx("div", { style: { display: 'flex', alignItems: 'center', backgroundColor: '#f9f9f9', padding: '6px 16px', borderRadius: '999px', boxShadow: '0 1px 4px rgba(0, 0, 0, 0.05)' }, children: steps.map((step, index) => {
|
|
435
435
|
const isPastStep = index < currentStep;
|
|
436
436
|
const isCurrent = currentStep === index;
|
|
437
|
-
return _jsxs("div", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx(StepSpan, {
|
|
437
|
+
return _jsxs("div", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx(StepSpan, { $isCurrent: isCurrent, $isPast: isPastStep, onClick: isPastStep ? () => onStepChange(index) : undefined, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center' }, children: [_jsx("span", { children: step.title }), step.subtitle && _jsxs("span", { style: { fontSize: '0.90em', fontStyle: "italic" }, children: ["\"", step.subtitle, "\""] })] }) }), index < steps.length - 1 && (_jsx("span", { style: { margin: '0 8px', color: '#ddd' }, children: _jsx("i", { className: 'dx-icon-greater' }) }))] }, step.id);
|
|
438
438
|
}) }) }));
|
|
439
439
|
};
|
|
@@ -4,6 +4,16 @@ import { DeviceType } from "../../base/TMDeviceProvider";
|
|
|
4
4
|
import { WorkItemDetail } from "../../../ts";
|
|
5
5
|
interface IWorkflowOperationButtonsProps {
|
|
6
6
|
dtd: DcmtTypeDescriptor | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Forza la forma dei pulsanti: `true` = flusso di FIRMA (Firma e approva),
|
|
9
|
+
* `false` = flusso di APPROVAZIONE. Se omesso si deduce dal tipo documento
|
|
10
|
+
* (widget Sign4Top), che è il comportamento del workflow.
|
|
11
|
+
*
|
|
12
|
+
* Serve a chi conosce la natura dell'attività meglio del tipo documento: un
|
|
13
|
+
* work item di sola approvazione su un tipo ABILITATO alla firma non deve
|
|
14
|
+
* mostrare "Firma e approva".
|
|
15
|
+
*/
|
|
16
|
+
signFlow?: boolean;
|
|
7
17
|
approveDisable?: boolean;
|
|
8
18
|
signApproveDisable?: boolean;
|
|
9
19
|
rejectDisable?: boolean;
|