@topconsultnpm/sdkui-react 6.20.0-test1 → 6.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +3 -1
- package/lib/components/NewComponents/ContextMenu/styles.js +7 -5
- package/lib/components/base/Styled.d.ts +4 -1
- package/lib/components/base/Styled.js +11 -3
- package/lib/components/base/TMPanel.js +6 -4
- package/lib/components/base/TMPopUp.js +4 -0
- package/lib/components/base/TMTreeView.d.ts +3 -1
- package/lib/components/base/TMTreeView.js +68 -21
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDataListItemEditor.d.ts +11 -0
- package/lib/components/choosers/TMDataListItemEditor.js +130 -0
- package/lib/components/choosers/TMDataListItemFields.d.ts +11 -0
- package/lib/components/choosers/TMDataListItemFields.js +61 -0
- package/lib/components/choosers/TMDataListItemPicker.d.ts +2 -0
- package/lib/components/choosers/TMDataListItemPicker.js +182 -18
- package/lib/components/choosers/TMDynDataListItemChooser.js +11 -6
- package/lib/components/choosers/TMImageIDChooser.d.ts +16 -0
- package/lib/components/choosers/TMImageIDChooser.js +53 -0
- package/lib/components/choosers/TMMetadataChooser.js +1 -1
- package/lib/components/choosers/TMUserChooser.js +1 -1
- package/lib/components/editors/TMDateBox.js +1 -1
- package/lib/components/editors/TMHtmlEditor.js +1 -1
- package/lib/components/editors/TMLocalizedTextBox.d.ts +1 -0
- package/lib/components/editors/TMLocalizedTextBox.js +3 -3
- package/lib/components/editors/TMMetadataValues.js +203 -41
- package/lib/components/editors/TMTextArea.d.ts +1 -0
- package/lib/components/editors/TMTextArea.js +6 -6
- package/lib/components/editors/TMTextBox.js +9 -10
- package/lib/components/features/archive/TMArchive.d.ts +3 -1
- package/lib/components/features/archive/TMArchive.js +31 -44
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +3 -0
- package/lib/components/features/blog/TMBlogCommentForm.js +42 -36
- package/lib/components/features/documents/TMDcmtForm.d.ts +3 -1
- package/lib/components/features/documents/TMDcmtForm.js +215 -54
- package/lib/components/features/documents/TMDcmtPreview.js +66 -13
- package/lib/components/features/documents/TMDcmtTasks.d.ts +3 -1
- package/lib/components/features/documents/TMDcmtTasks.js +2 -2
- package/lib/components/features/documents/TMFileUploader.d.ts +5 -0
- package/lib/components/features/documents/TMFileUploader.js +28 -6
- package/lib/components/features/documents/TMMasterDetailDcmts.js +31 -85
- package/lib/components/features/documents/TMRelationViewer.d.ts +7 -1
- package/lib/components/features/documents/TMRelationViewer.js +497 -111
- package/lib/components/features/search/TMSearchQueryPanel.js +6 -6
- package/lib/components/features/search/TMSearchResult.d.ts +2 -0
- package/lib/components/features/search/TMSearchResult.js +106 -86
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +1 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +6 -18
- package/lib/components/features/search/TMSignatureInfoContent.js +10 -6
- package/lib/components/features/search/TMTreeSelector.js +1 -1
- package/lib/components/features/tasks/TMTaskForm.d.ts +1 -0
- package/lib/components/features/tasks/TMTaskForm.js +61 -193
- package/lib/components/features/tasks/TMTaskFormUtils.d.ts +80 -0
- package/lib/components/features/tasks/TMTaskFormUtils.js +559 -0
- package/lib/components/features/tasks/TMTasksUtils.d.ts +3 -1
- package/lib/components/features/tasks/TMTasksUtils.js +46 -16
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +0 -7
- package/lib/components/features/tasks/TMTasksUtilsView.js +7 -14
- package/lib/components/features/tasks/TMTasksView.js +5 -3
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +20 -3
- package/lib/components/features/workflow/TMWorkflowPopup.js +21 -109
- package/lib/components/features/workflow/diagram/ConnectionComponent.d.ts +1 -0
- package/lib/components/features/workflow/diagram/ConnectionComponent.js +6 -2
- package/lib/components/features/workflow/diagram/DiagramItemForm.d.ts +2 -0
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +32 -25
- package/lib/components/features/workflow/diagram/RecipientList.d.ts +3 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +13 -9
- package/lib/components/features/workflow/diagram/WFDiagram.js +102 -5
- package/lib/components/features/workflow/diagram/workflowHelpers.js +31 -19
- package/lib/components/forms/Login/TMLoginForm.js +1 -1
- package/lib/components/forms/TMSaveForm.js +61 -13
- package/lib/components/grids/TMBlogsPost.js +8 -8
- package/lib/components/grids/TMBlogsPostUtils.js +2 -2
- package/lib/components/grids/TMRecentsManager.js +1 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +2 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +3 -2
- package/lib/components/pages/TMPage.js +4 -0
- package/lib/components/query/TMQueryEditor.d.ts +1 -0
- package/lib/components/query/TMQueryEditor.js +3 -3
- package/lib/components/viewers/TMMidViewer.js +2 -1
- package/lib/components/viewers/TMTidViewer.js +7 -3
- package/lib/helper/Enum_Localizator.js +5 -0
- package/lib/helper/GlobalStyles.js +3 -0
- package/lib/helper/SDKUI_Globals.d.ts +12 -0
- package/lib/helper/SDKUI_Globals.js +21 -1
- package/lib/helper/SDKUI_Localizator.d.ts +31 -7
- package/lib/helper/SDKUI_Localizator.js +286 -46
- package/lib/helper/TMIcons.d.ts +2 -1
- package/lib/helper/TMIcons.js +4 -1
- package/lib/helper/TMUtils.d.ts +33 -41
- package/lib/helper/TMUtils.js +157 -170
- package/lib/helper/helpers.d.ts +6 -2
- package/lib/helper/helpers.js +24 -8
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/helper/queryHelper.js +1 -1
- package/lib/hooks/useBetaFeatures.d.ts +1 -0
- package/lib/hooks/useBetaFeatures.js +41 -0
- package/lib/hooks/useDataUserIdItem.js +2 -2
- package/lib/hooks/useDcmtOperations.js +14 -2
- package/lib/hooks/useRelatedDocuments.js +64 -42
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/services/platform_services.d.ts +1 -1
- package/lib/services/platform_services.js +4 -0
- package/lib/ts/types.d.ts +3 -0
- package/package.json +2 -2
- package/lib/components/features/search/TMSignSettingsForm.d.ts +0 -9
- package/lib/components/features/search/TMSignSettingsForm.js +0 -621
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
-
import { PlatformObjectValidator, QueryDescriptor, WhereItem, SDK_Localizator, OrderByItem, SelectItem, SelectItemVisibilities, SDK_Globals, SavedQueryCacheService, SearchEngine, QueryOperators } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { PlatformObjectValidator, QueryDescriptor, WhereItem, SDK_Localizator, OrderByItem, SelectItem, SelectItemVisibilities, SDK_Globals, SavedQueryCacheService, SearchEngine, QueryOperators, AccessLevelsEx, AccessLevels } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import TMSearchQueryEditor from './TMSearchQueryEditor';
|
|
6
6
|
import { getDcmtTypesByQdAsync, SDKUI_Localizator, getQD, IconMenuVertical, IconAddCircleOutline, IconEdit, IconEasy, IconAdvanced, deepCompare, IconSearch, IconClear, getDefaultOperator, prepareQdForSearchAsync, IsParametricQuery, SDKUI_Globals, IconArrowRight, IconMenuCAArchive, getListMaxItems, DEFAULT_MAX_DCMTS_TO_BE_RETURNED } from '../../../helper';
|
|
@@ -319,8 +319,8 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
|
|
|
319
319
|
{ icon: _jsx(IconEdit, {}), name: `${SDKUI_Localizator.Configure} - ${SDK_Localizator.QueryWhere}`, beginGroup: true, onClick: () => { setShowFiltersConfig(true); } },
|
|
320
320
|
{ icon: _jsx(IconEdit, {}), name: `${SDKUI_Localizator.Configure} - ${SDK_Localizator.QuerySelect}`, onClick: () => { setShowOutputConfig(true); } },
|
|
321
321
|
{ icon: _jsx(IconEdit, {}), name: `${SDKUI_Localizator.Configure} - ${SDK_Localizator.QueryOrderBy}`, onClick: () => { setShowOrderByConfig(true); } },
|
|
322
|
-
{ icon: _jsx(IconMenuCAArchive, { viewBox: '11 11.5 26 27', fontSize: 16, strokeWidth: 2, color: 'black' }), beginGroup: true, name: SDKUI_Localizator.PassToArchive, onClick: handlePassToArchive }
|
|
323
|
-
], [showBackToResultButton, showAdvancedSearch, SQD, onBackToResult, openSqdForm, changeAdvancedSearchAsync, setShowFiltersConfig, setShowOutputConfig, setShowOrderByConfig, handlePassToArchive]);
|
|
322
|
+
{ icon: _jsx(IconMenuCAArchive, { viewBox: '11 11.5 26 27', fontSize: 16, strokeWidth: 2, color: 'black' }), beginGroup: true, name: SDKUI_Localizator.PassToArchive, disabled: fromDTD?.perm?.canArchive !== AccessLevelsEx.Yes && fromDTD?.perm?.canArchive !== AccessLevelsEx.Mixed, onClick: handlePassToArchive }
|
|
323
|
+
], [showBackToResultButton, showAdvancedSearch, SQD, onBackToResult, openSqdForm, changeAdvancedSearchAsync, setShowFiltersConfig, setShowOutputConfig, setShowOrderByConfig, handlePassToArchive, fromDTD?.perm?.canArchive]);
|
|
324
324
|
const captionText = showAllMdWhere ? SDKUI_Localizator.ShowLess : SDKUI_Localizator.ShowAll;
|
|
325
325
|
let maxItems = getListMaxItems(deviceType ?? DeviceType.DESKTOP);
|
|
326
326
|
const diff = (qd?.where?.length ?? 0) - maxItems;
|
|
@@ -337,9 +337,9 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
|
|
|
337
337
|
gap: '10px',
|
|
338
338
|
width: '100%'
|
|
339
339
|
}, children: [_jsx(TMButton, { btnStyle: 'advanced', icon: _jsx(IconSearch, {}), showTooltip: false, width: '90px', caption: SDKUI_Localizator.Search, advancedColor: '#4A96D2', onClick: handleSearchButtonClick }), _jsx(TMButton, { width: '90px', btnStyle: 'advanced', advancedType: 'primary', showTooltip: false, caption: SDKUI_Localizator.Clear, icon: _jsx(IconClear, {}), advancedColor: 'white', color: 'primaryOutline', onClick: clearFilters }), (!showAdvancedSearch && qd?.where && qd.where.length > initialMaxItems) && (_jsx(TMButton, { width: '120px', btnStyle: isMobile ? 'icon' : 'advanced', advancedColor: TMColors.button_primary, caption: captionText, showTooltip: false, icon: isMobile ? (_jsx("div", { children: _jsx("p", { children: showAllMdWhere ? `-${diff}` : `+${diff}` }) })) : (_jsx("p", { children: showAllMdWhere ? `-${diff}` : `+${diff}` })), onClick: () => setShowAllMdWhere(!showAllMdWhere) }))] }), showFiltersConfig &&
|
|
340
|
-
_jsx(TMMetadataChooserForm, { allowMultipleSelection: true, height: '500px', width: '600px', allowSysMetadata: true, qd: qd, selectedIDs: qd?.where?.map((w) => ({ tid: w.tid, mid: w.mid })), onClose: handleCloseFiltersConfig, onChoose: handleChooseFilters }), showOutputConfig &&
|
|
341
|
-
_jsx(TMMetadataChooserForm, { allowMultipleSelection: true, height: '500px', width: '600px', allowSysMetadata: true, qd: qd, selectedIDs: qd?.select?.map((item) => ({ tid: item.tid, mid: item.mid })), onClose: handleCloseOutputConfig, onChoose: handleChooseOutput }), showOrderByConfig &&
|
|
342
|
-
_jsx(TMMetadataChooserForm, { allowMultipleSelection: true, height: '500px', width: '600px', allowSysMetadata: true, qd: qd, selectedIDs: qd?.orderBy?.map((item) => ({ tid: item.tid, mid: item.mid })), onClose: handleCloseOrderByConfig, onChoose: handleChooseOrderBy })] })
|
|
340
|
+
_jsx(TMMetadataChooserForm, { allowMultipleSelection: true, height: '500px', width: '600px', allowSysMetadata: true, filterMetadata: (o => o.perm?.canSearch === AccessLevels.Yes), qd: qd, selectedIDs: qd?.where?.map((w) => ({ tid: w.tid, mid: w.mid })), onClose: handleCloseFiltersConfig, onChoose: handleChooseFilters }), showOutputConfig &&
|
|
341
|
+
_jsx(TMMetadataChooserForm, { allowMultipleSelection: true, height: '500px', width: '600px', allowSysMetadata: true, filterMetadata: (o => o.perm?.canView === AccessLevels.Yes || o.perm?.canUpdate === AccessLevels.Yes), qd: qd, selectedIDs: qd?.select?.map((item) => ({ tid: item.tid, mid: item.mid })), onClose: handleCloseOutputConfig, onChoose: handleChooseOutput }), showOrderByConfig &&
|
|
342
|
+
_jsx(TMMetadataChooserForm, { allowMultipleSelection: true, height: '500px', width: '600px', allowSysMetadata: true, filterMetadata: (o => o.perm?.canView === AccessLevels.Yes || o.perm?.canUpdate === AccessLevels.Yes), qd: qd, selectedIDs: qd?.orderBy?.map((item) => ({ tid: item.tid, mid: item.mid })), onClose: handleCloseOrderByConfig, onChoose: handleChooseOrderBy })] })
|
|
343
343
|
:
|
|
344
344
|
_jsx(TMToppyMessage, { message: SDKUI_Localizator.DcmtTypeSelectOrQuickSearch, titleTooltip: SDKUI_Localizator.DcmtTypeSelectOrQuickSearch }), showSqdForm &&
|
|
345
345
|
_jsx(StyledModalContainer, { style: { backgroundColor: `${TMColors.backgroundColorHeader}12` }, children: _jsx(TMSavedQueryForm, { height: '50%', width: '50%', id: formModeSqdForm === FormModes.Create ? -1 : SQD?.id, title: 'Ricerca rapida', formMode: formModeSqdForm, showBackButton: true, qd: qd, isAdvancedSearch: showAdvancedSearch, isModal: false, onClose: () => { setShowSqdForm(false); }, onSaved: onSqdSaved }) })] }), showDistinctValuesPanel &&
|
|
@@ -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;
|
|
@@ -50,6 +51,7 @@ interface ITMSearchResultProps {
|
|
|
50
51
|
showTodoDcmtForm?: boolean;
|
|
51
52
|
showToppyDraggableHelpCenter?: boolean;
|
|
52
53
|
toppyHelpCenterUsePortal?: boolean;
|
|
54
|
+
showNoDcmtFoundMessage?: boolean;
|
|
53
55
|
onReferenceClick?: (ref: ObjectRef) => void;
|
|
54
56
|
}
|
|
55
57
|
declare const TMSearchResult: React.FC<ITMSearchResultProps>;
|
|
@@ -1,14 +1,14 @@
|
|
|
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,
|
|
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';
|
|
10
10
|
import { DcmtOperationTypes, SearchResultContext } from '../../../ts';
|
|
11
|
-
import { Gutters
|
|
11
|
+
import { Gutters } from '../../../utils/theme';
|
|
12
12
|
import { StyledModalContainer, StyledMultiViewPanel } from '../../base/Styled';
|
|
13
13
|
import TMButton from '../../base/TMButton';
|
|
14
14
|
import TMDataGrid, { TMDataGridPageSize } from '../../base/TMDataGrid';
|
|
@@ -36,11 +36,9 @@ 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';
|
|
43
|
-
import TMSignSettingsForm from './TMSignSettingsForm';
|
|
44
42
|
import { getDcmtCicoStatus } from '../../../helper/checkinCheckoutManager';
|
|
45
43
|
import TMViewHistoryDcmt from './TMViewHistoryDcmt';
|
|
46
44
|
import TMBlogCommentForm from '../blog/TMBlogCommentForm';
|
|
@@ -69,7 +67,7 @@ const orderByName = (array) => {
|
|
|
69
67
|
return 1;
|
|
70
68
|
} return 0; });
|
|
71
69
|
};
|
|
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, }) => {
|
|
70
|
+
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, showNoDcmtFoundMessage = true, onReferenceClick, }) => {
|
|
73
71
|
const [id, setID] = useState('');
|
|
74
72
|
const [showApprovePopup, setShowApprovePopup] = useState(false);
|
|
75
73
|
const [showRejectPopup, setShowRejectPopup] = useState(false);
|
|
@@ -97,10 +95,9 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
97
95
|
const [sharedDcmtFile, setSharedDcmtFile] = useState(undefined);
|
|
98
96
|
// State to control whether the export form (for exporting to Excel/CSV/txt and others) should be shown
|
|
99
97
|
const [showExportForm, setShowExportForm] = useState(false);
|
|
100
|
-
const [showSignSettingsForm, setShowSignSettingsForm] = useState(false);
|
|
101
|
-
const [indexingInfoCache, setIndexingInfoCache] = useState(new Map());
|
|
102
98
|
const [showIndexingInfo, setShowIndexingInfo] = useState(false);
|
|
103
99
|
const [loadingIndexingInfo, setLoadingIndexingInfo] = useState(false);
|
|
100
|
+
const [indexingInfo, setIndexingInfo] = useState('');
|
|
104
101
|
const floatingBarContainerRef = useRef(null);
|
|
105
102
|
const [confirmFormat, ConfirmFormatDialog] = useInputCvtFormatDialog();
|
|
106
103
|
const { openConfirmAttachmentsDialog, ConfirmAttachmentsDialog } = useInputAttachmentsDialog();
|
|
@@ -147,7 +144,18 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
147
144
|
setSelectedSearchResult(searchResults[0]);
|
|
148
145
|
return;
|
|
149
146
|
}
|
|
150
|
-
//
|
|
147
|
+
// Se il TID precedentemente selezionato esiste ancora nei nuovi risultati, mantienilo.
|
|
148
|
+
// Questo evita l'errore E1047 in modalità multi-TID: cambiando TID cambiano le colonne
|
|
149
|
+
// e il filtro applicato potrebbe riferire campi non più presenti.
|
|
150
|
+
const prevTID = selectedSearchResult?.fromTID;
|
|
151
|
+
if (prevTID !== undefined) {
|
|
152
|
+
const found = searchResults.find(r => r.fromTID === prevTID);
|
|
153
|
+
if (found) {
|
|
154
|
+
setSelectedSearchResult(found);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// Altrimenti seleziona il primo risultato ordinato
|
|
151
159
|
setSelectedSearchResult(orderByName(searchResults)[0]);
|
|
152
160
|
}, [searchResults]);
|
|
153
161
|
useEffect(() => {
|
|
@@ -294,12 +302,6 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
294
302
|
const handleToggleSearch = () => {
|
|
295
303
|
setShowSearch(prev => !prev);
|
|
296
304
|
};
|
|
297
|
-
const openSignSettingsForm = () => {
|
|
298
|
-
setShowSignSettingsForm(true);
|
|
299
|
-
};
|
|
300
|
-
const closeSignSettingsForm = useCallback(() => {
|
|
301
|
-
setShowSignSettingsForm(false);
|
|
302
|
-
}, []);
|
|
303
305
|
const copyCheckoutPathToClipboardOperationCallback = () => {
|
|
304
306
|
const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
305
307
|
const firstDoc = selectedDocs?.[0];
|
|
@@ -600,7 +602,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
600
602
|
&& !showTodoDcmtForm);
|
|
601
603
|
}, [showToppyForApprove, showToppyDraggableHelpCenter, selectedDocs, showApprovePopup, showRejectPopup, showReAssignPopup, showMoreInfoPopup, editPdfForm, openS4TViewer, showTodoDcmtForm]);
|
|
602
604
|
const floatingMenuItems = useMemo(() => {
|
|
603
|
-
const baseMenuItems = getCommandsMenuItems(isMobile, fromDTD, allUsers, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove,
|
|
605
|
+
const baseMenuItems = getCommandsMenuItems(isMobile, fromDTD, allUsers, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, handleCheckOutOperationCallback, handleCheckInOperationCallback, showCheckoutInformationFormCallback, showHistoryCallback, copyCheckoutPathToClipboardOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation, pinnedItemIds, togglePin);
|
|
604
606
|
const customButtons = customButtonMenuItems();
|
|
605
607
|
return customButtons.name ? baseMenuItems.concat([customButtons]) : baseMenuItems;
|
|
606
608
|
}, [
|
|
@@ -612,19 +614,19 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
612
614
|
const searchResutlToolbar = _jsxs(_Fragment, { children: [(dcmtsReturned != dcmtsFound) && _jsx("p", { style: { textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${dcmtsReturned}/${dcmtsFound} restituiti` }), context === SearchResultContext.FAVORITES_AND_RECENTS &&
|
|
613
615
|
_jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconDelete, { color: 'white' }), caption: "Rimuovi da " + (selectedSearchResult?.category === "Favorites" ? '"Preferiti"' : '"Recenti"'), disabled: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length <= 0, onClick: removeDcmtFromFavsOrRecents }) }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconRefresh, { color: 'white' }), caption: SDKUI_Localizator.Refresh, onClick: onRefreshSearchAsync }), _jsx(TMContextMenu, { items: floatingMenuItems, trigger: "left", children: _jsx(IconMenuVertical, { color: 'white', cursor: 'pointer' }) })] });
|
|
614
616
|
const tmSearchResult = useMemo(() => (!searchResults || searchResults.length <= 0)
|
|
615
|
-
? _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%' }, children: [_jsx(IconBoard, { fontSize: 96 }), _jsx("div", { style: { fontSize: "15px", marginTop: "10px" }, children: SDKUI_Localizator.NoDcmtFound }), openAddDocumentForm && _jsx("div", { style: { marginTop: "10px" }, children: _jsx(TMButton, { fontSize: "15px", icon: _jsx("i", { className: 'dx-icon-share' }), caption: SDKUI_Localizator.Share, onClick: openAddDocumentForm }) })] })
|
|
617
|
+
? _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%' }, children: [_jsx(IconBoard, { fontSize: 96 }), showNoDcmtFoundMessage && _jsx("div", { style: { fontSize: "15px", marginTop: "10px" }, children: SDKUI_Localizator.NoDcmtFound }), openAddDocumentForm && _jsx("div", { style: { marginTop: "10px" }, children: _jsx(TMButton, { fontSize: "15px", icon: _jsx("i", { className: 'dx-icon-share' }), caption: SDKUI_Localizator.Share, onClick: openAddDocumentForm }) })] })
|
|
616
618
|
:
|
|
617
619
|
_jsxs(_Fragment, { children: [_jsxs(TMLayoutItem, { height: '100%', children: [_jsxs("div", { ref: floatingBarContainerRef, style: { position: 'relative', height: '100%', width: '100%' }, children: [_jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: Gutters.getGutters(), separatorActiveColor: 'transparent', separatorColor: 'transparent', min: ['0', '0'], showSeparator: showSelector && deviceType !== DeviceType.MOBILE, start: showSelector ? deviceType !== DeviceType.MOBILE ? ['30%', '70%'] : splitterSize : ['0%', '100%'], children: [showSelector ?
|
|
618
620
|
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, selectedSearchResult: selectedSearchResult, autoSelectFirst: !isMobile || currentSearchResults.length === 1, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
619
621
|
:
|
|
620
622
|
_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 &&
|
|
621
|
-
_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: () => {
|
|
623
|
+
_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, { fromDTD: fromDTD, TID: focusedItem?.TID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: onWFOperationCompleted, onClose: () => setShowMoreInfoPopup(false), getAllTasks: getAllTasks, triggerBlogRefresh: triggerBlogRefresh }), 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: () => {
|
|
622
624
|
setIsOpenBatchUpdate(false);
|
|
623
625
|
}, onSavedCallbackAsync: async () => {
|
|
624
626
|
setIsOpenBatchUpdate(false);
|
|
625
627
|
setIsModifiedBatchUpdate(false);
|
|
626
628
|
await refreshSelectionDataRowsAsync();
|
|
627
|
-
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), _jsx(TMToppyDraggableHelpCenter, { usePortal: toppyHelpCenterUsePortal, isVisible: isToppyHelpCenterVisible, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => {
|
|
629
|
+
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), _jsx(TMToppyDraggableHelpCenter, { usePortal: toppyHelpCenterUsePortal, isVisible: isToppyHelpCenterVisible, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { dtd: fromDTD, deviceType: deviceType, onApprove: () => {
|
|
628
630
|
setShowApprovePopup(true);
|
|
629
631
|
}, onSignApprove: () => {
|
|
630
632
|
handleSignApprove();
|
|
@@ -634,7 +636,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
634
636
|
setShowReAssignPopup(true);
|
|
635
637
|
}, onMoreInfo: () => {
|
|
636
638
|
setShowMoreInfoPopup(true);
|
|
637
|
-
}, approveDisable: selectedDocs.length === 0, signApproveDisable: disableSignApproveDisable, rejectDisable: selectedDocs.length === 0, reassignDisable: selectedDocs.length === 0, infoDisable: selectedDocs.length !== 1
|
|
639
|
+
}, approveDisable: selectedDocs.length === 0, signApproveDisable: disableSignApproveDisable, rejectDisable: selectedDocs.length === 0, reassignDisable: selectedDocs.length === 0, infoDisable: selectedDocs.length !== 1 }) }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), customButton && _jsx(TMCustomButton, { button: customButton, formData: currentMetadataValues, selectedItems: selectedItems, onClose: () => setCustomButton(undefined) }), showRelatedDcmtsChooser &&
|
|
638
640
|
_jsx(TMChooserForm, { dataSource: relatedDcmtsChooserDataSource, onChoose: async (selectedRelation) => {
|
|
639
641
|
try {
|
|
640
642
|
setShowRelatedDcmtsChooser(false);
|
|
@@ -731,42 +733,55 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
731
733
|
onRefreshSearchAsync,
|
|
732
734
|
handleNavigateToWGs,
|
|
733
735
|
handleNavigateToDossiers,
|
|
734
|
-
editPdfForm
|
|
736
|
+
editPdfForm,
|
|
737
|
+
showNoDcmtFoundMessage
|
|
735
738
|
]);
|
|
736
739
|
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]);
|
|
737
740
|
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]);
|
|
738
741
|
const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { currentDcmt: currentDcmt }, refreshPreviewTrigger), [currentDcmt, refreshPreviewTrigger]);
|
|
742
|
+
// Auto-fetch indexing info when drawer is open and focusedItem changes
|
|
743
|
+
useEffect(() => {
|
|
744
|
+
if (!focusedItem || !showIndexingInfo)
|
|
745
|
+
return;
|
|
746
|
+
const fetchData = async () => {
|
|
747
|
+
try {
|
|
748
|
+
setLoadingIndexingInfo(true);
|
|
749
|
+
const msg = await SDK_Globals.tmSession?.NewSearchEngine().FreeSearchGetDcmtInfoAsync(focusedItem.TID, focusedItem.DID);
|
|
750
|
+
setIndexingInfo(msg ?? '');
|
|
751
|
+
}
|
|
752
|
+
catch (e) {
|
|
753
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
754
|
+
}
|
|
755
|
+
finally {
|
|
756
|
+
setLoadingIndexingInfo(false);
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
fetchData();
|
|
760
|
+
}, [focusedItem, showIndexingInfo]);
|
|
739
761
|
const handleToggleIndexingInfo = async () => {
|
|
740
762
|
if (!focusedItem)
|
|
741
763
|
return;
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
}
|
|
757
|
-
catch (e) {
|
|
758
|
-
TMExceptionBoxManager.show({ exception: e });
|
|
759
|
-
}
|
|
760
|
-
finally {
|
|
761
|
-
setLoadingIndexingInfo(false);
|
|
764
|
+
const newShowState = !showIndexingInfo;
|
|
765
|
+
setShowIndexingInfo(newShowState);
|
|
766
|
+
if (newShowState) {
|
|
767
|
+
try {
|
|
768
|
+
setLoadingIndexingInfo(true);
|
|
769
|
+
const msg = await SDK_Globals.tmSession?.NewSearchEngine().FreeSearchGetDcmtInfoAsync(focusedItem.TID, focusedItem.DID);
|
|
770
|
+
setIndexingInfo(msg ?? '');
|
|
771
|
+
}
|
|
772
|
+
catch (e) {
|
|
773
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
774
|
+
}
|
|
775
|
+
finally {
|
|
776
|
+
setLoadingIndexingInfo(false);
|
|
777
|
+
}
|
|
762
778
|
}
|
|
763
779
|
};
|
|
764
780
|
const tmFullTextSearch = useMemo(() => {
|
|
765
781
|
if (!focusedItem) {
|
|
766
782
|
return (_jsxs(StyledPlaceholder, { children: [" ", _jsx("p", { children: "Seleziona un documento per visualizzare i dettagli della ricerca full-text" }), " "] }));
|
|
767
783
|
}
|
|
768
|
-
|
|
769
|
-
const ftExplanationsColumnIndex = selectedSearchResult?.selectMIDs?.findIndex(mid => mid === 0); //nosonar
|
|
784
|
+
const ftExplanationsColumnIndex = selectedSearchResult?.dtdResult?.columns?.findIndex(col => col.caption === 'FTExplanations');
|
|
770
785
|
if (ftExplanationsColumnIndex === undefined || ftExplanationsColumnIndex < 0) {
|
|
771
786
|
return (_jsxs(StyledPlaceholder, { children: [" ", _jsx("p", { children: "Nessuna info full-text disponibile" }), " "] }));
|
|
772
787
|
}
|
|
@@ -778,23 +793,21 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
778
793
|
if (!ftExplanation) {
|
|
779
794
|
return (_jsxs(StyledPlaceholder, { children: [" ", _jsx("p", { children: "Nessuna info disponibile per questo documento" }), " "] }));
|
|
780
795
|
}
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', height: '100%', overflow: 'hidden' }, 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 info' : SDKUI_Localizator.IndexingInformation })] }), _jsxs(StyledRightContent, { children: [cachedInfo && (_jsx(TMTooltip, { content: "Da cache", children: _jsx(StyledCachedIcon, { children: _jsx(IconCache, {}) }) })), _jsx(StyledChevron, { "$isOpen": showIndexingInfo, children: "\u25BC" })] })] }), loadingIndexingInfo && (_jsxs("div", { style: { marginTop: '10px', color: '#666' }, children: [SDKUI_Localizator.Loading, "..."] })), showIndexingInfo && cachedInfo && !loadingIndexingInfo && (_jsx(StyledIndexingInfoBox, { children: _jsx("div", { dangerouslySetInnerHTML: { __html: cachedInfo } }) }))] })] }));
|
|
784
|
-
}, [selectedSearchResult, focusedItem, indexingInfoCache, showIndexingInfo, loadingIndexingInfo]);
|
|
796
|
+
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, "..."] }))] }))] })] }));
|
|
797
|
+
}, [selectedSearchResult, focusedItem, indexingInfo, showIndexingInfo, loadingIndexingInfo]);
|
|
785
798
|
const allInitialPanelVisibility = {
|
|
786
799
|
'tmSearchResult': true,
|
|
787
800
|
'tmBlog': false,
|
|
788
801
|
'tmSysMetadata': false,
|
|
802
|
+
'tmFullTextSearch': false,
|
|
789
803
|
'tmDcmtPreview': false,
|
|
790
|
-
// 'tmFullTextSearch': false,
|
|
791
804
|
};
|
|
792
805
|
const initialPanelDimensions = {
|
|
793
806
|
'tmSearchResult': { width: '25%', height: '100%' },
|
|
794
807
|
'tmBlog': { width: '25%', height: '100%' },
|
|
795
808
|
'tmSysMetadata': { width: '25%', height: '100%' },
|
|
809
|
+
'tmFullTextSearch': { width: '25%', height: '100%' },
|
|
796
810
|
'tmDcmtPreview': { width: '25%', height: '100%' },
|
|
797
|
-
// 'tmFullTextSearch': { width: '25%', height: '100%' },
|
|
798
811
|
};
|
|
799
812
|
const initialPanels = useMemo(() => [
|
|
800
813
|
{
|
|
@@ -813,34 +826,34 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
813
826
|
toolbar: searchResutlToolbar
|
|
814
827
|
},
|
|
815
828
|
},
|
|
816
|
-
toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible:
|
|
829
|
+
toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmSearchResult, orderNumber: 1, isActive: allInitialPanelVisibility['tmSearchResult'] }
|
|
817
830
|
},
|
|
818
831
|
{
|
|
819
832
|
id: 'tmBlog',
|
|
820
833
|
name: SDKUI_Localizator.BlogCase,
|
|
821
834
|
contentOptions: { component: tmBlog, panelContainer: { title: SDKUI_Localizator.BlogCase, allowMaximize: !isMobile } },
|
|
822
|
-
toolbarOptions: { icon: _jsx(IconBoard, { fontSize: 24 }), visible:
|
|
835
|
+
toolbarOptions: { icon: _jsx(IconBoard, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmBlog, orderNumber: 2, isActive: allInitialPanelVisibility['tmBlog'] }
|
|
823
836
|
},
|
|
824
837
|
{
|
|
825
838
|
id: 'tmSysMetadata',
|
|
826
839
|
name: SDKUI_Localizator.MetadataSystem,
|
|
827
840
|
contentOptions: { component: tmSysMetadata, panelContainer: { title: SDKUI_Localizator.MetadataSystem, allowMaximize: !isMobile } },
|
|
828
|
-
toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible:
|
|
841
|
+
toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmSysMetadata, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
|
|
829
842
|
},
|
|
843
|
+
...(context === SearchResultContext.FREE_SEARCH ? [
|
|
844
|
+
{
|
|
845
|
+
id: 'tmFullTextSearch',
|
|
846
|
+
name: SDKUI_Localizator.ResultDetails,
|
|
847
|
+
contentOptions: { component: tmFullTextSearch, panelContainer: { title: SDKUI_Localizator.ResultDetails, allowMaximize: !isMobile } },
|
|
848
|
+
toolbarOptions: { icon: _jsx(IconPlatform, { fontSize: 20 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmFullTextSearch, orderNumber: 4, isActive: allInitialPanelVisibility['tmFullTextSearch'] }
|
|
849
|
+
}
|
|
850
|
+
] : []),
|
|
830
851
|
{
|
|
831
852
|
id: 'tmDcmtPreview',
|
|
832
853
|
name: SDKUI_Localizator.PreviewDocument,
|
|
833
854
|
contentOptions: { component: tmDcmtPreview },
|
|
834
|
-
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible:
|
|
835
|
-
}
|
|
836
|
-
// ...(context === SearchResultContext.FREE_SEARCH ? [
|
|
837
|
-
// {
|
|
838
|
-
// id: 'tmFullTextSearch',
|
|
839
|
-
// name: 'Ricerca FullText',
|
|
840
|
-
// contentOptions: { component: tmFullTextSearch, panelContainer: { title: 'Ricerca FullText', allowMaximize: !isMobile } },
|
|
841
|
-
// toolbarOptions: { icon: <IconMenuFullTextSearch fontSize={24} />, visible: true, orderNumber: 5, isActive: allInitialPanelVisibility['tmFullTextSearch'] }
|
|
842
|
-
// }
|
|
843
|
-
// ] : [])
|
|
855
|
+
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'] }
|
|
856
|
+
}
|
|
844
857
|
], [tmSearchResult, tmBlog, tmSysMetadata, tmDcmtPreview, tmFullTextSearch, showToolbarHeader, context, isMobile]);
|
|
845
858
|
return (_jsxs(StyledMultiViewPanel, { "$isVisible": isVisible, children: [_jsx(StyledMultiViewPanel, { "$isVisible": !isOpenDcmtForm && !isOpenDetails && !isOpenMaster, style: {
|
|
846
859
|
display: 'flex',
|
|
@@ -854,7 +867,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
854
867
|
:
|
|
855
868
|
_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) => {
|
|
856
869
|
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}`));
|
|
857
|
-
})] }), _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:
|
|
870
|
+
})] }), _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: () => {
|
|
858
871
|
setIsOpenArchiveRelationForm(false);
|
|
859
872
|
setArchiveType(undefined);
|
|
860
873
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
@@ -865,7 +878,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
865
878
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
866
879
|
setArchiveRelatedDcmtFormMids([]);
|
|
867
880
|
await onRefreshSearchAsync?.();
|
|
868
|
-
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar:
|
|
881
|
+
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar }), (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)] })] }));
|
|
869
882
|
};
|
|
870
883
|
export default TMSearchResult;
|
|
871
884
|
const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem, showSearch, allowMultipleSelection = true, showExportForm = false, onCloseExportForm, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, floatingMenuItems, onSelectionChanged, onDblClick }) => {
|
|
@@ -877,6 +890,7 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
877
890
|
const [visibleItems, setVisibleItems] = useState([]);
|
|
878
891
|
const [pageSize, setPageSize] = useState(SDKUI_Globals.userSettings.searchSettings?.pageSize ?? TMDataGridPageSize.Large);
|
|
879
892
|
const [isDataGridReady, setIsDataGridReady] = useState(false);
|
|
893
|
+
const dataGridRef = useRef(null);
|
|
880
894
|
const { loadDataListsAsync, renderDataListCell, dataListsCache } = useDataListItem();
|
|
881
895
|
const { loadUsersAsync, renderUserIdViewer, usersCache } = useDataUserIdItem();
|
|
882
896
|
useEffect(() => {
|
|
@@ -1147,6 +1161,19 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
1147
1161
|
]);
|
|
1148
1162
|
// Genera colonne con cache popolate per garantire headerFilter completi
|
|
1149
1163
|
const cols = generateColumns();
|
|
1164
|
+
// Cancella i filtri SOLO se le colonne sono cambiate (es. cambio TID).
|
|
1165
|
+
// Se le colonne restano le stesse (es. refresh sullo stesso TID), il filtro resta valido.
|
|
1166
|
+
// Previene l'errore E1047 quando il filtro riferisce campi non più presenti nelle nuove colonne.
|
|
1167
|
+
const oldFields = columns.map(c => c.dataField);
|
|
1168
|
+
const newFields = cols.map(c => c.dataField);
|
|
1169
|
+
const columnsChanged = oldFields.length !== newFields.length ||
|
|
1170
|
+
oldFields.some((f, i) => f !== newFields[i]);
|
|
1171
|
+
if (columnsChanged) {
|
|
1172
|
+
const gridInstance = dataGridRef.current?.instance();
|
|
1173
|
+
if (gridInstance) {
|
|
1174
|
+
gridInstance.clearFilter();
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1150
1177
|
setColumns(cols);
|
|
1151
1178
|
// Converte i risultati di ricerca in un array semplice per la griglia
|
|
1152
1179
|
let newDataSource = searchResultDescriptorToSimpleArray(searchResult);
|
|
@@ -1226,7 +1253,7 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
1226
1253
|
setVisibleItems(visibleRows.map((row) => { return row.data; }));
|
|
1227
1254
|
}, []);
|
|
1228
1255
|
useEffect(() => { onVisibleItemChanged?.(visibleItems); }, [visibleItems]);
|
|
1229
|
-
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [!isDataGridReady && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: '10px' }, children: [_jsx(LoadIndicator, { height: 60, width: 60 }), _jsx("div", { children: SDKUI_Localizator.Loading })] })), isDataGridReady && _jsx(TMDataGrid, { id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearch, showFilterPanel: true, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: pageSize, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, showHeaderColumnChooser: true, onKeyDown: onKeyDown, customContextMenuItems: floatingMenuItems, counterConfig: { show: true } }), (showExportForm && searchResult && onCloseExportForm) && _jsx(TMDataGridExportForm, { dataColumns: dataColumns, dataSource: dataSource, selectedRowKeys: selectedRowKeys, onCloseExportForm: onCloseExportForm, searchResult: searchResult })] });
|
|
1256
|
+
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [!isDataGridReady && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: '10px' }, children: [_jsx(LoadIndicator, { height: 60, width: 60 }), _jsx("div", { children: SDKUI_Localizator.Loading })] })), isDataGridReady && _jsx(TMDataGrid, { ref: dataGridRef, id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearch, showFilterPanel: true, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: pageSize, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, showHeaderColumnChooser: true, onKeyDown: onKeyDown, customContextMenuItems: floatingMenuItems, counterConfig: { show: true } }), (showExportForm && searchResult && onCloseExportForm) && _jsx(TMDataGridExportForm, { dataColumns: dataColumns, dataSource: dataSource, selectedRowKeys: selectedRowKeys, onCloseExportForm: onCloseExportForm, searchResult: searchResult })] });
|
|
1230
1257
|
};
|
|
1231
1258
|
//#region TMSearchResultSelector
|
|
1232
1259
|
const StyledItemTemplate = styled.div `
|
|
@@ -1258,13 +1285,21 @@ const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCa
|
|
|
1258
1285
|
sortedCategories.forEach((category) => {
|
|
1259
1286
|
groupedResults[category].sort((a, b) => (a.fromName ?? '').localeCompare(b.fromName ?? ''));
|
|
1260
1287
|
});
|
|
1261
|
-
//
|
|
1262
|
-
//
|
|
1288
|
+
// Sincronizza la selezione interna con quella del parent.
|
|
1289
|
+
// Quando selectedSearchResult è undefined (es. mobile back) resetta.
|
|
1290
|
+
// Quando selectedSearchResult cambia (es. refresh dopo WF operation), cerca il corrispondente
|
|
1291
|
+
// nel nuovo searchResults per aggiornare il reference e mantenere lo stile di selezione.
|
|
1263
1292
|
useEffect(() => {
|
|
1264
1293
|
if (selectedSearchResult === undefined) {
|
|
1265
1294
|
setSelectedResult(undefined);
|
|
1266
1295
|
}
|
|
1267
|
-
|
|
1296
|
+
else {
|
|
1297
|
+
const found = searchResults.find(r => r.fromTID === selectedSearchResult.fromTID);
|
|
1298
|
+
if (found) {
|
|
1299
|
+
setSelectedResult(found);
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
}, [selectedSearchResult, searchResults]);
|
|
1268
1303
|
// Auto-seleziona il primo risultato di ricerca solo se autoSelectFirst è true.
|
|
1269
1304
|
// Su mobile con più risultati, autoSelectFirst è false per permettere all'utente
|
|
1270
1305
|
// di vedere prima la lista dei tipi documento e scegliere manualmente.
|
|
@@ -1312,7 +1347,7 @@ const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCa
|
|
|
1312
1347
|
default: return category;
|
|
1313
1348
|
}
|
|
1314
1349
|
};
|
|
1315
|
-
const renderItemTemplate = useCallback((data) => (_jsxs("div", { style: { width: '100%', padding: '5px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, children: [_jsx(TMTidViewer, { tid: data.fromTID, did: Number(data.dtdResult?.rows?.[0]?.[1]), showIcon: true
|
|
1350
|
+
const renderItemTemplate = useCallback((data) => (_jsxs("div", { style: { width: '100%', padding: '5px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, children: [_jsx(TMTidViewer, { tid: data.fromTID, did: Number(data.dtdResult?.rows?.[0]?.[1]), showIcon: true }), _jsx("div", { style: { padding: 3, display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: 'white', color: 'gray', borderRadius: 3 }, children: data.dcmtsReturned })] })), []);
|
|
1316
1351
|
const accordionGroups = useMemo(() => sortedCategories.map((category, index) => ({
|
|
1317
1352
|
id: category,
|
|
1318
1353
|
title: getHeaderTitle(category),
|
|
@@ -1328,7 +1363,7 @@ const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCa
|
|
|
1328
1363
|
tooltip: 'Numero di tutti documenti'
|
|
1329
1364
|
}
|
|
1330
1365
|
],
|
|
1331
|
-
renderItem: (result, isSelected) => (_jsxs("div", { style: { width: '100%', padding: '5px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, children: [_jsx(TMTidViewer, { tid: result.fromTID, did: Number(result.dtdResult?.rows?.[0]?.[1]), showIcon: true
|
|
1366
|
+
renderItem: (result, isSelected) => (_jsxs("div", { style: { width: '100%', padding: '5px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, children: [_jsx(TMTidViewer, { tid: result.fromTID, did: Number(result.dtdResult?.rows?.[0]?.[1]), showIcon: true }), _jsx("div", { style: { padding: 3, display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: 'white', color: 'gray', borderRadius: 3 }, children: result.dcmtsReturned })] })),
|
|
1332
1367
|
itemHeight: 40
|
|
1333
1368
|
})), [sortedCategories, groupedResults, searchResults]);
|
|
1334
1369
|
const renderCategoryItems = (category) => (_jsx("div", { style: { padding: '5px' }, children: groupedResults[category].map((result, index) => (_jsx(MemoizedStyledItemTemplate, { "$isSelected": selectedResult === result, onClick: () => handleSelect(result), children: renderItemTemplate(result) }, index))) }));
|
|
@@ -1386,11 +1421,6 @@ const StyledIndexingToggle = styled.button `
|
|
|
1386
1421
|
transform: translateY(1px);
|
|
1387
1422
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
1388
1423
|
}
|
|
1389
|
-
|
|
1390
|
-
svg {
|
|
1391
|
-
color: #2196F3;
|
|
1392
|
-
font-size: 18px;
|
|
1393
|
-
}
|
|
1394
1424
|
`;
|
|
1395
1425
|
const StyledLeftContent = styled.div `
|
|
1396
1426
|
display: flex;
|
|
@@ -1402,17 +1432,6 @@ const StyledRightContent = styled.div `
|
|
|
1402
1432
|
align-items: center;
|
|
1403
1433
|
gap: 8px;
|
|
1404
1434
|
`;
|
|
1405
|
-
const StyledCachedIcon = styled.div `
|
|
1406
|
-
display: flex;
|
|
1407
|
-
align-items: center;
|
|
1408
|
-
justify-content: center;
|
|
1409
|
-
color: #4CAF50;
|
|
1410
|
-
font-size: 16px;
|
|
1411
|
-
|
|
1412
|
-
svg {
|
|
1413
|
-
color: #4CAF50;
|
|
1414
|
-
}
|
|
1415
|
-
`;
|
|
1416
1435
|
const StyledChevron = styled.span `
|
|
1417
1436
|
transition: transform 0.2s ease;
|
|
1418
1437
|
transform: ${props => props.$isOpen ? 'rotate(180deg)' : 'rotate(0deg)'};
|
|
@@ -1420,6 +1439,7 @@ const StyledChevron = styled.span `
|
|
|
1420
1439
|
font-size: 12px;
|
|
1421
1440
|
`;
|
|
1422
1441
|
const StyledIndexingInfoBox = styled.div `
|
|
1442
|
+
position: relative;
|
|
1423
1443
|
background: white;
|
|
1424
1444
|
border: 1px solid #e0e0e0;
|
|
1425
1445
|
border-radius: 6px;
|
|
@@ -5,7 +5,7 @@ import { DcmtInfo, DcmtOperationTypes, DownloadModes, DownloadTypes, SearchResul
|
|
|
5
5
|
export declare const getSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => DcmtInfo[];
|
|
6
6
|
export declare const getAllFieldSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => any[];
|
|
7
7
|
export declare const signatureInformationCallback: (isMobile: boolean, inputDcmts: DcmtInfo[] | undefined) => Promise<void>;
|
|
8
|
-
export declare const getCommandsMenuItems: (isMobile: boolean, dtd: DcmtTypeDescriptor | undefined, allUsers: Array<UserDescriptor>, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, workingGroupContext: WorkingGroupDescriptor | undefined, showSearch: boolean, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, openSharedArchiveHandler: () => Promise<void>, showSharedDcmtsHandler: () => Promise<void>, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean) => Promise<void>, runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>, onRefreshSearchAsync: (() => Promise<void>) | undefined, onRefreshDataRowsAsync: (() => Promise<void>) | undefined, onRefreshAfterAddDcmtToFavs: (() => void) | undefined, confirmFormat: () => Promise<FileFormats>, confirmAttachments: (list: FileDescriptor[]) => Promise<string[] | undefined>, openTaskFormHandler: () => void, openDetailDcmtsFormHandler: (value: boolean) => void, openMasterDcmtsFormHandler: (value: boolean) => void, openBatchUpdateFormHandler: (value: boolean) => void, openExportForm: () => void, handleToggleSearch: () => void, handleSignApprove: () => void,
|
|
8
|
+
export declare const getCommandsMenuItems: (isMobile: boolean, dtd: DcmtTypeDescriptor | undefined, allUsers: Array<UserDescriptor>, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, workingGroupContext: WorkingGroupDescriptor | undefined, showSearch: boolean, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, openSharedArchiveHandler: () => Promise<void>, showSharedDcmtsHandler: () => Promise<void>, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean) => Promise<void>, runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>, onRefreshSearchAsync: (() => Promise<void>) | undefined, onRefreshDataRowsAsync: (() => Promise<void>) | undefined, onRefreshAfterAddDcmtToFavs: (() => void) | undefined, confirmFormat: () => Promise<FileFormats>, confirmAttachments: (list: FileDescriptor[]) => Promise<string[] | undefined>, openTaskFormHandler: () => void, openDetailDcmtsFormHandler: (value: boolean) => void, openMasterDcmtsFormHandler: (value: boolean) => void, openBatchUpdateFormHandler: (value: boolean) => void, openExportForm: () => void, handleToggleSearch: () => void, handleSignApprove: () => void, handleCheckOutOperationCallback: (checkout: boolean) => Promise<void>, handleCheckInOperationCallback: () => void, showCheckoutInformationFormCallback: () => void, viewHistoryCallback: () => void, copyCheckoutPathToClipboardOperationCallback: () => void, openWGsCopyMoveForm?: ((mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void), openCommentFormCallback?: ((documents: Array<DcmtInfo>) => void), openEditPdf?: ((documents: Array<DcmtInfo>) => void), openAddDocumentForm?: () => void, passToArchiveCallback?: (outputMids: Array<{
|
|
9
9
|
mid: number;
|
|
10
10
|
value: string;
|
|
11
11
|
}>, tid?: number) => void, archiveMasterDocuments?: (tid: number | undefined) => Promise<void>, archiveDetailDocuments?: (tid: number | undefined) => Promise<void>, hasMasterRelation?: boolean, hasDetailRelation?: boolean, canArchiveMasterRelation?: boolean, canArchiveDetailRelation?: boolean, pairManyToManyDocuments?: (isPairing: boolean) => Promise<void>, hasManyToManyRelation?: boolean, pinnedItemIds?: string[], onTogglePin?: (id: string) => void) => Array<TMContextMenuItemProps>;
|