@topconsultnpm/sdkui-react 6.22.0-dev3.9 → 6.22.0-dev4.11
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/base/TMAlert.js +6 -8
- package/lib/components/base/TMAreaManager.js +53 -55
- package/lib/components/base/TMButton.js +4 -2
- package/lib/components/base/TMCounterContainer.d.ts +3 -1
- package/lib/components/base/TMCounterContainer.js +16 -1
- package/lib/components/base/TMCustomButton.js +40 -48
- package/lib/components/base/TMDataGrid.js +24 -4
- package/lib/components/base/TMPanel.js +173 -170
- package/lib/components/base/TMSpinner.d.ts +2 -1
- package/lib/components/base/TMSpinner.js +9 -7
- package/lib/components/base/TMTabControl.d.ts +5 -0
- package/lib/components/base/TMTabControl.js +18 -7
- package/lib/components/base/TMTreeView.js +20 -0
- package/lib/components/base/TMWaitPanel.js +1 -1
- 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 +179 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.js +373 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +58 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.js +346 -0
- package/lib/components/base/waitPanel/index.d.ts +1 -0
- package/lib/components/base/waitPanel/index.js +1 -0
- package/lib/components/choosers/TMDistinctValues.js +3 -3
- package/lib/components/choosers/TMPathChooser.js +17 -34
- package/lib/components/editors/TMTextBox.d.ts +4 -0
- package/lib/components/editors/TMTextBox.js +99 -11
- package/lib/components/features/archive/TMArchive.js +7 -2
- package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +28 -0
- package/lib/components/features/assistant/TMHelpOnLineChat.js +1231 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
- package/lib/components/features/documents/TMBatchUpdateForm.js +3 -4
- package/lib/components/features/documents/TMCopyToFolderForm.js +53 -84
- package/lib/components/features/documents/TMDcmtForm.js +50 -61
- 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 +5 -3
- package/lib/components/features/documents/TMDcmtTasks.js +2 -9
- package/lib/components/features/documents/TMFileUploader.js +26 -26
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +53 -148
- package/lib/components/features/documents/TMMasterInfoFields.js +3 -2
- package/lib/components/features/documents/TMMergeToPdfForm.js +52 -56
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +14 -15
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +1 -1
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +3 -3
- package/lib/components/features/documents/TMRelationViewer.d.ts +13 -14
- package/lib/components/features/documents/TMRelationViewer.js +206 -143
- package/lib/components/features/documents/relationTreeState.d.ts +32 -0
- package/lib/components/features/documents/relationTreeState.js +89 -0
- package/lib/components/features/search/TMSearch.js +3 -4
- package/lib/components/features/search/TMSearchQueryPanel.js +0 -4
- package/lib/components/features/search/TMSearchResult.d.ts +5 -0
- package/lib/components/features/search/TMSearchResult.js +51 -24
- package/lib/components/features/search/TMTreeSelector.js +23 -27
- package/lib/components/features/search/TMViewHistoryDcmt.js +15 -26
- package/lib/components/features/tasks/TMTasksView.js +97 -90
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +104 -100
- package/lib/components/forms/TMResultDialog.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +93 -97
- package/lib/components/index.d.ts +5 -1
- package/lib/components/index.js +4 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +16 -15
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +5 -1
- package/lib/components/layout/panelManager/TMPanelManagerLoader.d.ts +6 -0
- package/lib/components/layout/panelManager/TMPanelManagerLoader.js +18 -0
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +4 -8
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +1 -1
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.js +2 -1
- package/lib/components/pages/TMPage.js +32 -31
- package/lib/components/query/TMQueryEditor.d.ts +3 -0
- package/lib/components/query/TMQueryEditor.js +2 -1
- package/lib/components/sidebar/TMHeader.d.ts +1 -0
- package/lib/components/sidebar/TMHeader.js +2 -2
- package/lib/helper/Enum_Localizator.js +1 -0
- package/lib/helper/SDKUI_Globals.d.ts +7 -2
- package/lib/helper/SDKUI_Globals.js +7 -2
- package/lib/helper/SDKUI_Localizator.d.ts +31 -6
- package/lib/helper/SDKUI_Localizator.js +301 -51
- package/lib/helper/ZipManager.d.ts +1 -1
- package/lib/helper/ZipManager.js +2 -1
- package/lib/helper/checkinCheckoutManager.js +2 -3
- package/lib/helper/dcmtsHelper.d.ts +2 -0
- package/lib/helper/dcmtsHelper.js +3 -1
- package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
- package/lib/hooks/useCheckInOutOperations.js +16 -37
- package/lib/hooks/useDcmtOperations.d.ts +3 -19
- package/lib/hooks/useDcmtOperations.js +175 -229
- package/lib/hooks/useDocumentOperations.d.ts +1 -0
- package/lib/hooks/useDocumentOperations.js +16 -29
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +0 -15
- package/lib/hooks/useMultiMasterDetailDcmts.js +70 -68
- package/lib/hooks/usePreventFileDrop.js +9 -0
- package/lib/hooks/useWorkflowApprove.js +33 -17
- package/lib/services/caseflow/CaseFlowService.d.ts +69 -9
- package/lib/services/caseflow/CaseFlowService.js +126 -58
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { SDKUI_Localizator } from "../../../helper";
|
|
4
4
|
import { DeviceType, useDeviceType } from "../../base/TMDeviceProvider";
|
|
5
5
|
import { useTMPanelManagerContext } from "../../layout/panelManager/TMPanelManagerContext";
|
|
6
6
|
import TMPanel from "../../base/TMPanel";
|
|
@@ -12,13 +12,6 @@ const TMDcmtTasks = (props) => {
|
|
|
12
12
|
// This avoids unnecessary re-renders by only recalculating when deviceType changes.
|
|
13
13
|
let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
|
|
14
14
|
const { togglePanelVisibility, toggleMaximize, countVisibleLeafPanels } = useTMPanelManagerContext();
|
|
15
|
-
|
|
16
|
-
{
|
|
17
|
-
icon: _jsx(IconRefresh, {}),
|
|
18
|
-
onClick: async () => await getAllTasks(),
|
|
19
|
-
text: SDKUI_Localizator.Refresh,
|
|
20
|
-
},
|
|
21
|
-
], children: _jsx(IconMenuVertical, { id: "TMTaksPanel-Commands-Header", color: 'white', cursor: 'pointer' }) }), []);
|
|
22
|
-
return _jsx("div", { style: { width: "100%", height: "100%", position: 'relative' }, children: _jsx(TMPanel, { title: SDKUI_Localizator.Widget_Activities, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onClose: countVisibleLeafPanels() > 1 ? () => togglePanelVisibility("tmDcmtTasks") : undefined, onMaximize: countVisibleLeafPanels() > 1 ? () => toggleMaximize("tmDcmtTasks") : undefined, toolbar: toolbar, onBack: onBack, children: _jsx(TMTasksPanelContent, { id: "dcmtTasks", taskContext: taskContext, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs ? handleNavigateToWGs : () => { return Promise.resolve(); }, handleNavigateToDossiers: handleNavigateToDossiers ? handleNavigateToDossiers : () => { return Promise.resolve(); }, afterTaskSaved: afterTaskSaved }) }) });
|
|
15
|
+
return _jsx("div", { style: { width: "100%", height: "100%", position: 'relative' }, children: _jsx(TMPanel, { title: SDKUI_Localizator.Widget_Activities, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onClose: countVisibleLeafPanels() > 1 ? () => togglePanelVisibility("tmDcmtTasks") : undefined, onMaximize: countVisibleLeafPanels() > 1 ? () => toggleMaximize("tmDcmtTasks") : undefined, onRefresh: getAllTasks, onBack: onBack, children: _jsx(TMTasksPanelContent, { id: "dcmtTasks", taskContext: taskContext, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs ? handleNavigateToWGs : () => { return Promise.resolve(); }, handleNavigateToDossiers: handleNavigateToDossiers ? handleNavigateToDossiers : () => { return Promise.resolve(); }, afterTaskSaved: afterTaskSaved }) }) });
|
|
23
16
|
};
|
|
24
17
|
export default TMDcmtTasks;
|
|
@@ -29,6 +29,7 @@ const TMFileUploader = ({ fromDTD, deviceType = DeviceType.DESKTOP, onClose, onF
|
|
|
29
29
|
const [fileSize, setFileSize] = useState(undefined);
|
|
30
30
|
const [fileExt, setFileExt] = useState(undefined);
|
|
31
31
|
const uploaderRef = useRef(null);
|
|
32
|
+
const fileInputRef = useRef(null);
|
|
32
33
|
// Ref al TMPanel per chiamare focusPanel()
|
|
33
34
|
const fileUploaderPanelRef = useRef(null);
|
|
34
35
|
usePreventFileDrop([uploaderRef]);
|
|
@@ -85,19 +86,18 @@ const TMFileUploader = ({ fromDTD, deviceType = DeviceType.DESKTOP, onClose, onF
|
|
|
85
86
|
setFileSize(undefined);
|
|
86
87
|
setFileExt(undefined);
|
|
87
88
|
onFileUpload?.(null);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
fileInput.value = '';
|
|
89
|
+
if (fileInputRef.current) {
|
|
90
|
+
fileInputRef.current.value = '';
|
|
91
91
|
}
|
|
92
92
|
//Rifocalizza dopo la cancellazione del file
|
|
93
93
|
if (refocus)
|
|
94
94
|
refocusAfterFileInput();
|
|
95
95
|
}, [onFileUpload, refocusAfterFileInput]);
|
|
96
96
|
const browseHandler = useCallback(() => {
|
|
97
|
-
|
|
97
|
+
fileInputRef.current?.click();
|
|
98
98
|
}, []);
|
|
99
99
|
let content = !uploadedFile ?
|
|
100
|
-
_jsxs("div", { style: { display: 'flex', gap: 10, width: '100%', height: '100%' }, children: [_jsx(HiddenInput, {
|
|
100
|
+
_jsxs("div", { style: { display: 'flex', gap: 10, width: '100%', height: '100%' }, children: [_jsx(HiddenInput, { ref: fileInputRef, type: "file", onChange: handleInputChange }), _jsxs(UploadContainer, { ref: uploaderRef, tabIndex: 0, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, style: { backgroundColor: dragOver ? '#76b1e6' : 'white' }, onDoubleClick: browseHandler, $isRequired: isRequired, children: [_jsxs("div", { style: { display: 'flex', gap: '10px', flexDirection: 'column', position: 'absolute', right: 5, top: 5 }, children: [_jsx(TMButton, { btnStyle: 'icon', caption: 'Sfoglia', color: isRequired && !uploadedFile ? 'error' : 'primary', onClick: browseHandler, icon: _jsx(IconFolderOpen, { fontSize: 22 }) }), showScannerIcon && isScannerLicenseConfigured() && onScanRequest && _jsx(TMButton, { btnStyle: 'icon', caption: 'Scanner', color: 'primary', onClick: () => { onScanRequest((file) => { onFileUpload?.(file); }); }, icon: _jsx(IconScanner, { fontSize: 22 }) }), showScannerIcon && isScannerLicenseConfigured() && !onScanRequest && _jsx(TMButton, { btnStyle: 'icon', caption: 'Scanner', color: 'primary', onClick: () => { ShowAlert({ message: SDKUI_Localizator.ScanFeatureUnavailableInThisContext, mode: 'info', duration: 3000, title: 'Scanner' }); }, icon: _jsx(IconScanner, { fontSize: 22 }) })] }), _jsx("p", { style: { fontSize: '1.2rem', fontWeight: 'bold' }, children: deviceType === DeviceType.MOBILE ? SDKUI_Localizator.ClickToBrowseFile : SDKUI_Localizator.DragOrDoubleClickToBrowseFile }), isRequired && _jsxs("p", { style: { fontWeight: 'bold' }, children: [" ", SDKUI_Localizator.RequiredField, " "] })] })] }) :
|
|
101
101
|
_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 10, width: '100%', height: '100%' }, children: [_jsxs("div", { style: { backgroundColor: 'white', padding: '5px 10px', borderRadius: 8, display: 'flex', alignItems: 'center', justifyContent: 'space-between', color: TMColors.primaryColor }, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 5 }, children: [_jsx("p", { children: "File name:" }), _jsxs("div", { style: { fontWeight: 'bold' }, children: [fileName, " ", _jsxs("span", { children: [" ", ` (${formatBytes(fileSize)})`, " "] })] })] }), uploadedFile && _jsx(TMButton, { btnStyle: 'icon', color: 'error', caption: 'Pulisci', onClick: () => clearFile(true), icon: _jsx(IconClear, { fontSize: 22 }) })] }), extensionHandler(fileExt) === FileExtensionHandler.READY_TO_SHOW ? _jsx(TMFileViewer, { fileBlob: uploadedFile, isResizingActive: isResizingActive }) :
|
|
102
102
|
_jsx("div", { style: { backgroundColor: '#f6dbdb', padding: '5px 10px', borderRadius: 8, display: 'flex', alignItems: 'center', justifyContent: 'space-between', color: TMColors.error }, children: _jsxs("div", { children: [" ", SDKUI_Localizator.PreviewNotAvailable, fileExt && _jsx("b", { children: ` (*.${fileExt})` })] }) })] });
|
|
103
103
|
const innerContent = (_jsxs("div", { style: { width: '100%', height: '100%', padding: '2px', display: 'flex', flexDirection: 'column', gap: 10 }, children: [enableDragDropOverlay && _jsx(TMDragDropOverlay, { handleFile: handleFile, refocusAfterFileInput: refocusAfterFileInput }), content] }));
|
|
@@ -112,27 +112,27 @@ const TMFileUploader = ({ fromDTD, deviceType = DeviceType.DESKTOP, onClose, onF
|
|
|
112
112
|
}, [deviceType, fromDTD, onClose]);
|
|
113
113
|
return showTMPanel ? (_jsx(TMPanel, { ref: fileUploaderPanelRef, panelID: 'file-uploader-panel', title: SDKUI_Localizator.FileUpload, onBack: deviceType === DeviceType.MOBILE ? () => onClose?.() : undefined, toolbar: toolbar, children: innerContent })) : (innerContent);
|
|
114
114
|
};
|
|
115
|
-
const UploadContainer = styled.div `
|
|
116
|
-
position: relative;
|
|
117
|
-
display: flex;
|
|
118
|
-
align-items: center;
|
|
119
|
-
justify-content: center;
|
|
120
|
-
flex-direction: column;
|
|
121
|
-
gap: 5px;
|
|
122
|
-
border: 2px dashed ${props => props.$isRequired ? () => TMColors.error : () => TMColors.primaryColor};
|
|
123
|
-
/* max-height: 100px; */
|
|
124
|
-
width: 100%;
|
|
125
|
-
height: 100%;
|
|
126
|
-
border-radius: 8px;
|
|
127
|
-
padding: 30px;
|
|
128
|
-
text-align: center;
|
|
129
|
-
color: ${props => props.$isRequired ? () => TMColors.error : () => TMColors.primaryColor};
|
|
130
|
-
transition: background-color 0.3s;
|
|
131
|
-
&:hover {
|
|
132
|
-
background-color: #658cab;
|
|
133
|
-
}
|
|
115
|
+
const UploadContainer = styled.div `
|
|
116
|
+
position: relative;
|
|
117
|
+
display: flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
justify-content: center;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
gap: 5px;
|
|
122
|
+
border: 2px dashed ${props => props.$isRequired ? () => TMColors.error : () => TMColors.primaryColor};
|
|
123
|
+
/* max-height: 100px; */
|
|
124
|
+
width: 100%;
|
|
125
|
+
height: 100%;
|
|
126
|
+
border-radius: 8px;
|
|
127
|
+
padding: 30px;
|
|
128
|
+
text-align: center;
|
|
129
|
+
color: ${props => props.$isRequired ? () => TMColors.error : () => TMColors.primaryColor};
|
|
130
|
+
transition: background-color 0.3s;
|
|
131
|
+
&:hover {
|
|
132
|
+
background-color: #658cab;
|
|
133
|
+
}
|
|
134
134
|
`;
|
|
135
|
-
const HiddenInput = styled.input `
|
|
136
|
-
display: none;
|
|
135
|
+
const HiddenInput = styled.input `
|
|
136
|
+
display: none;
|
|
137
137
|
`;
|
|
138
138
|
export default TMFileUploader;
|
|
@@ -22,6 +22,8 @@ interface ITMMasterDetailDcmtsProps extends DeviceContextProps {
|
|
|
22
22
|
onNext?: () => void;
|
|
23
23
|
onPrev?: () => void;
|
|
24
24
|
onBack?: () => void;
|
|
25
|
+
/** Invocato quando il calcolo iniziale delle correlazioni è finito */
|
|
26
|
+
onFirstLoadCompleted?: () => void;
|
|
25
27
|
appendMasterDcmts?: (tid: number | undefined, did: number | undefined) => void;
|
|
26
28
|
onTaskCreateRequest?: (taskContext: TaskContext, onTaskCreated?: (task?: TaskDescriptor) => void) => void;
|
|
27
29
|
onRefreshAfterAddDcmtToFavs?: () => void;
|
|
@@ -14,12 +14,13 @@ import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/p
|
|
|
14
14
|
import TMSearchResult from '../search/TMSearchResult';
|
|
15
15
|
import TMDcmtForm from './TMDcmtForm';
|
|
16
16
|
import { TMNothingToShow } from './TMDcmtPreview';
|
|
17
|
-
import { TMButton
|
|
17
|
+
import { TMButton } from '../..';
|
|
18
|
+
import TMLayoutContainer from '../../base/TMLayout';
|
|
18
19
|
import { useDocumentOperations } from '../../../hooks/useDocumentOperations';
|
|
19
20
|
import TMToppyMessage from '../../../helper/TMToppyMessage';
|
|
20
21
|
import TMPanel from '../../base/TMPanel';
|
|
21
|
-
import
|
|
22
|
-
const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, deviceType, inputDcmts, isForMaster, showCurrentDcmtIndicator = true, allowNavigation, canNext, canPrev, onNext, onPrev, onBack, appendMasterDcmts, onTaskCreateRequest, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, datagridUtility, dcmtUtility, fetchRemoteCertificates }) => {
|
|
22
|
+
import TMSpinner from '../../base/TMSpinner';
|
|
23
|
+
const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, deviceType, inputDcmts, isForMaster, showCurrentDcmtIndicator = true, allowNavigation, canNext, canPrev, onNext, onPrev, onBack, onFirstLoadCompleted, appendMasterDcmts, onTaskCreateRequest, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, datagridUtility, dcmtUtility, fetchRemoteCertificates }) => {
|
|
23
24
|
const floatingBarContainerRef = useRef(null);
|
|
24
25
|
const [focusedItem, setFocusedItem] = useState();
|
|
25
26
|
const [selectedItems, setSelectedItems] = useState([]);
|
|
@@ -45,6 +46,13 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
45
46
|
const [refreshKey, setRefreshKey] = useState(0);
|
|
46
47
|
// Separate refresh key for TMFormOrResultWrapper only (doesn't affect tmTreeView)
|
|
47
48
|
const [refreshKeyFormOrResult, setRefreshKeyFormOrResult] = useState(0);
|
|
49
|
+
// Stato dell'albero conservato qui perché il bump di refreshKey rimonta TMRelationViewer:
|
|
50
|
+
// una ref interna al viewer non sopravvivrebbe. Riletto dal useMemo di tmTreeView,
|
|
51
|
+
// che si ricalcola proprio al refresh.
|
|
52
|
+
const treeStateRef = useRef(undefined);
|
|
53
|
+
const handleTreeStateChange = useCallback((state) => {
|
|
54
|
+
treeStateRef.current = state;
|
|
55
|
+
}, []);
|
|
48
56
|
/** State for transformed focusedItem metadata values (similar to formData in TMDcmtForm) */
|
|
49
57
|
const [focusedItemFormData, setFocusedItemFormData] = useState([]);
|
|
50
58
|
// Trigger operationItems refresh (after file substitution, etc.)
|
|
@@ -64,6 +72,24 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
64
72
|
setIsCheckingFirstLoad(false);
|
|
65
73
|
}
|
|
66
74
|
}, [isRelationViewerLoading, isCheckingFirstLoad]);
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (!isCheckingFirstLoad)
|
|
77
|
+
onFirstLoadCompleted?.();
|
|
78
|
+
}, [isCheckingFirstLoad, onFirstLoadCompleted]);
|
|
79
|
+
// Dal montaggio fino all'apertura del wait panel del viewer (il tempo di caricare i
|
|
80
|
+
// tipi documento) la pagina resta nascosta: senza spinner non si vedrebbe nulla.
|
|
81
|
+
const [waitingFirstLoad, setWaitingFirstLoad] = useState(true);
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (!waitingFirstLoad)
|
|
84
|
+
return;
|
|
85
|
+
// Da qui in avanti e' il wait panel a dare riscontro
|
|
86
|
+
if (isRelationViewerLoading) {
|
|
87
|
+
setWaitingFirstLoad(false);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
TMSpinner.show({ description: SDKUI_Localizator.Loading });
|
|
91
|
+
return () => TMSpinner.hide();
|
|
92
|
+
}, [waitingFirstLoad, isRelationViewerLoading]);
|
|
67
93
|
// Increments trigger counter to force operationItems to re-calculate
|
|
68
94
|
const onRefreshOperationsDatagrid = useCallback(async () => {
|
|
69
95
|
setRefreshOperationsTrigger(prev => prev + 1);
|
|
@@ -72,12 +98,6 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
72
98
|
const handleStopCalculationReady = useCallback((stopCalculation) => {
|
|
73
99
|
stopRelationsCalculationRef.current = stopCalculation;
|
|
74
100
|
}, []);
|
|
75
|
-
// Interrompe il calcolo delle correlazioni: mostra subito quelle già calcolate
|
|
76
|
-
// senza attendere le restanti chiamate GetMetadata
|
|
77
|
-
const handleStopRelationsCalculation = useCallback(() => {
|
|
78
|
-
stopRelationsCalculationRef.current?.();
|
|
79
|
-
setIsCheckingFirstLoad(false); // Nasconde l'overlay e mostra l'albero (parziale)
|
|
80
|
-
}, []);
|
|
81
101
|
// Esce dalla maschera interrompendo anche le chiamate GetMetadata ancora in coda:
|
|
82
102
|
// l'interruzione è invocata in modo sincrono perché onBack può smontare il componente
|
|
83
103
|
// (un effect non farebbe in tempo a propagare l'interruzione)
|
|
@@ -86,25 +106,30 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
86
106
|
stopRelationsCalculationRef.current?.();
|
|
87
107
|
onBack?.();
|
|
88
108
|
}, [onBack]);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
//
|
|
94
|
-
const [relationsProgress, setRelationsProgress] = useState({ value: 0, max: 0 });
|
|
95
|
-
const handleRelationsProgress = useCallback((value, max) => {
|
|
96
|
-
setRelationsProgress({ value, max });
|
|
97
|
-
}, []);
|
|
98
|
-
// Notifica all'utente che i dati mostrati sono parziali (non quando si sta uscendo)
|
|
109
|
+
// Letta da handleRelationsCalculationStopped, che deve restare stabile: arriva fino
|
|
110
|
+
// alle dipendenze di loadData nel viewer, dove un cambio farebbe ripartire il calcolo
|
|
111
|
+
const handleBackRef = useRef(handleBack);
|
|
112
|
+
handleBackRef.current = handleBack;
|
|
113
|
+
// Notifica all'utente che i dati mostrati sono parziali
|
|
99
114
|
const handleRelationsCalculationStopped = useCallback((loadedCount, totalCount) => {
|
|
100
115
|
if (isLeavingRef.current)
|
|
101
116
|
return;
|
|
102
|
-
//
|
|
103
|
-
|
|
117
|
+
// Interrotto prima di calcolare qualcosa: non c'è nulla da mostrare, si torna indietro
|
|
118
|
+
if (loadedCount === 0) {
|
|
119
|
+
ShowAlert({
|
|
120
|
+
message: SDKUI_Localizator.RelationsCalculationStoppedEmpty,
|
|
121
|
+
title: SDKUI_Localizator.Attention,
|
|
122
|
+
duration: 6000,
|
|
123
|
+
mode: 'warning',
|
|
124
|
+
});
|
|
125
|
+
handleBackRef.current();
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
// Testo breve: il box di ShowAlert ha altezza fissa e taglia oltre le due righe
|
|
104
129
|
ShowAlert({
|
|
105
|
-
message:
|
|
130
|
+
message: SDKUI_Localizator.RelationsCalculationStoppedProgress.replaceParams(loadedCount.toString(), totalCount.toString()),
|
|
106
131
|
title: SDKUI_Localizator.Attention,
|
|
107
|
-
duration:
|
|
132
|
+
duration: 6000,
|
|
108
133
|
mode: 'info',
|
|
109
134
|
});
|
|
110
135
|
}, []);
|
|
@@ -282,7 +307,6 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
282
307
|
onRefreshAfterAddDcmtToFavs,
|
|
283
308
|
},
|
|
284
309
|
});
|
|
285
|
-
const { dcmtOperations: { abortController, showWaitPanel, showPrimary, waitPanelTitle, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, }, } = features;
|
|
286
310
|
// Nuovi documenti in input: il componente non sta più uscendo dalla maschera
|
|
287
311
|
// (chiave stabile: l'array inputDcmts può essere ricreato a ogni render)
|
|
288
312
|
const inputDcmtsKey = useMemo(() => (inputDcmts ?? []).map(d => `${d.TID}-${d.DID}`).join('|'), [inputDcmts]);
|
|
@@ -386,11 +410,11 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
386
410
|
setContextMenuVisible(true);
|
|
387
411
|
}, children: [_jsx(TMRelationViewerWrapper, { refreshKey: refreshKey, inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, showZeroDcmts: showZeroDcmts,
|
|
388
412
|
// customItemRender={customItemRender}
|
|
389
|
-
allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: handleSelectedItemsChanged, onNoRelationsFound: handleNoRelationsFound, onItemContextMenu: isRelationViewerLoading ? undefined : onItemContextMenu,
|
|
413
|
+
allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: handleSelectedItemsChanged, onNoRelationsFound: handleNoRelationsFound, onItemContextMenu: isRelationViewerLoading ? undefined : onItemContextMenu, onLoadingStateChanged: setIsRelationViewerLoading, onStopCalculationReady: handleStopCalculationReady, onCalculationStopped: handleRelationsCalculationStopped, initialTreeState: treeStateRef.current, onTreeStateChange: handleTreeStateChange }), _jsx(TMContextMenu, { items: operationItems, externalControl: {
|
|
390
414
|
visible: contextMenuVisible,
|
|
391
415
|
position: contextMenuPosition,
|
|
392
416
|
onClose: () => setContextMenuVisible(false)
|
|
393
|
-
} })] }) }), [inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, allowMultipleSelection, focusedItem, selectedItems, handleFocusedItemChanged, handleSelectedItemsChanged, handleNoRelationsFound, onItemContextMenu, contextMenuVisible, contextMenuPosition, refreshKey, focusedItemFormData, isRelationViewerLoading, handleStopCalculationReady, handleRelationsCalculationStopped]);
|
|
417
|
+
} })] }) }), [inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, allowMultipleSelection, focusedItem, selectedItems, handleFocusedItemChanged, handleSelectedItemsChanged, handleNoRelationsFound, onItemContextMenu, contextMenuVisible, contextMenuPosition, refreshKey, focusedItemFormData, isRelationViewerLoading, handleStopCalculationReady, handleRelationsCalculationStopped, handleTreeStateChange]);
|
|
394
418
|
const tmFormOrResult = useMemo(() => _jsx(TMFormOrResultWrapper, { refreshKey: refreshKeyFormOrResult, deviceType: deviceType, focusedItem: focusedItem, onTaskCreateRequest: onTaskCreateRequest, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, handleNavigateToReference: handleNavigateToReference, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, onRefreshSearchResults: onRefreshAllPanels }), [focusedItem, deviceType, allTasks, handleNavigateToWGs, handleNavigateToDossiers, handleNavigateToReference, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshAfterAddDcmtToFavs, refreshKeyFormOrResult]);
|
|
395
419
|
const initialPanelDimensions = {
|
|
396
420
|
'tmTreeView': { width: '50%', height: '100%' },
|
|
@@ -470,12 +494,7 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
470
494
|
toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: false, orderNumber: 2, isActive: allInitialPanelVisibility['tmFormOrResult'] }
|
|
471
495
|
}
|
|
472
496
|
], [tmTreeView, tmFormOrResult, focusedItem?.isDcmt, dtdMaster]);
|
|
473
|
-
return (
|
|
474
|
-
? `${isForMaster ? SDKUI_Localizator.LoadingMasterDocuments : SDKUI_Localizator.LoadingDetailDocuments} (${relationsProgress.value}/${relationsProgress.max})`
|
|
475
|
-
: undefined, progressValue: relationsProgress.value, progressMax: relationsProgress.max,
|
|
476
|
-
// Con un solo documento in input la chiamata è unica: non ci sono
|
|
477
|
-
// risultati parziali da mostrare, quindi il pulsante resta disabilitato
|
|
478
|
-
stopDisabled: (inputDcmts?.length ?? 0) <= 1 })), _jsxs("div", { style: isCheckingFirstLoad ? { position: 'absolute', width: 0, height: 0, overflow: 'hidden', opacity: 0, pointerEvents: 'none' } : { width: '100%', height: '100%' }, children: [_jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmTreeView', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }), renderDcmtOperations, renderFloatingBar] })] }));
|
|
497
|
+
return (_jsx("div", { style: { width: '100%', height: '100%', position: 'relative' }, children: _jsxs("div", { style: isCheckingFirstLoad ? { position: 'absolute', width: 0, height: 0, overflow: 'hidden', opacity: 0, pointerEvents: 'none' } : { width: '100%', height: '100%' }, children: [_jsx(TMLayoutContainer, { direction: 'vertical', children: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmTreeView', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }), renderDcmtOperations, renderFloatingBar] }) }));
|
|
479
498
|
};
|
|
480
499
|
export default TMMasterDetailDcmts;
|
|
481
500
|
/**
|
|
@@ -484,7 +503,7 @@ export default TMMasterDetailDcmts;
|
|
|
484
503
|
* - Panel visibility toggling
|
|
485
504
|
* - Focus delay handling
|
|
486
505
|
*/
|
|
487
|
-
const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, customItemRender, allowMultipleSelection, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onNoRelationsFound, onItemContextMenu,
|
|
506
|
+
const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, customItemRender, allowMultipleSelection, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onNoRelationsFound, onItemContextMenu, onLoadingStateChanged, onStopCalculationReady, onCalculationStopped, initialTreeState, onTreeStateChange }) => {
|
|
488
507
|
const { setPanelVisibilityById, setToolbarButtonVisibility } = useTMPanelManagerContext();
|
|
489
508
|
// Monitor device type changes to restore panel visibility when switching from mobile to desktop
|
|
490
509
|
const deviceType = useDeviceType();
|
|
@@ -544,7 +563,7 @@ const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurr
|
|
|
544
563
|
onItemContextMenu?.(item, e);
|
|
545
564
|
}, 100);
|
|
546
565
|
}, [onItemContextMenu, handleFocusedItemChanged]);
|
|
547
|
-
return (_jsx(TMRelationViewer, { inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, initialShowZeroDcmts: showZeroDcmts, customItemRender: customItemRender, allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: onSelectedItemsChanged, maxDepthLevel: 1, invertMasterNavigation: false, showExpandAllButton: true, onNoRelationsFound: onNoRelationsFound, onItemContextMenu: onContextMenu,
|
|
566
|
+
return (_jsx(TMRelationViewer, { inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, initialShowZeroDcmts: showZeroDcmts, customItemRender: customItemRender, allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: onSelectedItemsChanged, maxDepthLevel: 1, invertMasterNavigation: false, showExpandAllButton: true, onNoRelationsFound: onNoRelationsFound, onItemContextMenu: onContextMenu, onLoadingStateChanged: onLoadingStateChanged, onStopCalculationReady: onStopCalculationReady, onCalculationStopped: onCalculationStopped, initialTreeState: initialTreeState, onTreeStateChange: onTreeStateChange }, refreshKey));
|
|
548
567
|
};
|
|
549
568
|
const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCreateRequest, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshSearchAsyncDatagrid, onRefreshSearchResults, handleNavigateToReference, fetchRemoteCertificates }) => {
|
|
550
569
|
const { setPanelVisibilityById } = useTMPanelManagerContext();
|
|
@@ -554,117 +573,3 @@ const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCrea
|
|
|
554
573
|
}, fetchRemoteCertificates: fetchRemoteCertificates }, refreshKey) :
|
|
555
574
|
focusedItem?.searchResult === undefined ? (_jsx(TMPanel, { title: SDKUI_Localizator.SearchResult, children: _jsx(TMToppyMessage, { message: SDKUI_Localizator.SelectDocumentToViewSearchResults }) })) : (_jsx(TMSearchResult, { groupId: 'tmFormOrResult', isClosable: deviceType !== DeviceType.MOBILE, context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, allowRelations: false, openDcmtFormAsModal: true, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, showDcmtFormSidebar: false, autoFocusFirstRow: false, onTaskCreateRequest: onTaskCreateRequest, onClose: () => { setPanelVisibilityById('tmTreeView', true); }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, editPdfForm: editPdfForm, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, enablePinIcons: false, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, showBackButton: false, onRefreshSearchAsyncDatagrid: onRefreshSearchResults, onReferenceClick: handleNavigateToReference, fetchRemoteCertificates: fetchRemoteCertificates }, refreshKey)) }));
|
|
556
575
|
};
|
|
557
|
-
const TMLoadingOverlay = ({ onCancel, onStop, description, cancelText, stopText, progressValue, progressMax, stopDisabled }) => {
|
|
558
|
-
// Stesso calcolo di TMWaitPanel: 0 quando il massimo non è ancora noto
|
|
559
|
-
const progressPercent = (progressMax ?? 0) > 0
|
|
560
|
-
? Math.min(100, ((progressValue ?? 0) / (progressMax ?? 1)) * 100)
|
|
561
|
-
: 0;
|
|
562
|
-
return (_jsx("div", { style: {
|
|
563
|
-
position: 'absolute',
|
|
564
|
-
top: 0,
|
|
565
|
-
left: 0,
|
|
566
|
-
width: '100%',
|
|
567
|
-
height: '100%',
|
|
568
|
-
backgroundColor: 'rgba(248, 250, 252, 0.92)',
|
|
569
|
-
zIndex: 1000,
|
|
570
|
-
display: 'flex',
|
|
571
|
-
justifyContent: 'center',
|
|
572
|
-
alignItems: 'center',
|
|
573
|
-
}, children: _jsxs("div", { style: {
|
|
574
|
-
display: 'flex',
|
|
575
|
-
flexDirection: 'column',
|
|
576
|
-
alignItems: 'center',
|
|
577
|
-
gap: '16px',
|
|
578
|
-
padding: '24px 32px',
|
|
579
|
-
background: '#fcfcfc',
|
|
580
|
-
borderRadius: '8px',
|
|
581
|
-
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.1)',
|
|
582
|
-
}, children: [_jsxs("div", { style: { position: 'relative', width: '80px', height: '80px' }, children: [_jsx("img", { style: {
|
|
583
|
-
position: 'absolute',
|
|
584
|
-
top: '50%',
|
|
585
|
-
left: '50%',
|
|
586
|
-
transform: 'translate(-54%, -54%)'
|
|
587
|
-
}, src: sixLogo, width: 35, alt: "" }), _jsx("style", { children: `
|
|
588
|
-
@keyframes tmSpinnerRotate {
|
|
589
|
-
0% { transform: rotate(0deg); }
|
|
590
|
-
100% { transform: rotate(360deg); }
|
|
591
|
-
}
|
|
592
|
-
.tm-spinner-animation {
|
|
593
|
-
display: inline-block;
|
|
594
|
-
width: 80px;
|
|
595
|
-
height: 80px;
|
|
596
|
-
position: absolute;
|
|
597
|
-
top: 50%;
|
|
598
|
-
left: 50%;
|
|
599
|
-
transform: translate(-50%, -50%);
|
|
600
|
-
}
|
|
601
|
-
.tm-spinner-animation div {
|
|
602
|
-
animation: tmSpinnerRotate 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
|
603
|
-
transform-origin: 40px 40px;
|
|
604
|
-
}
|
|
605
|
-
.tm-spinner-animation div:after {
|
|
606
|
-
content: " ";
|
|
607
|
-
display: block;
|
|
608
|
-
position: absolute;
|
|
609
|
-
width: 7px;
|
|
610
|
-
height: 7px;
|
|
611
|
-
border-radius: 50%;
|
|
612
|
-
background: #0c448e;
|
|
613
|
-
margin: -4px 0 0 -4px;
|
|
614
|
-
}
|
|
615
|
-
.tm-spinner-animation div:nth-child(1) { animation-delay: -0.036s; }
|
|
616
|
-
.tm-spinner-animation div:nth-child(1):after { top: 63px; left: 63px; background: #f7a51f; }
|
|
617
|
-
.tm-spinner-animation div:nth-child(2) { animation-delay: -0.072s; }
|
|
618
|
-
.tm-spinner-animation div:nth-child(2):after { top: 68px; left: 56px; background: #f7a51f; }
|
|
619
|
-
.tm-spinner-animation div:nth-child(3) { animation-delay: -0.108s; }
|
|
620
|
-
.tm-spinner-animation div:nth-child(3):after { top: 71px; left: 48px; background: #d3237b; }
|
|
621
|
-
.tm-spinner-animation div:nth-child(4) { animation-delay: -0.144s; }
|
|
622
|
-
.tm-spinner-animation div:nth-child(4):after { top: 72px; left: 40px; background: #d3237b; }
|
|
623
|
-
.tm-spinner-animation div:nth-child(5) { animation-delay: -0.18s; }
|
|
624
|
-
.tm-spinner-animation div:nth-child(5):after { top: 71px; left: 32px; background: #d12a1c; }
|
|
625
|
-
.tm-spinner-animation div:nth-child(6) { animation-delay: -0.216s; }
|
|
626
|
-
.tm-spinner-animation div:nth-child(6):after { top: 68px; left: 24px; background: #d12a1c; }
|
|
627
|
-
.tm-spinner-animation div:nth-child(7) { animation-delay: -0.252s; }
|
|
628
|
-
.tm-spinner-animation div:nth-child(7):after { top: 63px; left: 17px; background: #782b7d; }
|
|
629
|
-
.tm-spinner-animation div:nth-child(8) { animation-delay: -0.288s; }
|
|
630
|
-
.tm-spinner-animation div:nth-child(8):after { top: 56px; left: 12px; background: #782b7d; }
|
|
631
|
-
` }), _jsxs("div", { className: "tm-spinner-animation", children: [_jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {}), _jsx("div", {})] })] }), _jsx("span", { style: { fontSize: '14px', color: '#334155', textAlign: 'center' }, children: description ?? SDKUI_Localizator.Loading }), (progressMax ?? 0) > 1 && (_jsxs("div", { style: { width: '260px' }, children: [_jsx("div", { style: { width: '100%', height: '20px', background: '#e0e0e0', borderRadius: '10px', overflow: 'hidden' }, children: _jsx("div", { style: { width: `${progressPercent.toFixed(2)}%`, height: '100%', background: '#4caf50', transition: 'width 0.3s ease' } }) }), _jsxs("p", { style: { fontWeight: 'bold', color: '#333', margin: '8px 0 0', textAlign: 'center' }, children: [progressPercent.toFixed(2), "%"] })] })), (onStop || onCancel) && (_jsxs("div", { style: { marginTop: '4px', display: 'flex', alignItems: 'center', justifyContent: 'center', flexWrap: 'wrap', gap: '10px' }, children: [onStop && (_jsx("button", { onClick: onStop, disabled: stopDisabled, title: SDKUI_Localizator.StopRelationsCalculation, style: {
|
|
632
|
-
padding: '8px 24px',
|
|
633
|
-
fontSize: '13px',
|
|
634
|
-
fontWeight: 500,
|
|
635
|
-
color: stopDisabled ? '#94a3b8' : 'white',
|
|
636
|
-
background: stopDisabled ? '#e2e8f0' : '#0c448e',
|
|
637
|
-
border: `1.5px solid ${stopDisabled ? '#e2e8f0' : '#0c448e'}`,
|
|
638
|
-
borderRadius: '6px',
|
|
639
|
-
cursor: stopDisabled ? 'not-allowed' : 'pointer',
|
|
640
|
-
transition: 'all 0.2s ease',
|
|
641
|
-
}, onMouseEnter: (e) => {
|
|
642
|
-
if (stopDisabled)
|
|
643
|
-
return;
|
|
644
|
-
e.currentTarget.style.background = '#0a3872';
|
|
645
|
-
e.currentTarget.style.borderColor = '#0a3872';
|
|
646
|
-
}, onMouseLeave: (e) => {
|
|
647
|
-
if (stopDisabled)
|
|
648
|
-
return;
|
|
649
|
-
e.currentTarget.style.background = '#0c448e';
|
|
650
|
-
e.currentTarget.style.borderColor = '#0c448e';
|
|
651
|
-
}, children: stopText ?? SDKUI_Localizator.ShowPartialResults })), onCancel && (_jsx("button", { onClick: onCancel, style: {
|
|
652
|
-
padding: '8px 24px',
|
|
653
|
-
fontSize: '13px',
|
|
654
|
-
fontWeight: 500,
|
|
655
|
-
color: '#64748b',
|
|
656
|
-
background: 'transparent',
|
|
657
|
-
border: '1.5px solid #cbd5e1',
|
|
658
|
-
borderRadius: '6px',
|
|
659
|
-
cursor: 'pointer',
|
|
660
|
-
transition: 'all 0.2s ease',
|
|
661
|
-
}, onMouseEnter: (e) => {
|
|
662
|
-
e.currentTarget.style.background = '#f1f5f9';
|
|
663
|
-
e.currentTarget.style.borderColor = '#94a3b8';
|
|
664
|
-
e.currentTarget.style.color = '#475569';
|
|
665
|
-
}, onMouseLeave: (e) => {
|
|
666
|
-
e.currentTarget.style.background = 'transparent';
|
|
667
|
-
e.currentTarget.style.borderColor = '#cbd5e1';
|
|
668
|
-
e.currentTarget.style.color = '#64748b';
|
|
669
|
-
}, children: cancelText ?? SDKUI_Localizator.Back }))] }))] }) }));
|
|
670
|
-
};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { DataListViewModes, MetadataDataDomains, SDK_Globals } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { hoverStyle, IconChevronDown, IconClearButton, IconCopy, IconSearch, IconSuccess, SDKUI_Localizator } from '../../../helper';
|
|
5
|
-
import { formatScalarValue, getUserMetadataSorted } from '../../../helper/dcmtsHelper';
|
|
5
|
+
import { canViewMetadata, formatScalarValue, getUserMetadataSorted } from '../../../helper/dcmtsHelper';
|
|
6
6
|
import { useDataListItem } from '../../../hooks/useDataListItem';
|
|
7
7
|
import { TMColors } from '../../../utils/theme';
|
|
8
8
|
import ShowAlert from '../../base/TMAlert';
|
|
@@ -84,7 +84,8 @@ const TMMasterInfoFields = ({ dtd, dcmt, getValuesByMidAsync, reloadToken, isExp
|
|
|
84
84
|
setRows([]);
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
// I metadati che l'utente non può vedere non si mostrano, come nel risultato di ricerca
|
|
88
|
+
const metadata = getUserMetadataSorted(dtd).filter(canViewMetadata);
|
|
88
89
|
// Precarica le liste dati referenziate dai metadati, così le card mostrano subito il valore leggibile
|
|
89
90
|
const dataListIDs = new Set();
|
|
90
91
|
metadata.forEach(md => { if (md.dataDomain === MetadataDataDomains.DataList && md.dataListID)
|