@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.
Files changed (34) hide show
  1. package/lib/components/base/TMAreaManager.js +18 -3
  2. package/lib/components/base/TMPanel.js +1 -0
  3. package/lib/components/base/TMTreeView.d.ts +2 -1
  4. package/lib/components/base/TMTreeView.js +8 -3
  5. package/lib/components/choosers/TMUserChooser.js +3 -1
  6. package/lib/components/features/archive/TMArchive.js +1 -1
  7. package/lib/components/features/documents/TMDcmtForm.js +12 -8
  8. package/lib/components/features/documents/TMFileUploader.d.ts +1 -1
  9. package/lib/components/features/documents/TMFileUploader.js +3 -3
  10. package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +27 -2
  11. package/lib/components/features/documents/TMMasterDetailDcmts.js +215 -20
  12. package/lib/components/features/documents/TMRelationViewer.d.ts +12 -1
  13. package/lib/components/features/documents/TMRelationViewer.js +49 -10
  14. package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
  15. package/lib/components/features/search/TMSearch.d.ts +1 -0
  16. package/lib/components/features/search/TMSearch.js +2 -2
  17. package/lib/components/features/search/TMSearchResult.d.ts +1 -0
  18. package/lib/components/features/search/TMSearchResult.js +18 -4
  19. package/lib/components/features/search/TMViewHistoryDcmt.js +6 -0
  20. package/lib/components/features/workflow/diagram/DiagramItemForm.js +5 -1
  21. package/lib/components/features/workflow/diagram/WFDiagram.js +7 -1
  22. package/lib/components/features/workflow/diagram/xmlParser.js +13 -14
  23. package/lib/components/pages/TMPage.js +4 -2
  24. package/lib/components/query/TMQueryEditor.js +20 -1
  25. package/lib/helper/SDKUI_Globals.d.ts +2 -0
  26. package/lib/helper/checkinCheckoutManager.d.ts +1 -1
  27. package/lib/helper/checkinCheckoutManager.js +18 -4
  28. package/lib/hooks/useDcmtOperations.d.ts +1 -0
  29. package/lib/hooks/useDcmtOperations.js +75 -4
  30. package/lib/hooks/useDocumentOperations.d.ts +1 -0
  31. package/lib/hooks/useDocumentOperations.js +46 -12
  32. package/lib/hooks/useInputDialog.d.ts +2 -0
  33. package/lib/hooks/useInputDialog.js +34 -0
  34. package/package.json +55 -55
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { DcmtTypeDescriptor, SearchResultDescriptor, DataColumnDescriptor } from "@topconsultnpm/sdk-ts";
3
- import { DcmtInfo } from '../../../ts';
3
+ import { DcmtInfo, MetadataValueDescriptorEx } from '../../../ts';
4
4
  import { ITMTreeItem } from '../../base/TMTreeView';
5
5
  /**
6
6
  * Tree item structure for relations
@@ -22,6 +22,7 @@ export interface RelationTreeItem extends ITMTreeItem {
22
22
  values?: any;
23
23
  searchResult?: SearchResultDescriptor[];
24
24
  itemsCount?: number;
25
+ fileExt?: string;
25
26
  }
26
27
  /**
27
28
  * Props for TMRelationViewer component
@@ -98,6 +99,16 @@ export interface TMRelationViewerProps {
98
99
  * Useful to notify parent component that there are no correlated documents to display.
99
100
  */
100
101
  onNoRelationsFound?: () => void;
102
+ /**
103
+ * Callback invoked when user right-clicks on a tree item.
104
+ * Use to show a context menu.
105
+ */
106
+ onItemContextMenu?: (item: RelationTreeItem, e: React.MouseEvent) => void;
107
+ /**
108
+ * Metadata values for the focused item
109
+ * (used in master-detail context)
110
+ */
111
+ focusedItemFormData?: MetadataValueDescriptorEx[];
101
112
  }
102
113
  /**
103
114
  * Check if document type has detail relations
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
3
- import { DcmtTypeListCacheService, SDK_Globals, DataColumnTypes, MetadataFormats, SystemMIDs, MetadataDataDomains, RelationCacheService, RelationTypes } from "@topconsultnpm/sdk-ts";
4
- import { genUniqueId, IconFolder, IconBackhandIndexPointingRight, IconCircleInfo } from '../../../helper';
3
+ import { DcmtTypeListCacheService, SDK_Globals, DataColumnTypes, MetadataFormats, SystemMIDs, MetadataDataDomains, RelationCacheService, RelationTypes, UserListCacheService } from "@topconsultnpm/sdk-ts";
4
+ import { genUniqueId, IconFolder, IconBackhandIndexPointingRight, IconCircleInfo, getDcmtCicoStatus } from '../../../helper';
5
5
  import { TMColors } from '../../../utils/theme';
6
6
  import { StyledDivHorizontal, StyledBadge } from '../../base/Styled';
7
7
  import TMTreeView from '../../base/TMTreeView';
@@ -136,7 +136,7 @@ export const searchResultToDataSource = async (searchResult, hideSysMetadata) =>
136
136
  }
137
137
  return output;
138
138
  };
139
- const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndicator = true, allowShowZeroDcmts = true, initialShowZeroDcmts = false, allowedTIDs, allowMultipleSelection = false, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onDocumentDoubleClick, customItemRender, customDocumentStyle, customMainContainerContent, customDocumentContent, showMetadataNames = false, maxDepthLevel = 2, invertMasterNavigation = true, additionalStaticItems, showMainDocument = true, labelMainContainer, onNoRelationsFound, }) => {
139
+ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndicator = true, allowShowZeroDcmts = true, initialShowZeroDcmts = false, allowedTIDs, allowMultipleSelection = false, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onDocumentDoubleClick, customItemRender, customDocumentStyle, customMainContainerContent, customDocumentContent, showMetadataNames = false, maxDepthLevel = 2, invertMasterNavigation = true, additionalStaticItems, showMainDocument = true, labelMainContainer, onNoRelationsFound, onItemContextMenu, focusedItemFormData = [] }) => {
140
140
  // State
141
141
  const [dcmtTypes, setDcmtTypes] = useState([]);
142
142
  const [treeData, setTreeData] = useState([]);
@@ -160,6 +160,16 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
160
160
  const userInteractedWithStaticItemsRef = React.useRef(false);
161
161
  // Ref to track the last inputKey for which we set the focused item
162
162
  const lastFocusedInputRef = React.useRef('');
163
+ // State for all users (used for checkout status display)
164
+ const [allUsers, setAllUsers] = useState([]);
165
+ // Load all users for checkout status resolution
166
+ useEffect(() => {
167
+ const fetchAllUsers = async () => {
168
+ const users = await UserListCacheService.GetAllAsync();
169
+ setAllUsers(users ?? []);
170
+ };
171
+ fetchAllUsers();
172
+ }, []);
163
173
  /**
164
174
  * Generate a stable key from inputDcmts to detect real changes
165
175
  */
@@ -234,6 +244,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
234
244
  dcmtDetails.push({
235
245
  tid: tid,
236
246
  did: did,
247
+ dtd: dtd,
237
248
  isLogDel: isLogDel,
238
249
  key: `${tid}_${did}_${searchResult.relationID}_${mTID}_${mDID}_${rowGUID}`,
239
250
  isDcmt: true,
@@ -246,7 +257,8 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
246
257
  // Children will be loaded lazily by calculateItemsForNode when expanded
247
258
  expanded: false,
248
259
  hidden: false,
249
- name: row?.SYS_Abstract?.value || row?.SYS_SUBJECT?.value || `Documento ${did}`
260
+ name: row?.SYS_Abstract?.value || row?.SYS_SUBJECT?.value || `Documento ${did}`,
261
+ fileExt: row?.FILEEXT?.value,
250
262
  // Note: Recursive loading on expansion is handled by calculateItemsForNode
251
263
  });
252
264
  }
@@ -259,7 +271,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
259
271
  console.error('❌ Error loading detail documents:', error);
260
272
  }
261
273
  return items;
262
- }, [allowedTIDs]);
274
+ }, [allowedTIDs, focusedItemFormData, focusedItem?.dtd?.id]);
263
275
  /**
264
276
  * Recursively retrieve master documents
265
277
  */
@@ -318,6 +330,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
318
330
  dcmtMasters.push({
319
331
  tid: tid,
320
332
  did: did,
333
+ dtd: dtd,
321
334
  isLogDel: isLogDel,
322
335
  key: `${tid}_${did}_${searchResult.relationID}_${dTID}_${dDID}_${rowGUID}`,
323
336
  isDcmt: true,
@@ -375,7 +388,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
375
388
  isContainer: false,
376
389
  isDcmt: false,
377
390
  isInfoMessage: true,
378
- isExpandible: false
391
+ isExpandible: false,
379
392
  },
380
393
  ...filteredChildren
381
394
  ];
@@ -608,17 +621,20 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
608
621
  name: docRow?.SYS_Abstract?.value || docRow?.SYS_SUBJECT?.value || `Documento ${isForMaster ? 'Dettaglio' : 'Master'}`,
609
622
  tid: dcmt.TID,
610
623
  did: dcmt.DID,
624
+ dtd: dtd,
611
625
  isDcmt: true,
612
626
  isContainer: false,
613
627
  expanded: false,
614
628
  isZero: dcmt.DID === 0,
615
629
  isMaster: !isForMaster,
616
630
  isLoaded: true,
631
+ isLogDel: docRow?.ISLOGDEL?.value,
617
632
  hidden: false,
618
633
  values: docRow,
619
634
  searchResult: result ? [result] : [],
620
635
  items: relatedDocs,
621
- itemsCount: relatedDocs.length
636
+ itemsCount: relatedDocs.length,
637
+ fileExt: docRow?.FILEEXT?.value
622
638
  };
623
639
  // Check if a type container for this TID already exists in the tree
624
640
  const existingContainer = tree.find(c => c.tid === dcmt.TID && c.isContainer);
@@ -1078,8 +1094,31 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
1078
1094
  const metadataContent = customDocumentContent
1079
1095
  ? customDocumentContent(item, defaultMetadataContent || _jsx(_Fragment, {}))
1080
1096
  : defaultMetadataContent;
1081
- return (_jsxs("div", { onDoubleClick: handleDoubleClick, style: documentStyle, children: [item.did && item.tid && showCurrentDcmtIndicator && inputDcmts?.some(d => d.DID === item.did && d.TID === item.tid) ? _jsx(IconBackhandIndexPointingRight, { fontSize: 22, overflow: 'visible' }) : _jsx(_Fragment, {}), item.values && (_jsx(TMDcmtIcon, { tid: item.values?.TID?.value, did: item.values?.DID?.value, fileExtension: item.values?.FILEEXT?.value, fileCount: item.values?.FILECOUNT?.value, isLexProt: item.values?.IsLexProt?.value, isMail: item.values?.ISMAIL?.value, isShared: item.values?.ISSHARED?.value, isSigned: item.values?.ISSIGNED?.value, downloadMode: 'openInNewWindow' })), metadataContent] }));
1082
- }, [onDocumentDoubleClick, showCurrentDcmtIndicator, inputDcmts, customMainContainerContent, customDocumentStyle, customDocumentContent, showMetadataNames, showMainDocument]);
1097
+ // Calculate checkout status for non-root documents
1098
+ let checkoutStatusIcon = null;
1099
+ if (item.values && item.dtd) {
1100
+ // Convert item.values to flat format expected by getDcmtCicoStatus
1101
+ const flatValues = {};
1102
+ if (item.values) {
1103
+ for (const key of Object.keys(item.values)) {
1104
+ const entry = item.values[key];
1105
+ if (entry?.md?.id && item.tid) {
1106
+ // Create TID_MID key format for metadata
1107
+ flatValues[`${item.tid}_${entry.md.id}`] = entry.value;
1108
+ }
1109
+ // Also add direct key for system properties
1110
+ flatValues[key] = entry?.value;
1111
+ }
1112
+ flatValues.TID = item.tid;
1113
+ flatValues.DID = item.did;
1114
+ }
1115
+ const { checkoutStatus } = getDcmtCicoStatus(flatValues, allUsers, item.dtd);
1116
+ if (checkoutStatus.isCheckedOut && checkoutStatus.icon) {
1117
+ checkoutStatusIcon = checkoutStatus.icon;
1118
+ }
1119
+ }
1120
+ return (_jsxs("div", { onDoubleClick: handleDoubleClick, style: documentStyle, children: [item.did && item.tid && showCurrentDcmtIndicator && inputDcmts?.some(d => d.DID === item.did && d.TID === item.tid) ? _jsx(IconBackhandIndexPointingRight, { fontSize: 22, overflow: 'visible' }) : _jsx(_Fragment, {}), item.values && (_jsx(TMDcmtIcon, { tid: item.values?.TID?.value, did: item.values?.DID?.value, fileExtension: item.values?.FILEEXT?.value, fileCount: item.values?.FILECOUNT?.value, isLexProt: item.values?.IsLexProt?.value, isMail: item.values?.ISMAIL?.value, isShared: item.values?.ISSHARED?.value, isSigned: item.values?.ISSIGNED?.value, downloadMode: 'openInNewWindow' })), checkoutStatusIcon, metadataContent] }));
1121
+ }, [onDocumentDoubleClick, showCurrentDcmtIndicator, inputDcmts, customMainContainerContent, customDocumentStyle, customDocumentContent, showMetadataNames, showMainDocument, focusedItemFormData, focusedItem?.dtd, allUsers]);
1083
1122
  /**
1084
1123
  * Wrapper renderer that handles custom rendering if provided
1085
1124
  */
@@ -1130,7 +1169,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
1130
1169
  return null;
1131
1170
  return _jsx("div", { style: { padding: '20px', textAlign: 'center', color: '#666' }, children: "Nessuna relazione disponibile." });
1132
1171
  }
1133
- return (_jsxs(_Fragment, { children: [_jsx(TMTreeView, { dataSource: mergedTreeData, itemRender: finalItemRender, calculateItemsForNode: calculateItemsForNode, onDataChanged: handleDataChanged, focusedItem: focusedItem, onFocusedItemChanged: handleFocusedItemChanged, allowMultipleSelection: allowMultipleSelection, selectedItems: selectedItems, itemsPerPage: 100, onSelectionChanged: handleSelectedItemsChanged }), showExpansionWaitPanel && (_jsx(TMWaitPanel, { title: isForMaster ? 'Caricamento documenti master' : 'Caricamento documenti dettaglio', showPrimary: true, textPrimary: expansionWaitPanelText, valuePrimary: expansionWaitPanelValue, maxValuePrimary: expansionWaitPanelMaxValue, isCancelable: true, abortController: expansionAbortController, onAbortClick: (abortController) => {
1172
+ return (_jsxs(_Fragment, { children: [_jsx(TMTreeView, { dataSource: mergedTreeData, itemRender: finalItemRender, calculateItemsForNode: calculateItemsForNode, onDataChanged: handleDataChanged, focusedItem: focusedItem, onFocusedItemChanged: handleFocusedItemChanged, allowMultipleSelection: allowMultipleSelection, selectedItems: selectedItems, itemsPerPage: 100, onSelectionChanged: handleSelectedItemsChanged, onItemContextMenu: onItemContextMenu }), showExpansionWaitPanel && (_jsx(TMWaitPanel, { title: isForMaster ? 'Caricamento documenti master' : 'Caricamento documenti dettaglio', showPrimary: true, textPrimary: expansionWaitPanelText, valuePrimary: expansionWaitPanelValue, maxValuePrimary: expansionWaitPanelMaxValue, isCancelable: true, abortController: expansionAbortController, onAbortClick: (abortController) => {
1134
1173
  setTimeout(() => {
1135
1174
  abortController?.abort();
1136
1175
  }, 100);
@@ -201,7 +201,7 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
201
201
  alignItems: 'center',
202
202
  justifyContent: 'center',
203
203
  minWidth: 0
204
- }, children: [_jsx("p", { style: {
204
+ }, children: [_jsx("p", { title: sqd.name, style: {
205
205
  fontSize: '1rem',
206
206
  fontWeight: sqd.id === 1 ? 600 : 'normal',
207
207
  whiteSpace: 'nowrap',
@@ -27,6 +27,7 @@ interface ITMSearchProps {
27
27
  openS4TViewer?: boolean;
28
28
  onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: (() => Promise<void>)) => void;
29
29
  onOpenPdfEditorRequest?: ((dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void);
30
+ openFileUploaderPdfEditor?: (fromDTD?: DcmtTypeDescriptor, file?: File | null, handleFile?: (file: File) => void) => void;
30
31
  showTodoDcmtForm?: boolean;
31
32
  showToppyDraggableHelpCenter?: boolean;
32
33
  toppyHelpCenterUsePortal?: boolean;
@@ -19,7 +19,7 @@ var TMSearchViews;
19
19
  TMSearchViews[TMSearchViews["Search"] = 0] = "Search";
20
20
  TMSearchViews[TMSearchViews["Result"] = 1] = "Result";
21
21
  })(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, showTodoDcmtForm, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, passToArchiveCallback, onCurrentTIDChangedCallback, onlyShowSearchQueryPanel, onReferenceClick }) => {
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
23
  const [allSQDs, setAllSQDs] = useState([]);
24
24
  const [filteredByTIDSQDs, setFilteredByTIDSQDs] = useState([]);
25
25
  const [currentSQD, setCurrentSQD] = useState();
@@ -258,7 +258,7 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
258
258
  toolbarOptions: { icon: _jsx(IconSavedQuery, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['TMSavedQuerySelector'] }
259
259
  }
260
260
  ], [tmTreeSelectorElement, showSearchResults, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement, fromDTD, mruTIDs]);
261
- return (_jsxs(_Fragment, { children: [showSearchResults ? _jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true, minPanelSizePx: !isMobile ? 250 : 150 }) }) }) : tmSearchQueryPanelElement, showSearchResults && _jsx(TMSearchResult, { isVisible: isVisible && currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, openInOffice: openInOffice, onRefreshSearchAsyncDatagrid: onRefreshSearchAsyncDatagrid, onClose: () => { onlyShowSearchQueryPanel ? setShowSearchResults(false) : setCurrentSearchView(TMSearchViews.Search); }, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, passToArchiveCallback: passToArchiveCallback, onSelectedTIDChanged: onCurrentTIDChangedCallback, showTodoDcmtForm: showTodoDcmtForm, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers })] }));
261
+ return (_jsxs(_Fragment, { children: [showSearchResults ? _jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true, minPanelSizePx: !isMobile ? 250 : 150 }) }) }) : tmSearchQueryPanelElement, showSearchResults && _jsx(TMSearchResult, { isVisible: isVisible && currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, openInOffice: openInOffice, onRefreshSearchAsyncDatagrid: onRefreshSearchAsyncDatagrid, onClose: () => { onlyShowSearchQueryPanel ? setShowSearchResults(false) : setCurrentSearchView(TMSearchViews.Search); }, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, openFileUploaderPdfEditor: openFileUploaderPdfEditor, passToArchiveCallback: passToArchiveCallback, onSelectedTIDChanged: onCurrentTIDChangedCallback, showTodoDcmtForm: showTodoDcmtForm, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers })] }));
262
262
  };
263
263
  export default TMSearch;
264
264
  const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
@@ -45,6 +45,7 @@ interface ITMSearchResultProps {
45
45
  }>, tid?: number) => void;
46
46
  onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void;
47
47
  onOpenPdfEditorRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void;
48
+ openFileUploaderPdfEditor?: (fromDTD?: DcmtTypeDescriptor, file?: File | null, handleFile?: (file: File) => void) => void;
48
49
  openCommentFormCallback?: (documents: Array<DcmtInfo>) => void;
49
50
  openAddDocumentForm?: () => void;
50
51
  allTasks?: Array<TaskDescriptor>;
@@ -56,7 +56,7 @@ groupId, searchResults = [], context = SearchResultContext.METADATA_SEARCH, titl
56
56
  // Boolean flags to enable/disable features
57
57
  isVisible = true, allowRelations = true, openDcmtFormAsModal = false, showSearchResultSidebar = true, showDcmtFormSidebar = true, showSelector = false, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, showBackButton = true, disableAccordionIfSingleCategory = false, editPdfForm = false, openS4TViewer = false, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, showNoDcmtFoundMessage = true, enablePinIcons = true,
58
58
  // Callbacks (optional)
59
- openInOffice, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsyncDatagrid, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onTaskCreateRequest, openWGsCopyMoveForm, openCommentFormCallback, openAddDocumentForm, onOpenS4TViewerRequest, onOpenPdfEditorRequest, passToArchiveCallback, onReferenceClick,
59
+ openInOffice, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsyncDatagrid, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onTaskCreateRequest, openWGsCopyMoveForm, openCommentFormCallback, openAddDocumentForm, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor, passToArchiveCallback, onReferenceClick,
60
60
  // Tasks
61
61
  allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback,
62
62
  // Navigation
@@ -346,12 +346,13 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
346
346
  openWGsCopyMoveForm,
347
347
  onOpenS4TViewerRequest,
348
348
  onOpenPdfEditorRequest,
349
+ openFileUploaderPdfEditor,
349
350
  // Task related
350
351
  onTaskCreateRequest,
351
352
  openTaskFormHandler,
352
353
  },
353
354
  });
354
- 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;
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, FileSourceDialog, }, relatedDocumentsInfo: { isOpenDetails, isOpenMaster, checkRelatedDcmtsArchiveCapability, checkManyToManyCapability, }, toppyOperations: { showApprovePopup, showRejectPopup, showReAssignPopup, showMoreInfoPopup, updateShowApprovePopup, updateShowRejectPopup, updateShowReAssignPopup, updateShowMoreInfoPopup } } = features;
355
356
  const deviceType = useDeviceType();
356
357
  const isMobile = deviceType === DeviceType.MOBILE;
357
358
  const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
@@ -657,6 +658,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
657
658
  }
658
659
  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, "..."] }))] }))] })] }));
659
660
  }, [selectedSearchResult, focusedItem, indexingInfo, showIndexingInfo, loadingIndexingInfo]);
661
+ const isBoardDisabled = useMemo(() => fromDTD?.hasBlog !== 1, [fromDTD?.hasBlog]);
660
662
  const allInitialPanelVisibility = {
661
663
  'tmSearchResult': true,
662
664
  'tmBlog': false,
@@ -725,9 +727,9 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
725
727
  width: '100%',
726
728
  height: '100%',
727
729
  }, children: _jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showCicoWaitPanel, showWaitPanelPrimary: showCicoPrimaryProgress, waitPanelTitle: cicoWaitPanelTitle, waitPanelTextPrimary: cicoPrimaryProgressText, waitPanelValuePrimary: cicoPrimaryProgressValue, waitPanelMaxValuePrimary: cicoPrimaryProgressMax, isCancelable: true, abortController: abortControllerLocal, children: (groupId && groupId.length > 0) ?
728
- _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showSearchResultSidebar })
730
+ _jsxs(_Fragment, { children: [_jsx(PanelDisabledStateHandler, { isBoardDisabled: isBoardDisabled }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showSearchResultSidebar })] })
729
731
  :
730
- _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmSearchResult', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showSearchResultSidebar }) }) }) }) }), renderDcmtOperations] }));
732
+ _jsxs(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmSearchResult', children: [_jsx(PanelDisabledStateHandler, { isBoardDisabled: isBoardDisabled }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showSearchResultSidebar })] }) }) }) }), renderDcmtOperations] }));
731
733
  };
732
734
  export default TMSearchResult;
733
735
  const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, inputFocusedItem, allowMultipleSelection = true, showExportForm = false, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, onSelectionChanged, onDblClick, showSearchTMDatagrid, updateDataColumnsFromDataGrid, updateDataSourceFromDataGrid, updateSelectedRowKeysFromDataGrid }) => {
@@ -1237,6 +1239,18 @@ const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCa
1237
1239
  return (_jsx(TMAccordionNew, { groups: accordionGroups, selectedItem: selectedResult, onSelectedItemChange: (result) => handleSelect(result) }));
1238
1240
  };
1239
1241
  //#endregion TMSearchResultSelector
1242
+ const PanelDisabledStateHandler = ({ isBoardDisabled }) => {
1243
+ const { setPanelVisibilityById, setToolbarButtonDisabled, panelVisibility } = useTMPanelManagerContext();
1244
+ useEffect(() => {
1245
+ // Aggiorna lo stato disabled del bottone toolbar
1246
+ setToolbarButtonDisabled('tmBlog', isBoardDisabled);
1247
+ // Chiude il pannello solo se è attualmente visibile e deve essere disabilitato
1248
+ if (isBoardDisabled && panelVisibility['tmBlog']) {
1249
+ setPanelVisibilityById('tmBlog', false);
1250
+ }
1251
+ }, [isBoardDisabled, setPanelVisibilityById, setToolbarButtonDisabled, panelVisibility]);
1252
+ return null;
1253
+ };
1240
1254
  const TMDcmtPreviewWrapper = ({ refreshPreviewTrigger, currentDcmt, isVisible }) => {
1241
1255
  const { setPanelVisibilityById, toggleMaximize, isResizingActive, countVisibleLeafPanels } = useTMPanelManagerContext();
1242
1256
  const deviceType = useDeviceType();
@@ -87,6 +87,12 @@ const TMViewHistoryDcmt = (props) => {
87
87
  IsSigned: row.IsSigned ? row.IsSigned.toString() === '1' : false,
88
88
  };
89
89
  });
90
+ // Sort by LastUpdateTime ascending
91
+ historyFileItems.sort((a, b) => {
92
+ const dateA = a.LastUpdateTime ? new Date(a.LastUpdateTime).getTime() : 0;
93
+ const dateB = b.LastUpdateTime ? new Date(b.LastUpdateTime).getTime() : 0;
94
+ return dateA - dateB;
95
+ });
90
96
  return historyFileItems;
91
97
  }
92
98
  return [];
@@ -70,7 +70,11 @@ const ButtonsContainer = styled.div `
70
70
  `;
71
71
  const SET_RULE_DATASOURCE = [
72
72
  { value: WorkItemSetRules.Ands_AND_Ors, display: "Ands_AND_Ors" },
73
- { value: WorkItemSetRules.Ands_OR_Ors, display: "Ands_OR_Ors" }
73
+ { value: WorkItemSetRules.Ands_OR_Ors, display: "Ands_OR_Ors" },
74
+ { value: WorkItemSetRules.Ands_AND_Ors_AssignModeOrs, display: "Ands_AND_Ors_AssignModeOrs" },
75
+ { value: WorkItemSetRules.Ands_OR_Ors_AssignModeOrs, display: "Ands_OR_Ors_AssignModeOrs" },
76
+ { value: WorkItemSetRules.Ands_AND_Ors_WaitForAllAnds, display: "Ands_AND_Ors_WaitForAllAnds" },
77
+ { value: WorkItemSetRules.Ands_OR_Ors_WaitForAllAnds, display: "Ands_OR_Ors_WaitForAllAnds" }
74
78
  ];
75
79
  const SEVERITY_DATASOURCE = [
76
80
  { value: Severities.Critical, display: "Critical" },
@@ -341,6 +341,7 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
341
341
  const isUndoingRedoing = useRef(false);
342
342
  const initialDiagramRef = useRef(null);
343
343
  const notifiedXmlRef = useRef(null);
344
+ const serializationGenRef = useRef(0);
344
345
  const svgRef = useRef(null);
345
346
  const containerRef = useRef(null);
346
347
  const [isDrawingConnection, setIsDrawingConnection] = useState(false);
@@ -430,10 +431,15 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
430
431
  setHistoryIndex(newHistory.length);
431
432
  }
432
433
  setWfDiagram(newDiagram);
434
+ const currentGen = ++serializationGenRef.current;
433
435
  (async () => {
434
436
  try {
435
437
  // await è necessario per attendere il risultato stringa
436
438
  const newXml = await serializeWfDiagramToXml(newDiagram);
439
+ // Ignora serializzazioni obsolete: se nel frattempo è partita una nuova serializzazione,
440
+ // questa è vecchia e non deve sovrascrivere il risultato più recente.
441
+ if (currentGen !== serializationGenRef.current)
442
+ return;
437
443
  notifiedXmlRef.current = newXml;
438
444
  // Chiama il callback per notificare TMWFEditor
439
445
  // L'invio dell'XML al genitore avviene solo a serializzazione completata.
@@ -449,7 +455,7 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
449
455
  catch (e) {
450
456
  TMExceptionBoxManager.show({ exception: e });
451
457
  }
452
- }, [wfDiagramHistory, historyIndex, isUndoingRedoing, setWfDiagramHistory, setHistoryIndex, setWfDiagram, isReadOnly]);
458
+ }, [wfDiagramHistory, historyIndex, isUndoingRedoing, setWfDiagramHistory, setHistoryIndex, setWfDiagram, isReadOnly, onDiagramChange]);
453
459
  const handleUndo = useCallback(() => {
454
460
  if (isReadOnly)
455
461
  return;
@@ -67,14 +67,13 @@ export const getSeveritiesNumber = (severity) => {
67
67
  };
68
68
  export const getWorkItemSetRulesNumber = (setRule) => {
69
69
  switch (setRule) {
70
- case WorkItemSetRules.Ands_AND_Ors:
71
- return 0;
72
- case WorkItemSetRules.Ands_OR_Ors:
73
- return 1;
74
- case WorkItemSetRules.Custom:
75
- return 2;
76
- default:
77
- return 0;
70
+ case WorkItemSetRules.Ands_AND_Ors: return 0;
71
+ case WorkItemSetRules.Ands_OR_Ors: return 1;
72
+ case WorkItemSetRules.Ands_AND_Ors_AssignModeOrs: return 2;
73
+ case WorkItemSetRules.Ands_OR_Ors_AssignModeOrs: return 3;
74
+ case WorkItemSetRules.Ands_AND_Ors_WaitForAllAnds: return 4;
75
+ case WorkItemSetRules.Ands_OR_Ors_WaitForAllAnds: return 5;
76
+ default: return 0;
78
77
  }
79
78
  };
80
79
  export const getWFAppTypesNumber = (appType) => {
@@ -147,12 +146,12 @@ const mapSeverity = (severityValue) => {
147
146
  // Funzione helper per mappare i valori numerici di WorkItemSetRules
148
147
  const mapWorkItemSetRules = (ruleValue) => {
149
148
  switch (ruleValue) {
150
- case 0:
151
- return WorkItemSetRules.Ands_AND_Ors;
152
- case 1:
153
- return WorkItemSetRules.Ands_OR_Ors;
154
- case 2:
155
- return WorkItemSetRules.Custom;
149
+ case 0: return WorkItemSetRules.Ands_AND_Ors;
150
+ case 1: return WorkItemSetRules.Ands_OR_Ors;
151
+ case 2: return WorkItemSetRules.Ands_AND_Ors_AssignModeOrs;
152
+ case 3: return WorkItemSetRules.Ands_OR_Ors_AssignModeOrs;
153
+ case 4: return WorkItemSetRules.Ands_AND_Ors_WaitForAllAnds;
154
+ case 5: return WorkItemSetRules.Ands_OR_Ors_WaitForAllAnds;
156
155
  default:
157
156
  console.warn(`Valore WorkItemSetRules sconosciuto: ${ruleValue}. Ritorno WorkItemSetRules.Ands_AND_Ors.`);
158
157
  return WorkItemSetRules.Ands_AND_Ors;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import React, { useState, useEffect } from "react";
3
3
  import { SDK_Globals, ObjectClasses, ResultTypes } from "@topconsultnpm/sdk-ts";
4
4
  import DataGrid, { Column, GroupPanel, Grouping, HeaderFilter, LoadPanel, Pager, Paging, Scrolling, SearchPanel, Selection } from "devextreme-react/data-grid";
@@ -215,7 +215,9 @@ const TMPage = ({ id, objClass = ObjectClasses.None, listDisabled = false, lastR
215
215
  return;
216
216
  setSelectedItems([row.data]);
217
217
  setShowList(false);
218
- }, showColumnLines: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.showColumnLines) === 1, showRowLines: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.showRowLines) === 1, onSelectionChanged: (e) => { setSelectedItems(e.selectedRowsData); onSelectionChanged?.(e.selectedRowsData); }, children: [_jsx(GroupPanel, { visible: !!(deviceType !== DeviceType.MOBILE && showAllColumns) }), _jsx(SearchPanel, { visible: false }), _jsx(Grouping, { autoExpandAll: false }), _jsx(HeaderFilter, { visible: true }), _jsx(Selection, { mode: "multiple", showCheckBoxesMode: "onClick", selectAllMode: 'allPages' }), _jsx(Scrolling, { mode: "standard", useNative: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar) === 1 }), _jsx(Paging, { pageSize: 25 }), _jsx(Pager, { visible: true, showInfo: true, showNavigationButtons: true }), _jsx(LoadPanel, { enabled: true }), _jsx(Column, { width: 20, cellRender: cellRenderObjectIcon }), _jsx(Column, { width: 'auto', visible: showId, dataField: "id", caption: "ID" }), _jsx(Column, { width: 250, dataField: "name", caption: SDKUI_Localizator.Name, sortOrder: "asc" }), _jsx(Column, { width: 250, visible: showAllColumns, dataField: "description", caption: SDKUI_Localizator.Description }), customColumns?.map((item, index) => { return React.cloneElement(item, { key: index, visible: showAllColumns }); }), _jsx(Column, { width: 'auto', visible: showAllColumns, dataField: "ownerID", caption: SDKUI_Localizator.OwnerID }), _jsx(Column, { width: 'auto', visible: showAllColumns, dataField: "ownerName", caption: SDKUI_Localizator.OwnerName }), _jsx(Column, { width: 'auto', dataType: "date", format: Globalization.getDateDisplayFormat(), visible: showAllColumns, dataField: "creationTime", caption: SDKUI_Localizator.CreationTime }), _jsx(Column, { width: 'auto', dataType: "date", format: Globalization.getDateDisplayFormat(), visible: showAllColumns, dataField: "lastUpdateTime", caption: SDKUI_Localizator.LastUpdateTime })] })] }), detailInsteadOfContent ??
218
+ }, showColumnLines: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.showColumnLines) === 1, showRowLines: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.showRowLines) === 1, onSelectionChanged: (e) => { setSelectedItems(e.selectedRowsData); onSelectionChanged?.(e.selectedRowsData); }, children: [_jsx(GroupPanel, { visible: !!(deviceType !== DeviceType.MOBILE && showAllColumns) }), _jsx(SearchPanel, { visible: false }), _jsx(Grouping, { autoExpandAll: false }), _jsx(HeaderFilter, { visible: true }), _jsx(Selection, { mode: "multiple", showCheckBoxesMode: "onClick", selectAllMode: 'allPages' }), _jsx(Scrolling, { mode: "standard", useNative: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar) === 1 }), _jsx(Paging, { pageSize: 25 }), _jsx(Pager, { visible: true, showInfo: true, showNavigationButtons: true }), _jsx(LoadPanel, { enabled: true }), _jsx(Column, { width: 20, cellRender: cellRenderObjectIcon }), _jsx(Column, { width: 'auto', visible: showId, dataField: "id", caption: "ID" }), _jsx(Column, { width: 250, dataField: "name", caption: SDKUI_Localizator.Name, sortOrder: "asc" }), objClass == ObjectClasses.User ?
219
+ _jsxs(_Fragment, { children: [_jsx(Column, { width: 'auto', dataField: "type", caption: SDKUI_Localizator.Type }), _jsx(Column, { width: 'auto', dataField: "fn", caption: SDKUI_Localizator.User_FirstName }), _jsx(Column, { width: 'auto', dataField: "ln", caption: SDKUI_Localizator.User_LastName })] })
220
+ : _jsx(_Fragment, {}), _jsx(Column, { width: 250, visible: objClass == ObjectClasses.User ? true : showAllColumns, dataField: "description", caption: SDKUI_Localizator.Description }), customColumns?.map((item, index) => { return React.cloneElement(item, { key: index, visible: showAllColumns }); }), _jsx(Column, { width: 'auto', visible: showAllColumns, dataField: "ownerID", caption: SDKUI_Localizator.OwnerID }), _jsx(Column, { width: 'auto', visible: showAllColumns, dataField: "ownerName", caption: SDKUI_Localizator.OwnerName }), _jsx(Column, { width: 'auto', dataType: "date", format: Globalization.getDateDisplayFormat(), visible: showAllColumns, dataField: "creationTime", caption: SDKUI_Localizator.CreationTime }), _jsx(Column, { width: 'auto', dataType: "date", format: Globalization.getDateDisplayFormat(), visible: showAllColumns, dataField: "lastUpdateTime", caption: SDKUI_Localizator.LastUpdateTime })] })] }), detailInsteadOfContent ??
219
221
  _jsx(TMLayoutItem, { children: selectedItems.length == 1 || formMode == FormModes.Create || formMode == FormModes.Duplicate ?
220
222
  _jsx(TMToolbarCard, { onBack: deviceType === DeviceType.MOBILE ? () => setShowList(true) : undefined, title: calcSaveFormTitle(objName, formMode, selectedItems.length == 0 ? -1 : selectedItems[0].id, detailTitlePathKeys), children: getDetailFormWithProps() })
221
223
  :
@@ -703,7 +703,26 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDis
703
703
  }
704
704
  };
705
705
  // #endregion
706
- return (_jsxs(_Fragment, { children: [_jsxs(TMApplyForm, { isModal: false, formMode: formMode, isModified: calcIsModified(formData, formDataOrig), exception: exception, validationItems: validationItems, hasNavigation: false, customToolbarElements: _jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Search, color: 'tertiary', icon: _jsx(IconSearch, {}), disabled: errorsCount > 0, onClick: async () => await onSearchAsync(formData) }), _jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Count, icon: _jsx(IconCount, {}), disabled: errorsCount > 0, onClick: () => getQueryCountAsync(formData, true) }), SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.SURFER && _jsx(TMButton, { caption: "Passa ad archiviazione", icon: _jsx(IconArchiveDoc, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO Passa ad archiviazione", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } }), SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.SURFER && _jsx(TMButton, { caption: "Vai a risultato", icon: _jsx(IconArrowRight, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO Vai a risultato", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } })] }), showToolbar: showToolbar, showApply: showApply, showUndo: showUndo, showBack: showBack, onApply: () => applyData(), onClose: () => onClose?.(), onUndo: () => setFormData(formDataOrig), children: [_jsxs(Accordion, { elementAttr: { class: 'tm-query-dx-accordion' }, height: height, multiple: true, collapsible: true, repaintChangesOnly: true, deferRendering: false, animationDuration: 0, onContentReady: (e) => {
706
+ const getQueryCountLocalAsync = async (qd, showSpinner) => {
707
+ if (IsParametricQuery(qd)) {
708
+ const qdParams = await confirmQueryParams(qd, lastQdParams);
709
+ setLastQdParams(qdParams);
710
+ if (!qdParams || qdParams.length <= 0)
711
+ return;
712
+ for (const qpd of qdParams) {
713
+ let wi = qd.where?.find(o => o.value1 == qpd.name);
714
+ if (wi)
715
+ wi.value1 = wi.value1?.replace(wi.value1, !qpd.value ? '' : qpd.value.toString());
716
+ else {
717
+ wi = qd.where?.find(o => o.value2 == qpd.name);
718
+ if (wi)
719
+ wi.value2 = wi.value2?.replace(wi.value2, !qpd.value ? '' : qpd.value.toString());
720
+ }
721
+ }
722
+ }
723
+ await getQueryCountAsync(qd, showSpinner);
724
+ };
725
+ return (_jsxs(_Fragment, { children: [_jsxs(TMApplyForm, { isModal: false, formMode: formMode, isModified: calcIsModified(formData, formDataOrig), exception: exception, validationItems: validationItems, hasNavigation: false, customToolbarElements: _jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Search, color: 'tertiary', icon: _jsx(IconSearch, {}), disabled: errorsCount > 0, onClick: async () => await onSearchAsync(formData) }), _jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Count, icon: _jsx(IconCount, {}), disabled: errorsCount > 0, onClick: () => getQueryCountLocalAsync(formData, true) }), SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.SURFER && _jsx(TMButton, { caption: "Passa ad archiviazione", icon: _jsx(IconArchiveDoc, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO Passa ad archiviazione", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } }), SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.SURFER && _jsx(TMButton, { caption: "Vai a risultato", icon: _jsx(IconArrowRight, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO Vai a risultato", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } })] }), showToolbar: showToolbar, showApply: showApply, showUndo: showUndo, showBack: showBack, onApply: () => applyData(), onClose: () => onClose?.(), onUndo: () => setFormData(formDataOrig), children: [_jsxs(Accordion, { elementAttr: { class: 'tm-query-dx-accordion' }, height: height, multiple: true, collapsible: true, repaintChangesOnly: true, deferRendering: false, animationDuration: 0, onContentReady: (e) => {
707
726
  let items = e.component.option("items");
708
727
  if (items && items.length > 0) {
709
728
  for (let i = 0; i < items.length; i++) {
@@ -123,4 +123,6 @@ export declare class DcmtFormSettings {
123
123
  }
124
124
  export declare class SDKUI_Globals {
125
125
  static userSettings: UserSettings;
126
+ /** Global handler for scanner requests. Set by the host app (e.g. surfer) to open the scanner UI. */
127
+ static scanRequestHandler?: (mode: 'new' | 'edit', onFileScanned: (file: File) => void, onCancel: () => void, existingFile?: File) => void;
126
128
  }
@@ -22,7 +22,7 @@ export interface CheckoutInfo {
22
22
  checkoutFolder: string;
23
23
  checkoutName: string;
24
24
  }
25
- interface CheckoutStatusResult {
25
+ export interface CheckoutStatusResult {
26
26
  isCheckedOut: boolean;
27
27
  mode: 'editMode' | 'lockMode' | '';
28
28
  version: number;
@@ -259,8 +259,9 @@ export const getDcmtCicoStatus = (dcmt, allUsers, dtd) => {
259
259
  let checkoutDate;
260
260
  let version = 1;
261
261
  let fileExt;
262
+ let isMetadata = false;
262
263
  // ========================================================================
263
- // CASO 1: Documento come Array di MetadataValueDescriptorEx
264
+ // CASO 1: Documento come Array di MetadataValueDescriptorEx: Form del documento
264
265
  // ========================================================================
265
266
  // Questo formato viene utilizzato quando il documento proviene da query
266
267
  // o liste dove ogni metadato è un oggetto separato con proprietà 'md' e 'value'
@@ -279,9 +280,11 @@ export const getDcmtCicoStatus = (dcmt, allUsers, dtd) => {
279
280
  version = (versionRaw != null && !isNaN(Number(versionRaw))) ? Number(versionRaw) : 1;
280
281
  const fileExtProperty = dcmtsArray.find((item) => item.mid === SystemMIDsAsNumber.FileExt);
281
282
  fileExt = fileExtProperty?.value ? fileExtProperty.value.toString() : null;
283
+ const fileCountProperty = dcmtsArray.find((item) => item.mid === SystemMIDsAsNumber.FileCount);
284
+ isMetadata = !(fileCountProperty?.value && Number(fileCountProperty.value) > 0);
282
285
  }
283
286
  // ========================================================================
284
- // CASO 2: Documento come Oggetto Piatto (formato standard)
287
+ // CASO 2: Documento come Oggetto Piatto (formato standard): Risultato della ricerca
285
288
  // ========================================================================
286
289
  // Questo formato viene utilizzato quando il documento ha proprietà dirette
287
290
  // nel formato chiave-valore: TID, DID, e "TID_MetadataID" per i metadati
@@ -290,6 +293,8 @@ export const getDcmtCicoStatus = (dcmt, allUsers, dtd) => {
290
293
  const CICO_CheckoutUserID_Meta = dtd.metadata?.find(md => md.name === CICO_MetadataNames.CICO_CheckoutUserID);
291
294
  const CICO_CheckoutDate_Meta = dtd.metadata?.find(md => md.name === CICO_MetadataNames.CICO_CheckoutDate);
292
295
  const CICO_Version_Meta = dtd.metadata?.find(md => md.name === CICO_MetadataNames.CICO_Version);
296
+ const fileCountValue = dcmt.FILECOUNT != null ? Number(dcmt.FILECOUNT) : NaN;
297
+ isMetadata = isNaN(fileCountValue) || fileCountValue <= 0;
293
298
  fileExt = dcmt.FILEEXT ? dcmt.FILEEXT.toString() : null;
294
299
  // Estrai l'ID dell'utente che ha effettuato il checkout
295
300
  if (CICO_CheckoutUserID_Meta?.id) {
@@ -310,6 +315,15 @@ export const getDcmtCicoStatus = (dcmt, allUsers, dtd) => {
310
315
  }
311
316
  }
312
317
  // ========================================================================
318
+ // EARLY RETURN: Documento di soli metadati (senza file)
319
+ // ========================================================================
320
+ if (isMetadata) {
321
+ return {
322
+ cicoEnabled: false,
323
+ checkoutStatus: { isCheckedOut: false, mode: '', version: 1, icon: null, editLockTooltipText: null }
324
+ };
325
+ }
326
+ // ========================================================================
313
327
  // COSTRUZIONE DELLO STATO DI CHECKOUT
314
328
  // ========================================================================
315
329
  let checkoutStatus = {
@@ -345,8 +359,8 @@ export const getDcmtCicoStatus = (dcmt, allUsers, dtd) => {
345
359
  // RESTITUZIONE RISULTATO FINALE
346
360
  // ========================================================================
347
361
  return {
348
- // CICO è abilitato se configurato nel DTD e l'utente ha i permessi
349
- cicoEnabled: cicoInfo.CICO === 1 && cicoInfo.CanCICO === AccessLevels.Yes && fileExt !== null && fileExt !== '',
362
+ // CICO è abilitato se configurato nel DTD, l'utente ha i permessi e il documento non è di soli metadati
363
+ cicoEnabled: cicoInfo.CICO === 1 && cicoInfo.CanCICO === AccessLevels.Yes && fileExt !== null && fileExt !== '' && !isMetadata,
350
364
  checkoutStatus: checkoutStatus
351
365
  };
352
366
  };
@@ -21,5 +21,6 @@ export interface UseDcmtOperationsReturn {
21
21
  removeDcmtsFileCache: (key: string) => void;
22
22
  isDcmtFileInCache: (key: string) => boolean;
23
23
  runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>;
24
+ FileSourceDialog: () => JSX.Element;
24
25
  }
25
26
  export declare const useDcmtOperations: () => UseDcmtOperationsReturn;