@topconsultnpm/sdkui-react 6.21.0-dev2.3 → 6.21.0-dev2.30

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 (50) hide show
  1. package/lib/components/base/TMAccordionNew.d.ts +1 -0
  2. package/lib/components/base/TMAccordionNew.js +6 -5
  3. package/lib/components/base/TMAreaManager.js +19 -3
  4. package/lib/components/base/TMDataGrid.js +2 -2
  5. package/lib/components/base/TMPanel.d.ts +7 -4
  6. package/lib/components/base/TMPanel.js +58 -26
  7. package/lib/components/choosers/TMDistinctValues.js +35 -21
  8. package/lib/components/editors/TMDateBox.js +4 -2
  9. package/lib/components/editors/TMFormulaEditor.d.ts +2 -0
  10. package/lib/components/editors/TMFormulaEditor.js +75 -21
  11. package/lib/components/editors/TMMetadataValues.js +2 -1
  12. package/lib/components/editors/TMRadioButton.js +2 -1
  13. package/lib/components/editors/TMTextArea.d.ts +2 -0
  14. package/lib/components/editors/TMTextArea.js +6 -3
  15. package/lib/components/features/documents/TMDcmtForm.d.ts +1 -0
  16. package/lib/components/features/documents/TMDcmtForm.js +105 -27
  17. package/lib/components/features/documents/TMDcmtFormActionButtons.js +17 -2
  18. package/lib/components/features/documents/TMDcmtPreview.d.ts +1 -0
  19. package/lib/components/features/documents/TMDcmtPreview.js +2 -2
  20. package/lib/components/features/documents/TMDcmtTasks.d.ts +1 -0
  21. package/lib/components/features/documents/TMDcmtTasks.js +2 -2
  22. package/lib/components/features/search/SignatureParamsManager.d.ts +70 -0
  23. package/lib/components/features/search/SignatureParamsManager.js +145 -0
  24. package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
  25. package/lib/components/features/search/TMSavedQuerySelector.js +3 -2
  26. package/lib/components/features/search/TMSearch.d.ts +2 -1
  27. package/lib/components/features/search/TMSearch.js +15 -9
  28. package/lib/components/features/search/TMSearchQueryPanel.js +1 -1
  29. package/lib/components/features/search/TMSearchResult.js +65 -18
  30. package/lib/components/features/search/TMViewHistoryDcmt.js +1 -2
  31. package/lib/components/features/workflow/diagram/queryDescriptorParser.js +3 -6
  32. package/lib/components/grids/TMBlogAttachments.d.ts +1 -0
  33. package/lib/components/grids/TMBlogAttachments.js +38 -12
  34. package/lib/components/grids/TMBlogsPost.js +7 -1
  35. package/lib/components/grids/TMBlogsPostUtils.js +11 -17
  36. package/lib/components/index.d.ts +1 -0
  37. package/lib/components/index.js +1 -0
  38. package/lib/components/pages/TMPage.js +3 -1
  39. package/lib/components/viewers/TMTidViewer.js +1 -1
  40. package/lib/helper/GlobalStyles.js +6 -0
  41. package/lib/helper/SDKUI_Localizator.d.ts +49 -0
  42. package/lib/helper/SDKUI_Localizator.js +492 -0
  43. package/lib/helper/TMPdfViewer.js +25 -24
  44. package/lib/hooks/useDataUserIdItem.js +6 -4
  45. package/lib/hooks/useDocumentOperations.d.ts +1 -0
  46. package/lib/hooks/useDocumentOperations.js +8 -6
  47. package/lib/hooks/useForm.js +5 -2
  48. package/lib/hooks/useResizeObserver.d.ts +1 -1
  49. package/lib/hooks/useResizeObserver.js +16 -15
  50. package/package.json +2 -2
@@ -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
- if (inputSqdID) {
54
- SavedQueryCacheService.GetAsync(inputSqdID).then(async (resultSqd) => {
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',
@@ -101,6 +101,15 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
101
101
  // State to control the layout of the custom buttons
102
102
  const [customButtonsLayout, setCustomButtonsLayout] = useState();
103
103
  const [allUsers, setAllUsers] = useState([]);
104
+ const [isBoardDisabled, setIsBoardDisabled] = useState(true);
105
+ useEffect(() => {
106
+ if (!fromDTD) {
107
+ setIsBoardDisabled(false);
108
+ return;
109
+ }
110
+ const newValue = fromDTD.hasBlog !== undefined && fromDTD.hasBlog !== 1;
111
+ setIsBoardDisabled(newValue);
112
+ }, [fromDTD]);
104
113
  useEffect(() => {
105
114
  const fetchAllUsers = async () => {
106
115
  const users = await UserListCacheService.GetAllAsync();
@@ -318,6 +327,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
318
327
  allowFloatingBar,
319
328
  enablePinIcons,
320
329
  allowRelations,
330
+ showTodoDcmtForm
321
331
  },
322
332
  tasks: {
323
333
  allTasks: allTasks,
@@ -352,7 +362,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
352
362
  openTaskFormHandler,
353
363
  },
354
364
  });
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;
365
+ 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
366
  const deviceType = useDeviceType();
357
367
  const isMobile = deviceType === DeviceType.MOBILE;
358
368
  const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
@@ -366,6 +376,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
366
376
  useEffect(() => {
367
377
  setSelectedItems([]);
368
378
  updateBatchUpdateForm(false);
379
+ closeDcmtFormHandler();
369
380
  setCurrentSearchResults(searchResults);
370
381
  if (searchResults.length <= 0) {
371
382
  setSelectedSearchResult(undefined);
@@ -512,6 +523,21 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
512
523
  return newResults;
513
524
  });
514
525
  };
526
+ /**
527
+ * Restituisce l'handler onBack per i pannelli, evitando duplicazione di codice.
528
+ * @param isMainPanel - Se true, è il pannello principale dei risultati di ricerca
529
+ */
530
+ const getOnBackHandler = (isMainPanel = false) => {
531
+ // Se showBackButton è false, non mostrare mai il back
532
+ if (showBackButton === false)
533
+ return undefined;
534
+ // Mobile: mostra back su tutti i pannelli (se showBackButton è definito e non è closable)
535
+ if (isMobile) {
536
+ return (showBackButton !== undefined && !isClosable) ? onBack : undefined;
537
+ }
538
+ // Desktop: mostra back solo sul pannello principale dei risultati (se showBackButton è definito e non è closable)
539
+ return (showBackButton !== undefined && isMainPanel && !isClosable) ? onBack : undefined;
540
+ };
515
541
  const removeDcmtFromFavsOrRecents = async () => {
516
542
  switch (selectedSearchResult?.category) {
517
543
  case "Favorites":
@@ -601,7 +627,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
601
627
  ]);
602
628
  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
629
  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]);
630
+ const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { refreshPreviewTrigger: refreshPreviewTrigger, currentDcmt: currentDcmt, onBack: getOnBackHandler() }), [currentDcmt, refreshPreviewTrigger]);
605
631
  // Auto-fetch indexing info when drawer is open and focusedItem changes
606
632
  useEffect(() => {
607
633
  if (!focusedItem || !showIndexingInfo)
@@ -658,7 +684,6 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
658
684
  }
659
685
  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
686
  }, [selectedSearchResult, focusedItem, indexingInfo, showIndexingInfo, loadingIndexingInfo]);
661
- const isBoardDisabled = useMemo(() => fromDTD?.hasBlog !== 1, [fromDTD?.hasBlog]);
662
687
  const allInitialPanelVisibility = {
663
688
  'tmSearchResult': true,
664
689
  'tmBlog': false,
@@ -683,9 +708,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
683
708
  title: getTitleHeader(),
684
709
  showHeader: showToolbarHeader,
685
710
  allowMaximize: !isMobile,
686
- onBack: showBackButton !== undefined
687
- ? (showBackButton ? onBack : undefined)
688
- : ((!isClosable && context === SearchResultContext.METADATA_SEARCH) || (isMobile && context !== SearchResultContext.METADATA_SEARCH && splitterSize[1] === '100%') ? onBack : undefined),
711
+ onBack: getOnBackHandler(true),
689
712
  onClose: isClosable ? onBack : undefined,
690
713
  toolbar: searchResutlToolbar
691
714
  },
@@ -695,27 +718,50 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
695
718
  {
696
719
  id: 'tmBlog',
697
720
  name: SDKUI_Localizator.BlogCase,
698
- contentOptions: { component: tmBlog, panelContainer: { title: SDKUI_Localizator.BlogCase, allowMaximize: !isMobile } },
721
+ contentOptions: {
722
+ component: tmBlog,
723
+ panelContainer: {
724
+ title: SDKUI_Localizator.BlogCase,
725
+ allowMaximize: !isMobile,
726
+ onBack: getOnBackHandler(),
727
+ }
728
+ },
699
729
  toolbarOptions: { icon: _jsx(IconBoard, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmBlog, orderNumber: 2, isActive: allInitialPanelVisibility['tmBlog'] }
700
730
  },
701
731
  {
702
732
  id: 'tmSysMetadata',
703
733
  name: SDKUI_Localizator.MetadataSystem,
704
- contentOptions: { component: tmSysMetadata, panelContainer: { title: SDKUI_Localizator.MetadataSystem, allowMaximize: !isMobile } },
734
+ contentOptions: {
735
+ component: tmSysMetadata,
736
+ panelContainer: {
737
+ title: SDKUI_Localizator.MetadataSystem,
738
+ allowMaximize: !isMobile,
739
+ onBack: getOnBackHandler(),
740
+ }
741
+ },
705
742
  toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmSysMetadata, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
706
743
  },
707
744
  ...(context === SearchResultContext.FREE_SEARCH ? [
708
745
  {
709
746
  id: 'tmFullTextSearch',
710
747
  name: SDKUI_Localizator.ResultDetails,
711
- contentOptions: { component: tmFullTextSearch, panelContainer: { title: SDKUI_Localizator.ResultDetails, allowMaximize: !isMobile } },
748
+ contentOptions: {
749
+ component: tmFullTextSearch,
750
+ panelContainer: {
751
+ title: SDKUI_Localizator.ResultDetails,
752
+ allowMaximize: !isMobile,
753
+ onBack: getOnBackHandler(),
754
+ }
755
+ },
712
756
  toolbarOptions: { icon: _jsx(IconPlatform, { fontSize: 20 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmFullTextSearch, orderNumber: 4, isActive: allInitialPanelVisibility['tmFullTextSearch'] }
713
757
  }
714
758
  ] : []),
715
759
  {
716
760
  id: 'tmDcmtPreview',
717
761
  name: SDKUI_Localizator.PreviewDocument,
718
- contentOptions: { component: tmDcmtPreview },
762
+ contentOptions: {
763
+ component: tmDcmtPreview
764
+ },
719
765
  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
766
  }
721
767
  ], [tmSearchResult, tmBlog, tmSysMetadata, tmDcmtPreview, tmFullTextSearch, showToolbarHeader, context, isMobile]);
@@ -1240,22 +1286,23 @@ const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCa
1240
1286
  };
1241
1287
  //#endregion TMSearchResultSelector
1242
1288
  const PanelDisabledStateHandler = ({ isBoardDisabled }) => {
1243
- const { setPanelVisibilityById, setToolbarButtonDisabled, panelVisibility } = useTMPanelManagerContext();
1289
+ const { setPanelVisibilityById, setToolbarButtonDisabled } = useTMPanelManagerContext();
1244
1290
  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']) {
1291
+ if (isBoardDisabled) {
1292
+ setToolbarButtonDisabled('tmBlog', true);
1249
1293
  setPanelVisibilityById('tmBlog', false);
1250
1294
  }
1251
- }, [isBoardDisabled, setPanelVisibilityById, setToolbarButtonDisabled, panelVisibility]);
1295
+ else {
1296
+ setToolbarButtonDisabled('tmBlog', false);
1297
+ }
1298
+ }, [isBoardDisabled]);
1252
1299
  return null;
1253
1300
  };
1254
- const TMDcmtPreviewWrapper = ({ refreshPreviewTrigger, currentDcmt, isVisible }) => {
1301
+ const TMDcmtPreviewWrapper = ({ refreshPreviewTrigger, currentDcmt, isVisible, onBack }) => {
1255
1302
  const { setPanelVisibilityById, toggleMaximize, isResizingActive, countVisibleLeafPanels } = useTMPanelManagerContext();
1256
1303
  const deviceType = useDeviceType();
1257
1304
  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));
1305
+ 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
1306
  };
1260
1307
  // Styled Components
1261
1308
  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: "LastUpdateTimeDisplay", caption: SDKUI_Localizator.LastUpdateTime },
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;
@@ -1,10 +1,10 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { SDK_Globals } from "@topconsultnpm/sdk-ts";
3
3
  import { getAttachmentInfo, lightenColor, removeFileExtension } from "./TMBlogsPostUtils";
4
4
  import TMDcmtIcon from "../features/documents/TMDcmtIcon";
5
5
  import { IconAttachment } from "../../helper";
6
6
  const TMBlogAttachments = (props) => {
7
- const { layoutMode, attachments, isSelected, searchText, dcmtTypeDescriptors, treeFs, draftLatestInfoMap, archivedDocumentMap, handleAttachmentFocus, openDcmtForm } = props;
7
+ const { layoutMode, attachments, isSelected, isLoading = false, searchText, dcmtTypeDescriptors, treeFs, draftLatestInfoMap, archivedDocumentMap, handleAttachmentFocus, openDcmtForm } = props;
8
8
  const handleMouseEnter = (e, blogPostAttachment, name, fileExt) => {
9
9
  e.currentTarget.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.15)';
10
10
  e.currentTarget.style.backgroundColor = isSelected ? lightenColor("#135596", 40) : '#cfcfcf';
@@ -24,7 +24,7 @@ const TMBlogAttachments = (props) => {
24
24
  };
25
25
  return _jsx("div", { style: { width: "100%", marginTop: "5px", overflow: "hidden" }, children: attachments.map((blogPostAttachment, index) => {
26
26
  const { name, nameElement, tooltipContent, fileExt, archivedDocumentsExist, draftExist } = getAttachmentInfo(blogPostAttachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, isSelected, searchText);
27
- return _jsx("div", { onDoubleClick: (e) => onDoubleClick(e, blogPostAttachment, name, fileExt), onMouseEnter: (e) => handleMouseEnter(e, blogPostAttachment, name, fileExt), onMouseLeave: (e) => handleMouseLeave(e), style: {
27
+ return _jsx("div", { onDoubleClick: (e) => !isLoading && onDoubleClick(e, blogPostAttachment, name, fileExt), onMouseEnter: (e) => !isLoading && handleMouseEnter(e, blogPostAttachment, name, fileExt), onMouseLeave: (e) => !isLoading && handleMouseLeave(e), style: {
28
28
  display: layoutMode === "extended" ? "inline-flex" : "flex",
29
29
  padding: '4px 8px',
30
30
  margin: '4px',
@@ -32,17 +32,43 @@ const TMBlogAttachments = (props) => {
32
32
  borderRadius: '8px',
33
33
  boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)',
34
34
  backgroundColor: isSelected ? "#135596" : "#ffffff",
35
- cursor: "pointer",
35
+ cursor: isLoading ? "default" : "pointer",
36
36
  fontSize: '0.9rem',
37
37
  color: isSelected ? "#ffffff" : "#000000",
38
- }, children: _jsxs("div", { style: { alignItems: 'center', display: 'flex', minWidth: 0 }, children: [(!archivedDocumentsExist && !draftExist) ?
39
- _jsx(IconAttachment, { style: { marginRight: "5px", flexShrink: 0 } }) :
40
- _jsx("div", { style: { marginRight: "10px", flexShrink: 0 }, children: _jsx(TMDcmtIcon, { tid: blogPostAttachment.tid, did: blogPostAttachment.did, fileExtension: fileExt, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent }) }), _jsx("span", { title: layoutMode === 'compact' ? name + " (DID: " + blogPostAttachment.did + ")" : undefined, style: {
41
- whiteSpace: 'nowrap',
42
- overflow: 'hidden',
43
- textOverflow: 'ellipsis',
44
- minWidth: 0,
45
- }, children: nameElement })] }) }, blogPostAttachment.did + "_" + index);
38
+ }, children: _jsx("div", { style: { alignItems: 'center', display: 'flex', minWidth: 0 }, children: isLoading ? (_jsxs(_Fragment, { children: [_jsx("div", { style: {
39
+ width: '16px',
40
+ height: '16px',
41
+ marginRight: '8px',
42
+ border: '2px solid #ddd',
43
+ borderTop: `2px solid ${isSelected ? '#fff' : '#135596'}`,
44
+ borderRadius: '50%',
45
+ animation: 'spin 1s linear infinite',
46
+ flexShrink: 0,
47
+ } }), _jsx("span", { style: {
48
+ background: isSelected ? 'rgba(255,255,255,0.3)' : 'linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%)',
49
+ backgroundSize: '200% 100%',
50
+ animation: 'shimmer 1.5s infinite',
51
+ borderRadius: '4px',
52
+ width: '120px',
53
+ height: '14px',
54
+ display: 'inline-block',
55
+ } }), _jsx("style", { children: `
56
+ @keyframes spin {
57
+ 0% { transform: rotate(0deg); }
58
+ 100% { transform: rotate(360deg); }
59
+ }
60
+ @keyframes shimmer {
61
+ 0% { background-position: -200% 0; }
62
+ 100% { background-position: 200% 0; }
63
+ }
64
+ ` })] })) : (_jsxs(_Fragment, { children: [(!archivedDocumentsExist && !draftExist) ?
65
+ _jsx(IconAttachment, { style: { marginRight: "5px", flexShrink: 0 } }) :
66
+ _jsx("div", { style: { marginRight: "10px", flexShrink: 0 }, children: _jsx(TMDcmtIcon, { tid: blogPostAttachment.tid, did: blogPostAttachment.did, fileExtension: fileExt, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent }) }), _jsx("span", { title: layoutMode === 'compact' ? name + " (DID: " + blogPostAttachment.did + ")" : undefined, style: {
67
+ whiteSpace: 'nowrap',
68
+ overflow: 'hidden',
69
+ textOverflow: 'ellipsis',
70
+ minWidth: 0,
71
+ }, children: nameElement })] })) }) }, blogPostAttachment.did + "_" + index);
46
72
  }) });
47
73
  };
48
74
  export default TMBlogAttachments;
@@ -48,6 +48,7 @@ const TMBlogsPost = (props) => {
48
48
  const [firstUnreadPost, setFirstUnreadPost] = useState(undefined);
49
49
  // State to manage the focused file
50
50
  const [dcmtTypeDescriptors, setDcmtTypeDescriptors] = useState(new Map());
51
+ const [descriptorsLoaded, setDescriptorsLoaded] = useState(false);
51
52
  const [currentHeader, setCurrentHeader] = useState(header);
52
53
  const [isHeaderHidden, setIsHeaderHidden] = useState(isHeaderFullyHidden(currentHeader));
53
54
  const [localShowId, setLocalShowId] = useState(false);
@@ -147,8 +148,13 @@ const TMBlogsPost = (props) => {
147
148
  useEffect(() => {
148
149
  (async () => {
149
150
  if (showExtendedAttachments) {
151
+ setDescriptorsLoaded(false);
150
152
  const descriptors = await getDcmtTypeDescriptor(posts);
151
153
  setDcmtTypeDescriptors(descriptors);
154
+ setDescriptorsLoaded(true);
155
+ }
156
+ else {
157
+ setDescriptorsLoaded(true);
152
158
  }
153
159
  const publishedBlogssLength = posts.filter(newsFeed => newsFeed.isSys !== 1 && newsFeed.isDel !== 1).length;
154
160
  const systemBlogsLength = posts.filter(newsFeed => newsFeed.isSys === 1).length;
@@ -679,7 +685,7 @@ const TMBlogsPost = (props) => {
679
685
  textDecoration: blogPost.isDel ? 'line-through' : 'none',
680
686
  boxShadow: isFocused ? "0 4px 12px rgba(19, 85, 150, 0.6)" : "none",
681
687
  cursor: 'pointer',
682
- }, children: [_jsx(BlogPostTitle, { displayMode: displayMode, layoutMode: layoutMode, blogPost: blogPost, isSelected: isSelected, isOwnComment: isOwnComment, searchText: searchText, isSys: isSys, isHomeBlogPost: isHomeBlogPost, showId: localShowId, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), isNew && _jsx(NewBadge, { layoutMode: layoutMode }), _jsx("div", { style: { fontSize: '1rem', color: "#000", marginTop: "10px", overflow: "hidden" }, children: _jsx(TMHtmlContentDisplay, { markup: blogPost.description ?? '-', searchText: searchText, isSelected: isSelected }) }), showExtendedAttachments && blogPost.attachments && blogPost.attachments.length > 0 && (_jsx(TMBlogAttachments, { attachments: blogPost.attachments, layoutMode: layoutMode, isSelected: isSelected, searchText: searchText, dcmtTypeDescriptors: dcmtTypeDescriptors, treeFs: treeFs, draftLatestInfoMap: draftLatestInfoMap, archivedDocumentMap: archivedDocumentMap, handleAttachmentFocus: handleFocusedAttachment, openDcmtForm: openDcmtForm }))] }, `${id}-blogpost-${blogPost.id}`) })] }, "blog-post-wrapper-" + id + "-" + blogPost.id);
688
+ }, children: [_jsx(BlogPostTitle, { displayMode: displayMode, layoutMode: layoutMode, blogPost: blogPost, isSelected: isSelected, isOwnComment: isOwnComment, searchText: searchText, isSys: isSys, isHomeBlogPost: isHomeBlogPost, showId: localShowId, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), isNew && _jsx(NewBadge, { layoutMode: layoutMode }), _jsx("div", { style: { fontSize: '1rem', color: "#000", marginTop: "10px", overflow: "hidden" }, children: _jsx(TMHtmlContentDisplay, { markup: blogPost.description ?? '-', searchText: searchText, isSelected: isSelected }) }), showExtendedAttachments && blogPost.attachments && blogPost.attachments.length > 0 && (_jsx(TMBlogAttachments, { attachments: blogPost.attachments, layoutMode: layoutMode, isSelected: isSelected, isLoading: !descriptorsLoaded, searchText: searchText, dcmtTypeDescriptors: dcmtTypeDescriptors, treeFs: treeFs, draftLatestInfoMap: draftLatestInfoMap, archivedDocumentMap: archivedDocumentMap, handleAttachmentFocus: handleFocusedAttachment, openDcmtForm: openDcmtForm }))] }, `${id}-blogpost-${blogPost.id}`) })] }, "blog-post-wrapper-" + id + "-" + blogPost.id);
683
689
  }), _jsx("div", { ref: bottomRef })] }), _jsx(TMContextMenu, { items: menuItems, target: `#${id}-blogs-wrapper`, externalControl: {
684
690
  visible: menuVisible,
685
691
  position: menuPosition,
@@ -142,27 +142,21 @@ export const getAttachmentInfo = (attachment, treeFs, draftLatestInfoMap, archiv
142
142
  return { name, nameElement, tooltipContent, folderId, fileExt, draftExist, archivedDocumentsExist };
143
143
  };
144
144
  export const getDcmtTypeDescriptor = async (blogPosts) => {
145
- // Create a Map to store tid as key and DcmtTypeDescriptor as value
146
145
  const dcmtTypeMap = new Map();
147
- // Collect unique tids first to avoid duplicate HTTP calls
148
- const uniqueTids = new Set();
149
- for (const blogPost of blogPosts) {
150
- if (blogPost.attachments) {
151
- for (const attachment of blogPost.attachments) {
152
- if (attachment.tid) {
153
- uniqueTids.add(attachment.tid);
154
- }
155
- }
146
+ // Collect unique tid-did pairs to avoid duplicate HTTP calls
147
+ const tidDidMap = new Map();
148
+ for (const { tid, did } of blogPosts.flatMap(bp => bp.attachments ?? [])) {
149
+ if (tid !== undefined && !tidDidMap.has(tid)) {
150
+ tidDidMap.set(tid, did);
156
151
  }
157
152
  }
158
- // Fetch all descriptors in parallel instead of sequentially
159
- const promises = Array.from(uniqueTids).map(async (tid) => {
160
- const dcmtTypeDescriptor = await DcmtTypeListCacheService.GetAsync(tid, true);
161
- if (dcmtTypeDescriptor) {
162
- dcmtTypeMap.set(tid, dcmtTypeDescriptor);
153
+ // Fetch all descriptors in parallel
154
+ await Promise.all(Array.from(tidDidMap.entries()).map(async ([tid, did]) => {
155
+ const descriptor = await DcmtTypeListCacheService.GetWithNotGrantedAsync(tid, did);
156
+ if (descriptor) {
157
+ dcmtTypeMap.set(tid, descriptor);
163
158
  }
164
- });
165
- await Promise.all(promises);
159
+ }));
166
160
  return dcmtTypeMap;
167
161
  };
168
162
  export const BlogPostHomeHeader = (header, classId, isSelected, searchText, headerClickCallback) => {
@@ -71,6 +71,7 @@ export * from './features/documents/TMRelationViewer';
71
71
  export * from './features/archive/TMArchive';
72
72
  export * from './features/search/TMSearch';
73
73
  export * from './features/search/TMSearchResult';
74
+ export * from './features/search/SignatureParamsManager';
74
75
  export { default as TMTaskForm } from './features/tasks/TMTaskForm';
75
76
  export { default as TMTasksAgenda } from './features/tasks/TMTasksAgenda';
76
77
  export { default as TMTasksCalendar } from './features/tasks/TMTasksCalendar';
@@ -81,6 +81,7 @@ export * from './features/archive/TMArchive';
81
81
  //search
82
82
  export * from './features/search/TMSearch';
83
83
  export * from './features/search/TMSearchResult';
84
+ export * from './features/search/SignatureParamsManager';
84
85
  // tasks
85
86
  export { default as TMTaskForm } from './features/tasks/TMTaskForm';
86
87
  export { default as TMTasksAgenda } from './features/tasks/TMTasksAgenda';
@@ -188,8 +188,10 @@ const TMPage = ({ id, objClass = ObjectClasses.None, listDisabled = false, lastR
188
188
  onStatusChanged: (isModified) => { setSelectionListDisabled((formMode == FormModes.Create || formMode == FormModes.Duplicate) ? true : isModified); },
189
189
  onSaved: async (newItem) => {
190
190
  try {
191
+ console.log('Saved item', newItem);
191
192
  const currentItems = items.map((job) => job);
192
193
  const index = currentItems.findIndex((o) => o.id == newItem.id);
194
+ console.log('index', index);
193
195
  if (index >= 0)
194
196
  currentItems[index] = newItem;
195
197
  else
@@ -221,6 +223,6 @@ const TMPage = ({ id, objClass = ObjectClasses.None, listDisabled = false, lastR
221
223
  _jsx(TMLayoutItem, { children: selectedItems.length == 1 || formMode == FormModes.Create || formMode == FormModes.Duplicate ?
222
224
  _jsx(TMToolbarCard, { onBack: deviceType === DeviceType.MOBILE ? () => setShowList(true) : undefined, title: calcSaveFormTitle(objName, formMode, selectedItems.length == 0 ? -1 : selectedItems[0].id, detailTitlePathKeys), children: getDetailFormWithProps() })
223
225
  :
224
- _jsx(MultipleSelectionManager, {}) })] }) }));
226
+ selectedItems.length > 0 ? _jsx(MultipleSelectionManager, {}) : _jsx(_Fragment, {}) })] }) }));
225
227
  };
226
228
  export default TMPage;
@@ -332,7 +332,7 @@ export const renderDTDTooltipContent = (dtd) => {
332
332
  : _jsxs(StyledTooltipContainer, { children: [_jsx(StyledTooltipItem, { children: `${SDK_Globals.useLocalizedName ? dtd.nameLoc : dtd.name} (${dtd.isView ? 'VID' : 'TID'}: ${dtd.id}, RootTID: ${dtd.rootTID ?? 0})` }), dtd.description && _jsx(StyledTooltipItem, { children: dtd.description }), _jsx(StyledTooltipSeparatorItem, {}), dtd.customData2 === "NOTGRANTED"
333
333
  ? _jsx(StyledTooltipItem, { style: { fontWeight: 600 }, children: 'Tipo documento NON autorizzato' })
334
334
  :
335
- _jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ArchiveConstraint}: ${LocalizeArchiveConstraints(dtd.archiveConstraint)}` }), dtd.isView && dtd.parametricFilterType != ParametricFilterTypes.None && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ParametricFilter}: ${LocalizeParametricFilterTypes(dtd.parametricFilterType)}` }), dtd.isView && dtd.withCheckOption && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ViewWithCheckOption}: ${SDKUI_Localizator.Yes}` }), dtd.isLexProt && dtd.isLexProt > 0 && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LexProt}: ${SDKUI_Localizator.Yes}` }), dtd.isFreeSearchable && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search_Free}: ${SDKUI_Localizator.Yes}` }), dtd.templateTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Template}: ${dtd.templateTID}` }), dtd.traceTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Tracing}: ${SDKUI_Localizator.Yes} - ${dtd.templateTID == TemplateTIDs.Trace_DcmtType ? SDKUI_Localizator.Destination : SDKUI_Localizator.Source} ${dtd.traceTID < 0 ? SDKUI_Localizator.Disabled : ''}` }), dtd.wfAppr && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.WorkflowApproval}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.BlogCase}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${dtd.cico ? SDKUI_Localizator.Yes : SDKUI_Localizator.No}` }), dtd.perm ?
335
+ _jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ArchiveConstraint}: ${LocalizeArchiveConstraints(dtd.archiveConstraint)}` }), dtd.isView && dtd.parametricFilterType != ParametricFilterTypes.None && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ParametricFilter}: ${LocalizeParametricFilterTypes(dtd.parametricFilterType)}` }), dtd.isView && dtd.withCheckOption && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ViewWithCheckOption}: ${SDKUI_Localizator.Yes}` }), dtd.isLexProt && dtd.isLexProt > 0 && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LexProt}: ${SDKUI_Localizator.Yes}` }), dtd.isFreeSearchable && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search_Free}: ${SDKUI_Localizator.Yes}` }), dtd.templateTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Template}: ${dtd.templateTID}` }), dtd.traceTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Tracing}: ${SDKUI_Localizator.Yes} - ${dtd.templateTID == TemplateTIDs.Trace_DcmtType ? SDKUI_Localizator.Destination : SDKUI_Localizator.Source} ${dtd.traceTID < 0 ? SDKUI_Localizator.Disabled : ''}` }), dtd.wfAppr && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.WorkflowApproval}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.BlogCase}: ${dtd.hasBlog ? SDKUI_Localizator.Yes : SDKUI_Localizator.No}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${dtd.cico ? SDKUI_Localizator.Yes : SDKUI_Localizator.No}` }), dtd.perm ?
336
336
  _jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${mapAccessLevelToLocalizedString(dtd.perm.canArchive)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${mapAccessLevelToLocalizedString(dtd.perm.canView)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${mapAccessLevelToLocalizedString(dtd.perm.canSearch)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${mapAccessLevelToLocalizedString(dtd.perm.canUpdate)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.RetrieveFile}: ${mapAccessLevelToLocalizedString(dtd.perm.canRetrieveFile)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.AddOrSubstFile}: ${mapAccessLevelToLocalizedString(dtd.perm.canSubstFile)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LogDelete}: ${mapAccessLevelToLocalizedString(dtd.perm.canLogicalDelete)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.PhysDelete}: ${mapAccessLevelToLocalizedString(dtd.perm.canPhysicalDelete)}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Read}: ${mapAccessLevelToLocalizedString(dtd.perm.canReadBlog)}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Write}: ${mapAccessLevelToLocalizedString(dtd.perm.canWriteBlog)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${mapAccessLevelToLocalizedString(dtd.perm.canCICO)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ChronologyDelete}: ${mapAccessLevelToLocalizedString(dtd.perm.canDelChron)}` })] })
337
337
  : dtd.ownershipLevel == OwnershipLevels.DirectOwner || dtd.ownershipLevel == OwnershipLevels.IndirectOwner ?
338
338
  _jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.RetrieveFile}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.AddOrSubstFile}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LogDelete}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.PhysDelete}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Read}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Write}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ChronologyDelete}: ${SDKUI_Localizator.Yes}` })] })
@@ -6,6 +6,12 @@ const GlobalStyle = createGlobalStyle `
6
6
  * {
7
7
  font-family: var(--base-font-family, "Inter"), sans-serif;
8
8
  }
9
+
10
+ .dx-widget input,
11
+ .dx-widget textarea {
12
+ font-family: var(--base-font-family, "Inter"), sans-serif !important;
13
+ }
14
+
9
15
  .dx-filemanager-dirs-tree-item-text{
10
16
  font-size: var(--base-font-size, 13px);
11
17
  }