@topconsultnpm/sdkui-react 6.20.0-dev2.5 → 6.20.0-dev2.51

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 (67) hide show
  1. package/lib/components/base/Styled.d.ts +1 -0
  2. package/lib/components/base/Styled.js +10 -2
  3. package/lib/components/base/TMTreeView.d.ts +3 -1
  4. package/lib/components/base/TMTreeView.js +63 -20
  5. package/lib/components/choosers/TMDataListItemEditor.d.ts +11 -0
  6. package/lib/components/choosers/TMDataListItemEditor.js +130 -0
  7. package/lib/components/choosers/TMDataListItemFields.d.ts +11 -0
  8. package/lib/components/choosers/TMDataListItemFields.js +61 -0
  9. package/lib/components/choosers/TMDataListItemPicker.d.ts +1 -0
  10. package/lib/components/choosers/TMDataListItemPicker.js +178 -18
  11. package/lib/components/choosers/TMDynDataListItemChooser.js +11 -6
  12. package/lib/components/choosers/TMImageIDChooser.d.ts +16 -0
  13. package/lib/components/choosers/TMImageIDChooser.js +53 -0
  14. package/lib/components/choosers/TMMetadataChooser.js +1 -1
  15. package/lib/components/editors/TMLocalizedTextBox.d.ts +1 -0
  16. package/lib/components/editors/TMLocalizedTextBox.js +3 -3
  17. package/lib/components/editors/TMMetadataValues.js +3 -1
  18. package/lib/components/editors/TMTextBox.js +8 -9
  19. package/lib/components/features/archive/TMArchive.js +29 -42
  20. package/lib/components/features/documents/TMDcmtForm.js +165 -42
  21. package/lib/components/features/documents/TMDcmtPreview.js +2 -1
  22. package/lib/components/features/documents/TMMasterDetailDcmts.js +67 -6
  23. package/lib/components/features/documents/TMRelationViewer.d.ts +7 -1
  24. package/lib/components/features/documents/TMRelationViewer.js +389 -76
  25. package/lib/components/features/search/TMSearchResult.d.ts +1 -0
  26. package/lib/components/features/search/TMSearchResult.js +44 -82
  27. package/lib/components/features/search/TMSearchResultsMenuItems.js +2 -2
  28. package/lib/components/features/tasks/TMTaskForm.js +35 -187
  29. package/lib/components/features/tasks/TMTaskFormUtils.d.ts +74 -0
  30. package/lib/components/features/tasks/TMTaskFormUtils.js +538 -0
  31. package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -0
  32. package/lib/components/features/tasks/TMTasksUtils.js +38 -13
  33. package/lib/components/features/tasks/TMTasksUtilsView.d.ts +0 -7
  34. package/lib/components/features/tasks/TMTasksUtilsView.js +7 -14
  35. package/lib/components/features/tasks/TMTasksView.js +2 -2
  36. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +2 -1
  37. package/lib/components/features/workflow/TMWorkflowPopup.js +2 -1
  38. package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
  39. package/lib/components/forms/Login/TMLoginForm.js +1 -1
  40. package/lib/components/forms/TMSaveForm.js +61 -13
  41. package/lib/components/grids/TMBlogsPost.js +2 -2
  42. package/lib/components/index.d.ts +2 -0
  43. package/lib/components/index.js +2 -0
  44. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +3 -2
  45. package/lib/components/pages/TMPage.js +4 -0
  46. package/lib/components/query/TMQueryEditor.d.ts +1 -0
  47. package/lib/components/query/TMQueryEditor.js +2 -2
  48. package/lib/helper/Enum_Localizator.js +5 -0
  49. package/lib/helper/GlobalStyles.js +3 -0
  50. package/lib/helper/SDKUI_Globals.d.ts +4 -0
  51. package/lib/helper/SDKUI_Globals.js +6 -0
  52. package/lib/helper/SDKUI_Localizator.d.ts +11 -3
  53. package/lib/helper/SDKUI_Localizator.js +102 -22
  54. package/lib/helper/TMUtils.d.ts +18 -0
  55. package/lib/helper/TMUtils.js +58 -0
  56. package/lib/helper/helpers.d.ts +6 -2
  57. package/lib/helper/helpers.js +23 -8
  58. package/lib/helper/index.d.ts +1 -0
  59. package/lib/helper/index.js +1 -0
  60. package/lib/helper/queryHelper.js +1 -1
  61. package/lib/hooks/useBetaFeatures.d.ts +1 -0
  62. package/lib/hooks/useBetaFeatures.js +41 -0
  63. package/lib/hooks/useDcmtOperations.js +14 -2
  64. package/lib/hooks/useRelatedDocuments.js +34 -11
  65. package/lib/index.d.ts +1 -0
  66. package/lib/index.js +1 -0
  67. package/package.json +11 -11
@@ -20,6 +20,7 @@ interface ITMSearchResultProps {
20
20
  isVisible?: boolean;
21
21
  openDcmtFormAsModal?: boolean;
22
22
  showSearchResultSidebar?: boolean;
23
+ showDcmtFormSidebar?: boolean;
23
24
  showSelector?: boolean;
24
25
  showToolbarHeader?: boolean;
25
26
  showBackButton?: boolean;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
- import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes, DcmtTypeListCacheService, SystemMIDsAsNumber, RetrieveFileOptions, DcmtOpers, GeneralRetrieveFormats, AccessLevelsEx, LayoutCacheService, UserListCacheService } from '@topconsultnpm/sdk-ts';
3
+ import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes, DcmtTypeListCacheService, SystemMIDsAsNumber, RetrieveFileOptions, DcmtOpers, GeneralRetrieveFormats, AccessLevelsEx, LayoutCacheService, UserListCacheService, AppModules } from '@topconsultnpm/sdk-ts';
4
4
  import styled from 'styled-components';
5
5
  import { getAllFieldSelectedDcmtsOrFocused, getCommandsMenuItems, getSelectedDcmtsOrFocused } from './TMSearchResultsMenuItems';
6
- import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, deepCompare, generateUniqueColumnKeys, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, IconSearchCheck, TMImageLibrary, convertSearchResultDescriptorToFileItems, IconCustom, isApprovalWorkflowView, SDKUI_Globals, getMoreInfoTasksForDocument, IconInfo, IconCache, IconPlatform } from '../../../helper';
6
+ import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, deepCompare, generateUniqueColumnKeys, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, IconSearchCheck, TMImageLibrary, convertSearchResultDescriptorToFileItems, IconCustom, isApprovalWorkflowView, SDKUI_Globals, getMoreInfoTasksForDocument, IconPlatform, getSearchToolbarVisibility } from '../../../helper';
7
7
  import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
8
8
  import { useInputAttachmentsDialog, useInputCvtFormatDialog } from '../../../hooks/useInputDialog';
9
9
  import { useRelatedDocuments } from '../../../hooks/useRelatedDocuments';
@@ -36,7 +36,6 @@ import ShowAlert from '../../base/TMAlert';
36
36
  import TMSpinner from '../../base/TMSpinner';
37
37
  import TMChooserForm from '../../forms/TMChooserForm';
38
38
  import TMModal from '../../base/TMModal';
39
- import TMTooltip from '../../base/TMTooltip';
40
39
  import TMSearch from './TMSearch';
41
40
  import TMArchive from '../archive/TMArchive';
42
41
  import TMCustomButton from '../../base/TMCustomButton';
@@ -69,7 +68,7 @@ const orderByName = (array) => {
69
68
  return 1;
70
69
  } return 0; });
71
70
  };
72
- const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showSelector = false, groupId, title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, showBackButton = true, selectedSearchResultTID, workingGroupContext = undefined, disableAccordionIfSingleCategory = false, floatingActionConfig, openInOffice, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onTaskCreateRequest, openWGsCopyMoveForm, editPdfForm = false, openEditPdf, openCommentFormCallback, openAddDocumentForm, openS4TViewer = false, onOpenS4TViewerRequest, passToArchiveCallback, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, onReferenceClick, }) => {
71
+ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showDcmtFormSidebar = true, showSelector = false, groupId, title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, showBackButton = true, selectedSearchResultTID, workingGroupContext = undefined, disableAccordionIfSingleCategory = false, floatingActionConfig, openInOffice, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onTaskCreateRequest, openWGsCopyMoveForm, editPdfForm = false, openEditPdf, openCommentFormCallback, openAddDocumentForm, openS4TViewer = false, onOpenS4TViewerRequest, passToArchiveCallback, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, onReferenceClick, }) => {
73
72
  const [id, setID] = useState('');
74
73
  const [showApprovePopup, setShowApprovePopup] = useState(false);
75
74
  const [showRejectPopup, setShowRejectPopup] = useState(false);
@@ -98,10 +97,9 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
98
97
  // State to control whether the export form (for exporting to Excel/CSV/txt and others) should be shown
99
98
  const [showExportForm, setShowExportForm] = useState(false);
100
99
  const [showSignSettingsForm, setShowSignSettingsForm] = useState(false);
101
- const [indexingInfoCache, setIndexingInfoCache] = useState(new Map());
102
100
  const [showIndexingInfo, setShowIndexingInfo] = useState(false);
103
101
  const [loadingIndexingInfo, setLoadingIndexingInfo] = useState(false);
104
- const [openedDrawerItems, setOpenedDrawerItems] = useState(new Set());
102
+ const [indexingInfo, setIndexingInfo] = useState('');
105
103
  const floatingBarContainerRef = useRef(null);
106
104
  const [confirmFormat, ConfirmFormatDialog] = useInputCvtFormatDialog();
107
105
  const { openConfirmAttachmentsDialog, ConfirmAttachmentsDialog } = useInputAttachmentsDialog();
@@ -619,7 +617,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
619
617
  _jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, selectedSearchResult: selectedSearchResult, autoSelectFirst: !isMobile || currentSearchResults.length === 1, onSelectionChanged: onSearchResultSelectionChanged }) })
620
618
  :
621
619
  _jsx(_Fragment, {}), _jsx(TMLayoutItem, { children: _jsx(TMSearchResultGrid, { showSearch: showSearch, fromDTD: fromDTD, allUsers: allUsers, inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], lastUpdateSearchTime: lastUpdateSearchTime, openInOffice: openInOffice, onDblClick: () => openFormHandler(LayoutModes.Update), floatingMenuItems: floatingMenuItems, onSelectionChanged: (items) => { setSelectedItems(items); }, onVisibleItemChanged: setVisibleItems, onFocusedItemChanged: setFocusedItem, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync(inputDcmts, downloadType, downloadMode, onFileOpened, confirmAttachments), showExportForm: showExportForm, onCloseExportForm: onCloseExportForm }) })] }), allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE &&
622
- _jsx(TMFloatingMenuBar, { containerRef: floatingBarContainerRef, contextMenuItems: floatingMenuItems, isConstrained: true, defaultPosition: { x: 1, y: 88 }, defaultPinnedItems: ['rel-det', 'rel-mst', 'dl'], defaultOrientation: 'horizontal', hasContextMenu: false, pinnedItemIds: pinnedItemIds, onPinChange: setPinnedItemIds })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { TID: focusedItem?.TID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: onWFOperationCompleted, onClose: () => setShowMoreInfoPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: `${SDKUI_Localizator.BatchUpdate} (${getSelectionDcmtInfo().length} documenti selezionati)`, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
620
+ _jsx(TMFloatingMenuBar, { containerRef: floatingBarContainerRef, contextMenuItems: floatingMenuItems, isConstrained: true, defaultPosition: { x: 1, y: 88 }, defaultPinnedItems: ['rel-det', 'rel-mst', 'dl'], defaultOrientation: 'horizontal', hasContextMenu: false, pinnedItemIds: pinnedItemIds, onPinChange: setPinnedItemIds })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { TID: focusedItem?.TID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: onWFOperationCompleted, onClose: () => setShowMoreInfoPopup(false), getAllTasks: getAllTasks }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: `${SDKUI_Localizator.BatchUpdate} (${getSelectionDcmtInfo().length} documenti selezionati)`, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
623
621
  setIsOpenBatchUpdate(false);
624
622
  }, onSavedCallbackAsync: async () => {
625
623
  setIsOpenBatchUpdate(false);
@@ -737,32 +735,35 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
737
735
  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]);
738
736
  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]);
739
737
  const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { currentDcmt: currentDcmt }, refreshPreviewTrigger), [currentDcmt, refreshPreviewTrigger]);
738
+ // Auto-fetch indexing info when drawer is open and focusedItem changes
740
739
  useEffect(() => {
741
- if (!focusedItem)
740
+ if (!focusedItem || !showIndexingInfo)
742
741
  return;
743
- const cacheKey = `${focusedItem.TID}-${focusedItem.DID}`;
744
- setShowIndexingInfo(openedDrawerItems.has(cacheKey));
745
- }, [focusedItem, openedDrawerItems]);
742
+ const fetchData = async () => {
743
+ try {
744
+ setLoadingIndexingInfo(true);
745
+ const msg = await SDK_Globals.tmSession?.NewSearchEngine().FreeSearchGetDcmtInfoAsync(focusedItem.TID, focusedItem.DID);
746
+ setIndexingInfo(msg ?? '');
747
+ }
748
+ catch (e) {
749
+ TMExceptionBoxManager.show({ exception: e });
750
+ }
751
+ finally {
752
+ setLoadingIndexingInfo(false);
753
+ }
754
+ };
755
+ fetchData();
756
+ }, [focusedItem, showIndexingInfo]);
746
757
  const handleToggleIndexingInfo = async () => {
747
758
  if (!focusedItem)
748
759
  return;
749
- const cacheKey = `${focusedItem.TID}-${focusedItem.DID}`;
750
- if (showIndexingInfo) {
751
- setOpenedDrawerItems(prev => {
752
- const newSet = new Set(prev);
753
- newSet.delete(cacheKey);
754
- return newSet;
755
- });
756
- setShowIndexingInfo(false);
757
- return;
758
- }
759
- setOpenedDrawerItems(prev => new Set(prev).add(cacheKey));
760
- setShowIndexingInfo(true);
761
- if (!indexingInfoCache.has(cacheKey)) {
760
+ const newShowState = !showIndexingInfo;
761
+ setShowIndexingInfo(newShowState);
762
+ if (newShowState) {
762
763
  try {
763
764
  setLoadingIndexingInfo(true);
764
765
  const msg = await SDK_Globals.tmSession?.NewSearchEngine().FreeSearchGetDcmtInfoAsync(focusedItem.TID, focusedItem.DID);
765
- setIndexingInfoCache(prev => new Map(prev).set(cacheKey, msg ?? ''));
766
+ setIndexingInfo(msg ?? '');
766
767
  }
767
768
  catch (e) {
768
769
  TMExceptionBoxManager.show({ exception: e });
@@ -772,28 +773,11 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
772
773
  }
773
774
  }
774
775
  };
775
- const handleRefreshIndexingInfo = async () => {
776
- if (!focusedItem)
777
- return;
778
- const cacheKey = `${focusedItem.TID}-${focusedItem.DID}`;
779
- try {
780
- setLoadingIndexingInfo(true);
781
- const msg = await SDK_Globals.tmSession?.NewSearchEngine().FreeSearchGetDcmtInfoAsync(focusedItem.TID, focusedItem.DID);
782
- setIndexingInfoCache(prev => new Map(prev).set(cacheKey, msg ?? ''));
783
- }
784
- catch (e) {
785
- TMExceptionBoxManager.show({ exception: e });
786
- }
787
- finally {
788
- setLoadingIndexingInfo(false);
789
- }
790
- };
791
776
  const tmFullTextSearch = useMemo(() => {
792
777
  if (!focusedItem) {
793
778
  return (_jsxs(StyledPlaceholder, { children: [" ", _jsx("p", { children: "Seleziona un documento per visualizzare i dettagli della ricerca full-text" }), " "] }));
794
779
  }
795
- // const ftExplanationsColumnIndex = selectedSearchResult?.dtdResult?.columns?.findIndex( col => col.caption === 'FTExplanations' );
796
- const ftExplanationsColumnIndex = selectedSearchResult?.selectMIDs?.findIndex(mid => mid === 0); //nosonar
780
+ const ftExplanationsColumnIndex = selectedSearchResult?.dtdResult?.columns?.findIndex(col => col.caption === 'FTExplanations');
797
781
  if (ftExplanationsColumnIndex === undefined || ftExplanationsColumnIndex < 0) {
798
782
  return (_jsxs(StyledPlaceholder, { children: [" ", _jsx("p", { children: "Nessuna info full-text disponibile" }), " "] }));
799
783
  }
@@ -805,23 +789,21 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
805
789
  if (!ftExplanation) {
806
790
  return (_jsxs(StyledPlaceholder, { children: [" ", _jsx("p", { children: "Nessuna info disponibile per questo documento" }), " "] }));
807
791
  }
808
- const cacheKey = `${focusedItem.TID}-${focusedItem.DID}`;
809
- const cachedInfo = indexingInfoCache.get(cacheKey);
810
- 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: [_jsxs(StyledLeftContent, { children: [_jsx(IconInfo, {}), _jsx("span", { children: showIndexingInfo ? 'Nascondi' : SDKUI_Localizator.IndexingInformation })] }), _jsxs(StyledRightContent, { children: [cachedInfo && (_jsxs(_Fragment, { children: [_jsx(TMTooltip, { content: "Aggiorna", children: _jsx(StyledRefreshIcon, { onClick: (e) => { e.stopPropagation(); handleRefreshIndexingInfo(); }, children: _jsx(IconRefresh, {}) }) }), _jsx(TMTooltip, { content: "Da cache", children: _jsx(StyledCachedIcon, { children: _jsx(IconCache, {}) }) })] })), _jsx(StyledChevron, { "$isOpen": showIndexingInfo, children: "\u25BC" })] })] }), loadingIndexingInfo && !cachedInfo && (_jsxs("div", { style: { marginTop: '10px', color: '#666' }, children: [SDKUI_Localizator.Loading, "..."] })), showIndexingInfo && cachedInfo && (_jsxs(StyledIndexingInfoBox, { children: [_jsx("div", { dangerouslySetInnerHTML: { __html: cachedInfo } }), 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, "..."] }))] }))] })] }));
811
- }, [selectedSearchResult, focusedItem, indexingInfoCache, showIndexingInfo, loadingIndexingInfo]);
792
+ 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, "..."] }))] }))] })] }));
793
+ }, [selectedSearchResult, focusedItem, indexingInfo, showIndexingInfo, loadingIndexingInfo]);
812
794
  const allInitialPanelVisibility = {
813
795
  'tmSearchResult': true,
814
796
  'tmBlog': false,
815
797
  'tmSysMetadata': false,
816
- 'tmDcmtPreview': false,
817
798
  'tmFullTextSearch': false,
799
+ 'tmDcmtPreview': false,
818
800
  };
819
801
  const initialPanelDimensions = {
820
802
  'tmSearchResult': { width: '25%', height: '100%' },
821
803
  'tmBlog': { width: '25%', height: '100%' },
822
804
  'tmSysMetadata': { width: '25%', height: '100%' },
823
- 'tmDcmtPreview': { width: '25%', height: '100%' },
824
805
  'tmFullTextSearch': { width: '25%', height: '100%' },
806
+ 'tmDcmtPreview': { width: '25%', height: '100%' },
825
807
  };
826
808
  const initialPanels = useMemo(() => [
827
809
  {
@@ -840,34 +822,34 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
840
822
  toolbar: searchResutlToolbar
841
823
  },
842
824
  },
843
- toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: true, orderNumber: 1, isActive: allInitialPanelVisibility['tmSearchResult'] }
825
+ toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmSearchResult, orderNumber: 1, isActive: allInitialPanelVisibility['tmSearchResult'] }
844
826
  },
845
827
  {
846
828
  id: 'tmBlog',
847
829
  name: SDKUI_Localizator.BlogCase,
848
830
  contentOptions: { component: tmBlog, panelContainer: { title: SDKUI_Localizator.BlogCase, allowMaximize: !isMobile } },
849
- toolbarOptions: { icon: _jsx(IconBoard, { fontSize: 24 }), visible: true, orderNumber: 2, isActive: allInitialPanelVisibility['tmBlog'] }
831
+ toolbarOptions: { icon: _jsx(IconBoard, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmBlog, orderNumber: 2, isActive: allInitialPanelVisibility['tmBlog'] }
850
832
  },
851
833
  {
852
834
  id: 'tmSysMetadata',
853
835
  name: SDKUI_Localizator.MetadataSystem,
854
836
  contentOptions: { component: tmSysMetadata, panelContainer: { title: SDKUI_Localizator.MetadataSystem, allowMaximize: !isMobile } },
855
- toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: true, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
856
- },
857
- {
858
- id: 'tmDcmtPreview',
859
- name: SDKUI_Localizator.PreviewDocument,
860
- contentOptions: { component: tmDcmtPreview },
861
- toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
837
+ toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmSysMetadata, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
862
838
  },
863
839
  ...(context === SearchResultContext.FREE_SEARCH ? [
864
840
  {
865
841
  id: 'tmFullTextSearch',
866
842
  name: SDKUI_Localizator.ResultDetails,
867
843
  contentOptions: { component: tmFullTextSearch, panelContainer: { title: SDKUI_Localizator.ResultDetails, allowMaximize: !isMobile } },
868
- toolbarOptions: { icon: _jsx(IconPlatform, { fontSize: 20 }), visible: true, orderNumber: 5, isActive: allInitialPanelVisibility['tmFullTextSearch'] }
844
+ toolbarOptions: { icon: _jsx(IconPlatform, { fontSize: 20 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmFullTextSearch, orderNumber: 4, isActive: allInitialPanelVisibility['tmFullTextSearch'] }
869
845
  }
870
- ] : [])
846
+ ] : []),
847
+ {
848
+ id: 'tmDcmtPreview',
849
+ name: SDKUI_Localizator.PreviewDocument,
850
+ contentOptions: { component: tmDcmtPreview },
851
+ 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'] }
852
+ }
871
853
  ], [tmSearchResult, tmBlog, tmSysMetadata, tmDcmtPreview, tmFullTextSearch, showToolbarHeader, context, isMobile]);
872
854
  return (_jsxs(StyledMultiViewPanel, { "$isVisible": isVisible, children: [_jsx(StyledMultiViewPanel, { "$isVisible": !isOpenDcmtForm && !isOpenDetails && !isOpenMaster, style: {
873
855
  display: 'flex',
@@ -881,7 +863,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
881
863
  :
882
864
  _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmSearchResult', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showSearchResultSidebar }) }) }) }) }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDetails, children: isOpenDetails && _jsx(TMMasterDetailDcmts, { deviceType: deviceType, isForMaster: false, inputDcmts: getSelectionDcmtInfo(), allowNavigation: focusedItem && selectedItems.length <= 0, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onBack: () => setIsOpenDetails(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), _jsxs(StyledMultiViewPanel, { "$isVisible": isOpenMaster, children: [isOpenMaster && _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: getSelectionDcmtInfo(), isForMaster: true, allowNavigation: focusedItem && selectedItems.length <= 0, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onBack: () => setIsOpenMaster(false), appendMasterDcmts: handleAddItem, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), secondaryMasterDcmts.length > 0 && secondaryMasterDcmts.map((dcmt, index) => {
883
865
  return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: [dcmt], isForMaster: true, allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID), appendMasterDcmts: handleAddItem, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }, `${index}-${dcmt.DID}`));
884
- })] }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: isOpenDcmtForm && focusedItem?.TID !== undefined && focusedItem?.DID !== undefined && _jsx(TMDcmtForm, { isModal: openDcmtFormAsModal || (dcmtFormLayoutMode === LayoutModes.Ark && focusedItem?.DID), titleModal: fromDTD?.name ?? '', TID: focusedItem.TID, DID: focusedItem.DID, allowButtonsRefs: true, layoutMode: dcmtFormLayoutMode, count: visibleItems.length, itemIndex: visibleItems.findIndex(o => o.rowIndex === focusedItem?.rowIndex) + 1, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onClose: () => { setIsOpenDcmtForm(false); }, onWFOperationCompleted: onWFOperationCompleted, onTaskCreateRequest: onTaskCreateRequest, onSavedAsyncCallback: handleSavedAsyncCallback, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.TID, focusedItem?.DID), showDcmtFormSidebar: showSearchResultSidebar }) }), isOpenArchiveRelationForm && _jsx(TMDcmtForm, { isModal: true, titleModal: SDKUI_Localizator.Archive + ' - ' + (archiveType === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster), TID: archiveRelatedDcmtFormTID, layoutMode: LayoutModes.Ark, inputMids: archiveRelatedDcmtFormMids, showBackButton: false, allowButtonsRefs: false, onClose: () => {
866
+ })] }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: isOpenDcmtForm && focusedItem?.TID !== undefined && focusedItem?.DID !== undefined && _jsx(TMDcmtForm, { isModal: openDcmtFormAsModal || (dcmtFormLayoutMode === LayoutModes.Ark && focusedItem?.DID), titleModal: fromDTD?.name ?? '', TID: focusedItem.TID, DID: focusedItem.DID, allowButtonsRefs: true, layoutMode: dcmtFormLayoutMode, count: visibleItems.length, itemIndex: visibleItems.findIndex(o => o.rowIndex === focusedItem?.rowIndex) + 1, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onClose: () => { setIsOpenDcmtForm(false); }, onWFOperationCompleted: onWFOperationCompleted, onTaskCreateRequest: onTaskCreateRequest, onSavedAsyncCallback: handleSavedAsyncCallback, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.TID, focusedItem?.DID), showDcmtFormSidebar: showDcmtFormSidebar }) }), isOpenArchiveRelationForm && _jsx(TMDcmtForm, { isModal: true, titleModal: SDKUI_Localizator.Archive + ' - ' + (archiveType === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster), TID: archiveRelatedDcmtFormTID, layoutMode: LayoutModes.Ark, inputMids: archiveRelatedDcmtFormMids, showBackButton: false, allowButtonsRefs: false, onClose: () => {
885
867
  setIsOpenArchiveRelationForm(false);
886
868
  setArchiveType(undefined);
887
869
  setArchiveRelatedDcmtFormTID(undefined);
@@ -892,7 +874,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
892
874
  setArchiveRelatedDcmtFormTID(undefined);
893
875
  setArchiveRelatedDcmtFormMids([]);
894
876
  await onRefreshSearchAsync?.();
895
- }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showSearchResultSidebar }), (showSignSettingsForm && fromDTD) && _jsx(TMSignSettingsForm, { fromDTD: fromDTD, inputDcmts: allFieldSelectedDocs, onCloseSignSettingsForm: closeSignSettingsForm, onSavedAsyncCallback: handleSavedAsyncCallback }), (showHistory && fromDTD && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMViewHistoryDcmt, { fromDTD: fromDTD, deviceType: deviceType, inputDcmt: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0], onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (commentFormState.show && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].TID, did: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID } }, onClose: hideCommentFormCallback, refreshCallback: triggerBlogRefresh, participants: [], showAttachmentsSection: true, allArchivedDocumentsFileItems: convertSearchResultDescriptorToFileItems(currentSearchResults ?? []), isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment, selectedAttachmentDid: [Number(getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID)] })] }));
877
+ }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar }), (showSignSettingsForm && fromDTD) && _jsx(TMSignSettingsForm, { fromDTD: fromDTD, inputDcmts: allFieldSelectedDocs, onCloseSignSettingsForm: closeSignSettingsForm, onSavedAsyncCallback: handleSavedAsyncCallback }), (showHistory && fromDTD && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMViewHistoryDcmt, { fromDTD: fromDTD, deviceType: deviceType, inputDcmt: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0], onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (commentFormState.show && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].TID, did: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID } }, onClose: hideCommentFormCallback, refreshCallback: triggerBlogRefresh, participants: [], showAttachmentsSection: true, allArchivedDocumentsFileItems: convertSearchResultDescriptorToFileItems(currentSearchResults ?? []), isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment, selectedAttachmentDid: [Number(getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID)] })] }));
896
878
  };
897
879
  export default TMSearchResult;
898
880
  const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem, showSearch, allowMultipleSelection = true, showExportForm = false, onCloseExportForm, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, floatingMenuItems, onSelectionChanged, onDblClick }) => {
@@ -1413,11 +1395,6 @@ const StyledIndexingToggle = styled.button `
1413
1395
  transform: translateY(1px);
1414
1396
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
1415
1397
  }
1416
-
1417
- svg {
1418
- color: #2196F3;
1419
- font-size: 18px;
1420
- }
1421
1398
  `;
1422
1399
  const StyledLeftContent = styled.div `
1423
1400
  display: flex;
@@ -1429,21 +1406,6 @@ const StyledRightContent = styled.div `
1429
1406
  align-items: center;
1430
1407
  gap: 8px;
1431
1408
  `;
1432
- const StyledCachedIcon = styled.div `
1433
- display: flex;
1434
- align-items: center;
1435
- justify-content: center;
1436
- color: #4CAF50;
1437
- font-size: 16px;
1438
- `;
1439
- const StyledRefreshIcon = styled.div `
1440
- display: flex;
1441
- align-items: center;
1442
- justify-content: center;
1443
- font-size: 16px;
1444
- cursor: pointer;
1445
- transition: transform 0.2s ease;
1446
- `;
1447
1409
  const StyledChevron = styled.span `
1448
1410
  transition: transform 0.2s ease;
1449
1411
  transform: ${props => props.$isOpen ? 'rotate(180deg)' : 'rotate(0deg)'};
@@ -254,10 +254,10 @@ export const getCommandsMenuItems = (isMobile, dtd, allUsers, selectedItems, foc
254
254
  const passToArchive = () => {
255
255
  return {
256
256
  id: 'p2a',
257
- icon: _jsx(IconMenuCAArchive, { fontSize: 16, viewBox: '11 11.5 26 27', strokeWidth: 2, color: 'black' }),
257
+ icon: _jsx(IconMenuCAArchive, { fontSize: 16, viewBox: '11 11.5 26 27', strokeWidth: 2 }),
258
258
  name: SDKUI_Localizator.PassToArchive,
259
259
  operationType: 'singleRow',
260
- disabled: disabledForSingleRow(selectedItems, focusedItem),
260
+ disabled: dtd?.perm?.canArchive !== AccessLevelsEx.Yes && dtd?.perm?.canArchive !== AccessLevelsEx.Mixed ? true : disabledForSingleRow(selectedItems, focusedItem),
261
261
  onClick: async () => {
262
262
  try {
263
263
  const item = selectedItems.length === 1 ? selectedItems[0] : focusedItem;