@topconsultnpm/sdkui-react 6.21.0-dev1.2 → 6.21.0-dev1.20
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/TMAreaManager.js +18 -3
- package/lib/components/base/TMPanel.js +1 -0
- package/lib/components/base/TMTreeView.d.ts +2 -1
- package/lib/components/base/TMTreeView.js +8 -3
- package/lib/components/choosers/TMUserChooser.js +3 -1
- package/lib/components/features/archive/TMArchive.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.js +12 -8
- package/lib/components/features/documents/TMFileUploader.d.ts +1 -1
- package/lib/components/features/documents/TMFileUploader.js +3 -3
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +27 -2
- package/lib/components/features/documents/TMMasterDetailDcmts.js +215 -20
- package/lib/components/features/documents/TMRelationViewer.d.ts +12 -1
- package/lib/components/features/documents/TMRelationViewer.js +49 -10
- package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
- package/lib/components/features/search/TMSearch.d.ts +1 -0
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchResult.d.ts +1 -0
- package/lib/components/features/search/TMSearchResult.js +18 -4
- package/lib/components/features/search/TMViewHistoryDcmt.js +6 -0
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +5 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +7 -1
- package/lib/components/features/workflow/diagram/xmlParser.js +13 -14
- package/lib/components/pages/TMPage.js +4 -2
- package/lib/components/query/TMQueryEditor.js +20 -1
- package/lib/helper/SDKUI_Globals.d.ts +2 -0
- package/lib/helper/checkinCheckoutManager.d.ts +1 -1
- package/lib/helper/checkinCheckoutManager.js +18 -4
- package/lib/hooks/useDcmtOperations.d.ts +1 -0
- package/lib/hooks/useDcmtOperations.js +75 -4
- package/lib/hooks/useDocumentOperations.d.ts +1 -0
- package/lib/hooks/useDocumentOperations.js +46 -12
- package/lib/hooks/useInputDialog.d.ts +2 -0
- package/lib/hooks/useInputDialog.js +34 -0
- package/package.json +55 -55
|
@@ -4,9 +4,19 @@ import { SDK_Globals, RetrieveFileOptions, DcmtOpers, ResultTypes, RecentCategor
|
|
|
4
4
|
import { ShowAlert, TMResultManager, FormulaHelper, TMExceptionBoxManager, TMSpinner } from '../components';
|
|
5
5
|
import { Globalization, getExceptionMessage, dialogConfirmOperation, extensionHandler, downloadBase64File, SDKUI_Globals, dcmtsFileCacheDownload, CACHE_SIZE_LIMIT, clearDcmtsFileCache, dcmtsFileCachePreview, isDcmtFileInCache, removeDcmtsFileCache, SDKUI_Localizator } from '../helper';
|
|
6
6
|
import { DcmtOperationTypes, DownloadTypes, FileExtensionHandler } from '../ts';
|
|
7
|
-
import { useFileDialog } from './useInputDialog';
|
|
7
|
+
import { useFileDialog, useFileSourceDialog } from './useInputDialog';
|
|
8
8
|
import { isXMLFileExt } from '../helper/dcmtsHelper';
|
|
9
9
|
import { ShowConfirm } from '../components/base/TMConfirm';
|
|
10
|
+
import { useBetaFeatures } from './useBetaFeatures';
|
|
11
|
+
const isScannerLicenseConfigured = () => {
|
|
12
|
+
try {
|
|
13
|
+
const scannerLicense = SDKUI_Globals.userSettings.advancedSettings.scannerLicense;
|
|
14
|
+
return scannerLicense && scannerLicense.trim() !== '';
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
10
20
|
let abortController = new AbortController();
|
|
11
21
|
const downloadCountMap = new Map();
|
|
12
22
|
const getDownloadFileName = (fileName) => {
|
|
@@ -32,6 +42,8 @@ export const useDcmtOperations = () => {
|
|
|
32
42
|
const [waitPanelValueSecondary, setWaitPanelValueSecondary] = useState(0);
|
|
33
43
|
const [waitPanelMaxValueSecondary, setWaitPanelMaxValueSecondary] = useState(0);
|
|
34
44
|
const { OpenFileDialog } = useFileDialog();
|
|
45
|
+
const isBetaFeaturesEnabled = useBetaFeatures();
|
|
46
|
+
const [selectFileSource, FileSourceDialog] = useFileSourceDialog();
|
|
35
47
|
const _downloadDcmtsAsync = async (inputDcmts, downloadMode = "download", onFileDownloaded, skipConfirmation = false) => {
|
|
36
48
|
if (inputDcmts === undefined)
|
|
37
49
|
return;
|
|
@@ -210,7 +222,60 @@ export const useDcmtOperations = () => {
|
|
|
210
222
|
return;
|
|
211
223
|
if (inputDcmts.length <= 0)
|
|
212
224
|
return;
|
|
213
|
-
let file = inputDcmts[0].FILE
|
|
225
|
+
let file = inputDcmts[0].FILE;
|
|
226
|
+
if (!file) {
|
|
227
|
+
if (isBetaFeaturesEnabled && isScannerLicenseConfigured()) {
|
|
228
|
+
const source = await selectFileSource();
|
|
229
|
+
if (!source)
|
|
230
|
+
return;
|
|
231
|
+
switch (source) {
|
|
232
|
+
case 'filesystem':
|
|
233
|
+
file = await OpenFileDialog();
|
|
234
|
+
break;
|
|
235
|
+
case 'scanner-new':
|
|
236
|
+
if (SDKUI_Globals.scanRequestHandler) {
|
|
237
|
+
file = await new Promise((resolve) => {
|
|
238
|
+
SDKUI_Globals.scanRequestHandler('new', (scannedFile) => resolve(scannedFile), () => resolve(undefined));
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
ShowAlert({ message: 'Funzionalità scanner non disponibile in questo contesto.', mode: 'info', duration: 3000, title: 'Scanner' });
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
break;
|
|
246
|
+
case 'scanner-edit':
|
|
247
|
+
if (SDKUI_Globals.scanRequestHandler) {
|
|
248
|
+
// Download the existing file from the document
|
|
249
|
+
let existingFile;
|
|
250
|
+
try {
|
|
251
|
+
const rfo = new RetrieveFileOptions();
|
|
252
|
+
rfo.retrieveReason = DcmtOpers.None;
|
|
253
|
+
const retrievedFile = await SDK_Globals.tmSession?.NewSearchEngine().RetrieveFileAsync(inputDcmts[0].TID, inputDcmts[0].DID, rfo);
|
|
254
|
+
existingFile = retrievedFile;
|
|
255
|
+
}
|
|
256
|
+
catch (ex) {
|
|
257
|
+
TMExceptionBoxManager.show({ exception: getExceptionMessage(ex) });
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
if (!existingFile) {
|
|
261
|
+
ShowAlert({ message: 'Impossibile recuperare il file del documento.', mode: 'warning', duration: 3000, title: 'Scanner' });
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
file = await new Promise((resolve) => {
|
|
265
|
+
SDKUI_Globals.scanRequestHandler('edit', (scannedFile) => resolve(scannedFile), () => resolve(undefined), existingFile);
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
ShowAlert({ message: 'Funzionalità scanner non disponibile in questo contesto.', mode: 'info', duration: 3000, title: 'Scanner' });
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
file = await OpenFileDialog();
|
|
277
|
+
}
|
|
278
|
+
}
|
|
214
279
|
if (!file)
|
|
215
280
|
return;
|
|
216
281
|
setShowWaitPanel(true);
|
|
@@ -489,10 +554,16 @@ export const useDcmtOperations = () => {
|
|
|
489
554
|
actionAfterOperationAsync?.();
|
|
490
555
|
TMResultManager.show(result, operationTitle, "TID", "DID");
|
|
491
556
|
};
|
|
492
|
-
|
|
557
|
+
// Per SubstituteFile con beta features e scanner, non mostrare conferma
|
|
558
|
+
if (dcmtOperationType === DcmtOperationTypes.SubstituteFile && isBetaFeaturesEnabled && isScannerLicenseConfigured()) {
|
|
559
|
+
await doOperationAsync();
|
|
560
|
+
}
|
|
561
|
+
else {
|
|
562
|
+
dialogConfirmOperation(operationTitle, msg, doOperationAsync);
|
|
563
|
+
}
|
|
493
564
|
};
|
|
494
565
|
return {
|
|
495
566
|
abortController, showWaitPanel, showPrimary, waitPanelTitle, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary,
|
|
496
|
-
downloadDcmtsAsync, getDcmtFileAsync, clearDcmtsFileCache, removeDcmtsFileCache, isDcmtFileInCache, runOperationAsync
|
|
567
|
+
downloadDcmtsAsync, getDcmtFileAsync, clearDcmtsFileCache, removeDcmtsFileCache, isDcmtFileInCache, runOperationAsync, FileSourceDialog
|
|
497
568
|
};
|
|
498
569
|
};
|
|
@@ -86,6 +86,7 @@ export interface OperationCallbacks {
|
|
|
86
86
|
openWGsCopyMoveForm?: (mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void;
|
|
87
87
|
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void;
|
|
88
88
|
onOpenPdfEditorRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void;
|
|
89
|
+
openFileUploaderPdfEditor?: (fromDTD?: DcmtTypeDescriptor, file?: File | null, handleFile?: (file: File) => void) => void;
|
|
89
90
|
onTaskCreateRequest?: (taskContext: TaskContext, onTaskCreated?: (task?: TaskDescriptor) => void) => void;
|
|
90
91
|
openTaskFormHandler?: (onTaskCreated?: (task?: TaskDescriptor) => void) => void;
|
|
91
92
|
}
|
|
@@ -93,7 +93,7 @@ export const useDocumentOperations = (props) => {
|
|
|
93
93
|
// Navigation
|
|
94
94
|
canNavigateHandler, onNavigateHandler, handleNavigateToWGs, handleNavigateToDossiers, onReferenceClick,
|
|
95
95
|
// Document forms/operations
|
|
96
|
-
openAddDocumentForm, openCommentFormCallback, onFileOpened, passToArchiveCallback, openWGsCopyMoveForm, onOpenS4TViewerRequest, onOpenPdfEditorRequest,
|
|
96
|
+
openAddDocumentForm, openCommentFormCallback, onFileOpened, passToArchiveCallback, openWGsCopyMoveForm, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor,
|
|
97
97
|
// Task related
|
|
98
98
|
onTaskCreateRequest, openTaskFormHandler, } = callbacks;
|
|
99
99
|
// Force recalculation of selectedDcmtInfos when refreshOperationsTrigger changes (e.g., after file substitution where FILEEXT may change)
|
|
@@ -105,10 +105,11 @@ export const useDocumentOperations = (props) => {
|
|
|
105
105
|
}, [refreshOperationsTrigger]);
|
|
106
106
|
// Context helpers
|
|
107
107
|
const isDcmtFormContext = context === SearchResultContext.DCMT_FORM;
|
|
108
|
+
const isMasterDetailContext = context === SearchResultContext.MASTER_DETAIL;
|
|
108
109
|
const { showHistory, showHistoryCallback, hideHistoryCallback, showCheckoutInformationForm, commentFormState, hideCommentFormCallback, showCheckoutInformationFormCallback, hideCheckoutInformationFormCallback, copyCheckoutPathToClipboardCallback, handleCheckOutCallback, handleCheckInCallback, showCicoWaitPanel, cicoWaitPanelTitle, showCicoPrimaryProgress, cicoPrimaryProgressText, cicoPrimaryProgressValue, cicoPrimaryProgressMax, } = useCheckInOutOperations({
|
|
109
110
|
onRefreshPreview: onRefreshPreviewCallback
|
|
110
111
|
});
|
|
111
|
-
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync, getDcmtFileAsync, clearDcmtsFileCache, removeDcmtsFileCache, isDcmtFileInCache } = useDcmtOperations();
|
|
112
|
+
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync, getDcmtFileAsync, clearDcmtsFileCache, removeDcmtsFileCache, isDcmtFileInCache, FileSourceDialog } = useDcmtOperations();
|
|
112
113
|
const {
|
|
113
114
|
// Data
|
|
114
115
|
relatedDcmts, pairedSearchResults, manyToManyRelations, selectedManyToManyRelation, manyToManyChooserDataSource, relatedDcmtsChooserDataSource,
|
|
@@ -632,7 +633,7 @@ export const useDocumentOperations = (props) => {
|
|
|
632
633
|
const checkinMenuItem = () => {
|
|
633
634
|
// Take the first document (used for validation checks)
|
|
634
635
|
let dcmt = focusedItem;
|
|
635
|
-
if (isDcmtFormContext) {
|
|
636
|
+
if (isDcmtFormContext || isMasterDetailContext) {
|
|
636
637
|
dcmt = dcmtDataRowForCicoStatus;
|
|
637
638
|
}
|
|
638
639
|
const { cicoEnabled, checkoutStatus } = getDcmtCicoStatus(dcmt, allUsers, dtd);
|
|
@@ -820,7 +821,14 @@ export const useDocumentOperations = (props) => {
|
|
|
820
821
|
try {
|
|
821
822
|
TMSpinner.show({ description: `${SDKUI_Localizator.Loading}...` });
|
|
822
823
|
const msg = await SDK_Globals.tmSession?.NewSearchEngine().FreeSearchGetDcmtInfoAsync(dcmt.TID, dcmt.DID);
|
|
823
|
-
TMMessageBoxManager.show({
|
|
824
|
+
TMMessageBoxManager.show({
|
|
825
|
+
buttons: [ButtonNames.OK],
|
|
826
|
+
showToppy: false,
|
|
827
|
+
resizable: true,
|
|
828
|
+
initialWidth: !isMobile ? '700px' : undefined,
|
|
829
|
+
message: msg,
|
|
830
|
+
title: SDKUI_Localizator.IndexingInformation
|
|
831
|
+
});
|
|
824
832
|
}
|
|
825
833
|
catch (e) {
|
|
826
834
|
TMExceptionBoxManager.show({ exception: e });
|
|
@@ -1044,6 +1052,25 @@ export const useDocumentOperations = (props) => {
|
|
|
1044
1052
|
return items.sort((a, b) => a.name.localeCompare(b.name));
|
|
1045
1053
|
};
|
|
1046
1054
|
const getDcmtFormMenuItems = () => {
|
|
1055
|
+
return [
|
|
1056
|
+
{
|
|
1057
|
+
id: 'doc',
|
|
1058
|
+
icon: _jsx(IconFileDots, {}),
|
|
1059
|
+
name: !isMobile ? SDKUI_Localizator.DocumentOperations : SDKUI_Localizator.Documents,
|
|
1060
|
+
disabled: isDisabledForSingleRow() && isDisabledForMultiRow(),
|
|
1061
|
+
submenu: [
|
|
1062
|
+
addToFavoriteOperation(),
|
|
1063
|
+
downloadFileMenuItem(),
|
|
1064
|
+
downloadXMLAttachmentsMenuItem(),
|
|
1065
|
+
]
|
|
1066
|
+
},
|
|
1067
|
+
signatureMenuItem(),
|
|
1068
|
+
checkinMenuItem(),
|
|
1069
|
+
...(allowRelations && inputDcmtFormLayoutMode === LayoutModes.Update ? [relationsMenuItem()] : []),
|
|
1070
|
+
...((inputDcmtFormLayoutMode === LayoutModes.Update) ? [fullTextSearchMenuItem()] : []),
|
|
1071
|
+
];
|
|
1072
|
+
};
|
|
1073
|
+
const getMasterDetailMenuItems = () => {
|
|
1047
1074
|
return [
|
|
1048
1075
|
{
|
|
1049
1076
|
id: 'doc',
|
|
@@ -1052,15 +1079,19 @@ export const useDocumentOperations = (props) => {
|
|
|
1052
1079
|
disabled: isDisabledForSingleRow() && isDisabledForMultiRow(),
|
|
1053
1080
|
submenu: [
|
|
1054
1081
|
...(inputDcmtFormLayoutMode === LayoutModes.Update ? [addToFavoriteOperation()] : []),
|
|
1055
|
-
|
|
1082
|
+
addReplaceFileOperation(),
|
|
1083
|
+
openFormOperation(),
|
|
1084
|
+
deletetionMenuItem(),
|
|
1085
|
+
fileCheckMenuItem(),
|
|
1086
|
+
fileConversionsMenuItem(),
|
|
1087
|
+
...(SDK_Globals.tmSession?.SessionDescr?.appModuleID === AppModules.SURFER ? [createContextualTaskMenuItem()] : []),
|
|
1056
1088
|
downloadFileMenuItem(),
|
|
1057
1089
|
downloadXMLAttachmentsMenuItem(),
|
|
1058
|
-
...(selectedDcmtInfos.length > 0 && isPdfEditorAvailable(dtd, selectedDcmtInfos[0]?.FILEEXT) && onOpenPdfEditorRequest ? [pdfEditorMenuItem(onOpenPdfEditorRequest)] : [])
|
|
1090
|
+
...(selectedDcmtInfos.length > 0 && isPdfEditorAvailable(dtd, selectedDcmtInfos[0]?.FILEEXT) && onOpenPdfEditorRequest ? [pdfEditorMenuItem(onOpenPdfEditorRequest)] : [])
|
|
1059
1091
|
]
|
|
1060
1092
|
},
|
|
1061
1093
|
signatureMenuItem(),
|
|
1062
1094
|
checkinMenuItem(),
|
|
1063
|
-
...(allowRelations && inputDcmtFormLayoutMode === LayoutModes.Update ? [relationsMenuItem()] : []),
|
|
1064
1095
|
...((inputDcmtFormLayoutMode === LayoutModes.Update) ? [fullTextSearchMenuItem()] : []),
|
|
1065
1096
|
];
|
|
1066
1097
|
};
|
|
@@ -1071,6 +1102,8 @@ export const useDocumentOperations = (props) => {
|
|
|
1071
1102
|
return getDcmtFormMenuItems();
|
|
1072
1103
|
case SearchResultContext.ARCHIVED_WORKGROUP:
|
|
1073
1104
|
return getArchivedWorkgroupMenuItems();
|
|
1105
|
+
case SearchResultContext.MASTER_DETAIL:
|
|
1106
|
+
return getMasterDetailMenuItems();
|
|
1074
1107
|
default:
|
|
1075
1108
|
return getDefaultMenuItems();
|
|
1076
1109
|
}
|
|
@@ -1084,15 +1117,15 @@ export const useDocumentOperations = (props) => {
|
|
|
1084
1117
|
};
|
|
1085
1118
|
const renderFloatingBar = (floatingBarContainerRef && floatingBarContainerRef.current && allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE) ? (_jsx(TMFloatingMenuBar, { containerRef: floatingBarContainerRef, contextMenuItems: operationItems(), isConstrained: true, defaultPosition: { x: 1, y: 88 }, defaultPinnedItems: ['rel-det', 'rel-mst', 'dl'], defaultOrientation: 'horizontal', hasContextMenu: false, pinnedItemIds: pinnedItemIds, onPinChange: setPinnedItemIds })) : null;
|
|
1086
1119
|
const renderDcmtOperations = (_jsxs(_Fragment, { children: [(showExportForm && searchResult && dataColumns && dataSource && selectedRowKeys) && (_jsx(TMDataGridExportForm, { dataColumns: dataColumns, dataSource: dataSource, selectedRowKeys: selectedRowKeys, onCloseExportForm: () => setShowExportForm(false), searchResult: searchResult })), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: ((isOpenDcmtForm && focusedItem?.TID !== undefined && focusedItem?.DID !== undefined) &&
|
|
1087
|
-
_jsx(TMDcmtForm, { isModal: openDcmtFormAsModal || (dcmtFormLayoutMode === LayoutModes.Ark && focusedItem?.DID !== undefined), titleModal: dtd?.name ?? '', TID: focusedItem.TID, DID: focusedItem.DID, allowButtonsRefs: true, layoutMode: dcmtFormLayoutMode, count: visibleItems?.length, itemIndex: visibleItems ? visibleItems.findIndex(o => o.rowIndex === focusedItem?.rowIndex) + 1 : undefined, canNext: canNavigateHandler ? canNavigateHandler('next') : false, canPrev: canNavigateHandler ? canNavigateHandler('prev') : false, onNext: () => onNavigateHandler && onNavigateHandler('next'), onPrev: () => onNavigateHandler && onNavigateHandler('prev'), onClose: () => {
|
|
1120
|
+
_jsx(TMDcmtForm, { isModal: openDcmtFormAsModal || (dcmtFormLayoutMode === LayoutModes.Ark && focusedItem?.DID !== undefined), titleModal: dtd?.name ?? '', TID: focusedItem.TID, DID: focusedItem.DID, allowButtonsRefs: true, layoutMode: dcmtFormLayoutMode, count: visibleItems?.length, itemIndex: visibleItems ? visibleItems.findIndex(o => o.rowIndex === focusedItem?.rowIndex) + 1 : undefined, canNext: canNavigateHandler ? canNavigateHandler('next') : false, canPrev: canNavigateHandler ? canNavigateHandler('prev') : false, onNext: () => onNavigateHandler && onNavigateHandler('next'), onPrev: () => onNavigateHandler && onNavigateHandler('prev'), onClose: () => { (false); onDcmtFormOpenChange(false, LayoutModes.Update); }, onWFOperationCompleted: onWFOperationCompleted, onTaskCreateRequest: onTaskCreateRequest, onSavedAsyncCallback: onSavedAsyncCallback, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openFileUploaderPdfEditor: openFileUploaderPdfEditor, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.TID, focusedItem?.DID), showDcmtFormSidebar: showDcmtFormSidebar, datagridUtility: {
|
|
1088
1121
|
onRefreshSearchAsyncDatagrid,
|
|
1089
1122
|
onRefreshDataRowsAsync,
|
|
1090
1123
|
refreshFocusedDataRowAsync,
|
|
1091
1124
|
onRefreshBlogDatagrid,
|
|
1092
1125
|
onRefreshPreviewDatagrid
|
|
1093
1126
|
} })) }), (showHistory && dtd && selectedDcmtInfos.length > 0) && _jsx(TMViewHistoryDcmt, { fromDTD: dtd, deviceType: deviceType, inputDcmt: selectedDcmtInfos[0], onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (commentFormState.show && selectedDcmtInfos.length > 0) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: selectedDcmtInfos[0].TID, did: selectedDcmtInfos[0].DID } }, onClose: hideCommentFormCallback, refreshCallback: onRefreshBlog, participants: [], showAttachmentsSection: true, allArchivedDocumentsFileItems: convertSearchResultDescriptorToFileItems(currentSearchResults ?? []), isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment, selectedAttachmentDid: [Number(selectedDcmtInfos[0].DID)] }), (showCheckoutInformationForm && dtd && selectedDcmtInfos.length > 0) &&
|
|
1094
|
-
_jsx(TMDcmtCheckoutInfoForm, { dtdName: dtd.name ?? SDKUI_Localizator.SearchResult, selectedDcmtOrFocused: selectedDcmtInfos[0], onClose: hideCheckoutInformationFormCallback }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDetails, children: isOpenDetails && _jsx(TMMasterDetailDcmts, { deviceType: deviceType, isForMaster: false, inputDcmts: selectedDcmtInfos, allowNavigation: selectedDcmtInfos.length === 1, canNext: canNavigateHandler ? canNavigateHandler('next') : false, canPrev: canNavigateHandler ? canNavigateHandler('prev') : false, onNext: () => onNavigateHandler && onNavigateHandler('next'), onPrev: () => onNavigateHandler && onNavigateHandler('prev'), onBack: () => setIsOpenDetails(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), _jsxs(StyledMultiViewPanel, { "$isVisible": isOpenMaster, children: [isOpenMaster && _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: selectedDcmtInfos, isForMaster: true, allowNavigation: selectedDcmtInfos.length === 1, canNext: canNavigateHandler ? canNavigateHandler('next') : false, canPrev: canNavigateHandler ? canNavigateHandler('prev') : false, onNext: () => onNavigateHandler && onNavigateHandler('next'), onPrev: () => onNavigateHandler && onNavigateHandler('prev'), onBack: () => setIsOpenMaster(false), appendMasterDcmts: handleAddItem, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), secondaryMasterDcmts.length > 0 && secondaryMasterDcmts.map((dcmt, index) => {
|
|
1095
|
-
return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: [dcmt], isForMaster: true, allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID), appendMasterDcmts: handleAddItem, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }, `${index}-${dcmt.DID}`));
|
|
1127
|
+
_jsx(TMDcmtCheckoutInfoForm, { dtdName: dtd.name ?? SDKUI_Localizator.SearchResult, selectedDcmtOrFocused: selectedDcmtInfos[0], onClose: hideCheckoutInformationFormCallback }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDetails, children: isOpenDetails && _jsx(TMMasterDetailDcmts, { deviceType: deviceType, isForMaster: false, inputDcmts: selectedDcmtInfos, allowNavigation: selectedDcmtInfos.length === 1, canNext: canNavigateHandler ? canNavigateHandler('next') : false, canPrev: canNavigateHandler ? canNavigateHandler('prev') : false, onNext: () => onNavigateHandler && onNavigateHandler('next'), onPrev: () => onNavigateHandler && onNavigateHandler('prev'), onBack: () => setIsOpenDetails(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onTaskCreateRequest: onTaskCreateRequest, datagridUtility: datagridUtility, dcmtUtility: dcmtUtility }) }), _jsxs(StyledMultiViewPanel, { "$isVisible": isOpenMaster, children: [isOpenMaster && _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: selectedDcmtInfos, isForMaster: true, allowNavigation: selectedDcmtInfos.length === 1, canNext: canNavigateHandler ? canNavigateHandler('next') : false, canPrev: canNavigateHandler ? canNavigateHandler('prev') : false, onNext: () => onNavigateHandler && onNavigateHandler('next'), onPrev: () => onNavigateHandler && onNavigateHandler('prev'), onBack: () => setIsOpenMaster(false), appendMasterDcmts: handleAddItem, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onTaskCreateRequest: onTaskCreateRequest, datagridUtility: datagridUtility, dcmtUtility: dcmtUtility }), secondaryMasterDcmts.length > 0 && secondaryMasterDcmts.map((dcmt, index) => {
|
|
1128
|
+
return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: [dcmt], isForMaster: true, allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID), appendMasterDcmts: handleAddItem, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, onTaskCreateRequest: onTaskCreateRequest, datagridUtility: datagridUtility, dcmtUtility: dcmtUtility }) }, `${index}-${dcmt.DID}`));
|
|
1096
1129
|
})] }), isOpenArchiveRelationForm && _jsx(TMDcmtForm, { isModal: true, titleModal: SDKUI_Localizator.Archive + ' - ' + (archiveType === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster), TID: archiveRelatedDcmtFormTID, layoutMode: LayoutModes.Ark, inputMids: archiveRelatedDcmtFormMids, showBackButton: false, allowButtonsRefs: false, onClose: () => {
|
|
1097
1130
|
setIsOpenArchiveRelationForm(false);
|
|
1098
1131
|
setArchiveType(undefined);
|
|
@@ -1104,7 +1137,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1104
1137
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
1105
1138
|
setArchiveRelatedDcmtFormMids([]);
|
|
1106
1139
|
await onRefreshSearchAsyncDatagrid?.();
|
|
1107
|
-
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar }), showRelatedDcmtsChooser &&
|
|
1140
|
+
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar, openFileUploaderPdfEditor: openFileUploaderPdfEditor }), showRelatedDcmtsChooser &&
|
|
1108
1141
|
_jsx(TMChooserForm, { dataSource: relatedDcmtsChooserDataSource, onChoose: async (selectedRelation) => {
|
|
1109
1142
|
try {
|
|
1110
1143
|
setShowRelatedDcmtsChooser(false);
|
|
@@ -1150,7 +1183,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1150
1183
|
updateBatchUpdateForm(false);
|
|
1151
1184
|
setIsModifiedBatchUpdate(false);
|
|
1152
1185
|
await onRefreshDataRowsAsync?.();
|
|
1153
|
-
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: selectedDcmtInfos, isReject: 0, onClose: () => updateShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: selectedDcmtInfos, isReject: 1, onClose: () => updateShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: selectedDcmtInfos, onClose: () => updateShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { fromDTD: dtd, TID: contextConfig.approvalTID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: handleWFOperationCompleted, onClose: () => updateShowMoreInfoPopup(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, triggerBlogRefresh: onRefreshBlogDatagrid }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), taskFormDialogComponent, s4TViewerDialogComponent, currentCustomButton && _jsx(TMCustomButton, { button: currentCustomButton, formData: currentMetadataValues, selectedItems: selectedItemsFull, onClose: () => setCurrentCustomButton(undefined) })] }));
|
|
1186
|
+
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: selectedDcmtInfos, isReject: 0, onClose: () => updateShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: selectedDcmtInfos, isReject: 1, onClose: () => updateShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: selectedDcmtInfos, onClose: () => updateShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { fromDTD: dtd, TID: contextConfig.approvalTID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: handleWFOperationCompleted, onClose: () => updateShowMoreInfoPopup(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, triggerBlogRefresh: onRefreshBlogDatagrid }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), _jsx(FileSourceDialog, {}), taskFormDialogComponent, s4TViewerDialogComponent, currentCustomButton && _jsx(TMCustomButton, { button: currentCustomButton, formData: currentMetadataValues, selectedItems: selectedItemsFull, onClose: () => setCurrentCustomButton(undefined) })] }));
|
|
1154
1187
|
return {
|
|
1155
1188
|
operationItems: operationItems(),
|
|
1156
1189
|
renderFloatingBar,
|
|
@@ -1203,6 +1236,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1203
1236
|
removeDcmtsFileCache,
|
|
1204
1237
|
isDcmtFileInCache,
|
|
1205
1238
|
runOperationAsync,
|
|
1239
|
+
FileSourceDialog,
|
|
1206
1240
|
},
|
|
1207
1241
|
relatedDocumentsInfo: {
|
|
1208
1242
|
// Data
|
|
@@ -7,3 +7,5 @@ export declare const useInputAttachmentsDialog: () => {
|
|
|
7
7
|
openConfirmAttachmentsDialog: (list: FileDescriptor[]) => Promise<string[] | undefined>;
|
|
8
8
|
ConfirmAttachmentsDialog: () => import("react/jsx-runtime").JSX.Element | null;
|
|
9
9
|
};
|
|
10
|
+
export type FileSourceType = 'filesystem' | 'scanner-new' | 'scanner-edit' | undefined;
|
|
11
|
+
export declare const useFileSourceDialog: () => [() => Promise<FileSourceType>, () => JSX.Element];
|
|
@@ -103,3 +103,37 @@ export const useInputAttachmentsDialog = () => {
|
|
|
103
103
|
};
|
|
104
104
|
return { openConfirmAttachmentsDialog, ConfirmAttachmentsDialog };
|
|
105
105
|
};
|
|
106
|
+
const fileSourceOptions = [
|
|
107
|
+
{ value: 'filesystem', display: 'Da file system' },
|
|
108
|
+
{ value: 'scanner-new', display: 'Da scanner (nuova scansione)' },
|
|
109
|
+
{ value: 'scanner-edit', display: 'Da scanner (modifica scansione)' },
|
|
110
|
+
];
|
|
111
|
+
export const useFileSourceDialog = () => {
|
|
112
|
+
const [promise, setPromise] = useState(null);
|
|
113
|
+
const [open, setOpen] = useState(false);
|
|
114
|
+
const handleClose = () => {
|
|
115
|
+
setOpen(false);
|
|
116
|
+
setPromise(null);
|
|
117
|
+
};
|
|
118
|
+
const handleConfirm = (source) => {
|
|
119
|
+
promise?.resolve(source);
|
|
120
|
+
handleClose();
|
|
121
|
+
};
|
|
122
|
+
const handleCancel = () => {
|
|
123
|
+
promise?.resolve(undefined);
|
|
124
|
+
handleClose();
|
|
125
|
+
};
|
|
126
|
+
const FileSourceDialog = () => {
|
|
127
|
+
const [source, setSource] = useState('filesystem');
|
|
128
|
+
return (open ?
|
|
129
|
+
_jsx(TMModal, { title: SDKUI_Localizator.AddOrSubstFile, height: "max-content", width: "320px", onClose: handleCancel, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '5px', padding: '10px', height: '100%' }, children: [_jsx(TMRadioButton, { dataSource: fileSourceOptions, direction: 'column', value: source, onValueChanged: (newValue) => { setSource(newValue); } }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', gap: '5px', paddingTop: '10px', justifyContent: 'center', alignItems: 'center', height: '50px' }, children: [_jsx(TMButton, { btnStyle: "advanced", showTooltip: false, icon: _jsx(IconApply, {}), caption: "OK", advancedColor: TMColors.tertiary, onClick: () => handleConfirm(source) }), _jsx(TMButton, { btnStyle: "advanced", showTooltip: false, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Cancel, onClick: handleCancel })] })] }) })
|
|
130
|
+
: _jsx(_Fragment, {}));
|
|
131
|
+
};
|
|
132
|
+
const selectFileSource = () => {
|
|
133
|
+
return new Promise((resolve) => {
|
|
134
|
+
setOpen(true);
|
|
135
|
+
setPromise({ resolve });
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
return [selectFileSource, FileSourceDialog];
|
|
139
|
+
};
|
package/package.json
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name":
|
|
3
|
-
"version":
|
|
4
|
-
"description":
|
|
5
|
-
"scripts":
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"author":
|
|
17
|
-
"license":
|
|
18
|
-
"devDependencies":
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"main":
|
|
36
|
-
"types":
|
|
37
|
-
"module":
|
|
38
|
-
"files":
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"dependencies":
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"overrides":
|
|
55
|
-
|
|
56
|
-
|
|
2
|
+
"name": "@topconsultnpm/sdkui-react",
|
|
3
|
+
"version": "6.21.0-dev1.20",
|
|
4
|
+
"description": "",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
|
+
"clean": "powershell Remove-Item lib/ -recurse",
|
|
8
|
+
"copy-files": "copyfiles -u 1 src/assets/*.* src/assets/ImageLibrary/*.* src/assets/thumbnails/*.* src/assets/IconsS4t/*.* src/assets/Metadata/*.* src/css/tm-sdkui.css lib/",
|
|
9
|
+
"tm-build": "npm run clean && tsc && npm run copy-files",
|
|
10
|
+
"tm-watch": "tsc -w",
|
|
11
|
+
"tm-publish": "npm publish --tag latest",
|
|
12
|
+
"tm-publish_wl": "npm publish",
|
|
13
|
+
"storybook": "storybook dev -p 6006",
|
|
14
|
+
"build-storybook": "storybook build"
|
|
15
|
+
},
|
|
16
|
+
"author": "TopConsult",
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@chromatic-com/storybook": "^4.1.3",
|
|
20
|
+
"@storybook/addon-docs": "^10.1.0",
|
|
21
|
+
"@storybook/addon-onboarding": "^10.1.0",
|
|
22
|
+
"@storybook/react-vite": "^10.1.0",
|
|
23
|
+
"@types/htmlparser2": "^3.10.7",
|
|
24
|
+
"@types/node": "^20.2.5",
|
|
25
|
+
"@types/react": "^18.3.3",
|
|
26
|
+
"@types/react-dom": "^18.3.3",
|
|
27
|
+
"copyfiles": "^2.4.1",
|
|
28
|
+
"esbuild": "^0.25.0",
|
|
29
|
+
"react": "^18.3.1",
|
|
30
|
+
"react-dom": "^18.3.1",
|
|
31
|
+
"storybook": "^10.1.0",
|
|
32
|
+
"typescript": "^5.9.3",
|
|
33
|
+
"vite": "^6.1.1"
|
|
34
|
+
},
|
|
35
|
+
"main": "dist/cjs/index.js",
|
|
36
|
+
"types": "./index.d.ts",
|
|
37
|
+
"module": "lib/esm/index.js",
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"lib"
|
|
41
|
+
],
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@topconsultnpm/sdk-ts": "6.21.0-dev1.3",
|
|
44
|
+
"buffer": "^6.0.3",
|
|
45
|
+
"devextreme": "25.2.4",
|
|
46
|
+
"devextreme-react": "25.2.4",
|
|
47
|
+
"exceljs": "^4.4.0",
|
|
48
|
+
"htmlparser2": "^10.0.0",
|
|
49
|
+
"pdfjs-dist": "5.4.296",
|
|
50
|
+
"react-pdf": "^10.3.0",
|
|
51
|
+
"react-router-dom": "^6.15.0",
|
|
52
|
+
"styled-components": "^6.1.1"
|
|
53
|
+
},
|
|
54
|
+
"overrides": {
|
|
55
|
+
"esbuild": "^0.25.0"
|
|
56
|
+
}
|
|
57
57
|
}
|