@topconsultnpm/sdkui-react 6.21.0-dev2.2 → 6.21.0-dev2.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/TMAccordionNew.d.ts +1 -0
- package/lib/components/base/TMAccordionNew.js +6 -5
- package/lib/components/base/TMAreaManager.js +19 -3
- package/lib/components/base/TMPanel.d.ts +7 -4
- package/lib/components/base/TMPanel.js +54 -26
- package/lib/components/editors/TMDateBox.js +4 -2
- package/lib/components/editors/TMFormulaEditor.d.ts +2 -0
- package/lib/components/editors/TMFormulaEditor.js +75 -21
- package/lib/components/editors/TMMetadataValues.js +2 -1
- package/lib/components/editors/TMRadioButton.js +2 -1
- package/lib/components/editors/TMTextArea.d.ts +2 -0
- package/lib/components/editors/TMTextArea.js +6 -3
- package/lib/components/features/documents/TMDcmtForm.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtForm.js +40 -10
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +17 -2
- package/lib/components/features/documents/TMDcmtPreview.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtPreview.js +2 -2
- package/lib/components/features/documents/TMDcmtTasks.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtTasks.js +2 -2
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSavedQuerySelector.js +3 -2
- package/lib/components/features/search/TMSearch.d.ts +2 -1
- package/lib/components/features/search/TMSearch.js +15 -9
- package/lib/components/features/search/TMSearchQueryPanel.js +1 -1
- package/lib/components/features/search/TMSearchResult.js +56 -14
- package/lib/components/features/search/TMViewHistoryDcmt.js +1 -2
- package/lib/components/features/workflow/diagram/queryDescriptorParser.js +3 -6
- package/lib/components/grids/TMBlogAttachments.d.ts +1 -0
- package/lib/components/grids/TMBlogAttachments.js +38 -12
- package/lib/components/grids/TMBlogsPost.js +7 -1
- package/lib/components/grids/TMBlogsPostUtils.js +11 -17
- package/lib/components/pages/TMPage.js +3 -1
- package/lib/helper/GlobalStyles.js +6 -0
- package/lib/helper/SDKUI_Localizator.d.ts +47 -0
- package/lib/helper/SDKUI_Localizator.js +472 -0
- package/lib/helper/TMPdfViewer.js +25 -24
- package/lib/hooks/useDocumentOperations.d.ts +1 -0
- package/lib/hooks/useDocumentOperations.js +8 -6
- package/lib/hooks/useForm.js +3 -0
- package/package.json +54 -54
|
@@ -57,7 +57,7 @@ export var InvocationContext;
|
|
|
57
57
|
let abortControllerLocal = new AbortController();
|
|
58
58
|
;
|
|
59
59
|
//#endregion
|
|
60
|
-
const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMode = FormModes.Update, invocationContext = InvocationContext.Default, showHeader = true, showBackButton = true, showDcmtFormSidebar = true, isClosable = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, isModal = false, titleModal, widthModal = "100%", heightModal = "100%", allowNavigation = true, canNext, canPrev, count, itemIndex, onNext, onPrev, inputFile = null, inputMids = [], connectorFileSave = undefined, isSharedDcmt = false, sharedSourceTID, sharedSourceDID, allowRelations = true, allowButtonsRefs = false, openS4TViewer = false, enableDragDropOverlay = false, onClose, onSavedAsyncCallback, onSaveRecents, onWFOperationCompleted, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, onTaskCompleted, onTaskCreateRequest, moreInfoTasks, taskFormDialogComponent, handleNavigateToWGs, handleNavigateToDossiers, onReferenceClick, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor, s4TViewerDialogComponent, onScanRequest, passToSearch, datagridUtility }) => {
|
|
60
|
+
const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMode = FormModes.Update, invocationContext = InvocationContext.Default, showHeader = true, showBackButton = true, showDcmtFormSidebar = true, isClosable = false, showTodoDcmtForm = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, isModal = false, titleModal, widthModal = "100%", heightModal = "100%", allowNavigation = true, canNext, canPrev, count, itemIndex, onNext, onPrev, inputFile = null, inputMids = [], connectorFileSave = undefined, isSharedDcmt = false, sharedSourceTID, sharedSourceDID, allowRelations = true, allowButtonsRefs = false, openS4TViewer = false, enableDragDropOverlay = false, onClose, onSavedAsyncCallback, onSaveRecents, onWFOperationCompleted, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, onTaskCompleted, onTaskCreateRequest, moreInfoTasks, taskFormDialogComponent, handleNavigateToWGs, handleNavigateToDossiers, onReferenceClick, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor, s4TViewerDialogComponent, onScanRequest, passToSearch, datagridUtility }) => {
|
|
61
61
|
const { onRefreshSearchAsyncDatagrid, onRefreshBlogDatagrid, onRefreshPreviewDatagrid } = datagridUtility || {};
|
|
62
62
|
const floatingBarContainerRef = useRef(null);
|
|
63
63
|
const [id, setID] = useState('');
|
|
@@ -775,7 +775,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
775
775
|
// Verifica che ci siano riferimenti renderizzabili (solo Dossier o WorkingGroup)
|
|
776
776
|
return dcmtReferences.some(ref => ref.objClass === ObjectClasses.Dossier || ref.objClass === ObjectClasses.WorkingGroup);
|
|
777
777
|
}, [allowButtonsRefs, layoutMode, dcmtReferences, isOpenDetails, isOpenMaster]);
|
|
778
|
-
const isToppyVisible = useMemo(() => Boolean((showToppyForApprove || showToppyForCompleteMoreInfo || showToppyForReferences) && !openS4TViewer), [showToppyForApprove, showToppyForCompleteMoreInfo, showToppyForReferences, openS4TViewer]);
|
|
778
|
+
const isToppyVisible = useMemo(() => Boolean((showToppyForApprove || showToppyForCompleteMoreInfo || showToppyForReferences) && !openS4TViewer && !showTodoDcmtForm), [showToppyForApprove, showToppyForCompleteMoreInfo, showToppyForReferences, openS4TViewer, showTodoDcmtForm]);
|
|
779
779
|
const isModified = useMemo(() => calcIsModified(formData, formDataOrig), [formData, formDataOrig]);
|
|
780
780
|
const formToolbar = useMemo(() => _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [allowNavigation && canPrev != undefined && _jsx("p", { style: { textAlign: 'center', padding: '1px 4px', display: 'flex' }, children: `${itemIndex}/${count}` }), allowNavigation && canPrev != undefined && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', iconColor: 'white', isModified: isModified, formMode: formMode, canPrev: canPrev, onPrev: onPrev }), allowNavigation && canNext != undefined && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', iconColor: 'white', isModified: isModified, formMode: formMode, canNext: canNext, onNext: onNext }), layoutMode === LayoutModes.Update &&
|
|
781
781
|
_jsx(ContextMenu, { items: operationItems, trigger: "left", children: _jsx(IconMenuVertical, { color: 'white', cursor: 'pointer' }) }), layoutMode === LayoutModes.Ark &&
|
|
@@ -1016,6 +1016,21 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1016
1016
|
fd.tid = TID;
|
|
1017
1017
|
return fd;
|
|
1018
1018
|
}, [focusedMetadataValue?.value, focusedMetadataValue?.mid, TID]);
|
|
1019
|
+
/**
|
|
1020
|
+
* Restituisce l'handler onBack per i pannelli, evitando duplicazione di codice.
|
|
1021
|
+
* @param isMainPanel - Se true, è il pannello principale (tmDcmtForm)
|
|
1022
|
+
*/
|
|
1023
|
+
const getOnBackHandler = (isMainPanel = false) => {
|
|
1024
|
+
// Se showBackButton è false, non mostrare mai il back
|
|
1025
|
+
if (showBackButton === false)
|
|
1026
|
+
return undefined;
|
|
1027
|
+
// Mobile: mostra back su tutti i pannelli (se showBackButton è definito e non è closable)
|
|
1028
|
+
if (isMobile) {
|
|
1029
|
+
return (showBackButton !== undefined && !isClosable) ? handleClose : undefined;
|
|
1030
|
+
}
|
|
1031
|
+
// Desktop: mostra back solo sul pannello principale (se showBackButton è definito e non è closable)
|
|
1032
|
+
return (showBackButton !== undefined && isMainPanel && !isClosable) ? handleClose : undefined;
|
|
1033
|
+
};
|
|
1019
1034
|
// Determina se showAll deve essere automaticamente true
|
|
1020
1035
|
// Best practice: usa useMemo per calcolare valori derivati invece di useEffect con setState
|
|
1021
1036
|
const shouldShowAll = useMemo(() => {
|
|
@@ -1100,7 +1115,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1100
1115
|
]);
|
|
1101
1116
|
const tmBlog = useMemo(() => _jsx(TMDcmtBlog, { tid: TID, did: DID, fetchBlogDataTrigger: refreshBlogTrigger, onRefreshBlogDatagrid: onRefreshBlogDatagrid, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), [TID, DID, allTasks, refreshBlogTrigger, handleNavigateToWGs, handleNavigateToDossiers]);
|
|
1102
1117
|
const tmSysMetadata = useMemo(() => _jsx(TMMetadataValues, { layoutMode: layoutMode, openChooserBySingleClick: !isOpenDistinctValues, TID: TID, isReadOnly: true, deviceType: deviceType, metadataValues: formData.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: formData.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [], inputMids: inputMids }), [TID, layoutMode, formData, deviceType, inputMids]);
|
|
1103
|
-
const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { refreshPreviewTrigger: refreshPreviewTrigger, fromDTD: fromDTD, currentDcmt: currentDcmt, dcmtFile: dcmtFile ?? inputFile, deviceType: deviceType, layoutMode: layoutMode, onFileUpload: (file) => { setDcmtFile(file); }, openFileUploaderPdfEditor: openFileUploaderPdfEditor, enableDragDropOverlay: enableDragDropOverlay, onScanRequest: onScanRequest }), [currentDcmt, dcmtFile, deviceType, fromDTD, layoutMode, inputFile, enableDragDropOverlay, setDcmtFile, onScanRequest, openFileUploaderPdfEditor, refreshPreviewTrigger]);
|
|
1118
|
+
const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { refreshPreviewTrigger: refreshPreviewTrigger, fromDTD: fromDTD, currentDcmt: currentDcmt, dcmtFile: dcmtFile ?? inputFile, deviceType: deviceType, onBack: getOnBackHandler(), layoutMode: layoutMode, onFileUpload: (file) => { setDcmtFile(file); }, openFileUploaderPdfEditor: openFileUploaderPdfEditor, enableDragDropOverlay: enableDragDropOverlay, onScanRequest: onScanRequest }), [currentDcmt, dcmtFile, deviceType, fromDTD, layoutMode, inputFile, enableDragDropOverlay, setDcmtFile, onScanRequest, openFileUploaderPdfEditor, refreshPreviewTrigger]);
|
|
1104
1119
|
const tmWF = useMemo(() => {
|
|
1105
1120
|
if (isWFDataLoading) {
|
|
1106
1121
|
return (_jsx("div", { style: {
|
|
@@ -1171,7 +1186,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1171
1186
|
did: Number(DID),
|
|
1172
1187
|
name: fromDTD?.nameLoc ?? SDKUI_Localizator.Widget_Activities,
|
|
1173
1188
|
},
|
|
1174
|
-
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, afterTaskSaved: afterTaskSaved, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }));
|
|
1189
|
+
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, afterTaskSaved: afterTaskSaved, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onBack: getOnBackHandler() }));
|
|
1175
1190
|
}, [allTasks, TID, DID, fromDTD]);
|
|
1176
1191
|
const normalizedTID = TID !== undefined ? Number(TID) : undefined;
|
|
1177
1192
|
const defaultPanelDimensions = {
|
|
@@ -1230,7 +1245,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1230
1245
|
showHeader: showHeader,
|
|
1231
1246
|
title: titleDcmtFormPanel,
|
|
1232
1247
|
allowMaximize: !isMobile,
|
|
1233
|
-
onBack:
|
|
1248
|
+
onBack: getOnBackHandler(true),
|
|
1234
1249
|
onClose: isClosable ? () => { } : undefined,
|
|
1235
1250
|
toolbar: allowNavigation ? formToolbar : _jsx(_Fragment, {})
|
|
1236
1251
|
},
|
|
@@ -1245,7 +1260,14 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1245
1260
|
{
|
|
1246
1261
|
id: 'tmBlog',
|
|
1247
1262
|
name: SDKUI_Localizator.BlogCase,
|
|
1248
|
-
contentOptions: {
|
|
1263
|
+
contentOptions: {
|
|
1264
|
+
component: tmBlog,
|
|
1265
|
+
panelContainer: {
|
|
1266
|
+
title: SDKUI_Localizator.BlogCase,
|
|
1267
|
+
allowMaximize: !isMobile,
|
|
1268
|
+
onBack: getOnBackHandler(),
|
|
1269
|
+
}
|
|
1270
|
+
},
|
|
1249
1271
|
toolbarOptions: {
|
|
1250
1272
|
icon: _jsx(IconBoard, { fontSize: 24 }),
|
|
1251
1273
|
visible: getDcmtFormToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmBlog,
|
|
@@ -1257,7 +1279,14 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1257
1279
|
{
|
|
1258
1280
|
id: 'tmSysMetadata',
|
|
1259
1281
|
name: SDKUI_Localizator.MetadataSystem,
|
|
1260
|
-
contentOptions: {
|
|
1282
|
+
contentOptions: {
|
|
1283
|
+
component: tmSysMetadata,
|
|
1284
|
+
panelContainer: {
|
|
1285
|
+
title: SDKUI_Localizator.MetadataSystem,
|
|
1286
|
+
allowMaximize: !isMobile,
|
|
1287
|
+
onBack: getOnBackHandler(),
|
|
1288
|
+
}
|
|
1289
|
+
},
|
|
1261
1290
|
toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: getDcmtFormToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmSysMetadata, disabled: isSysMetadataDisabled, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
|
|
1262
1291
|
},
|
|
1263
1292
|
{
|
|
@@ -1278,7 +1307,8 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1278
1307
|
contentOptions: {
|
|
1279
1308
|
component: tmWF,
|
|
1280
1309
|
panelContainer: {
|
|
1281
|
-
title: "Workflow", allowMaximize: !isMobile
|
|
1310
|
+
title: "Workflow", allowMaximize: !isMobile,
|
|
1311
|
+
onBack: getOnBackHandler(),
|
|
1282
1312
|
}
|
|
1283
1313
|
},
|
|
1284
1314
|
toolbarOptions: {
|
|
@@ -1564,11 +1594,11 @@ const PanelDisabledStateHandler = ({ isWFDisabled, isSysMetadataDisabled, isBoar
|
|
|
1564
1594
|
}, [isSysMetadataDisabled, isBoardDisabled, isWFDisabled, isDcmtTasksDisabled, isPreviewDisabled, setPanelVisibilityById, setToolbarButtonDisabled, panelVisibility]);
|
|
1565
1595
|
return null;
|
|
1566
1596
|
};
|
|
1567
|
-
const TMDcmtPreviewWrapper = ({ refreshPreviewTrigger, fromDTD, currentDcmt, layoutMode, dcmtFile, deviceType, isVisible, onFileUpload, openFileUploaderPdfEditor, enableDragDropOverlay = false, onScanRequest }) => {
|
|
1597
|
+
const TMDcmtPreviewWrapper = ({ refreshPreviewTrigger, fromDTD, currentDcmt, layoutMode, dcmtFile, deviceType, isVisible, onFileUpload, openFileUploaderPdfEditor, enableDragDropOverlay = false, onScanRequest, onBack }) => {
|
|
1568
1598
|
const { setPanelVisibilityById, toggleMaximize, isResizingActive, countVisibleLeafPanels, panelVisibility } = useTMPanelManagerContext();
|
|
1569
1599
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
1570
1600
|
return (layoutMode === LayoutModes.Update ?
|
|
1571
|
-
_jsx(TMDcmtPreview, { dcmtData: currentDcmt, isVisible: isVisible, onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("tmDcmtPreview") : undefined, isResizingActive: isResizingActive }, refreshPreviewTrigger) :
|
|
1601
|
+
_jsx(TMDcmtPreview, { dcmtData: currentDcmt, isVisible: isVisible, onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("tmDcmtPreview") : undefined, onBack: onBack, isResizingActive: isResizingActive }, refreshPreviewTrigger) :
|
|
1572
1602
|
_jsx(TMFileUploader, { fromDTD: fromDTD, onFileUpload: onFileUpload, openFileUploaderPdfEditor: openFileUploaderPdfEditor, onClose: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, isRequired: fromDTD?.archiveConstraint === ArchiveConstraints.ContentCompulsory && dcmtFile === null, defaultBlob: dcmtFile, deviceType: deviceType, isResizingActive: isResizingActive, enableDragDropOverlay: panelVisibility['tmDcmtPreview'] && enableDragDropOverlay, onScanRequest: onScanRequest }));
|
|
1573
1603
|
};
|
|
1574
1604
|
const Ribbon = styled.div `
|
|
@@ -19,6 +19,18 @@ const TMDcmtFormActionButtons = (props) => {
|
|
|
19
19
|
return null;
|
|
20
20
|
return moreInfoTasks[0];
|
|
21
21
|
}, [moreInfoTasks]);
|
|
22
|
+
// Verifica se la More Info Card sarà effettivamente renderizzata (non null)
|
|
23
|
+
const isMoreInfoCardVisible = useMemo(() => {
|
|
24
|
+
if (!firstTask)
|
|
25
|
+
return false;
|
|
26
|
+
const userID = SDK_Globals.tmSession?.SessionDescr?.userID;
|
|
27
|
+
const isSender = firstTask?.fromID !== undefined && firstTask.fromID === userID;
|
|
28
|
+
const isRecipient = firstTask?.toID !== undefined && firstTask.toID === userID;
|
|
29
|
+
// Caso 4: L'utente è sia mittente che destinatario - la card non viene renderizzata
|
|
30
|
+
if (isSender && isRecipient)
|
|
31
|
+
return false;
|
|
32
|
+
return true;
|
|
33
|
+
}, [firstTask]);
|
|
22
34
|
const { hasMoreInfo, hasApprove, hasReferences } = useMemo(() => {
|
|
23
35
|
const referencesExist = showToppyForReferences && dcmtReferences?.some(ref => ref.objClass === ObjectClasses.Dossier || ref.objClass === ObjectClasses.WorkingGroup);
|
|
24
36
|
return {
|
|
@@ -56,6 +68,9 @@ const TMDcmtFormActionButtons = (props) => {
|
|
|
56
68
|
const senderNameTruncated = task?.fromName ? truncate(task.fromName, 30) : 'N/A';
|
|
57
69
|
const recipientNameTruncated = task?.toName ? truncate(task.toName, 30) : 'N/A';
|
|
58
70
|
const taskNameTrunc = task?.name ? truncate(task.name.replace(TASK_MORE_INFO_PREFIX_NAME ?? '', ''), 30) : 'N/A';
|
|
71
|
+
// Caso 4: L'utente è sia mittente che destinatario - non renderizzare nulla
|
|
72
|
+
if (isSender && isRecipient)
|
|
73
|
+
return null;
|
|
59
74
|
return (_jsxs("div", { style: { position: 'relative', display: 'flex' }, children: [_jsxs("div", { style: {
|
|
60
75
|
padding: '10px',
|
|
61
76
|
color: '#FFFFFF',
|
|
@@ -156,10 +171,10 @@ const TMDcmtFormActionButtons = (props) => {
|
|
|
156
171
|
e.currentTarget.style.transform = 'translateY(-50%)';
|
|
157
172
|
}, children: formatBadgeCount(othersCount) }))] }));
|
|
158
173
|
};
|
|
159
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [hasMoreInfo && firstTask && (_jsx("div", { style: { display: 'flex', gap: "10px", flexDirection: 'column', alignItems: 'center', paddingRight: tasksNumber > 1 ? '36px' : '0' }, children: renderMoreInfoCard(firstTask, tasksNumber > 1) })), hasMoreInfo && hasApprove && _jsx(Divider, {}), hasApprove && (workItems.length === 1 ?
|
|
174
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [hasMoreInfo && firstTask && isMoreInfoCardVisible && (_jsx("div", { style: { display: 'flex', gap: "10px", flexDirection: 'column', alignItems: 'center', paddingRight: tasksNumber > 1 ? '36px' : '0' }, children: renderMoreInfoCard(firstTask, tasksNumber > 1) })), hasMoreInfo && isMoreInfoCardVisible && hasApprove && _jsx(Divider, {}), hasApprove && (workItems.length === 1 ?
|
|
160
175
|
_jsx(WorkFlowOperationButtons, { dtd: fromDTD, deviceType: deviceType, onApprove: () => updateShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => updateShowRejectPopup(true), onReAssign: () => updateShowReAssignPopup(true), onMoreInfo: () => updateShowMoreInfoPopup(true) })
|
|
161
176
|
:
|
|
162
|
-
_jsxs("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: [`Questo documento è associato a ${workItems.length} workitem.`, _jsx("br", {}), `Per approvare, vai alla pagina "Approvazione workflow".`] })), (hasApprove && hasReferences) || (hasMoreInfo && !hasApprove && hasReferences) ? (_jsx(Divider, {})) : null, hasReferences && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px', alignItems: 'center' }, children: [dossierRefs.length > 0 && (_jsx("div", { style: { paddingRight: dossierRefs.length > 1 ? '36px' : '0' }, children: renderReferenceCard(dossierRefs[0], dossierRefs, dossierRefs.length > 1, () => setShowAllDossiersModal(true)) })), workingGroupRefs.length > 0 && (_jsx("div", { style: { paddingRight: workingGroupRefs.length > 1 ? '36px' : '0' }, children: renderReferenceCard(workingGroupRefs[0], workingGroupRefs, workingGroupRefs.length > 1, () => setShowAllWorkingGroupsModal(true)) }))] }))] }), showAllMoreInfoModal && moreInfoTasks && moreInfoTasks.length > 1 && (_jsx(TMModal, { title: `Altre richieste maggiori informazioni (${moreInfoTasks.length - 1})`, onClose: () => setShowAllMoreInfoModal(false), width: calcResponsiveSizes(deviceType, '450px', '450px', '95%'), height: 'auto', children: _jsx("div", { style: {
|
|
177
|
+
_jsxs("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: [`Questo documento è associato a ${workItems.length} workitem.`, _jsx("br", {}), `Per approvare, vai alla pagina "Approvazione workflow".`] })), (hasApprove && hasReferences) || (hasMoreInfo && isMoreInfoCardVisible && !hasApprove && hasReferences) ? (_jsx(Divider, {})) : null, hasReferences && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px', alignItems: 'center' }, children: [dossierRefs.length > 0 && (_jsx("div", { style: { paddingRight: dossierRefs.length > 1 ? '36px' : '0' }, children: renderReferenceCard(dossierRefs[0], dossierRefs, dossierRefs.length > 1, () => setShowAllDossiersModal(true)) })), workingGroupRefs.length > 0 && (_jsx("div", { style: { paddingRight: workingGroupRefs.length > 1 ? '36px' : '0' }, children: renderReferenceCard(workingGroupRefs[0], workingGroupRefs, workingGroupRefs.length > 1, () => setShowAllWorkingGroupsModal(true)) }))] }))] }), showAllMoreInfoModal && moreInfoTasks && moreInfoTasks.length > 1 && (_jsx(TMModal, { title: `Altre richieste maggiori informazioni (${moreInfoTasks.length - 1})`, onClose: () => setShowAllMoreInfoModal(false), width: calcResponsiveSizes(deviceType, '450px', '450px', '95%'), height: 'auto', children: _jsx("div", { style: {
|
|
163
178
|
display: 'flex',
|
|
164
179
|
flexDirection: 'column',
|
|
165
180
|
gap: '8px',
|
|
@@ -22,7 +22,7 @@ const ErrorContent = ({ error, isAbortError, onRetry }) => {
|
|
|
22
22
|
}
|
|
23
23
|
return _jsx(TMNothingToShow, { icon: _jsx(IconCloseOutline, { fontSize: 92, color: TMColors.error }), text: error });
|
|
24
24
|
};
|
|
25
|
-
const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev, onClosePanel, onNext, onPrev, allowMaximize = true, onMaximizePanel }) => {
|
|
25
|
+
const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev, onClosePanel, onBack, onNext, onPrev, allowMaximize = true, onMaximizePanel }) => {
|
|
26
26
|
const [dcmtBlob, setDcmtBlob] = useState(undefined);
|
|
27
27
|
const [showPreview, setShowPreview] = useState(false);
|
|
28
28
|
const [isFromCache, setIsFromCache] = useState(false);
|
|
@@ -183,7 +183,7 @@ const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev
|
|
|
183
183
|
{ icon: _jsx(IconCloseCircle, {}), name: SDKUI_Localizator.RemoveFromCache, onClick: () => { removeDcmtsFileCache(cacheKey); setIsFromCache(false); } },
|
|
184
184
|
{ icon: _jsx(IconClear, {}), name: SDKUI_Localizator.ClearCache, onClick: () => { clearDcmtsFileCache(); setIsFromCache(false); } },
|
|
185
185
|
], [cacheKey, removeDcmtsFileCache, clearDcmtsFileCache, setIsFromCache]);
|
|
186
|
-
return (_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(TMPanel, { padding: '0', title: titleHandler(), onClose: onClosePanel, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, toolbar: _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: '10px' }, children: [onPrev && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), onNext && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(StyledHeaderIcon, { "$color": TMColors.primaryColor, children: _jsx(ContextMenu, { items: cacheMenuItems, trigger: "left", children: _jsx(IconMenuVertical, {}) }) }), _jsx(StyledHeaderIcon, { onClick: reOpenDcmt, "$color": TMColors.primaryColor, children: _jsx(TMTooltip, { content: SDKUI_Localizator.ReopenDocument, children: _jsx(IconRefresh, {}) }) })] }), children: error
|
|
186
|
+
return (_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(TMPanel, { padding: '0', title: titleHandler(), onClose: onClosePanel, onBack: onBack, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, toolbar: _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: '10px' }, children: [onPrev && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), onNext && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(StyledHeaderIcon, { "$color": TMColors.primaryColor, children: _jsx(ContextMenu, { items: cacheMenuItems, trigger: "left", children: _jsx(IconMenuVertical, {}) }) }), _jsx(StyledHeaderIcon, { onClick: reOpenDcmt, "$color": TMColors.primaryColor, children: _jsx(TMTooltip, { content: SDKUI_Localizator.ReopenDocument, children: _jsx(IconRefresh, {}) }) })] }), children: error
|
|
187
187
|
? _jsx(ErrorContent, { error: error, isAbortError: isAbortError, onRetry: reOpenDcmt })
|
|
188
188
|
: renderedPreview(dcmtData?.tid, dcmtData?.did, dcmtData?.fileExt, dcmtData?.fileSize, dcmtData?.fileCount, extensionHandler(dcmtData?.fileExt), showPreview, isResizingActive, () => { isBasketMode ? loadBasketFile() : loadDocumentWithCache(); setShowPreview(true); }, dcmtBlob, isBasketMode) }) }));
|
|
189
189
|
};
|
|
@@ -10,6 +10,7 @@ interface TMDcmtTasksProps {
|
|
|
10
10
|
afterTaskSaved: (task: TaskDescriptor | undefined, formMode: FormModes | undefined, forceRefresh?: boolean) => Promise<void>;
|
|
11
11
|
handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
|
|
12
12
|
handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
|
|
13
|
+
onBack?: () => void;
|
|
13
14
|
}
|
|
14
15
|
declare const TMDcmtTasks: (props: TMDcmtTasksProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export default TMDcmtTasks;
|
|
@@ -6,7 +6,7 @@ import { useTMPanelManagerContext } from "../../layout/panelManager/TMPanelManag
|
|
|
6
6
|
import TMPanel from "../../base/TMPanel";
|
|
7
7
|
import TMTasksPanelContent from "../tasks/TMTasksPanelContent";
|
|
8
8
|
const TMDcmtTasks = (props) => {
|
|
9
|
-
const { taskContext, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, afterTaskSaved, handleNavigateToWGs, handleNavigateToDossiers } = props;
|
|
9
|
+
const { taskContext, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, afterTaskSaved, handleNavigateToWGs, handleNavigateToDossiers, onBack } = props;
|
|
10
10
|
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
|
|
11
11
|
const deviceType = useDeviceType();
|
|
12
12
|
// This avoids unnecessary re-renders by only recalculating when deviceType changes.
|
|
@@ -19,6 +19,6 @@ const TMDcmtTasks = (props) => {
|
|
|
19
19
|
text: SDKUI_Localizator.Refresh,
|
|
20
20
|
},
|
|
21
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, 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 }) }) });
|
|
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 }) }) });
|
|
23
23
|
};
|
|
24
24
|
export default TMDcmtTasks;
|
|
@@ -9,8 +9,8 @@ interface ITMSavedQuerySelectorProps {
|
|
|
9
9
|
manageDefault?: boolean;
|
|
10
10
|
onItemClick?: (sqd: SavedQueryDescriptor) => void;
|
|
11
11
|
onDeleted?: (sqd: SavedQueryDescriptor) => void;
|
|
12
|
-
|
|
12
|
+
refreshFavoriteSavedQueries?: (sqd: SavedQueryDescriptor) => void;
|
|
13
13
|
onRefreshData?: () => void;
|
|
14
14
|
}
|
|
15
|
-
declare const TMSavedQuerySelector: React.MemoExoticComponent<({ items, selectedId, allowShowSearch, height, manageDefault, onItemClick, onDeleted,
|
|
15
|
+
declare const TMSavedQuerySelector: React.MemoExoticComponent<({ items, selectedId, allowShowSearch, height, manageDefault, onItemClick, onDeleted, refreshFavoriteSavedQueries, onRefreshData }: ITMSavedQuerySelectorProps) => import("react/jsx-runtime").JSX.Element>;
|
|
16
16
|
export default TMSavedQuerySelector;
|
|
@@ -105,7 +105,7 @@ const getContextMenuItems = (sqd, manageDefault, isMobile, deleteAsync, setDefau
|
|
|
105
105
|
onClick: () => { setInfoSQD?.(sqd); }
|
|
106
106
|
}] : [])
|
|
107
107
|
];
|
|
108
|
-
const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch = true, height, manageDefault = true, onItemClick, onDeleted,
|
|
108
|
+
const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch = true, height, manageDefault = true, onItemClick, onDeleted, refreshFavoriteSavedQueries, onRefreshData }) => {
|
|
109
109
|
const [dataSource, setDataSource] = useState([]);
|
|
110
110
|
const [selectedItem, setSelectedItem] = useState();
|
|
111
111
|
const [searchText, setSearchText] = useState('');
|
|
@@ -135,6 +135,7 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
|
|
|
135
135
|
await SDK_Globals.tmSession?.NewSavedQueryEngine().DeleteAsync(sqd?.id);
|
|
136
136
|
await loadDataAsync(true);
|
|
137
137
|
onDeleted?.(sqd);
|
|
138
|
+
refreshFavoriteSavedQueries?.(sqd);
|
|
138
139
|
TMSpinner.hide();
|
|
139
140
|
}
|
|
140
141
|
catch (ex) {
|
|
@@ -148,7 +149,7 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
|
|
|
148
149
|
try {
|
|
149
150
|
TMSpinner.show();
|
|
150
151
|
await SDK_Globals.tmSession?.NewSavedQueryEngine().FavoritesAddOrRemoveAsync(sqd?.id, false);
|
|
151
|
-
|
|
152
|
+
refreshFavoriteSavedQueries?.(sqd);
|
|
152
153
|
TMSpinner.hide();
|
|
153
154
|
ShowAlert({ mode: 'success', title: SDK_Localizator.SavedQuery, message: SDKUI_Localizator.OperationSuccess, duration: 3000 });
|
|
154
155
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DcmtTypeDescriptor, TaskDescriptor, ObjectRef, HomeBlogPost } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
import { SavedQueryDescriptor, DcmtTypeDescriptor, TaskDescriptor, ObjectRef, HomeBlogPost } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { DcmtInfo, TaskContext } from '../../../ts';
|
|
4
4
|
import { TMSearchResultFloatingActionConfig } from './TMSearchResultFloatingActionButton';
|
|
5
5
|
interface ITMSearchProps {
|
|
@@ -36,6 +36,7 @@ interface ITMSearchProps {
|
|
|
36
36
|
mid: number;
|
|
37
37
|
value: string;
|
|
38
38
|
}>, tid?: number) => void;
|
|
39
|
+
refreshFavoriteSavedQueries?: (sqd: SavedQueryDescriptor) => void;
|
|
39
40
|
onCurrentTIDChangedCallback?: (tid: number | undefined) => void;
|
|
40
41
|
onlyShowSearchQueryPanel?: boolean;
|
|
41
42
|
onReferenceClick?: (ref: ObjectRef) => void;
|
|
@@ -14,12 +14,13 @@ import { StyledMultiViewPanel } from '../../base/Styled';
|
|
|
14
14
|
import { useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
|
|
15
15
|
import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
|
|
16
16
|
import { TMPanelManagerWithPersistenceProvider } from '../../layout/panelManager/TMPanelManagerWithPersistenceProvider';
|
|
17
|
+
import { TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
17
18
|
var TMSearchViews;
|
|
18
19
|
(function (TMSearchViews) {
|
|
19
20
|
TMSearchViews[TMSearchViews["Search"] = 0] = "Search";
|
|
20
21
|
TMSearchViews[TMSearchViews["Result"] = 1] = "Result";
|
|
21
22
|
})(TMSearchViews || (TMSearchViews = {}));
|
|
22
|
-
const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, openInOffice, isVisible, inputTID, inputSqdID, inputMids, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm, editPdfForm = false, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor, showTodoDcmtForm, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, passToArchiveCallback, onCurrentTIDChangedCallback, onlyShowSearchQueryPanel, onReferenceClick }) => {
|
|
23
|
+
const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, openInOffice, isVisible, inputTID, inputSqdID, inputMids, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm, editPdfForm = false, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor, showTodoDcmtForm, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, passToArchiveCallback, onCurrentTIDChangedCallback, onlyShowSearchQueryPanel, onReferenceClick, refreshFavoriteSavedQueries }) => {
|
|
23
24
|
const [allSQDs, setAllSQDs] = useState([]);
|
|
24
25
|
const [filteredByTIDSQDs, setFilteredByTIDSQDs] = useState([]);
|
|
25
26
|
const [currentSQD, setCurrentSQD] = useState();
|
|
@@ -50,13 +51,18 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
50
51
|
setCurrentSearchView(TMSearchViews.Search);
|
|
51
52
|
}, [inputTID]);
|
|
52
53
|
useEffect(() => {
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
const loadSqd = async () => {
|
|
55
|
+
try {
|
|
56
|
+
const resultSqd = await SavedQueryCacheService.GetAsync(inputSqdID);
|
|
55
57
|
await setSQDAsync(resultSqd);
|
|
56
58
|
// Mostra la vista Search per visualizzare i filtri della SavedQuery caricata
|
|
57
59
|
setCurrentSearchView(TMSearchViews.Search);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
TMExceptionBoxManager.show({ exception: err });
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
loadSqd();
|
|
60
66
|
}, [inputSqdID]);
|
|
61
67
|
useEffect(() => {
|
|
62
68
|
const newMaxDcmtsToBeReturned = SDKUI_Globals.userSettings.searchSettings?.maxDcmtsToBeReturned ?? 1000;
|
|
@@ -195,9 +201,9 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
195
201
|
} }), [fromDTD, showSearchResults, setShowSearchResults, currentSQD, isExpertMode, mruTIDs, searchResult, passToArchiveCallback, inputMids, maxDcmtsToBeReturned]);
|
|
196
202
|
const tmSavedQuerySelectorElement = useMemo(() => _jsxs(TabPanel, { width: "100%", height: "100%", showNavButtons: true, repaintChangesOnly: true, selectedIndex: currentSQDMode, onSelectedIndexChange: (index) => setCurrentSQDMode(index), children: [(currentTID || currentSQD) ? _jsx(Item, { title: fromDTD?.nameLoc, children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: false, items: filteredByTIDSQDs, selectedId: currentSQD?.id, onRefreshData: () => { loadDataSQDsAsync(true); }, onItemClick: (sqd) => {
|
|
197
203
|
onSQDItemClick(sqd, setSQDAsync);
|
|
198
|
-
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? filteredByTIDSQDs.find(o => o.id == 1) : currentSQD, setSQDAsync) }) }) : _jsx(_Fragment, {}), _jsx(Item, { title: SDKUI_Localizator.AllFemale, children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: true, items: allSQDs, manageDefault: false, onItemClick: (sqd) => {
|
|
204
|
+
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? filteredByTIDSQDs.find(o => o.id == 1) : currentSQD, setSQDAsync), refreshFavoriteSavedQueries: refreshFavoriteSavedQueries }) }) : _jsx(_Fragment, {}), _jsx(Item, { title: SDKUI_Localizator.AllFemale, children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: true, items: allSQDs, manageDefault: false, onItemClick: (sqd) => {
|
|
199
205
|
onSQDItemClick(sqd, setSQDAsync);
|
|
200
|
-
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? undefined : currentSQD, setSQDAsync) }) })] }), [currentSQDMode, currentTID, currentSQD, fromDTD, filteredByTIDSQDs, allSQDs]);
|
|
206
|
+
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? undefined : currentSQD, setSQDAsync), refreshFavoriteSavedQueries: refreshFavoriteSavedQueries }) })] }), [currentSQDMode, currentTID, currentSQD, fromDTD, filteredByTIDSQDs, allSQDs]);
|
|
201
207
|
// Returns the current panelLayout from user settings, falling back to an empty object if not present.
|
|
202
208
|
const getPanelLayoutSetting = () => {
|
|
203
209
|
return SDKUI_Globals.userSettings.searchSettings.panelLayout ?? {};
|
|
@@ -285,10 +291,10 @@ const TMSearchQueryPanelWrapper = ({ fromDTD, SQD, isExpertMode, showBackToResul
|
|
|
285
291
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
286
292
|
return (_jsx(TMSearchQueryPanel, { onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('TMSearchQueryPanel', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("TMSearchQueryPanel") : undefined, isExpertMode: isExpertMode, fromDTD: fromDTD, SQD: SQD, inputMids: inputMids, onSearchCompleted: onSearchCompleted, onSqdSaved: onSqdSaved, showBackToResultButton: showBackToResultButton, onBackToResult: onBackToResult, passToArchiveCallback: passToArchiveCallback, maxDcmtsToBeReturned: maxDcmtsToBeReturned }));
|
|
287
293
|
};
|
|
288
|
-
const TMSavedQuerySelectorWrapper = ({ items, selectedId, allowShowSearch, manageDefault, onRefreshData, onItemClick, onDeleted }) => {
|
|
294
|
+
const TMSavedQuerySelectorWrapper = ({ items, selectedId, allowShowSearch, manageDefault, onRefreshData, onItemClick, onDeleted, refreshFavoriteSavedQueries }) => {
|
|
289
295
|
const { setPanelVisibilityById } = useTMPanelManagerContext();
|
|
290
296
|
return (_jsx(TMSavedQuerySelector, { allowShowSearch: allowShowSearch, manageDefault: manageDefault, items: items, selectedId: selectedId, onRefreshData: onRefreshData, onItemClick: (sqd) => {
|
|
291
297
|
onItemClick?.(sqd);
|
|
292
298
|
setPanelVisibilityById('TMSearchQueryPanel', true);
|
|
293
|
-
}, onDeleted: onDeleted }));
|
|
299
|
+
}, onDeleted: onDeleted, refreshFavoriteSavedQueries: refreshFavoriteSavedQueries }));
|
|
294
300
|
};
|
|
@@ -327,7 +327,7 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
|
|
|
327
327
|
return (_jsxs(_Fragment, { children: [_jsxs(TMPanel, { title: fromDTD?.nameLoc ?? SDKUI_Localizator.Search_Metadata, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, onBack: onBack, onActiveChanged: handlePanelActiveChanged, toolbar: _jsx(_Fragment, { children: (SQD && !showSqdForm) ?
|
|
328
328
|
_jsx(ContextMenu, { items: contextMenuItems, trigger: "left", children: _jsx(TMButton, { btnStyle: 'icon', caption: 'Altro', icon: _jsx(IconMenuVertical, { color: 'white' }), showTooltip: false, onClick: () => setIsQueryPanelActive(true) }) })
|
|
329
329
|
: _jsx(_Fragment, {}) }), children: [_jsx(ConfirmQueryParamsDialog, {}), SQD
|
|
330
|
-
? _jsxs("div", { onContextMenu: (e) => e.preventDefault(), style: { height: '100%', width: '100%', position: 'relative', display: 'flex', flexDirection: 'column', gap: 5 }, children: [showAdvancedSearch
|
|
330
|
+
? _jsxs("div", { onContextMenu: (e) => e.preventDefault(), style: { height: '100%', width: '100%', position: 'relative', display: showSqdForm ? 'none' : 'flex', flexDirection: 'column', gap: 5 }, children: [showAdvancedSearch
|
|
331
331
|
? _jsx(TMQueryEditor, { formMode: FormModes.Update, showToolbar: false, inputData: qd, validateSelect: true, showApply: false, onQDChanged: handleQdChanged, updateIsModalOpen: updateIsModalOpen })
|
|
332
332
|
: _jsx(TMSearchQueryEditor, { qd: qd, dcmtTypesList: dcmtTypesList, isExpertMode: isExpertMode, showAllMdWhere: showAllMdWhere, onQdChanged: handleQdChanged, onFocusedMetadataChanged: setFocusedTidMid, onAdvancedMenuClick: handleAdvancedMenuClick, updateIsModalOpen: updateIsModalOpen }), _jsxs("div", { style: {
|
|
333
333
|
display: 'flex',
|
|
@@ -318,6 +318,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
318
318
|
allowFloatingBar,
|
|
319
319
|
enablePinIcons,
|
|
320
320
|
allowRelations,
|
|
321
|
+
showTodoDcmtForm
|
|
321
322
|
},
|
|
322
323
|
tasks: {
|
|
323
324
|
allTasks: allTasks,
|
|
@@ -352,7 +353,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
352
353
|
openTaskFormHandler,
|
|
353
354
|
},
|
|
354
355
|
});
|
|
355
|
-
const { isOpenDcmtForm, openFormHandler, dcmtFormLayoutMode, onDcmtFormOpenChange, showSearchTMDatagrid, showExportForm, isOpenBatchUpdate, isModifiedBatchUpdate, updateBatchUpdateForm, handleSignApprove, checkoutInfo: { showCicoWaitPanel, cicoWaitPanelTitle, showCicoPrimaryProgress, cicoPrimaryProgressText, cicoPrimaryProgressValue, cicoPrimaryProgressMax, }, dcmtOperations: { abortController, showWaitPanel, showPrimary, waitPanelTitle, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync, }, relatedDocumentsInfo: { isOpenDetails, isOpenMaster, checkRelatedDcmtsArchiveCapability, checkManyToManyCapability, }, toppyOperations: { showApprovePopup, showRejectPopup, showReAssignPopup, showMoreInfoPopup, updateShowApprovePopup, updateShowRejectPopup, updateShowReAssignPopup, updateShowMoreInfoPopup } } = features;
|
|
356
|
+
const { isOpenDcmtForm, openFormHandler, dcmtFormLayoutMode, onDcmtFormOpenChange, showSearchTMDatagrid, showExportForm, isOpenBatchUpdate, isModifiedBatchUpdate, updateBatchUpdateForm, closeDcmtFormHandler, handleSignApprove, checkoutInfo: { showCicoWaitPanel, cicoWaitPanelTitle, showCicoPrimaryProgress, cicoPrimaryProgressText, cicoPrimaryProgressValue, cicoPrimaryProgressMax, }, dcmtOperations: { abortController, showWaitPanel, showPrimary, waitPanelTitle, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync, }, relatedDocumentsInfo: { isOpenDetails, isOpenMaster, checkRelatedDcmtsArchiveCapability, checkManyToManyCapability, }, toppyOperations: { showApprovePopup, showRejectPopup, showReAssignPopup, showMoreInfoPopup, updateShowApprovePopup, updateShowRejectPopup, updateShowReAssignPopup, updateShowMoreInfoPopup } } = features;
|
|
356
357
|
const deviceType = useDeviceType();
|
|
357
358
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
358
359
|
const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
@@ -366,6 +367,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
366
367
|
useEffect(() => {
|
|
367
368
|
setSelectedItems([]);
|
|
368
369
|
updateBatchUpdateForm(false);
|
|
370
|
+
closeDcmtFormHandler();
|
|
369
371
|
setCurrentSearchResults(searchResults);
|
|
370
372
|
if (searchResults.length <= 0) {
|
|
371
373
|
setSelectedSearchResult(undefined);
|
|
@@ -512,6 +514,21 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
512
514
|
return newResults;
|
|
513
515
|
});
|
|
514
516
|
};
|
|
517
|
+
/**
|
|
518
|
+
* Restituisce l'handler onBack per i pannelli, evitando duplicazione di codice.
|
|
519
|
+
* @param isMainPanel - Se true, è il pannello principale dei risultati di ricerca
|
|
520
|
+
*/
|
|
521
|
+
const getOnBackHandler = (isMainPanel = false) => {
|
|
522
|
+
// Se showBackButton è false, non mostrare mai il back
|
|
523
|
+
if (showBackButton === false)
|
|
524
|
+
return undefined;
|
|
525
|
+
// Mobile: mostra back su tutti i pannelli (se showBackButton è definito e non è closable)
|
|
526
|
+
if (isMobile) {
|
|
527
|
+
return (showBackButton !== undefined && !isClosable) ? onBack : undefined;
|
|
528
|
+
}
|
|
529
|
+
// Desktop: mostra back solo sul pannello principale dei risultati (se showBackButton è definito e non è closable)
|
|
530
|
+
return (showBackButton !== undefined && isMainPanel && !isClosable) ? onBack : undefined;
|
|
531
|
+
};
|
|
515
532
|
const removeDcmtFromFavsOrRecents = async () => {
|
|
516
533
|
switch (selectedSearchResult?.category) {
|
|
517
534
|
case "Favorites":
|
|
@@ -601,7 +618,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
601
618
|
]);
|
|
602
619
|
const tmBlog = useMemo(() => _jsx(TMDcmtBlog, { tid: focusedItem?.TID, did: focusedItem?.DID, fetchBlogDataTrigger: refreshBlogTrigger, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), [focusedItem, allTasks, refreshBlogTrigger, handleNavigateToWGs, handleNavigateToDossiers, onRefreshBlogDatagrid]);
|
|
603
620
|
const tmSysMetadata = useMemo(() => _jsx(TMMetadataValues, { layoutMode: LayoutModes.Update, openChooserBySingleClick: true, TID: focusedItem?.TID, isReadOnly: true, deviceType: deviceType, metadataValues: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [] }), [focusedItem, currentMetadataValues, deviceType]);
|
|
604
|
-
const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { refreshPreviewTrigger: refreshPreviewTrigger, currentDcmt: currentDcmt }), [currentDcmt, refreshPreviewTrigger]);
|
|
621
|
+
const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { refreshPreviewTrigger: refreshPreviewTrigger, currentDcmt: currentDcmt, onBack: getOnBackHandler() }), [currentDcmt, refreshPreviewTrigger]);
|
|
605
622
|
// Auto-fetch indexing info when drawer is open and focusedItem changes
|
|
606
623
|
useEffect(() => {
|
|
607
624
|
if (!focusedItem || !showIndexingInfo)
|
|
@@ -658,7 +675,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
658
675
|
}
|
|
659
676
|
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', height: '100%', overflow: 'hidden', width: '100%' }, children: [_jsx("div", { style: { padding: '10px', overflow: 'auto', flex: 1 }, children: _jsx("div", { dangerouslySetInnerHTML: { __html: ftExplanation } }) }), _jsxs(StyledIndexingInfoSection, { children: [_jsxs(StyledIndexingToggle, { onClick: handleToggleIndexingInfo, disabled: loadingIndexingInfo, children: [_jsx(StyledLeftContent, { children: _jsx("span", { children: SDKUI_Localizator.IndexingInformation }) }), _jsx(StyledRightContent, { children: _jsx(StyledChevron, { "$isOpen": showIndexingInfo, children: "\u25BC" }) })] }), showIndexingInfo && indexingInfo && (_jsxs(StyledIndexingInfoBox, { children: [_jsx("div", { dangerouslySetInnerHTML: { __html: indexingInfo } }), loadingIndexingInfo && (_jsxs("div", { style: { position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', background: 'rgba(255, 255, 255, 0.9)', padding: '10px', borderRadius: '4px', boxShadow: '0 2px 8px rgba(0,0,0,0.15)' }, children: [SDKUI_Localizator.Loading, "..."] }))] }))] })] }));
|
|
660
677
|
}, [selectedSearchResult, focusedItem, indexingInfo, showIndexingInfo, loadingIndexingInfo]);
|
|
661
|
-
const isBoardDisabled = useMemo(() => fromDTD
|
|
678
|
+
const isBoardDisabled = useMemo(() => fromDTD !== undefined && fromDTD.hasBlog !== 1, [fromDTD]);
|
|
662
679
|
const allInitialPanelVisibility = {
|
|
663
680
|
'tmSearchResult': true,
|
|
664
681
|
'tmBlog': false,
|
|
@@ -683,9 +700,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
683
700
|
title: getTitleHeader(),
|
|
684
701
|
showHeader: showToolbarHeader,
|
|
685
702
|
allowMaximize: !isMobile,
|
|
686
|
-
onBack:
|
|
687
|
-
? (showBackButton ? onBack : undefined)
|
|
688
|
-
: ((!isClosable && context === SearchResultContext.METADATA_SEARCH) || (isMobile && context !== SearchResultContext.METADATA_SEARCH && splitterSize[1] === '100%') ? onBack : undefined),
|
|
703
|
+
onBack: getOnBackHandler(true),
|
|
689
704
|
onClose: isClosable ? onBack : undefined,
|
|
690
705
|
toolbar: searchResutlToolbar
|
|
691
706
|
},
|
|
@@ -695,27 +710,50 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
695
710
|
{
|
|
696
711
|
id: 'tmBlog',
|
|
697
712
|
name: SDKUI_Localizator.BlogCase,
|
|
698
|
-
contentOptions: {
|
|
713
|
+
contentOptions: {
|
|
714
|
+
component: tmBlog,
|
|
715
|
+
panelContainer: {
|
|
716
|
+
title: SDKUI_Localizator.BlogCase,
|
|
717
|
+
allowMaximize: !isMobile,
|
|
718
|
+
onBack: getOnBackHandler(),
|
|
719
|
+
}
|
|
720
|
+
},
|
|
699
721
|
toolbarOptions: { icon: _jsx(IconBoard, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmBlog, orderNumber: 2, isActive: allInitialPanelVisibility['tmBlog'] }
|
|
700
722
|
},
|
|
701
723
|
{
|
|
702
724
|
id: 'tmSysMetadata',
|
|
703
725
|
name: SDKUI_Localizator.MetadataSystem,
|
|
704
|
-
contentOptions: {
|
|
726
|
+
contentOptions: {
|
|
727
|
+
component: tmSysMetadata,
|
|
728
|
+
panelContainer: {
|
|
729
|
+
title: SDKUI_Localizator.MetadataSystem,
|
|
730
|
+
allowMaximize: !isMobile,
|
|
731
|
+
onBack: getOnBackHandler(),
|
|
732
|
+
}
|
|
733
|
+
},
|
|
705
734
|
toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmSysMetadata, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
|
|
706
735
|
},
|
|
707
736
|
...(context === SearchResultContext.FREE_SEARCH ? [
|
|
708
737
|
{
|
|
709
738
|
id: 'tmFullTextSearch',
|
|
710
739
|
name: SDKUI_Localizator.ResultDetails,
|
|
711
|
-
contentOptions: {
|
|
740
|
+
contentOptions: {
|
|
741
|
+
component: tmFullTextSearch,
|
|
742
|
+
panelContainer: {
|
|
743
|
+
title: SDKUI_Localizator.ResultDetails,
|
|
744
|
+
allowMaximize: !isMobile,
|
|
745
|
+
onBack: getOnBackHandler(),
|
|
746
|
+
}
|
|
747
|
+
},
|
|
712
748
|
toolbarOptions: { icon: _jsx(IconPlatform, { fontSize: 20 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmFullTextSearch, orderNumber: 4, isActive: allInitialPanelVisibility['tmFullTextSearch'] }
|
|
713
749
|
}
|
|
714
750
|
] : []),
|
|
715
751
|
{
|
|
716
752
|
id: 'tmDcmtPreview',
|
|
717
753
|
name: SDKUI_Localizator.PreviewDocument,
|
|
718
|
-
contentOptions: {
|
|
754
|
+
contentOptions: {
|
|
755
|
+
component: tmDcmtPreview
|
|
756
|
+
},
|
|
719
757
|
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmDcmtPreview, orderNumber: context === SearchResultContext.FREE_SEARCH ? 5 : 4, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
|
|
720
758
|
}
|
|
721
759
|
], [tmSearchResult, tmBlog, tmSysMetadata, tmDcmtPreview, tmFullTextSearch, showToolbarHeader, context, isMobile]);
|
|
@@ -1242,20 +1280,24 @@ const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCa
|
|
|
1242
1280
|
const PanelDisabledStateHandler = ({ isBoardDisabled }) => {
|
|
1243
1281
|
const { setPanelVisibilityById, setToolbarButtonDisabled, panelVisibility } = useTMPanelManagerContext();
|
|
1244
1282
|
useEffect(() => {
|
|
1245
|
-
// Aggiorna lo stato disabled del bottone toolbar
|
|
1246
|
-
setToolbarButtonDisabled('tmBlog', isBoardDisabled);
|
|
1247
1283
|
// Chiude il pannello solo se è attualmente visibile e deve essere disabilitato
|
|
1248
1284
|
if (isBoardDisabled && panelVisibility['tmBlog']) {
|
|
1249
1285
|
setPanelVisibilityById('tmBlog', false);
|
|
1286
|
+
setToolbarButtonDisabled('tmBlog', true);
|
|
1287
|
+
}
|
|
1288
|
+
// Riapre il pannello solo se è attualmente visibile e deve essere abilitato
|
|
1289
|
+
if (!isBoardDisabled && panelVisibility['tmBlog']) {
|
|
1290
|
+
setPanelVisibilityById('tmBlog', true);
|
|
1291
|
+
setToolbarButtonDisabled('tmBlog', false);
|
|
1250
1292
|
}
|
|
1251
1293
|
}, [isBoardDisabled, setPanelVisibilityById, setToolbarButtonDisabled, panelVisibility]);
|
|
1252
1294
|
return null;
|
|
1253
1295
|
};
|
|
1254
|
-
const TMDcmtPreviewWrapper = ({ refreshPreviewTrigger, currentDcmt, isVisible }) => {
|
|
1296
|
+
const TMDcmtPreviewWrapper = ({ refreshPreviewTrigger, currentDcmt, isVisible, onBack }) => {
|
|
1255
1297
|
const { setPanelVisibilityById, toggleMaximize, isResizingActive, countVisibleLeafPanels } = useTMPanelManagerContext();
|
|
1256
1298
|
const deviceType = useDeviceType();
|
|
1257
1299
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
1258
|
-
return (_jsx(TMDcmtPreview, { dcmtData: currentDcmt, onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("tmDcmtPreview") : undefined, isResizingActive: isResizingActive, isVisible: isVisible }, refreshPreviewTrigger));
|
|
1300
|
+
return (_jsx(TMDcmtPreview, { dcmtData: currentDcmt, onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, onBack: onBack, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("tmDcmtPreview") : undefined, isResizingActive: isResizingActive, isVisible: isVisible }, refreshPreviewTrigger));
|
|
1259
1301
|
};
|
|
1260
1302
|
// Styled Components
|
|
1261
1303
|
const StyledPlaceholder = styled.div `
|
|
@@ -77,7 +77,6 @@ const TMViewHistoryDcmt = (props) => {
|
|
|
77
77
|
UpdaterDisplayName: user?.name ?? updaterID.toString(),
|
|
78
78
|
CreationTime: row.CreationTime,
|
|
79
79
|
LastUpdateTime: row.LastUpdateTime,
|
|
80
|
-
LastUpdateTimeDisplay: row.LastUpdateTime ? Globalization.getDateTimeDisplayValue(new Date(row.LastUpdateTime)) : '-',
|
|
81
80
|
Version: row.Version,
|
|
82
81
|
CheckInTime: row.CheckInTime,
|
|
83
82
|
IsLex: row.IsLex ? row.IsLex.toString() === '1' : false,
|
|
@@ -277,7 +276,7 @@ const TMViewHistoryDcmt = (props) => {
|
|
|
277
276
|
{ dataField: "Version", caption: "V.", dataType: 'number' },
|
|
278
277
|
{ dataField: "FileSizeDisplay", caption: SDKUI_Localizator.Size },
|
|
279
278
|
{ dataField: "UpdaterDisplayName", caption: SDKUI_Localizator.Author },
|
|
280
|
-
{ dataField: "
|
|
279
|
+
{ dataField: "LastUpdateTime", caption: SDKUI_Localizator.LastUpdateTime, dataType: 'datetime', format: 'dd/MM/yyyy HH:mm:ss', },
|
|
281
280
|
]);
|
|
282
281
|
}, [showId]);
|
|
283
282
|
return _jsx(TMModal, { title: `${SDKUI_Localizator.SearchResult} \u2014 ${SDKUI_Localizator.History + ": " + (fromDTD.nameLoc ?? SDKUI_Localizator.Document) + " (DID:" + inputDcmt.DID})`, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '80%', '80%', '95%'), onClose: onClose, children: _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: _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showLocalWaitPanel, showWaitPanelPrimary: showLocalPrimary, waitPanelTitle: waitLocalPanelTitle, waitPanelTextPrimary: waitLocalPanelTextPrimary, waitPanelValuePrimary: waitLocalPanelValuePrimary, waitPanelMaxValuePrimary: waitLocalPanelMaxValuePrimary, isCancelable: true, abortController: abortLocalController, children: [_jsx(TMDataGrid, { dataSource: dcmtHistory, dataColumns: dataColumns, focusedRowKey: focusedRowKey, selection: selection, customContextMenuItems: customContextMenuItems, onFocusedRowChanged: onFocusedRowChanged, onCellDblClick: onCellDblClick, noDataText: SDKUI_Localizator.NoDataToDisplay, showSearchPanel: showSearch }), (showDcmtForm && selectedDcmt !== undefined) &&
|
|
@@ -175,14 +175,11 @@ export const parseQueryDescriptorXml = (xmlString) => {
|
|
|
175
175
|
return SearchEngine.NormalizeQueryDescriptor(queryDescriptor);
|
|
176
176
|
};
|
|
177
177
|
export const serializeQueryDescriptorXml = async (qd) => {
|
|
178
|
-
// try {
|
|
179
178
|
if (!qd)
|
|
180
179
|
return '';
|
|
180
|
+
// Per compatibilità con V5, assicurati che ogni JoinItem abbia un alias (anche se vuoto) prima della serializzazione,
|
|
181
|
+
// poiché la logica di serializzazione potrebbe aspettarsi questa proprietà.
|
|
182
|
+
qd.join?.forEach(join => { join.alias ??= ""; });
|
|
181
183
|
let xml = await SDK_Globals.tmSession?.NewDcmtPlatformEngine().UtilsSerializeQdAsync(qd) ?? '';
|
|
182
184
|
return xml;
|
|
183
|
-
// } catch (error) {
|
|
184
|
-
// console.error('Error serializing QueryDescriptor to XML:', error);
|
|
185
|
-
//TODO: gestire errore
|
|
186
|
-
// return '';
|
|
187
|
-
// }
|
|
188
185
|
};
|
|
@@ -5,6 +5,7 @@ interface TMBlogAttachmentsProps {
|
|
|
5
5
|
layoutMode: "compact" | "extended";
|
|
6
6
|
attachments: Array<BlogPostAttachment>;
|
|
7
7
|
isSelected: boolean;
|
|
8
|
+
isLoading?: boolean;
|
|
8
9
|
searchText: string;
|
|
9
10
|
dcmtTypeDescriptors: Map<number, DcmtTypeDescriptor>;
|
|
10
11
|
treeFs: FileItem | undefined;
|