@topconsultnpm/sdkui-react 6.20.0-test1 → 6.21.0-dev1.10
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/styles.d.ts +3 -1
- package/lib/components/NewComponents/ContextMenu/styles.js +7 -5
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +7 -1
- package/lib/components/base/Styled.d.ts +4 -1
- package/lib/components/base/Styled.js +11 -3
- package/lib/components/base/TMPanel.js +6 -4
- package/lib/components/base/TMPopUp.js +4 -0
- package/lib/components/base/TMTreeView.d.ts +5 -2
- package/lib/components/base/TMTreeView.js +74 -22
- package/lib/components/base/TMWaitPanel.js +6 -5
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDataListItemEditor.d.ts +11 -0
- package/lib/components/choosers/TMDataListItemEditor.js +130 -0
- package/lib/components/choosers/TMDataListItemFields.d.ts +11 -0
- package/lib/components/choosers/TMDataListItemFields.js +61 -0
- package/lib/components/choosers/TMDataListItemPicker.d.ts +2 -0
- package/lib/components/choosers/TMDataListItemPicker.js +182 -18
- package/lib/components/choosers/TMDynDataListItemChooser.js +11 -6
- package/lib/components/choosers/TMImageIDChooser.d.ts +16 -0
- package/lib/components/choosers/TMImageIDChooser.js +53 -0
- package/lib/components/choosers/TMMetadataChooser.js +1 -1
- package/lib/components/choosers/TMUserChooser.js +4 -2
- package/lib/components/editors/TMDateBox.js +1 -1
- package/lib/components/editors/TMHtmlEditor.js +1 -1
- package/lib/components/editors/TMLocalizedTextBox.d.ts +1 -0
- package/lib/components/editors/TMLocalizedTextBox.js +3 -3
- package/lib/components/editors/TMMetadataValues.js +203 -41
- package/lib/components/editors/TMTextArea.d.ts +1 -0
- package/lib/components/editors/TMTextArea.js +6 -6
- package/lib/components/editors/TMTextBox.js +9 -10
- package/lib/components/features/archive/TMArchive.d.ts +3 -1
- package/lib/components/features/archive/TMArchive.js +31 -44
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +3 -0
- package/lib/components/features/blog/TMBlogCommentForm.js +42 -36
- package/lib/components/features/documents/TMDcmtBlog.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtBlog.js +2 -1
- package/lib/components/features/documents/TMDcmtForm.d.ts +44 -34
- package/lib/components/features/documents/TMDcmtForm.js +367 -565
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +34 -0
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +124 -0
- package/lib/components/features/documents/TMDcmtPreview.js +66 -13
- package/lib/components/features/documents/TMDcmtTasks.d.ts +3 -1
- package/lib/components/features/documents/TMDcmtTasks.js +2 -2
- package/lib/components/features/documents/TMFileUploader.d.ts +5 -0
- package/lib/components/features/documents/TMFileUploader.js +28 -6
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +27 -2
- package/lib/components/features/documents/TMMasterDetailDcmts.js +264 -97
- package/lib/components/features/documents/TMRelationViewer.d.ts +19 -2
- package/lib/components/features/documents/TMRelationViewer.js +540 -116
- package/lib/components/features/search/TMSearch.d.ts +3 -2
- package/lib/components/features/search/TMSearch.js +3 -3
- package/lib/components/features/search/TMSearchQueryPanel.js +6 -6
- package/lib/components/features/search/TMSearchResult.d.ts +29 -25
- package/lib/components/features/search/TMSearchResult.js +446 -562
- package/lib/components/features/search/TMSignatureInfoContent.js +10 -6
- package/lib/components/features/search/TMTreeSelector.js +1 -1
- package/lib/components/features/tasks/TMTaskForm.d.ts +3 -1
- package/lib/components/features/tasks/TMTaskForm.js +61 -193
- package/lib/components/features/tasks/TMTaskFormUtils.d.ts +80 -0
- package/lib/components/features/tasks/TMTaskFormUtils.js +559 -0
- package/lib/components/features/tasks/TMTasksUtils.d.ts +3 -1
- package/lib/components/features/tasks/TMTasksUtils.js +46 -16
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +0 -7
- package/lib/components/features/tasks/TMTasksUtilsView.js +7 -14
- package/lib/components/features/tasks/TMTasksView.js +5 -3
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +20 -3
- package/lib/components/features/workflow/TMWorkflowPopup.js +21 -109
- package/lib/components/features/workflow/diagram/ConnectionComponent.d.ts +1 -0
- package/lib/components/features/workflow/diagram/ConnectionComponent.js +6 -2
- package/lib/components/features/workflow/diagram/DiagramItemForm.d.ts +2 -0
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +32 -25
- package/lib/components/features/workflow/diagram/RecipientList.d.ts +3 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +13 -9
- package/lib/components/features/workflow/diagram/WFDiagram.js +102 -5
- package/lib/components/features/workflow/diagram/workflowHelpers.js +31 -19
- package/lib/components/forms/Login/TMLoginForm.js +1 -1
- package/lib/components/forms/TMSaveForm.js +61 -13
- package/lib/components/grids/TMBlogsPost.js +8 -8
- package/lib/components/grids/TMBlogsPostUtils.js +2 -2
- package/lib/components/grids/TMRecentsManager.js +1 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +2 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +3 -2
- package/lib/components/pages/TMPage.js +4 -0
- package/lib/components/query/TMQueryEditor.d.ts +1 -0
- package/lib/components/query/TMQueryEditor.js +3 -3
- package/lib/components/viewers/TMMidViewer.js +2 -1
- package/lib/components/viewers/TMTidViewer.js +7 -3
- package/lib/helper/Enum_Localizator.js +5 -0
- package/lib/helper/GlobalStyles.js +3 -0
- package/lib/helper/SDKUI_Globals.d.ts +12 -0
- package/lib/helper/SDKUI_Globals.js +21 -1
- package/lib/helper/SDKUI_Localizator.d.ts +31 -7
- package/lib/helper/SDKUI_Localizator.js +286 -46
- package/lib/helper/TMIcons.d.ts +2 -1
- package/lib/helper/TMIcons.js +4 -1
- package/lib/helper/TMUtils.d.ts +33 -41
- package/lib/helper/TMUtils.js +157 -170
- package/lib/helper/checkinCheckoutManager.d.ts +1 -1
- package/lib/helper/checkinCheckoutManager.js +25 -6
- package/lib/helper/helpers.d.ts +6 -2
- package/lib/helper/helpers.js +24 -8
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/helper/queryHelper.js +1 -1
- package/lib/hooks/useBetaFeatures.d.ts +1 -0
- package/lib/hooks/useBetaFeatures.js +41 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +7 -6
- package/lib/hooks/useCheckInOutOperations.js +9 -16
- package/lib/hooks/useDataUserIdItem.js +2 -2
- package/lib/hooks/useDcmtOperations.d.ts +3 -2
- package/lib/hooks/useDcmtOperations.js +16 -4
- package/lib/hooks/useDocumentOperations.d.ts +140 -0
- package/lib/hooks/useDocumentOperations.js +1307 -0
- package/lib/hooks/useRelatedDocuments.d.ts +1 -1
- package/lib/hooks/useRelatedDocuments.js +64 -42
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/services/platform_services.d.ts +1 -1
- package/lib/services/platform_services.js +4 -0
- package/lib/ts/types.d.ts +5 -1
- package/lib/ts/types.js +1 -0
- package/package.json +2 -2
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +0 -11
- package/lib/components/features/search/TMSearchResultsMenuItems.js +0 -770
- package/lib/components/features/search/TMSignSettingsForm.d.ts +0 -9
- package/lib/components/features/search/TMSignSettingsForm.js +0 -621
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
-
import { DcmtTypeListCacheService, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { DcmtTypeListCacheService, LayoutModes, SDK_Globals, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import TMRelationViewer from './TMRelationViewer';
|
|
5
5
|
import TMContextMenu from '../../NewComponents/ContextMenu/TMContextMenu';
|
|
6
|
-
import {
|
|
6
|
+
import { IconMultipleSelection, IconCheckFile, IconDetailDcmts, SDKUI_Localizator, IconMenuVertical, IconDataList, IconPreview, IconSearchCheck, IconBoard, IconDcmtTypeSys, IconShow, getMoreInfoTasksForDocument, isApprovalWorkflowView, searchResultToMetadataValues } from '../../../helper';
|
|
7
7
|
import { FormModes, SearchResultContext } from '../../../ts';
|
|
8
8
|
import { TMColors } from '../../../utils/theme';
|
|
9
9
|
import ShowAlert from '../../base/TMAlert';
|
|
@@ -14,14 +14,190 @@ 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
|
-
|
|
18
|
-
|
|
17
|
+
import { Spinner } from '../..';
|
|
18
|
+
import { useDocumentOperations } from '../../../hooks/useDocumentOperations';
|
|
19
|
+
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 }) => {
|
|
20
|
+
const floatingBarContainerRef = useRef(null);
|
|
19
21
|
const [focusedItem, setFocusedItem] = useState();
|
|
20
22
|
const [selectedItems, setSelectedItems] = useState([]);
|
|
21
23
|
const [showZeroDcmts, setShowZeroDcmts] = useState(false);
|
|
22
24
|
const [allowMultipleSelection, setAllowMultipleSelection] = useState(false);
|
|
23
25
|
const [dtdMaster, setDtdMaster] = useState();
|
|
24
|
-
|
|
26
|
+
const [noRelationsOnFirstLoad, setNoRelationsOnFirstLoad] = useState(false);
|
|
27
|
+
const [isCheckingFirstLoad, setIsCheckingFirstLoad] = useState(true);
|
|
28
|
+
const [contextMenuVisible, setContextMenuVisible] = useState(false);
|
|
29
|
+
const [contextMenuPosition, setContextMenuPosition] = useState({ x: 0, y: 0 });
|
|
30
|
+
const [dtdFocused, setDtdFocused] = useState();
|
|
31
|
+
const [refreshKey, setRefreshKey] = useState(0);
|
|
32
|
+
// Stato per gestire la transizione fluida durante il refresh
|
|
33
|
+
const [isRefreshing, setIsRefreshing] = useState(false);
|
|
34
|
+
/** State for transformed focusedItem metadata values (similar to formData in TMDcmtForm) */
|
|
35
|
+
const [focusedItemFormData, setFocusedItemFormData] = useState([]);
|
|
36
|
+
// Trigger operationItems refresh (after file substitution, etc.)
|
|
37
|
+
const [refreshOperationsTrigger, setRefreshOperationsTrigger] = useState(0);
|
|
38
|
+
// Increments trigger counter to force operationItems to re-calculate
|
|
39
|
+
const onRefreshOperationsDatagrid = useCallback(async () => {
|
|
40
|
+
setRefreshOperationsTrigger(prev => prev + 1);
|
|
41
|
+
}, []);
|
|
42
|
+
// Refresh con transizione fluida: fade-out -> update -> fade-in
|
|
43
|
+
const onRefreshSearch = async () => {
|
|
44
|
+
await dcmtUtility?.onRefreshPreviewForm?.();
|
|
45
|
+
// Avvia fade-out
|
|
46
|
+
setIsRefreshing(true);
|
|
47
|
+
// Attendi che il fade-out sia completato, poi aggiorna
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
setRefreshKey(prev => prev + 1);
|
|
50
|
+
onRefreshOperationsDatagrid();
|
|
51
|
+
// Attendi un po' per dare tempo al re-render, poi fade-in
|
|
52
|
+
setTimeout(() => {
|
|
53
|
+
setIsRefreshing(false);
|
|
54
|
+
}, 300); // Durata extra dell'overlay dopo l'update
|
|
55
|
+
}, 200); // Durata del fade-out
|
|
56
|
+
};
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
const fetchFocusedItemMetadata = async () => {
|
|
59
|
+
if (!focusedItem?.tid || !focusedItem?.did) {
|
|
60
|
+
setFocusedItemFormData([]);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
const tid = focusedItem?.tid;
|
|
65
|
+
const did = focusedItem?.did;
|
|
66
|
+
const metadata = await SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(tid, did, true);
|
|
67
|
+
// Transform metadata to MetadataValueDescriptorEx[] (similar to setMetadataList in TMDcmtForm)
|
|
68
|
+
if (metadata) {
|
|
69
|
+
const dtdResult = metadata.dtdResult;
|
|
70
|
+
const rows = dtdResult?.rows ? dtdResult.rows[0] : [];
|
|
71
|
+
const mids = metadata.selectMIDs;
|
|
72
|
+
// Get DTD with metadata descriptors
|
|
73
|
+
const dtdWithMetadata = await DcmtTypeListCacheService.GetWithNotGrantedAsync(tid, did, metadata);
|
|
74
|
+
const mdList = dtdWithMetadata?.metadata ?? [];
|
|
75
|
+
const metadataList = searchResultToMetadataValues(tid, dtdResult, rows, mids, mdList, LayoutModes.Update);
|
|
76
|
+
setFocusedItemFormData(structuredClone(metadataList));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
console.error('Error fetching focusedItem metadata:', error);
|
|
81
|
+
setFocusedItemFormData([]);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
fetchFocusedItemMetadata();
|
|
85
|
+
}, [focusedItem?.tid, focusedItem?.did, refreshOperationsTrigger]);
|
|
86
|
+
// Load dtdFocused when focusedItem changes
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
const loadDtdFocused = async () => {
|
|
89
|
+
if (!focusedItem?.tid) {
|
|
90
|
+
setDtdFocused(undefined);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const dtd = await DcmtTypeListCacheService.GetAsync(focusedItem.tid);
|
|
94
|
+
setDtdFocused(dtd);
|
|
95
|
+
};
|
|
96
|
+
loadDtdFocused();
|
|
97
|
+
}, [focusedItem?.tid]);
|
|
98
|
+
const openTaskFormHandler = (onTaskCreated) => {
|
|
99
|
+
if (selectedItems.length > 1)
|
|
100
|
+
return;
|
|
101
|
+
const item = selectedItems.length === 1 ? selectedItems[0] : focusedItem;
|
|
102
|
+
if (item && item.tid && item.did) {
|
|
103
|
+
const createTaskFromDocumentOrWorkItem = async () => {
|
|
104
|
+
try {
|
|
105
|
+
const dtd = await DcmtTypeListCacheService.GetWithNotGrantedAsync(item.tid, item?.did);
|
|
106
|
+
if (dtd) {
|
|
107
|
+
const isWorkItem = isApprovalWorkflowView(dtd);
|
|
108
|
+
if (item.tid === undefined || item.did === undefined) {
|
|
109
|
+
console.error("TID or DID is undefined for the selected item.");
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const name = `${dtd.name ?? '-'} (DID: ${item.did})`;
|
|
113
|
+
onTaskCreateRequest?.(isWorkItem
|
|
114
|
+
? { workItem: { tid: item.tid, did: item.did, name } }
|
|
115
|
+
: { document: { tid: item.tid, did: item.did, name } }, onTaskCreated);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
console.error("Error fetching data:", error);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
createTaskFromDocumentOrWorkItem();
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
const { operationItems, renderFloatingBar, renderDcmtOperations, features } = useDocumentOperations({
|
|
126
|
+
context: SearchResultContext.MASTER_DETAIL,
|
|
127
|
+
documentData: {
|
|
128
|
+
dtd: dtdFocused,
|
|
129
|
+
selectedItems: selectedItems ? selectedItems.map(item => ({ TID: item.tid, DID: item.did, FILEEXT: item.fileExt })) : [],
|
|
130
|
+
focusedItem: focusedItem ? { TID: focusedItem.tid, DID: focusedItem.did, FILEEXT: focusedItem.fileExt } : undefined,
|
|
131
|
+
currentSearchResults: [],
|
|
132
|
+
currentMetadataValues: [],
|
|
133
|
+
allUsers: [],
|
|
134
|
+
// searchResult: selectedSearchResult,
|
|
135
|
+
datagridUtility: {
|
|
136
|
+
visibleItems: [],
|
|
137
|
+
onRefreshSearchAsyncDatagrid: datagridUtility?.onRefreshSearchAsyncDatagrid,
|
|
138
|
+
onRefreshDataRowsAsync: datagridUtility?.onRefreshDataRowsAsync,
|
|
139
|
+
refreshFocusedDataRowAsync: datagridUtility?.refreshFocusedDataRowAsync,
|
|
140
|
+
onRefreshBlogDatagrid: datagridUtility?.onRefreshBlogDatagrid,
|
|
141
|
+
onRefreshPreviewDatagrid: datagridUtility?.onRefreshPreviewDatagrid,
|
|
142
|
+
refreshOperationsTrigger,
|
|
143
|
+
onRefreshOperationsDatagrid,
|
|
144
|
+
},
|
|
145
|
+
dcmtUtility: {
|
|
146
|
+
approvalVID: dcmtUtility?.approvalVID,
|
|
147
|
+
dcmtDataRowForCicoStatus: focusedItemFormData, // Passa i metadata trasformati del focusedItem per le operazioni di CICO
|
|
148
|
+
selectedDcmtSearchResultRelations: dcmtUtility?.selectedDcmtSearchResultRelations,
|
|
149
|
+
dcmtTIDHasDetailRelations: dcmtUtility?.dcmtTIDHasDetailRelations,
|
|
150
|
+
dcmtTIDHasMasterRelations: dcmtUtility?.dcmtTIDHasMasterRelations,
|
|
151
|
+
updateCurrentDcmt: onRefreshSearch,
|
|
152
|
+
onCloseDcmtForm: dcmtUtility?.onCloseDcmtForm,
|
|
153
|
+
onRefreshBlogForm: dcmtUtility?.onRefreshBlogForm,
|
|
154
|
+
onRefreshPreviewForm: onRefreshSearch,
|
|
155
|
+
taskFormDialogComponent: dcmtUtility?.taskFormDialogComponent,
|
|
156
|
+
s4TViewerDialogComponent: dcmtUtility?.s4TViewerDialogComponent
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
uiConfig: {
|
|
160
|
+
floatingBarContainerRef,
|
|
161
|
+
openS4TViewer,
|
|
162
|
+
showDcmtFormSidebar: true,
|
|
163
|
+
openDcmtFormAsModal: true,
|
|
164
|
+
allowFloatingBar: false,
|
|
165
|
+
enablePinIcons: false,
|
|
166
|
+
allowRelations: true,
|
|
167
|
+
inputDcmtFormLayoutMode: LayoutModes.Update,
|
|
168
|
+
},
|
|
169
|
+
tasks: {
|
|
170
|
+
allTasks: allTasks,
|
|
171
|
+
getAllTasks: getAllTasks,
|
|
172
|
+
deleteTaskByIdsCallback: deleteTaskByIdsCallback,
|
|
173
|
+
addTaskCallback: addTaskCallback,
|
|
174
|
+
editTaskCallback: editTaskCallback
|
|
175
|
+
},
|
|
176
|
+
callbacks: {
|
|
177
|
+
// Refresh operations (data consistency)
|
|
178
|
+
/* onSavedAsyncCallback, */
|
|
179
|
+
// Workflow operations
|
|
180
|
+
/* onWFOperationCompleted, */
|
|
181
|
+
// Navigation
|
|
182
|
+
/* canNavigateHandler,
|
|
183
|
+
onNavigateHandler, */
|
|
184
|
+
handleNavigateToWGs,
|
|
185
|
+
handleNavigateToDossiers,
|
|
186
|
+
/* onReferenceClick, */
|
|
187
|
+
// Document forms/operations
|
|
188
|
+
/* openAddDocumentForm,
|
|
189
|
+
openCommentFormCallback,
|
|
190
|
+
onFileOpened,
|
|
191
|
+
passToArchiveCallback,
|
|
192
|
+
openWGsCopyMoveForm, */
|
|
193
|
+
onOpenS4TViewerRequest,
|
|
194
|
+
onOpenPdfEditorRequest,
|
|
195
|
+
// Task related
|
|
196
|
+
onTaskCreateRequest,
|
|
197
|
+
openTaskFormHandler,
|
|
198
|
+
onRefreshAfterAddDcmtToFavs,
|
|
199
|
+
},
|
|
200
|
+
});
|
|
25
201
|
// Load dtdMaster when inputDcmts changes
|
|
26
202
|
useEffect(() => {
|
|
27
203
|
const loadDtdMaster = async () => {
|
|
@@ -40,10 +216,37 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
40
216
|
}, [inputDcmts?.length, inputDcmts?.[0]?.TID, isForMaster]);
|
|
41
217
|
const handleFocusedItemChanged = useCallback((item) => {
|
|
42
218
|
setFocusedItem(item);
|
|
219
|
+
if (item) {
|
|
220
|
+
setIsCheckingFirstLoad(false);
|
|
221
|
+
}
|
|
43
222
|
}, []);
|
|
44
223
|
const handleSelectedItemsChanged = useCallback((items) => {
|
|
45
224
|
setSelectedItems(items);
|
|
46
225
|
}, []);
|
|
226
|
+
const handleNoRelationsFound = useCallback(() => {
|
|
227
|
+
if (isCheckingFirstLoad) {
|
|
228
|
+
setNoRelationsOnFirstLoad(true);
|
|
229
|
+
}
|
|
230
|
+
}, [isCheckingFirstLoad]);
|
|
231
|
+
const onItemContextMenu = useCallback((item, e) => {
|
|
232
|
+
if (!item.isDcmt)
|
|
233
|
+
return; // Show context menu only for document items
|
|
234
|
+
setContextMenuPosition({ x: e.clientX, y: e.clientY });
|
|
235
|
+
setContextMenuVisible(true);
|
|
236
|
+
}, []);
|
|
237
|
+
// Show warning alert and navigate back when no relations found on first load
|
|
238
|
+
useEffect(() => {
|
|
239
|
+
if (noRelationsOnFirstLoad) {
|
|
240
|
+
setNoRelationsOnFirstLoad(false);
|
|
241
|
+
ShowAlert({
|
|
242
|
+
message: SDKUI_Localizator.RelatedDcmtsNotFound,
|
|
243
|
+
title: SDKUI_Localizator.RelationsNotFound,
|
|
244
|
+
duration: 3000,
|
|
245
|
+
mode: 'warning',
|
|
246
|
+
});
|
|
247
|
+
onBack?.();
|
|
248
|
+
}
|
|
249
|
+
}, [noRelationsOnFirstLoad, onBack]);
|
|
47
250
|
const commandsMenuItems = [
|
|
48
251
|
{
|
|
49
252
|
icon: _jsx(IconMultipleSelection, { color: allowMultipleSelection ? TMColors.tertiary : TMColors.text_normal }),
|
|
@@ -66,95 +269,28 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
66
269
|
onClick: () => {
|
|
67
270
|
appendMasterDcmts?.(focusedItem?.tid, focusedItem?.did);
|
|
68
271
|
}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
icon: _jsx(IconMail, {}),
|
|
72
|
-
name: "Invia per posta",
|
|
73
|
-
disabled: false,
|
|
74
|
-
beginGroup: true,
|
|
75
|
-
submenu: [
|
|
76
|
-
{
|
|
77
|
-
icon: _jsx(IconMail, {}),
|
|
78
|
-
name: "I documenti selezionati",
|
|
79
|
-
disabled: false,
|
|
80
|
-
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
icon: _jsx(IconMail, {}),
|
|
84
|
-
name: "I documenti di primo livello e tutti i documenti correlati",
|
|
85
|
-
disabled: false,
|
|
86
|
-
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
icon: _jsx(IconMail, {}),
|
|
90
|
-
name: "I documenti di primo livello e i documenti correlati personalizzando l'operazione",
|
|
91
|
-
disabled: false,
|
|
92
|
-
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
93
|
-
},
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
icon: _jsx(IconDcmtTypeOnlyMetadata, {}),
|
|
98
|
-
name: "Unisci in un file PDF",
|
|
99
|
-
disabled: false,
|
|
100
|
-
submenu: [
|
|
101
|
-
{
|
|
102
|
-
icon: _jsx(IconDcmtTypeOnlyMetadata, {}),
|
|
103
|
-
name: "I documenti selezionati",
|
|
104
|
-
disabled: false,
|
|
105
|
-
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
icon: _jsx(IconDcmtTypeOnlyMetadata, {}),
|
|
109
|
-
name: "I documenti di primo livello e tutti i documenti correlati",
|
|
110
|
-
disabled: false,
|
|
111
|
-
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
icon: _jsx(IconDcmtTypeOnlyMetadata, {}),
|
|
115
|
-
name: "I documenti di primo livello e i documenti correlati personalizzando l'operazione",
|
|
116
|
-
disabled: false,
|
|
117
|
-
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
118
|
-
},
|
|
119
|
-
]
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
icon: _jsx(IconCopy, {}),
|
|
123
|
-
name: "Copia in una cartella",
|
|
124
|
-
disabled: false,
|
|
125
|
-
submenu: [
|
|
126
|
-
{
|
|
127
|
-
icon: _jsx(IconCopy, {}),
|
|
128
|
-
name: "I documenti selezionati",
|
|
129
|
-
disabled: false,
|
|
130
|
-
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
icon: _jsx(IconCopy, {}),
|
|
134
|
-
name: "I documenti di primo livello e tutti i documenti correlati",
|
|
135
|
-
disabled: false,
|
|
136
|
-
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
icon: _jsx(IconCopy, {}),
|
|
140
|
-
name: "I documenti di primo livello e i documenti correlati personalizzando l'operazione",
|
|
141
|
-
disabled: false,
|
|
142
|
-
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
143
|
-
},
|
|
144
|
-
]
|
|
145
272
|
}
|
|
146
273
|
];
|
|
147
|
-
const toolbar = _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [allowMultipleSelection && _jsx("p", { style: { color: TMColors.colorHeader, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${selectedItems.length} selezionati` }), allowNavigation && canPrev != undefined && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), allowNavigation && canNext != undefined && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(TMContextMenu, { items: commandsMenuItems, trigger: 'left', children: _jsx(IconMenuVertical, { color: 'white', cursor: 'pointer' }) })] });
|
|
274
|
+
const toolbar = _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [allowMultipleSelection && _jsx("p", { style: { color: TMColors.colorHeader, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${selectedItems.filter(item => item.isDcmt).length} selezionati` }), allowNavigation && canPrev != undefined && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), allowNavigation && canNext != undefined && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(TMContextMenu, { items: commandsMenuItems, trigger: 'left', children: _jsx(IconMenuVertical, { color: 'white', cursor: 'pointer' }) })] });
|
|
148
275
|
const getTitle = () => isForMaster ? `${SDKUI_Localizator.DcmtsMaster} - ${dtdMaster?.nameLoc}` : SDKUI_Localizator.DcmtsDetail;
|
|
149
276
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
150
277
|
const tmTreeView = useMemo(() => _jsx(_Fragment, { children: !inputDcmts || inputDcmts.length === 0
|
|
151
278
|
?
|
|
152
279
|
_jsx(TMNothingToShow, { text: getTitle(), secondText: SDKUI_Localizator.NoDataToDisplay, icon: isForMaster ? _jsx(IconDetailDcmts, { fontSize: 96, transform: 'scale(-1, 1)' }) : _jsx(IconDetailDcmts, { fontSize: 96 }) })
|
|
153
280
|
:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
281
|
+
_jsxs("div", { ref: floatingBarContainerRef, style: { width: "100%", height: "100%" }, onContextMenu: (e) => {
|
|
282
|
+
// Mostra context menu anche sullo spazio bianco (quando non si clicca su un item)
|
|
283
|
+
e.preventDefault();
|
|
284
|
+
setContextMenuPosition({ x: e.clientX, y: e.clientY });
|
|
285
|
+
setContextMenuVisible(true);
|
|
286
|
+
}, children: [_jsx(TMRelationViewerWrapper, { refreshKey: refreshKey, inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, showZeroDcmts: showZeroDcmts,
|
|
287
|
+
// customItemRender={customItemRender}
|
|
288
|
+
allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: handleSelectedItemsChanged, onNoRelationsFound: handleNoRelationsFound, onItemContextMenu: onItemContextMenu, focusedItemFormData: focusedItemFormData }), _jsx(TMContextMenu, { items: operationItems, externalControl: {
|
|
289
|
+
visible: contextMenuVisible,
|
|
290
|
+
position: contextMenuPosition,
|
|
291
|
+
onClose: () => setContextMenuVisible(false)
|
|
292
|
+
} })] }) }), [inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, allowMultipleSelection, focusedItem, selectedItems, handleFocusedItemChanged, handleSelectedItemsChanged, handleNoRelationsFound, onItemContextMenu, contextMenuVisible, contextMenuPosition, refreshKey, focusedItemFormData]);
|
|
293
|
+
const tmFormOrResult = useMemo(() => _jsx(TMFormOrResultWrapper, { refreshKey: refreshKey, deviceType: deviceType, focusedItem: focusedItem, onTaskCreateRequest: onTaskCreateRequest, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest }), [focusedItem, deviceType, allTasks, handleNavigateToWGs, handleNavigateToDossiers, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshAfterAddDcmtToFavs, refreshKey]);
|
|
158
294
|
const initialPanelDimensions = {
|
|
159
295
|
'tmTreeView': { width: '50%', height: '100%' },
|
|
160
296
|
'tmFormOrResult': { width: '50%', height: '100%' },
|
|
@@ -231,7 +367,28 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
231
367
|
toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: false, orderNumber: 2, isActive: allInitialPanelVisibility['tmFormOrResult'] }
|
|
232
368
|
}
|
|
233
369
|
], [tmTreeView, tmFormOrResult, focusedItem?.isDcmt, dtdMaster]);
|
|
234
|
-
return (_jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmTreeView', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) })
|
|
370
|
+
return (_jsxs("div", { style: { width: '100%', height: '100%', position: 'relative' }, children: [isCheckingFirstLoad && (_jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: true })), _jsxs("div", { style: isCheckingFirstLoad ? { position: 'absolute', width: 0, height: 0, overflow: 'hidden', opacity: 0, pointerEvents: 'none' } : { width: '100%', height: '100%' }, children: [_jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmTreeView', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }), _jsxs("div", { style: {
|
|
371
|
+
position: 'absolute',
|
|
372
|
+
top: 0,
|
|
373
|
+
left: 0,
|
|
374
|
+
right: 0,
|
|
375
|
+
bottom: 0,
|
|
376
|
+
backgroundColor: 'rgba(255, 255, 255, 0.7)',
|
|
377
|
+
display: 'flex',
|
|
378
|
+
alignItems: 'center',
|
|
379
|
+
justifyContent: 'center',
|
|
380
|
+
opacity: isRefreshing ? 1 : 0,
|
|
381
|
+
pointerEvents: isRefreshing ? 'auto' : 'none',
|
|
382
|
+
transition: 'opacity 200ms ease-in-out',
|
|
383
|
+
zIndex: 10,
|
|
384
|
+
}, children: [_jsx("div", { style: {
|
|
385
|
+
width: 40,
|
|
386
|
+
height: 40,
|
|
387
|
+
border: '3px solid #e0e0e0',
|
|
388
|
+
borderTopColor: TMColors.primaryColor,
|
|
389
|
+
borderRadius: '50%',
|
|
390
|
+
animation: 'spin 0.8s linear infinite',
|
|
391
|
+
} }), _jsx("style", { children: `@keyframes spin { to { transform: rotate(360deg); } }` })] }), renderDcmtOperations, renderFloatingBar] })] }));
|
|
235
392
|
};
|
|
236
393
|
export default TMMasterDetailDcmts;
|
|
237
394
|
/**
|
|
@@ -240,7 +397,7 @@ export default TMMasterDetailDcmts;
|
|
|
240
397
|
* - Panel visibility toggling
|
|
241
398
|
* - Focus delay handling
|
|
242
399
|
*/
|
|
243
|
-
const TMRelationViewerWrapper = ({ inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, customItemRender, allowMultipleSelection, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged }) => {
|
|
400
|
+
const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurrentDcmtIndicator, showZeroDcmts, customItemRender, allowMultipleSelection, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onNoRelationsFound, onItemContextMenu, focusedItemFormData }) => {
|
|
244
401
|
const { setPanelVisibilityById, setToolbarButtonVisibility } = useTMPanelManagerContext();
|
|
245
402
|
// Handle focused item changes with panel visibility management
|
|
246
403
|
const handleFocusedItemChanged = useCallback((item) => {
|
|
@@ -259,15 +416,25 @@ const TMRelationViewerWrapper = ({ inputDcmts, isForMaster, showCurrentDcmtIndic
|
|
|
259
416
|
setToolbarButtonVisibility('tmDcmtForm', false);
|
|
260
417
|
}
|
|
261
418
|
}, [onFocusedItemChanged, setPanelVisibilityById, setToolbarButtonVisibility]);
|
|
262
|
-
|
|
419
|
+
const onContextMenu = useCallback((item, e) => {
|
|
420
|
+
// Ferma la propagazione per evitare che l'evento arrivi al div contenitore
|
|
421
|
+
// (che ha il suo handler per il context menu sullo spazio bianco)
|
|
422
|
+
e.stopPropagation();
|
|
423
|
+
handleFocusedItemChanged(item);
|
|
424
|
+
// Il setTimeout è necessario per permettere a React di completare il re-render
|
|
425
|
+
// dopo il cambio di focus (handleFocusedItemChanged aggiorna stato e visibilità pannelli).
|
|
426
|
+
// Senza il delay, il context menu potrebbe mostrare opzioni basate sul vecchio stato.
|
|
427
|
+
setTimeout(() => {
|
|
428
|
+
onItemContextMenu?.(item, e);
|
|
429
|
+
}, 100);
|
|
430
|
+
}, [onItemContextMenu, handleFocusedItemChanged]);
|
|
431
|
+
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, onNoRelationsFound: onNoRelationsFound, onItemContextMenu: onContextMenu, focusedItemFormData: focusedItemFormData }, refreshKey));
|
|
263
432
|
};
|
|
264
|
-
const TMFormOrResultWrapper = ({ deviceType, focusedItem, onTaskCreateRequest, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers }) => {
|
|
433
|
+
const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCreateRequest, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshSearchAsyncDatagrid }) => {
|
|
265
434
|
const { setPanelVisibilityById } = useTMPanelManagerContext();
|
|
266
435
|
return (_jsx(_Fragment, { children: focusedItem?.isDcmt ?
|
|
267
|
-
_jsx(TMDcmtForm, { groupId: 'tmFormOrResult', TID: focusedItem?.tid, DID: focusedItem.did, allowButtonsRefs: true, isClosable: deviceType !== DeviceType.MOBILE, allowNavigation: false, allowRelations: deviceType !== DeviceType.MOBILE, showDcmtFormSidebar: false, onClose: () => {
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
_jsx(TMSearchResult, { groupId: 'tmFormOrResult', isClosable: deviceType !== DeviceType.MOBILE, context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, allowRelations: false, openDcmtFormAsModal: true, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, onTaskCreateRequest: onTaskCreateRequest, onClose: () => {
|
|
271
|
-
setPanelVisibilityById('tmTreeView', true);
|
|
272
|
-
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }));
|
|
436
|
+
_jsx(TMDcmtForm, { groupId: 'tmFormOrResult', TID: focusedItem?.tid, DID: focusedItem.did, allowButtonsRefs: true, isClosable: deviceType !== DeviceType.MOBILE, allowNavigation: false, allowRelations: deviceType !== DeviceType.MOBILE, showDcmtFormSidebar: false, onClose: () => { setPanelVisibilityById('tmTreeView', true); }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.tid, focusedItem?.did), openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, datagridUtility: {
|
|
437
|
+
onRefreshSearchAsyncDatagrid,
|
|
438
|
+
} }, refreshKey) :
|
|
439
|
+
_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, 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 }, refreshKey) }));
|
|
273
440
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DcmtTypeDescriptor, SearchResultDescriptor, DataColumnDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
|
-
import { DcmtInfo } from '../../../ts';
|
|
3
|
+
import { DcmtInfo, MetadataValueDescriptorEx } from '../../../ts';
|
|
4
4
|
import { ITMTreeItem } from '../../base/TMTreeView';
|
|
5
5
|
/**
|
|
6
6
|
* Tree item structure for relations
|
|
@@ -16,11 +16,13 @@ export interface RelationTreeItem extends ITMTreeItem {
|
|
|
16
16
|
isRoot?: boolean;
|
|
17
17
|
isMaster?: boolean;
|
|
18
18
|
isCorrelated?: boolean;
|
|
19
|
-
isLoaded?: boolean;
|
|
20
19
|
isSeparator?: boolean;
|
|
20
|
+
isInfoMessage?: boolean;
|
|
21
|
+
isLogDel?: number;
|
|
21
22
|
values?: any;
|
|
22
23
|
searchResult?: SearchResultDescriptor[];
|
|
23
24
|
itemsCount?: number;
|
|
25
|
+
fileExt?: string;
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
26
28
|
* Props for TMRelationViewer component
|
|
@@ -92,6 +94,21 @@ export interface TMRelationViewerProps {
|
|
|
92
94
|
* If not provided, uses the document type name.
|
|
93
95
|
*/
|
|
94
96
|
labelMainContainer?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Callback invoked when no relations are found for any of the input documents.
|
|
99
|
+
* Useful to notify parent component that there are no correlated documents to display.
|
|
100
|
+
*/
|
|
101
|
+
onNoRelationsFound?: () => void;
|
|
102
|
+
/**
|
|
103
|
+
* Callback invoked when user right-clicks on a tree item.
|
|
104
|
+
* Use to show a context menu.
|
|
105
|
+
*/
|
|
106
|
+
onItemContextMenu?: (item: RelationTreeItem, e: React.MouseEvent) => void;
|
|
107
|
+
/**
|
|
108
|
+
* Metadata values for the focused item
|
|
109
|
+
* (used in master-detail context)
|
|
110
|
+
*/
|
|
111
|
+
focusedItemFormData?: MetadataValueDescriptorEx[];
|
|
95
112
|
}
|
|
96
113
|
/**
|
|
97
114
|
* Check if document type has detail relations
|