@topconsultnpm/sdkui-react 6.22.0-t2 → 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/FloatingMenuBar/TMFloatingMenuBar.js +6 -6
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +15 -15
- 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.js +4 -4
- package/lib/components/base/TMClosableList.js +3 -3
- package/lib/components/base/TMCustomButton.js +40 -48
- package/lib/components/base/TMDataGrid.d.ts +2 -0
- package/lib/components/base/TMDataGrid.js +35 -7
- package/lib/components/base/TMDropDownMenu.js +1 -1
- package/lib/components/base/TMFileManagerDataGridView.js +1 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +2 -2
- 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.js +1 -1
- package/lib/components/base/TMPanel.js +8 -8
- package/lib/components/base/TMPopUp.js +2 -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/TMTreeView.js +35 -3
- 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 +1 -1
- package/lib/components/choosers/TMDiskChooser.js +1 -1
- package/lib/components/choosers/TMDistinctValues.js +28 -19
- package/lib/components/choosers/TMDynDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMImageIDChooser.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.js +2 -2
- package/lib/components/choosers/TMPathChooser.js +17 -34
- package/lib/components/choosers/TMQuickSearchInfo.js +4 -4
- package/lib/components/choosers/TMQuickSearchSettingsForm.js +1 -1
- package/lib/components/choosers/TMRelationChooser.js +1 -1
- package/lib/components/choosers/TMSelectedValuesSummary.js +1 -3
- package/lib/components/choosers/TMUserChooser.js +1 -1
- package/lib/components/editors/TMCheckBox.js +1 -1
- package/lib/components/editors/TMDropDown.js +7 -7
- package/lib/components/editors/TMEditorStyled.d.ts +1 -1
- 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/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.js +3 -3
- package/lib/components/editors/TMTextBox.js +3 -3
- package/lib/components/editors/TMTextExpression.js +1 -1
- package/lib/components/features/archive/TMArchive.js +7 -2
- 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 +4 -5
- package/lib/components/features/documents/TMCopyToFolderForm.js +50 -42
- package/lib/components/features/documents/TMDcmtForm.js +53 -64
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +2 -2
- package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -3
- package/lib/components/features/documents/TMDcmtIcon.js +3 -5
- package/lib/components/features/documents/TMDcmtPreview.js +6 -4
- 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 +55 -130
- package/lib/components/features/documents/TMMasterInfoFields.js +4 -5
- package/lib/components/features/documents/TMMergeToPdfForm.js +56 -54
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +3 -6
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +1 -1
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +4 -4
- package/lib/components/features/documents/TMRelationViewer.d.ts +16 -9
- package/lib/components/features/documents/TMRelationViewer.js +240 -168
- 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 +71 -12
- package/lib/components/features/search/TMSearchQueryEditor.js +2 -2
- package/lib/components/features/search/TMSearchQueryPanel.js +1 -5
- package/lib/components/features/search/TMSearchResult.d.ts +5 -0
- package/lib/components/features/search/TMSearchResult.js +34 -18
- package/lib/components/features/search/TMSignatureInfoContent.js +1 -1
- package/lib/components/features/search/TMTreeSelector.js +38 -36
- 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.js +2 -2
- 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/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 +1 -1
- package/lib/components/grids/TMBlogsPost.js +92 -96
- package/lib/components/grids/TMBlogsPostUtils.js +1 -1
- 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.js +3 -3
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +1 -1
- package/lib/components/layout/panelManager/TMPanelWrapper.js +1 -1
- package/lib/components/pages/TMPage.js +30 -32
- package/lib/components/query/TMQueryCountButton.js +1 -1
- package/lib/components/query/TMQueryEditor.d.ts +3 -0
- package/lib/components/query/TMQueryEditor.js +9 -8
- package/lib/components/sidebar/TMCommandsPanel.js +1 -1
- package/lib/components/sidebar/TMHeader.d.ts +1 -0
- package/lib/components/sidebar/TMHeader.js +9 -9
- package/lib/components/sidebar/TMSidebar.js +1 -1
- package/lib/components/sidebar/TMSidebarItem.js +1 -1
- package/lib/components/viewers/TMMidViewer.js +2 -2
- package/lib/components/viewers/TMTidViewer.js +3 -3
- package/lib/components/wizard/TMStepIndicator.js +3 -3
- 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_Localizator.d.ts +736 -712
- package/lib/helper/SDKUI_Localizator.js +240 -0
- package/lib/helper/TMAppUpdatedModal.js +2 -2
- package/lib/helper/TMIcons.js +1 -3
- package/lib/helper/TMPdfViewer.js +1 -1
- package/lib/helper/TMToppyMessage.js +1 -1
- package/lib/helper/TMUtils.js +1 -1
- 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/dcmtsHelper.d.ts +4 -2
- package/lib/helper/dcmtsHelper.js +3 -1
- package/lib/helper/helpers.d.ts +1 -1
- package/lib/helper/helpers.js +2 -2
- package/lib/hooks/tmDistinctValuesGridHelper.d.ts +1 -1
- package/lib/hooks/useCaseFlowApprove.d.ts +3 -3
- package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
- package/lib/hooks/useCheckInOutOperations.js +14 -34
- package/lib/hooks/useDcmtOperations.d.ts +3 -12
- package/lib/hooks/useDcmtOperations.js +187 -179
- package/lib/hooks/useDocumentOperations.d.ts +1 -0
- package/lib/hooks/useDocumentOperations.js +16 -27
- package/lib/hooks/useInputDialog.js +1 -1
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +1 -16
- package/lib/hooks/useMultiMasterDetailDcmts.js +65 -67
- package/lib/hooks/usePreventFileDrop.js +9 -0
- package/lib/hooks/useQueryParametersDialog.js +1 -1
- package/lib/hooks/useWorkflowApprove.js +33 -17
- package/lib/services/caseflow/CaseFlowService.d.ts +47 -6
- package/lib/services/caseflow/CaseFlowService.js +82 -14
- package/lib/services/platform_services.d.ts +4 -4
- package/package.json +9 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { DcmtTypeListCacheService, LayoutModes, SDK_Localizator, TreeCacheService, TreeItemTypes } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { TreeList, Column, Scrolling, Selection } from 'devextreme-react/tree-list';
|
|
@@ -22,9 +22,12 @@ const TMTreeDcmtTypeCell = ({ tid, isMobile }) => {
|
|
|
22
22
|
}, [isMobile, dtd, tid]);
|
|
23
23
|
return (_jsxs(StyledTreeDcmtTypeRow, { onMouseEnter: loadDTD, children: [_jsx("span", { style: { cursor: 'pointer', flex: 1, minWidth: 0 }, children: _jsx(TMTidViewer, { tid: tid, showIcon: false }) }), !isMobile && (_jsx("span", { className: 'info-icon', children: _jsx(TMDcmtTypeTooltip, { dtd: dtd, children: _jsx(IconInfo, { color: TMColors.info }) }) }))] }));
|
|
24
24
|
};
|
|
25
|
+
// La ricerca e l'archiviazione hanno ciascuna il proprio albero predefinito: il contesto lo decide il layoutMode
|
|
26
|
+
const getDefaultTreeId = (layoutMode) => layoutMode == LayoutModes.Update
|
|
27
|
+
? SDKUI_Globals.userSettings.searchSettings.defaultTree
|
|
28
|
+
: SDKUI_Globals.userSettings.archivingSettings.defaultTree;
|
|
25
29
|
const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelectedTIDChanged, onClosePanel, allowMaximize = true, onMaximizePanel }) => {
|
|
26
30
|
const [trees, setTrees] = useState([]);
|
|
27
|
-
const [treeItems, setTreeItems] = useState([]);
|
|
28
31
|
const [selectedTreeId, setSelectedTreeId] = useState(0);
|
|
29
32
|
const [infoDTD, setInfoDTD] = useState();
|
|
30
33
|
// State to store selected row keys
|
|
@@ -34,8 +37,11 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
34
37
|
// Elemento selezionato nell'albero: dopo un refresh va riproposto se esiste ancora
|
|
35
38
|
const [selectedTreeItemKey, setSelectedTreeItemKey] = useState(undefined);
|
|
36
39
|
const selectedTreeItemKeys = useMemo(() => selectedTreeItemKey !== undefined ? [selectedTreeItemKey] : [], [selectedTreeItemKey]);
|
|
37
|
-
|
|
38
|
-
const [
|
|
40
|
+
// Finche' gli alberi non sono arrivati il pannello mostra il loader invece della lista vuota
|
|
41
|
+
const [isLoadingTrees, setIsLoadingTrees] = useState(true);
|
|
42
|
+
const [defaultTreeId, setDefaultTreeId] = useState(() => getDefaultTreeId(layoutMode));
|
|
43
|
+
const dropDownBoxRef = useRef(null);
|
|
44
|
+
const closeDropDown = useCallback(() => { dropDownBoxRef.current?.instance()?.option('opened', false); }, []);
|
|
39
45
|
const deviceType = useDeviceType();
|
|
40
46
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
41
47
|
const panelRef = useOutsideClick(() => setInfoDTD(undefined));
|
|
@@ -48,6 +54,11 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
48
54
|
const loadTreesAsync = useCallback(async (forceRefresh = false) => {
|
|
49
55
|
const isSearchContext = layoutMode == LayoutModes.Update;
|
|
50
56
|
if (forceRefresh) {
|
|
57
|
+
// Gli alberi arrivano dal server filtrati sui tipi documento della sessione: senza rileggerli
|
|
58
|
+
// prima (RetrieveAll con refreshCache rigenera anche la cache lato server) un tipo documento
|
|
59
|
+
// appena creato da Designer non comparirebbe tra gli elementi dell'albero
|
|
60
|
+
DcmtTypeListCacheService.RemoveAllWithoutMetadata();
|
|
61
|
+
await DcmtTypeListCacheService.GetAllWithoutMetadataAsync();
|
|
51
62
|
if (isSearchContext)
|
|
52
63
|
TreeCacheService.RemoveAllSearch();
|
|
53
64
|
else
|
|
@@ -73,29 +84,24 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
73
84
|
setSelectedRowKeys([currentTreeId]);
|
|
74
85
|
return;
|
|
75
86
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
initialTreeId = defaultTree;
|
|
81
|
-
treeToSelect = result.find(o => o.id == defaultTree);
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
initialTreeId = result[0]?.id ?? 0;
|
|
85
|
-
treeToSelect = result[0];
|
|
86
|
-
}
|
|
87
|
-
setSelectedTreeId(initialTreeId);
|
|
87
|
+
// Il predefinito puo' non essere piu' tra gli alberi del contesto (cancellato, o permessi cambiati): si ripiega sul primo
|
|
88
|
+
const defaultTree = getDefaultTreeId(layoutMode);
|
|
89
|
+
const treeToSelect = (defaultTree > 0 ? result.find(o => o.id == defaultTree) : undefined) ?? result[0];
|
|
90
|
+
setSelectedTreeId(treeToSelect?.id ?? 0);
|
|
88
91
|
if (treeToSelect?.id) {
|
|
89
92
|
setSelectedRowKeys([treeToSelect.id]);
|
|
90
93
|
}
|
|
91
94
|
}, [layoutMode]);
|
|
92
|
-
useEffect(() => { loadTreesAsync(); }, [loadTreesAsync]);
|
|
93
95
|
useEffect(() => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
setIsLoadingTrees(true);
|
|
97
|
+
loadTreesAsync().finally(() => setIsLoadingTrees(false));
|
|
98
|
+
}, [loadTreesAsync]);
|
|
99
|
+
// Derivato nello stesso render degli alberi: con uno state la TreeList mostrerebbe "Nessun dato" per un frame
|
|
100
|
+
const treeItems = useMemo(() => trees.find(o => o.id == selectedTreeId)?.items ?? [], [trees, selectedTreeId]);
|
|
101
|
+
useEffect(() => {
|
|
96
102
|
// Mantiene la selezione dopo il refresh solo se l'elemento e' ancora presente (al cambio albero si azzera)
|
|
97
|
-
setSelectedTreeItemKey(prev => prev !== undefined &&
|
|
98
|
-
}, [
|
|
103
|
+
setSelectedTreeItemKey(prev => prev !== undefined && treeItems.some(o => o.id == prev) ? prev : undefined);
|
|
104
|
+
}, [treeItems]);
|
|
99
105
|
const renderCell = useCallback((data) => {
|
|
100
106
|
const treeItem = data.data;
|
|
101
107
|
// Documento (DcmtType)
|
|
@@ -129,8 +135,8 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
129
135
|
if (selectedKeys.length > 0)
|
|
130
136
|
setSelectedTreeId(selectedKeys[0]);
|
|
131
137
|
setSelectedRowKeys(selectedKeys);
|
|
132
|
-
|
|
133
|
-
}, []);
|
|
138
|
+
closeDropDown();
|
|
139
|
+
}, [closeDropDown]);
|
|
134
140
|
// Handles click on a tree row in the trees data grid: clicking the already selected tree
|
|
135
141
|
// does not raise onSelectionChanged, so the drop down must be closed here as well
|
|
136
142
|
const onRowClickTrees = useCallback((e) => {
|
|
@@ -139,8 +145,8 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
139
145
|
return;
|
|
140
146
|
setSelectedTreeId(tree.id);
|
|
141
147
|
setSelectedRowKeys([tree.id]);
|
|
142
|
-
|
|
143
|
-
}, []);
|
|
148
|
+
closeDropDown();
|
|
149
|
+
}, [closeDropDown]);
|
|
144
150
|
// Handles focus change in the data grid
|
|
145
151
|
const onFocusedRowChanged = useCallback((e) => {
|
|
146
152
|
setFocusedRowKey(e.row?.key);
|
|
@@ -150,12 +156,6 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
150
156
|
if (treeItemDescriptor?.id)
|
|
151
157
|
setSelectedRowKeys([treeItemDescriptor.id]);
|
|
152
158
|
}, []);
|
|
153
|
-
const onGridBoxOpened = useCallback((e) => {
|
|
154
|
-
if (e.name === 'opened') {
|
|
155
|
-
setIsGridBoxOpened(e.value);
|
|
156
|
-
}
|
|
157
|
-
;
|
|
158
|
-
}, []);
|
|
159
159
|
// Callback function to handle double-click events on a tree view cell
|
|
160
160
|
const onCellDblClickTreeView = useCallback((e) => {
|
|
161
161
|
// Extract the data from the clicked cell and cast it to the TreeItemDescriptor type
|
|
@@ -187,7 +187,7 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
187
187
|
const onSelectionChangedTreeView = useCallback((e) => {
|
|
188
188
|
setSelectedTreeItemKey(e.selectedRowKeys?.[0]);
|
|
189
189
|
}, []);
|
|
190
|
-
return (_jsx(TMPanel, { title: SDK_Localizator.Trees, isVisible: isVisible, totalItems: trees.length, onClose: onClosePanel, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, onRefresh: () => loadTreesAsync(true), toolbar: _jsx(TMButton, { btnStyle: 'icon', caption: defaultTreeId == selectedTreeId ? SDKUI_Localizator.TreeRemoveDefault : SDKUI_Localizator.SetAsDefault, icon: defaultTreeId == selectedTreeId ? _jsx(IconStarRemove, { color: 'rgb(243, 114, 92)' }) : _jsx(IconStar, { color: 'rgb(248, 215, 117)' }), onClick: () => {
|
|
190
|
+
return (_jsx(TMPanel, { title: SDK_Localizator.Trees, isVisible: isVisible, totalItems: trees.length, onClose: onClosePanel, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, onRefresh: () => loadTreesAsync(true), isRefreshing: isLoadingTrees, toolbar: _jsx(TMButton, { btnStyle: 'icon', caption: defaultTreeId == selectedTreeId ? SDKUI_Localizator.TreeRemoveDefault : SDKUI_Localizator.SetAsDefault, icon: defaultTreeId == selectedTreeId ? _jsx(IconStarRemove, { color: 'rgb(243, 114, 92)' }) : _jsx(IconStar, { color: 'rgb(248, 215, 117)' }), onClick: () => {
|
|
191
191
|
if (defaultTreeId == selectedTreeId) {
|
|
192
192
|
if (layoutMode == LayoutModes.Update)
|
|
193
193
|
SDKUI_Globals.userSettings.searchSettings.defaultTree = -1;
|
|
@@ -211,16 +211,18 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
211
211
|
width: '100%',
|
|
212
212
|
boxSizing: 'border-box',
|
|
213
213
|
minHeight: 0,
|
|
214
|
-
}, children: [_jsx("div", { style: { padding: '10px' }, children: _jsx(DropDownBox, { dropDownOptions: {
|
|
214
|
+
}, children: [_jsx("div", { style: { padding: '10px' }, children: _jsx(DropDownBox, { ref: dropDownBoxRef, dropDownOptions: {
|
|
215
215
|
resizeEnabled: true,
|
|
216
216
|
minWidth: "100%",
|
|
217
217
|
height: trees.length <= 10 ? 300 : 500,
|
|
218
218
|
maxWidth: "100%"
|
|
219
|
-
}, value: selectedTreeId,
|
|
219
|
+
}, value: selectedTreeId, valueExpr: "id", displayExpr: "nameLoc", deferRendering: false, dataSource: trees, onValueChanged: syncDataGridSelection, style: { height: 30 }, children: _jsx(TMDataGrid, { height: "100%", width: "100%", dataSource: trees, dataColumns: [
|
|
220
220
|
{ dataField: 'nameLoc', caption: SDKUI_Localizator.Name, width: 'auto' },
|
|
221
221
|
{ dataField: 'description', caption: SDKUI_Localizator.Description, width: 'auto' },
|
|
222
|
-
], selection: { mode: 'single', showCheckBoxesMode: "none" }, showHeaderFilter: false, selectedRowKeys: selectedRowKeys, onSelectionChanged: onSelectionChanged, onRowClick: onRowClickTrees, focusedRowKey: focusedRowKey, onFocusedRowChanged: onFocusedRowChanged }) }) }), _jsxs(StyledTreeListWrapper, { children: [_jsxs(TreeList, { height: "100%", dataSource: treeItems, showRowLines: false, showColumnLines: false, showBorders: false, columnAutoWidth: false, keyExpr: "id", parentIdExpr: "parentID", dataStructure: "plain", showColumnHeaders: false, selectedRowKeys: selectedTreeItemKeys, onSelectionChanged: onSelectionChangedTreeView, onCellDblClick: onCellDblClickTreeView, onRowClick: onRowClickTreeView, children: [_jsx(Column, { dataField: "nameLoc", caption: SDKUI_Localizator.Name, cellRender: renderCell, width: "100%" }), _jsx(Scrolling, { mode: "
|
|
223
|
-
:
|
|
222
|
+
], selection: { mode: 'single', showCheckBoxesMode: "none" }, showHeaderFilter: false, selectedRowKeys: selectedRowKeys, onSelectionChanged: onSelectionChanged, onRowClick: onRowClickTrees, focusedRowKey: focusedRowKey, onFocusedRowChanged: onFocusedRowChanged }) }) }), _jsxs(StyledTreeListWrapper, { children: [_jsxs(TreeList, { height: "100%", dataSource: treeItems, showRowLines: false, showColumnLines: false, showBorders: false, columnAutoWidth: false, keyExpr: "id", parentIdExpr: "parentID", dataStructure: "plain", showColumnHeaders: false, selectedRowKeys: selectedTreeItemKeys, onSelectionChanged: onSelectionChangedTreeView, onCellDblClick: onCellDblClickTreeView, onRowClick: onRowClickTreeView, children: [_jsx(Column, { dataField: "nameLoc", caption: SDKUI_Localizator.Name, cellRender: renderCell, width: "100%" }), _jsx(Scrolling, { mode: "standard", useNative: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar) === 1 }), _jsx(Selection, { mode: "single" })] }), _jsxs(StyledOffCanvasPanel, { ref: panelRef, $isOpen: isMobile && infoDTD !== undefined, children: [_jsxs(StyledDivHorizontal, { style: { gap: 10, padding: '10px 8px', width: '100%', alignItems: 'center' }, children: [_jsx("p", { style: { fontSize: '1.1rem', fontWeight: 'bold' }, children: `${SDKUI_Localizator.DcmtType} - ${SDKUI_Localizator.About}` }), _jsx(IconCloseOutline, { style: { marginLeft: 'auto', cursor: 'pointer' }, onClick: () => setInfoDTD(undefined) })] }), renderDTDTooltipContent(infoDTD)] })] })] })
|
|
223
|
+
: isLoadingTrees
|
|
224
|
+
? _jsx(_Fragment, {})
|
|
225
|
+
: _jsx("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', fontSize: '1.5rem' }, children: SDKUI_Localizator.TreesNoAvailable }) }));
|
|
224
226
|
};
|
|
225
227
|
export default TMTreeSelector;
|
|
226
228
|
const StyledTreeDcmtTypeRow = styled(StyledDivHorizontal) `
|
|
@@ -10,12 +10,13 @@ import TMDcmtIcon from "../documents/TMDcmtIcon";
|
|
|
10
10
|
import TMDataGrid from "../../base/TMDataGrid";
|
|
11
11
|
import TMDcmtForm from "../documents/TMDcmtForm";
|
|
12
12
|
import { useDcmtOperations } from "../../../hooks/useDcmtOperations";
|
|
13
|
-
import
|
|
13
|
+
import TMLayoutContainer from "../../base/TMLayout";
|
|
14
|
+
import TMWaitPanelManager from "../../base/waitPanel/TMWaitPanelManager";
|
|
14
15
|
import { TMResultManager } from "../../forms/TMResultDialog";
|
|
15
16
|
let abortLocalController = new AbortController();
|
|
16
17
|
const TMViewHistoryDcmt = (props) => {
|
|
17
18
|
const { deviceType, inputDcmt, onClose, fromDTD, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers } = props;
|
|
18
|
-
const {
|
|
19
|
+
const { downloadDcmtsAsync } = useDcmtOperations();
|
|
19
20
|
const [dcmtHistory, setDcmtHistory] = useState([]);
|
|
20
21
|
// showId is a state variable that determines whether an ID-related component or feature should be displayed
|
|
21
22
|
const [showId, setShowId] = useState(false);
|
|
@@ -33,18 +34,6 @@ const TMViewHistoryDcmt = (props) => {
|
|
|
33
34
|
const [showDcmtForm, setShowDcmtForm] = useState(false);
|
|
34
35
|
// Memoized value to get the selected draft based on the focused row key
|
|
35
36
|
const selectedDcmt = useMemo(() => dcmtHistory.find(dcmt => dcmt.id === focusedRowKey), [focusedRowKey, dcmtHistory]);
|
|
36
|
-
// State variable to control the visibility of the wait panel.
|
|
37
|
-
const [showLocalWaitPanel, setShowLocalWaitPanel] = useState(false);
|
|
38
|
-
// State variable to store the title of the wait panel.
|
|
39
|
-
const [waitLocalPanelTitle, setWaitLocalPanelTitle] = useState('');
|
|
40
|
-
// State variable to control the visibility of the primary section of the wait panel.
|
|
41
|
-
const [showLocalPrimary, setShowLocalPrimary] = useState(false);
|
|
42
|
-
// State variable to store the primary text of the wait panel.
|
|
43
|
-
const [waitLocalPanelTextPrimary, setWaitLocalPanelTextPrimary] = useState('');
|
|
44
|
-
// State variable to track the current value of the primary progress indicator in the wait panel.
|
|
45
|
-
const [waitLocalPanelValuePrimary, setWaitLocalPanelValuePrimary] = useState(0);
|
|
46
|
-
// State variable to define the maximum value for the primary progress indicator in the wait panel.
|
|
47
|
-
const [waitLocalPanelMaxValuePrimary, setWaitLocalPanelMaxValuePrimary] = useState(0);
|
|
48
37
|
const getParticipantById = (id, users) => {
|
|
49
38
|
if (users.length === 0)
|
|
50
39
|
return null;
|
|
@@ -155,18 +144,21 @@ const TMViewHistoryDcmt = (props) => {
|
|
|
155
144
|
onButtonClick: async (e) => {
|
|
156
145
|
if (e !== ButtonNames.YES)
|
|
157
146
|
return;
|
|
158
|
-
setWaitLocalPanelTitle(SDKUI_Localizator.Delete);
|
|
159
|
-
setShowLocalWaitPanel(true);
|
|
160
|
-
setShowLocalPrimary(true);
|
|
161
147
|
abortLocalController = new AbortController();
|
|
148
|
+
const panel = TMWaitPanelManager.show({
|
|
149
|
+
title: SDKUI_Localizator.Delete,
|
|
150
|
+
max: 1,
|
|
151
|
+
showCounters: false,
|
|
152
|
+
cancelable: true,
|
|
153
|
+
onAbort: () => abortLocalController.abort(),
|
|
154
|
+
});
|
|
162
155
|
let result = [];
|
|
163
156
|
let i = 0;
|
|
164
|
-
setWaitLocalPanelMaxValuePrimary(1);
|
|
165
157
|
if (abortLocalController.signal.aborted) {
|
|
166
158
|
result.push({ rowIndex: i, id1: currentDcmt.id, id2: currentDcmt.id, resultType: ResultTypes.WARNING, description: `Operazione interrotta. Elaborate ${i}` });
|
|
167
159
|
}
|
|
168
160
|
else {
|
|
169
|
-
|
|
161
|
+
panel.setSubtitle(SDKUI_Localizator.Delete);
|
|
170
162
|
const deleteEngine = new DeleteEngine(SDK_Globals.tmSession);
|
|
171
163
|
await deleteEngine.PhysDeleteByIDAsync(Number(currentDcmt.TID), Number(currentDcmt.DID), false)
|
|
172
164
|
.then(async () => {
|
|
@@ -178,10 +170,7 @@ const TMViewHistoryDcmt = (props) => {
|
|
|
178
170
|
});
|
|
179
171
|
}
|
|
180
172
|
setFocusedRowKey(undefined);
|
|
181
|
-
|
|
182
|
-
setWaitLocalPanelMaxValuePrimary(0);
|
|
183
|
-
setWaitLocalPanelValuePrimary(0);
|
|
184
|
-
setShowLocalWaitPanel(false);
|
|
173
|
+
panel.close();
|
|
185
174
|
TMResultManager.show(result, SDKUI_Localizator.Delete, "ID", undefined);
|
|
186
175
|
}
|
|
187
176
|
});
|
|
@@ -279,7 +268,7 @@ const TMViewHistoryDcmt = (props) => {
|
|
|
279
268
|
{ dataField: "LastUpdateTime", caption: SDKUI_Localizator.LastUpdateTime, dataType: 'datetime', format: 'dd/MM/yyyy HH:mm:ss', },
|
|
280
269
|
]);
|
|
281
270
|
}, [showId]);
|
|
282
|
-
return _jsx(TMModal, { title: `${SDKUI_Localizator.SearchResult} \u2014 ${SDKUI_Localizator.History + ": " + (fromDTD.nameLoc ?? SDKUI_Localizator.Document) + " (DID:" + inputDcmt.DID})`, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '80%', '80%', '95%'), onClose: onClose, children:
|
|
283
|
-
|
|
271
|
+
return _jsx(TMModal, { title: `${SDKUI_Localizator.SearchResult} \u2014 ${SDKUI_Localizator.History + ": " + (fromDTD.nameLoc ?? SDKUI_Localizator.Document) + " (DID:" + inputDcmt.DID})`, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '80%', '80%', '95%'), onClose: onClose, children: _jsxs(TMLayoutContainer, { direction: 'vertical', children: [_jsx(TMDataGrid, { dataSource: dcmtHistory, dataColumns: dataColumns, focusedRowKey: focusedRowKey, selection: selection, customContextMenuItems: customContextMenuItems, onFocusedRowChanged: onFocusedRowChanged, onCellDblClick: onCellDblClick, noDataText: SDKUI_Localizator.NoDataToDisplay, showSearchPanel: showSearch }), (showDcmtForm && selectedDcmt !== undefined) &&
|
|
272
|
+
_jsx(TMDcmtForm, { TID: Number(selectedDcmt.TID), DID: Number(selectedDcmt.DID), formMode: FormModes.ReadOnly, isModal: true, widthModal: "95%", heightModal: "95%", titleModal: fromDTD.name ?? SDKUI_Localizator.SearchResult, allowNavigation: dcmtHistory.length > 0, itemIndex: selectedIndex + 1, count: dcmtHistory.length, onClose: () => { setShowDcmtForm(false); }, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks ?? [], Number(selectedDcmt.TID), Number(selectedDcmt.DID)) })] }) });
|
|
284
273
|
};
|
|
285
274
|
export default TMViewHistoryDcmt;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { ObjectClasses, TaskDescriptor, PdGs, UserListCacheService, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { gotoPDGExtendedLabel, taskValidatorAsync } from './TMTasksUtils';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
3
|
import { PdGs, Priorities, SDK_Globals, Task_States } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { FormModes } from "../../../ts";
|
|
@@ -358,7 +358,7 @@ const TaskFormResponseComment = (props) => {
|
|
|
358
358
|
}, children: currentResponse && currentResponse.length > 0
|
|
359
359
|
? _jsx(TMHtmlContentDisplay, { markup: currentResponse ?? '-', isSelected: false })
|
|
360
360
|
: _jsx("span", { style: { color: '#6c757d', fontStyle: 'italic' }, children: SDKUI_Localizator.NoAnswerProvided }) }) }))] })
|
|
361
|
-
: (_jsxs(ResponseCommentWrapper, { children: [_jsx(ResponseCommentTextArea, { id: "responseId", name: "response",
|
|
361
|
+
: (_jsxs(ResponseCommentWrapper, { children: [_jsx(ResponseCommentTextArea, { id: "responseId", name: "response", $isValid: true, value: currentResponse ?? '', onChange: onAnswerChange ? onAnswerChange : undefined }), _jsx(ResponseCommentLabel, { htmlFor: "responseId", children: SDKUI_Localizator.Answer }), _jsx(ResponseCommentCharacterCounter, { children: `${500 - (currentResponse ?? '').length} ${SDKUI_Localizator.CharactersRemaining}` })] })) }));
|
|
362
362
|
};
|
|
363
363
|
// Stile comune per i container dei campi
|
|
364
364
|
const fieldContainerStyle = { width: '100%' };
|
|
@@ -423,7 +423,7 @@ export const RenderTaskFormStateField = (props) => {
|
|
|
423
423
|
// Non renderizzare nulla finché i dati non sono pronti
|
|
424
424
|
if (!formDataOrig)
|
|
425
425
|
return null;
|
|
426
|
-
return (_jsx("div", { style: { width: '100%', marginTop: 15 }, children: _jsxs(FloatingLabelFieldCard, {
|
|
426
|
+
return (_jsx("div", { style: { width: '100%', marginTop: 15 }, children: _jsxs(FloatingLabelFieldCard, { $isModifiedWhen: formDataOrig?.state !== formData?.state, style: { display: 'flex', flexDirection: 'column', gap: 10 }, children: [_jsx(FloatingFieldLabel, { $isModifiedWhen: formDataOrig?.state !== formData?.state, children: SDKUI_Localizator.StatusAndAnswer }), _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', width: '100%' }, children: [_jsx(StatusFieldLabel, { children: _jsxs(StatusValue, { $isModifiedWhen: formDataOrig?.state !== formData?.state, children: [_jsx("span", { style: { display: 'flex', alignItems: 'center' }, children: taskStateIconMap(20).get(formData?.state ?? Task_States.None) }), getStatusLocalizatorValue(formData?.state ?? Task_States.None)] }) }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [showModifyButton && (_jsxs("div", { onClick: () => handleShowChangeStateForm(true), style: {
|
|
427
427
|
backgroundColor: "#d17800",
|
|
428
428
|
color: "#fff",
|
|
429
429
|
padding: "10px 16px",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import ArrayStore from "devextreme/data/array_store";
|
|
4
4
|
import Scheduler from "devextreme-react/scheduler";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import ArrayStore from 'devextreme/data/array_store';
|
|
3
3
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { Priorities, Task_States } from "@topconsultnpm/sdk-ts";
|
|
@@ -28,7 +28,7 @@ const TMTasksHeader = (props) => {
|
|
|
28
28
|
const isValidKey = (key) => {
|
|
29
29
|
return key !== FilterCategoryId.AllStates && key !== FilterCategoryId.AllPriorities;
|
|
30
30
|
};
|
|
31
|
-
return (_jsx(StyledListHeader, { ref: containerRef,
|
|
31
|
+
return (_jsx(StyledListHeader, { ref: containerRef, $color: color ?? 'black', $height: height ?? '100%', onContextMenu: handleContextMenu, children: _jsx(ScrollView, { width: "100%", height: "100%", direction: "horizontal", useNative: true, children: _jsxs(StyledViewChangerContainer, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.SelectViewMode, showEvent: "mouseenter", hideEvent: "mouseleave", position: "top", children: _jsx(TMDropDown, { elementStyle: { minWidth: "120px", width: "120px", height: "29px" }, dataSource: [
|
|
32
32
|
{ value: TaskView.AGENDA_TASK, display: "Agenda", icon: 'clock' },
|
|
33
33
|
{ value: TaskView.CALENDAR_TASK, display: SDKUI_Localizator.Calendar, icon: 'event' },
|
|
34
34
|
{ value: TaskView.LIST_TASK, display: SDKUI_Localizator.List, icon: 'fields' },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { PdGs, Priorities, SDK_Globals, Task_States } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { Extended_Task_States, FilterCategoryId, filterTreeTask, gotoPDGExtendedLabel, prioritiesResourceData, taskIsExpiringSoon } from "./TMTasksUtils";
|
|
@@ -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',
|