@topconsultnpm/sdkui-react 6.19.0 → 6.20.0-dev1.100
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/assets/Toppy-help-center.png +0 -0
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.d.ts +4 -0
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +441 -0
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +18 -0
- package/lib/components/NewComponents/ContextMenu/hooks.js +120 -0
- package/lib/components/NewComponents/ContextMenu/index.d.ts +5 -0
- package/lib/components/NewComponents/ContextMenu/index.js +3 -0
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +35 -0
- package/lib/components/NewComponents/ContextMenu/styles.js +428 -0
- package/lib/components/NewComponents/ContextMenu/types.d.ts +39 -0
- package/lib/components/NewComponents/ContextMenu/types.js +1 -0
- package/lib/components/NewComponents/ContextMenu/useLongPress.d.ts +21 -0
- package/lib/components/NewComponents/ContextMenu/useLongPress.js +112 -0
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.d.ts +4 -0
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +821 -0
- package/lib/components/NewComponents/FloatingMenuBar/index.d.ts +2 -0
- package/lib/components/NewComponents/FloatingMenuBar/index.js +2 -0
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +54 -0
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +419 -0
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +36 -0
- package/lib/components/NewComponents/FloatingMenuBar/types.js +1 -0
- package/lib/components/base/TMAccordion.js +2 -2
- package/lib/components/base/TMAccordionNew.js +35 -14
- package/lib/components/base/TMCustomButton.js +61 -17
- package/lib/components/base/TMDataGrid.d.ts +7 -4
- package/lib/components/base/TMDataGrid.js +153 -11
- package/lib/components/base/TMDropDownMenu.js +19 -18
- package/lib/components/base/TMFileManager.d.ts +4 -3
- package/lib/components/base/TMFileManager.js +32 -24
- package/lib/components/base/TMFileManagerDataGridView.d.ts +3 -2
- package/lib/components/base/TMFileManagerDataGridView.js +1 -11
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +7 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +5 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +17 -4
- package/lib/components/base/TMFileManagerThumbnailsView.js +18 -6
- package/lib/components/base/TMFileManagerUtils.d.ts +0 -12
- package/lib/components/base/TMListView.js +33 -15
- package/lib/components/base/TMPanel.d.ts +1 -1
- package/lib/components/base/TMPanel.js +1 -1
- package/lib/components/choosers/TMDistinctValues.js +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.js +8 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMUserChooser.d.ts +0 -5
- package/lib/components/choosers/TMUserChooser.js +25 -45
- package/lib/components/editors/TMDateBox.js +18 -9
- package/lib/components/editors/TMHtmlEditor.js +1 -1
- package/lib/components/editors/TMMetadataValues.js +37 -5
- package/lib/components/editors/TMTextArea.js +18 -30
- package/lib/components/editors/TMTextBox.js +6 -3
- package/lib/components/features/archive/TMArchive.js +2 -2
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +15 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +460 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.d.ts +11 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.js +126 -0
- package/lib/components/features/documents/TMDcmtBlog.d.ts +1 -7
- package/lib/components/features/documents/TMDcmtBlog.js +29 -2
- package/lib/components/features/documents/TMDcmtForm.d.ts +14 -2
- package/lib/components/features/documents/TMDcmtForm.js +466 -232
- package/lib/components/features/documents/TMDcmtPreview.js +44 -78
- package/lib/components/features/documents/TMDcmtTasks.js +9 -9
- package/lib/components/features/documents/TMMasterDetailDcmts.js +38 -53
- package/lib/components/features/documents/TMRelationViewer.d.ts +1 -1
- package/lib/components/features/documents/TMRelationViewer.js +2 -2
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
- package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +6 -11
- package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
- package/lib/components/features/search/TMSearch.d.ts +3 -0
- package/lib/components/features/search/TMSearch.js +45 -10
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +19 -18
- package/lib/components/features/search/TMSearchResult.d.ts +3 -0
- package/lib/components/features/search/TMSearchResult.js +229 -160
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
- package/lib/components/features/search/TMSearchResultsMenuItems.js +216 -180
- package/lib/components/features/search/TMSignSettingsForm.js +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
- package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
- package/lib/components/features/search/{TMViewHistoryDcmtForm.d.ts → TMViewHistoryDcmt.d.ts} +3 -3
- package/lib/components/features/search/{TMViewHistoryDcmtForm.js → TMViewHistoryDcmt.js} +83 -13
- package/lib/components/features/tasks/TMTaskForm.js +20 -1
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +3 -1
- package/lib/components/features/tasks/TMTasksAgenda.js +48 -9
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +2 -0
- package/lib/components/features/tasks/TMTasksCalendar.js +19 -7
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
- package/lib/components/features/tasks/TMTasksUtils.js +43 -36
- package/lib/components/features/tasks/TMTasksView.js +28 -19
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
- package/lib/components/features/workflow/TMWorkflowPopup.js +139 -34
- package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +2 -0
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +12 -7
- package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
- package/lib/components/features/workflow/diagram/WFDiagram.d.ts +4 -0
- package/lib/components/features/workflow/diagram/WFDiagram.js +164 -13
- package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
- package/lib/components/forms/Login/LoginValidatorService.js +7 -2
- package/lib/components/forms/Login/TMLoginForm.js +34 -6
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +56 -31
- package/lib/components/grids/TMRecentsManager.js +20 -10
- package/lib/components/index.d.ts +5 -3
- package/lib/components/index.js +5 -3
- package/lib/components/query/TMQueryEditor.d.ts +2 -1
- package/lib/components/query/TMQueryEditor.js +92 -92
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/settings/SettingsAppearance.js +99 -30
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
- package/lib/components/viewers/TMDataListItemViewer.js +35 -71
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +8 -0
- package/lib/components/viewers/TMDataUserIdItemViewer.js +39 -0
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +22 -14
- package/lib/helper/SDKUI_Globals.js +6 -0
- package/lib/helper/SDKUI_Localizator.d.ts +24 -1
- package/lib/helper/SDKUI_Localizator.js +255 -1
- package/lib/helper/TMCommandsContextMenu.d.ts +4 -2
- package/lib/helper/TMCommandsContextMenu.js +15 -4
- package/lib/helper/TMIcons.d.ts +4 -0
- package/lib/helper/TMIcons.js +13 -3
- package/lib/helper/TMPdfViewer.d.ts +8 -0
- package/lib/helper/TMPdfViewer.js +373 -0
- package/lib/helper/TMUtils.d.ts +3 -1
- package/lib/helper/TMUtils.js +51 -0
- package/lib/helper/checkinCheckoutManager.d.ts +85 -0
- package/lib/helper/checkinCheckoutManager.js +348 -0
- package/lib/helper/devextremeCustomMessages.d.ts +30 -0
- package/lib/helper/devextremeCustomMessages.js +30 -0
- package/lib/helper/helpers.d.ts +3 -1
- package/lib/helper/helpers.js +31 -4
- package/lib/helper/index.d.ts +3 -0
- package/lib/helper/index.js +3 -0
- package/lib/helper/queryHelper.d.ts +1 -1
- package/lib/helper/queryHelper.js +46 -4
- package/lib/helper/workItemsHelper.d.ts +6 -0
- package/lib/helper/workItemsHelper.js +230 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
- package/lib/hooks/useCheckInOutOperations.js +223 -0
- package/lib/hooks/useDataListItem.d.ts +12 -0
- package/lib/hooks/useDataListItem.js +132 -0
- package/lib/hooks/useDataUserIdItem.d.ts +10 -0
- package/lib/hooks/useDataUserIdItem.js +96 -0
- package/lib/hooks/useSettingsFeedback.d.ts +11 -0
- package/lib/hooks/useSettingsFeedback.js +38 -0
- package/lib/hooks/useWorkflowApprove.d.ts +4 -0
- package/lib/hooks/useWorkflowApprove.js +14 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -2
- package/lib/services/platform_services.d.ts +3 -3
- package/lib/ts/types.d.ts +61 -1
- package/lib/utils/theme.d.ts +1 -1
- package/lib/utils/theme.js +1 -1
- package/package.json +55 -52
- package/lib/components/base/TMContextMenu.d.ts +0 -25
- package/lib/components/base/TMContextMenu.js +0 -109
- package/lib/components/base/TMContextMenuOLD.d.ts +0 -26
- package/lib/components/base/TMContextMenuOLD.js +0 -56
- package/lib/components/base/TMFloatingToolbar.d.ts +0 -9
- package/lib/components/base/TMFloatingToolbar.js +0 -101
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +0 -30
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +0 -482
- package/lib/components/features/assistant/ToppySpeechBubble.d.ts +0 -9
- package/lib/components/features/assistant/ToppySpeechBubble.js +0 -117
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
- package/lib/helper/cicoHelper.d.ts +0 -31
- package/lib/helper/cicoHelper.js +0 -155
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
-
import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes,
|
|
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';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { getAllFieldSelectedDcmtsOrFocused, getCommandsMenuItems, getSelectedDcmtsOrFocused } from './TMSearchResultsMenuItems';
|
|
6
|
-
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys,
|
|
6
|
+
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, deepCompare, generateUniqueColumnKeys, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, IconSearchCheck, TMImageLibrary, convertSearchResultDescriptorToFileItems, IconCustom, isApprovalWorkflowView, SDKUI_Globals, getMoreInfoTasksForDocument } 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
|
-
import { DcmtOperationTypes, SearchResultContext
|
|
10
|
+
import { DcmtOperationTypes, SearchResultContext } from '../../../ts';
|
|
11
11
|
import { Gutters, TMColors } from '../../../utils/theme';
|
|
12
12
|
import { StyledModalContainer, StyledMultiViewPanel } from '../../base/Styled';
|
|
13
13
|
import TMButton from '../../base/TMButton';
|
|
@@ -16,12 +16,11 @@ import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
|
|
16
16
|
import { TMSplitterLayout, TMLayoutItem } from '../../base/TMLayout';
|
|
17
17
|
import { TMMessageBoxManager, ButtonNames, TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
18
18
|
import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
|
19
|
-
import { TMUserIdViewer } from '../../choosers/TMUserChooser';
|
|
20
19
|
import TMMetadataValues from '../../editors/TMMetadataValues';
|
|
21
|
-
import TMDataListItemViewer from '../../viewers/TMDataListItemViewer';
|
|
22
20
|
import TMTidViewer from '../../viewers/TMTidViewer';
|
|
23
21
|
import TMDcmtPreview from '../documents/TMDcmtPreview';
|
|
24
|
-
import
|
|
22
|
+
import TMFloatingMenuBar from '../../NewComponents/FloatingMenuBar/TMFloatingMenuBar';
|
|
23
|
+
import TMContextMenu from '../../NewComponents/ContextMenu/TMContextMenu';
|
|
25
24
|
import { WorkFlowApproveRejectPopUp, WorkFlowMoreInfoPopUp, WorkFlowOperationButtons, WorkFlowReAssignPopUp } from '../workflow/TMWorkflowPopup';
|
|
26
25
|
import TMMasterDetailDcmts from '../documents/TMMasterDetailDcmts';
|
|
27
26
|
import TMBatchUpdateForm from '../../features/documents/TMBatchUpdateForm';
|
|
@@ -39,13 +38,18 @@ import TMChooserForm from '../../forms/TMChooserForm';
|
|
|
39
38
|
import TMModal from '../../base/TMModal';
|
|
40
39
|
import TMSearch from './TMSearch';
|
|
41
40
|
import TMArchive from '../archive/TMArchive';
|
|
42
|
-
import { TMResultManager } from '../../forms/TMResultDialog';
|
|
43
41
|
import TMCustomButton from '../../base/TMCustomButton';
|
|
44
|
-
import ToppyDraggableHelpCenter from '../assistant/ToppyDraggableHelpCenter';
|
|
45
42
|
import TMSignSettingsForm from './TMSignSettingsForm';
|
|
46
|
-
import {
|
|
47
|
-
import
|
|
48
|
-
import
|
|
43
|
+
import { getDcmtCicoStatus } from '../../../helper/checkinCheckoutManager';
|
|
44
|
+
import TMViewHistoryDcmt from './TMViewHistoryDcmt';
|
|
45
|
+
import TMBlogCommentForm from '../blog/TMBlogCommentForm';
|
|
46
|
+
import { useCheckInOutOperations } from '../../../hooks/useCheckInOutOperations';
|
|
47
|
+
import TMDcmtCheckoutInfoForm from './TMDcmtCheckoutInfoForm';
|
|
48
|
+
import { useDataListItem } from '../../../hooks/useDataListItem';
|
|
49
|
+
import { useDataUserIdItem } from '../../../hooks/useDataUserIdItem';
|
|
50
|
+
import { LoadIndicator } from 'devextreme-react';
|
|
51
|
+
import TMToppyDraggableHelpCenter from '../assistant/TMToppyDraggableHelpCenter';
|
|
52
|
+
let abortControllerLocal = new AbortController();
|
|
49
53
|
//#region Helper Methods
|
|
50
54
|
export const getSearchResultCountersSingleCategory = (searchResults) => {
|
|
51
55
|
// let totDcmtTypes = searchResults.length;
|
|
@@ -63,7 +67,7 @@ const orderByName = (array) => {
|
|
|
63
67
|
return 1;
|
|
64
68
|
} return 0; });
|
|
65
69
|
};
|
|
66
|
-
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, openEditPdf, openCommentFormCallback, openAddDocumentForm, openS4TViewer = false, onOpenS4TViewerRequest, passToArchiveCallback, showTodoDcmtForm = 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, 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, }) => {
|
|
67
71
|
const [id, setID] = useState('');
|
|
68
72
|
const [showApprovePopup, setShowApprovePopup] = useState(false);
|
|
69
73
|
const [showRejectPopup, setShowRejectPopup] = useState(false);
|
|
@@ -92,9 +96,11 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
92
96
|
// State to control whether the export form (for exporting to Excel/CSV/txt and others) should be shown
|
|
93
97
|
const [showExportForm, setShowExportForm] = useState(false);
|
|
94
98
|
const [showSignSettingsForm, setShowSignSettingsForm] = useState(false);
|
|
99
|
+
const floatingBarContainerRef = useRef(null);
|
|
95
100
|
const [confirmFormat, ConfirmFormatDialog] = useInputCvtFormatDialog();
|
|
96
101
|
const { openConfirmAttachmentsDialog, ConfirmAttachmentsDialog } = useInputAttachmentsDialog();
|
|
97
102
|
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync, getDcmtFileAsync } = useDcmtOperations();
|
|
103
|
+
const { showHistory, showHistoryCallback, hideHistoryCallback, showCheckoutInformationForm, commentFormState, hideCommentFormCallback, showCheckoutInformationFormCallback, hideCheckoutInformationFormCallback, copyCheckoutPathToClipboardCallback, handleCheckOutCallback, handleCheckInCallback, refreshPreviewTrigger, showCicoWaitPanel, cicoWaitPanelTitle, showCicoPrimaryProgress, cicoPrimaryProgressText, cicoPrimaryProgressValue, cicoPrimaryProgressMax, } = useCheckInOutOperations();
|
|
98
104
|
const relatedDocuments = useRelatedDocuments({ selectedSearchResult, focusedItem, currentSearchResults });
|
|
99
105
|
const { relatedDcmts, showRelatedDcmtsChooser, archiveType, isOpenDetails, isOpenMaster, isOpenArchiveRelationForm, archiveRelatedDcmtFormTID, archiveRelatedDcmtFormMids, relatedDcmtsChooserDataSource, showPairDcmtsModal, isPairingManyToMany, pairedSearchResults, manyToManyRelations, selectedManyToManyRelation, showManyToManyChooser, manyToManyChooserDataSource, showPairSearchModal, pairSearchModalTargetTID, pairSearchModalParentTID, pairSearchModalParentDID, pairSearchModalRelation, pairSearchModalInputMids, currentTIDHasDetailRelations, currentTIDHasMasterRelations, canArchiveMasterRelation, canArchiveDetailRelation, hasManyToManyRelation, setIsOpenDetails, setIsOpenMaster, setShowRelatedDcmtsChooser, setShowManyToManyChooser, setShowPairDcmtsModal, setShowPairSearchModal, setIsOpenArchiveRelationForm, setArchiveType, setArchiveRelatedDcmtFormTID, setArchiveRelatedDcmtFormMids, pairFloatingActionConfig, pairSearchModalFloatingActionConfig, archiveMasterDocuments, archiveDetailDocuments, pairManyToMany, checkRelatedDcmtsArchiveCapability, checkManyToManyCapability, archiveRelatedDcmtHandler, executeManyToManyPairing, } = relatedDocuments;
|
|
100
106
|
const [customButtonsLayout, setCustomButtonsLayout] = useState();
|
|
@@ -109,15 +115,12 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
109
115
|
const disableSignApproveDisable = selectedDocs.length !== 1 || (selectedDocs.length === 1 && selectedDocs[0].FILEEXT === null);
|
|
110
116
|
const dcmtsReturned = (searchResults?.length > 1 ? selectedSearchResult?.dcmtsReturned : searchResults[0]?.dcmtsReturned ?? 0);
|
|
111
117
|
const dcmtsFound = (searchResults?.length > 1 ? selectedSearchResult?.dcmtsFound : searchResults[0]?.dcmtsFound ?? 0);
|
|
112
|
-
// Dcmt Blog states
|
|
113
|
-
const [blogsDatasource, setBlogsDatasource] = useState([]);
|
|
114
|
-
const [hasLoadedDataOnce, setHasLoadedDataOnce] = useState(false); //traccia se *qualsiasi* dato è stato caricato per la prima volta
|
|
115
|
-
const [lastLoadedDid, setLastLoadedDid] = useState(undefined); // `lastLoadedDid` tiene traccia dell'ultimo `did` per cui abbiamo caricato i dati
|
|
116
|
-
// State to manage show history selected file
|
|
117
|
-
const [showHistory, setShowHistory] = useState(false);
|
|
118
118
|
const [allUsers, setAllUsers] = useState([]);
|
|
119
|
-
//
|
|
120
|
-
const [
|
|
119
|
+
// Stato per triggerare il refresh del blog dall'esterno
|
|
120
|
+
const [refreshBlogTrigger, setRefreshBlogTrigger] = useState(0);
|
|
121
|
+
const triggerBlogRefresh = useCallback(async () => {
|
|
122
|
+
setRefreshBlogTrigger(prev => prev + 1);
|
|
123
|
+
}, []);
|
|
121
124
|
useEffect(() => {
|
|
122
125
|
const fetchAllUsers = async () => {
|
|
123
126
|
const users = await UserListCacheService.GetAllAsync();
|
|
@@ -259,7 +262,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
259
262
|
try {
|
|
260
263
|
const dtd = await DcmtTypeListCacheService.GetWithNotGrantedAsync(item.TID, item?.DID);
|
|
261
264
|
if (dtd) {
|
|
262
|
-
const isWorkItem = dtd
|
|
265
|
+
const isWorkItem = isApprovalWorkflowView(dtd);
|
|
263
266
|
const name = `${dtd.name ?? '-'} (DID: ${item.DID})`;
|
|
264
267
|
onTaskCreateRequest?.(isWorkItem
|
|
265
268
|
? { workItem: { tid: item.TID, did: item.DID, name } }
|
|
@@ -291,12 +294,13 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
291
294
|
const closeSignSettingsForm = useCallback(() => {
|
|
292
295
|
setShowSignSettingsForm(false);
|
|
293
296
|
}, []);
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
297
|
+
const copyCheckoutPathToClipboardOperationCallback = () => {
|
|
298
|
+
const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
299
|
+
const firstDoc = selectedDocs?.[0];
|
|
300
|
+
if (!firstDoc)
|
|
301
|
+
return;
|
|
302
|
+
copyCheckoutPathToClipboardCallback(firstDoc, fromDTD?.name ?? SDKUI_Localizator.SearchResult);
|
|
303
|
+
};
|
|
300
304
|
const getTitleHeader = () => {
|
|
301
305
|
let counters = (showSelector && disableAccordionIfSingleCategory && searchResults.length > 1) ? getSearchResultCountersSingleCategory(searchResults) : "";
|
|
302
306
|
if (title)
|
|
@@ -357,88 +361,30 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
357
361
|
const customButtonMenuItems = () => {
|
|
358
362
|
const customButtonsItems = customButtonsLayout?.customButtons?.filter((customButton) => customButton.isForSearchResult && customButton.isForSearchResult > 0)
|
|
359
363
|
.map((customButton) => ({
|
|
360
|
-
icon:
|
|
361
|
-
|
|
364
|
+
icon: TMImageLibrary({ imageID: customButton.glyphID }),
|
|
365
|
+
name: customButton.title || 'Bottone personalizzato',
|
|
362
366
|
onClick: () => setCustomButton(customButton)
|
|
363
367
|
}));
|
|
364
|
-
return {
|
|
365
|
-
icon:
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
};
|
|
368
|
+
return customButtonsItems && customButtonsItems.length > 0 ? {
|
|
369
|
+
icon: _jsx(IconCustom, {}),
|
|
370
|
+
name: SDKUI_Localizator.CustomButtons,
|
|
371
|
+
submenu: customButtonsItems
|
|
372
|
+
} : {};
|
|
369
373
|
};
|
|
370
|
-
const
|
|
371
|
-
|
|
374
|
+
const handleCheckOutOperationCallback = async (checkout) => {
|
|
375
|
+
const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
376
|
+
const firstDoc = selectedDocs?.[0];
|
|
377
|
+
if (!firstDoc)
|
|
372
378
|
return;
|
|
373
|
-
|
|
374
|
-
e.items = e.items || [];
|
|
375
|
-
const menuItems = 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, openSignSettingsForm, handleCheckOutOperationCallback, showCheckoutInformationFormCallback, viewHistoryCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation);
|
|
376
|
-
e.items.push(...menuItems);
|
|
377
|
-
//disabilitato per ora
|
|
378
|
-
//e.items.push(customButtonMenuItems());
|
|
379
|
-
}
|
|
379
|
+
await handleCheckOutCallback(firstDoc, checkout, fromDTD?.name ?? SDKUI_Localizator.SearchResult, downloadDcmtsAsync, undefined, refreshFocusedDataRowAsync);
|
|
380
380
|
};
|
|
381
|
-
const
|
|
381
|
+
const handleCheckInOperationCallback = async () => {
|
|
382
382
|
const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
383
383
|
const firstDoc = selectedDocs?.[0];
|
|
384
384
|
if (!firstDoc)
|
|
385
385
|
return;
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
TMMessageBoxManager.show({
|
|
389
|
-
title: title,
|
|
390
|
-
message: msg,
|
|
391
|
-
buttons: [ButtonNames.YES, ButtonNames.NO],
|
|
392
|
-
onButtonClick: async (e) => {
|
|
393
|
-
let result = [];
|
|
394
|
-
if (e !== ButtonNames.YES)
|
|
395
|
-
return;
|
|
396
|
-
try {
|
|
397
|
-
const ue = SDK_Globals.tmSession?.NewUpdateEngineByID();
|
|
398
|
-
if (ue) {
|
|
399
|
-
ue.TID = firstDoc.TID;
|
|
400
|
-
ue.DID = firstDoc.DID;
|
|
401
|
-
if (checkout) {
|
|
402
|
-
await ue.CheckOutAsync()
|
|
403
|
-
.then(async () => {
|
|
404
|
-
const filename = fromDTD?.nameLoc || SDKUI_Localizator.SearchResult;
|
|
405
|
-
await downloadFilesCallback(filename, [firstDoc], true, downloadDcmtsAsync);
|
|
406
|
-
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
407
|
-
await refreshFocusedDataRowAsync(firstDoc.TID, firstDoc.DID, true);
|
|
408
|
-
})
|
|
409
|
-
.catch((error) => {
|
|
410
|
-
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
411
|
-
throw error;
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
else {
|
|
415
|
-
await ue.UndoCheckOutAsync()
|
|
416
|
-
.then(async () => {
|
|
417
|
-
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
418
|
-
// Remove the corresponding draft checkout item
|
|
419
|
-
updateDcmtCheckoutItem({
|
|
420
|
-
TID: firstDoc.TID.toString(),
|
|
421
|
-
DID: firstDoc.DID.toString(),
|
|
422
|
-
checkoutFolder: "",
|
|
423
|
-
checkoutName: ""
|
|
424
|
-
}, "remove");
|
|
425
|
-
await refreshFocusedDataRowAsync(firstDoc.TID, firstDoc.DID, true);
|
|
426
|
-
})
|
|
427
|
-
.catch((error) => {
|
|
428
|
-
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
429
|
-
throw error;
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
catch (error) {
|
|
435
|
-
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
436
|
-
}
|
|
437
|
-
finally {
|
|
438
|
-
TMResultManager.show(result, title, "ID", undefined);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
});
|
|
386
|
+
firstDoc.fileName = fromDTD?.name ?? SDKUI_Localizator.SearchResult;
|
|
387
|
+
await handleCheckInCallback(firstDoc, undefined, refreshFocusedDataRowAsync);
|
|
442
388
|
};
|
|
443
389
|
const refreshDataGridAfterRemoveAsync = async () => {
|
|
444
390
|
let index = selectedSearchResult?.dtdResult?.columns?.findIndex(col => col.caption === 'DID');
|
|
@@ -617,8 +563,6 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
617
563
|
break;
|
|
618
564
|
}
|
|
619
565
|
};
|
|
620
|
-
const searchResutlToolbar = _jsxs(_Fragment, { children: [(dcmtsReturned != dcmtsFound) && _jsx("p", { style: { backgroundColor: `white`, color: TMColors.primaryColor, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${dcmtsReturned}/${dcmtsFound} restituiti` }), context === SearchResultContext.FAVORITES_AND_RECENTS &&
|
|
621
|
-
_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(IconMenuVertical, { id: `commands-header-${id}`, color: 'white', cursor: 'pointer' }), _jsx(TMCommandsContextMenu, { target: `#commands-header-${id}`, showEvent: "click", menuItems: 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, openSignSettingsForm, handleCheckOutOperationCallback, showCheckoutInformationFormCallback, viewHistoryCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation) /*.concat([customButtonMenuItems()])*/ })] });
|
|
622
566
|
const handleAddItem = (tid, did) => {
|
|
623
567
|
let newItem = { TID: tid ?? 0, DID: did ?? 0 };
|
|
624
568
|
setSecondaryMasterDcmts((prevItems) => [...prevItems, newItem]);
|
|
@@ -626,40 +570,55 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
626
570
|
const handleRemoveItem = (tid, did) => {
|
|
627
571
|
setSecondaryMasterDcmts((prevItems) => prevItems.filter(item => item.TID !== tid && item.DID !== did));
|
|
628
572
|
};
|
|
629
|
-
const fetchBlogDataAsync = useCallback(async (tid, did) => {
|
|
630
|
-
try {
|
|
631
|
-
TMSpinner.show({ description: 'Caricamento - Bacheca...' });
|
|
632
|
-
const res = await SDK_Globals.tmSession?.NewSearchEngine().BlogRetrieveAsync(tid, did);
|
|
633
|
-
setBlogsDatasource(res ?? []);
|
|
634
|
-
setHasLoadedDataOnce(true);
|
|
635
|
-
setLastLoadedDid(did);
|
|
636
|
-
}
|
|
637
|
-
catch (e) {
|
|
638
|
-
let err = e;
|
|
639
|
-
TMExceptionBoxManager.show({ exception: err });
|
|
640
|
-
}
|
|
641
|
-
finally {
|
|
642
|
-
TMSpinner.hide();
|
|
643
|
-
}
|
|
644
|
-
}, []);
|
|
645
573
|
const handleSavedAsyncCallback = useCallback(async (tid, did, metadataResult) => {
|
|
646
574
|
await refreshFocusedDataRowAsync(tid, did, true, metadataResult);
|
|
647
|
-
}, []);
|
|
648
|
-
const showToppyForApprove = (
|
|
575
|
+
}, [refreshFocusedDataRowAsync]);
|
|
576
|
+
const showToppyForApprove = useMemo(() => {
|
|
577
|
+
return Boolean(isVisible && fromDTD && isApprovalWorkflowView(fromDTD) && !isOpenDcmtForm && !isOpenDetails && !isOpenMaster);
|
|
578
|
+
}, [isVisible, fromDTD, isOpenDcmtForm, isOpenDetails, isOpenMaster]);
|
|
579
|
+
/**
|
|
580
|
+
* TMToppyDraggableHelpCenter viene nascosto quando è aperto qualsiasi altro popup o modale che potrebbe
|
|
581
|
+
* interferire con l'interazione dell'utente (approvazione, rifiuto, riassegnazione, info aggiuntive,
|
|
582
|
+
* modifica PDF, visualizzatore S4T, form todo documento).
|
|
583
|
+
*/
|
|
584
|
+
const isToppyHelpCenterVisible = useMemo(() => {
|
|
585
|
+
return Boolean(showToppyForApprove
|
|
586
|
+
&& showToppyDraggableHelpCenter
|
|
587
|
+
&& selectedDocs.length > 0
|
|
588
|
+
&& !showApprovePopup
|
|
589
|
+
&& !showRejectPopup
|
|
590
|
+
&& !showReAssignPopup
|
|
591
|
+
&& !showMoreInfoPopup
|
|
592
|
+
&& !editPdfForm
|
|
593
|
+
&& !openS4TViewer
|
|
594
|
+
&& !showTodoDcmtForm);
|
|
595
|
+
}, [showToppyForApprove, showToppyDraggableHelpCenter, selectedDocs, showApprovePopup, showRejectPopup, showReAssignPopup, showMoreInfoPopup, editPdfForm, openS4TViewer, showTodoDcmtForm]);
|
|
596
|
+
const floatingMenuItems = useMemo(() => {
|
|
597
|
+
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, openSignSettingsForm, handleCheckOutOperationCallback, handleCheckInOperationCallback, showCheckoutInformationFormCallback, showHistoryCallback, copyCheckoutPathToClipboardOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation);
|
|
598
|
+
const customButtons = customButtonMenuItems();
|
|
599
|
+
return customButtons.name ? baseMenuItems.concat([customButtons]) : baseMenuItems;
|
|
600
|
+
}, [
|
|
601
|
+
isMobile, fromDTD, allUsers, selectedItems, focusedItem, context,
|
|
602
|
+
showFloatingBar, workingGroupContext, showSearch, currentTIDHasMasterRelations,
|
|
603
|
+
currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation,
|
|
604
|
+
hasManyToManyRelation, customButtonsLayout
|
|
605
|
+
]);
|
|
606
|
+
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 &&
|
|
607
|
+
_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' }) })] });
|
|
649
608
|
const tmSearchResult = useMemo(() => (!searchResults || searchResults.length <= 0)
|
|
650
609
|
? _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 }) })] })
|
|
651
610
|
:
|
|
652
|
-
_jsxs(_Fragment, { children: [_jsxs(TMLayoutItem, { height: '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 ?
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
611
|
+
_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 ?
|
|
612
|
+
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, selectedSearchResult: selectedSearchResult, autoSelectFirst: !isMobile || currentSearchResults.length === 1, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
613
|
+
:
|
|
614
|
+
_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 &&
|
|
615
|
+
_jsx(TMFloatingMenuBar, { containerRef: floatingBarContainerRef, contextMenuItems: floatingMenuItems, isConstrained: true, defaultPosition: { x: 1, y: 88 }, contextMenuDefaultPinnedIds: ['rel-det', 'rel-mst', 'dl'], defaultOrientation: 'horizontal' })] }), 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: () => {
|
|
657
616
|
setIsOpenBatchUpdate(false);
|
|
658
617
|
}, onSavedCallbackAsync: async () => {
|
|
659
618
|
setIsOpenBatchUpdate(false);
|
|
660
619
|
setIsModifiedBatchUpdate(false);
|
|
661
620
|
await refreshSelectionDataRowsAsync();
|
|
662
|
-
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), _jsx(
|
|
621
|
+
}, 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: () => {
|
|
663
622
|
setShowApprovePopup(true);
|
|
664
623
|
}, onSignApprove: () => {
|
|
665
624
|
handleSignApprove();
|
|
@@ -702,7 +661,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
702
661
|
TMSpinner.hide();
|
|
703
662
|
}
|
|
704
663
|
}, onClose: () => setShowManyToManyChooser(false), manageUseLocalizedName: false }), showPairDcmtsModal &&
|
|
705
|
-
_jsx(TMModal, { title: (isPairingManyToMany ? "Abbina" : "Disabbina") + " documenti", onClose: () => setShowPairDcmtsModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearchResult, { searchResults: pairedSearchResults, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync: onRefreshSearchAsync, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, openEditPdf: openEditPdf, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, passToArchiveCallback: passToArchiveCallback, showTodoDcmtForm: showTodoDcmtForm, allowFloatingBar: false, floatingActionConfig: pairFloatingActionConfig, showBackButton: false, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), showPairSearchModal &&
|
|
664
|
+
_jsx(TMModal, { title: (isPairingManyToMany ? "Abbina" : "Disabbina") + " documenti", onClose: () => setShowPairDcmtsModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearchResult, { searchResults: pairedSearchResults, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync: onRefreshSearchAsync, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, openEditPdf: openEditPdf, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, passToArchiveCallback: passToArchiveCallback, showTodoDcmtForm: showTodoDcmtForm, allowFloatingBar: false, floatingActionConfig: pairFloatingActionConfig, showBackButton: false, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter }) }), showPairSearchModal &&
|
|
706
665
|
_jsx(TMModal, { title: "Ricerca documenti", onClose: () => setShowPairSearchModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearch, { onlyShowSearchQueryPanel: true, inputTID: pairSearchModalTargetTID, inputMids: pairSearchModalInputMids, floatingActionConfig: pairSearchModalFloatingActionConfig, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), isOpenSharedArchive && _jsx(TMModal, { title: "Archiviazione condivisa", onClose: () => {
|
|
707
666
|
setIsOpenSharedArchive(false);
|
|
708
667
|
}, width: isMobile ? '90%' : '60%', height: isMobile ? '90%' : '80%', children: _jsx(TMArchive, { inputDID: focusedItem?.DID, inputTID: focusedItem?.TID, inputMids: currentMetadataValues.filter(md => md.mid && md.mid > 100).map(md => ({ mid: md.mid, value: md.value ?? '' })), isSharedArchive: true, inputFile: sharedDcmtFile, onSavedAsyncCallback: async (tid, did) => {
|
|
@@ -712,7 +671,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
712
671
|
_jsx(TMModal, { title: "Documenti condivisi", onClose: () => {
|
|
713
672
|
setSharedDcmtSearchResults([]);
|
|
714
673
|
}, width: isMobile ? '90%' : '60%', height: isMobile ? '90%' : '80%', children: _jsx(TMSearchResult, { searchResults: sharedDcmtSearchResults, allowFloatingBar: false, showSelector: true, disableAccordionIfSingleCategory: true, showBackButton: isMobile, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), (showCheckoutInformationForm && fromDTD && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) &&
|
|
715
|
-
_jsx(
|
|
674
|
+
_jsx(TMDcmtCheckoutInfoForm, { dtdName: fromDTD.name ?? SDKUI_Localizator.SearchResult, selectedDcmtOrFocused: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0], onClose: hideCheckoutInformationFormCallback }), (floatingActionConfig && floatingActionConfig.isVisible) && _jsx(TMSearchResultFloatingActionButton, { selectedDcmtsOrFocused: getSelectedDcmtsOrFocused(selectedItems, focusedItem), config: floatingActionConfig })] }), [
|
|
716
675
|
searchResults,
|
|
717
676
|
selectedSearchResult,
|
|
718
677
|
lastUpdateSearchTime,
|
|
@@ -763,11 +722,14 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
763
722
|
isMobile,
|
|
764
723
|
currentMetadataValues,
|
|
765
724
|
sharedDcmtFile,
|
|
766
|
-
onRefreshSearchAsync
|
|
725
|
+
onRefreshSearchAsync,
|
|
726
|
+
handleNavigateToWGs,
|
|
727
|
+
handleNavigateToDossiers,
|
|
728
|
+
editPdfForm
|
|
767
729
|
]);
|
|
768
|
-
const tmBlog = useMemo(() => _jsx(TMDcmtBlog, {
|
|
730
|
+
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]);
|
|
769
731
|
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]);
|
|
770
|
-
const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { currentDcmt: currentDcmt }), [currentDcmt]);
|
|
732
|
+
const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { currentDcmt: currentDcmt }, refreshPreviewTrigger), [currentDcmt, refreshPreviewTrigger]);
|
|
771
733
|
const allInitialPanelVisibility = {
|
|
772
734
|
'tmSearchResult': true,
|
|
773
735
|
'tmBlog': false,
|
|
@@ -825,12 +787,12 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
825
787
|
gap: Gutters.getGutters(),
|
|
826
788
|
width: '100%',
|
|
827
789
|
height: '100%',
|
|
828
|
-
}, children: _jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: (groupId && groupId.length > 0) ?
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
790
|
+
}, children: _jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showCicoWaitPanel, showWaitPanelPrimary: showCicoPrimaryProgress, waitPanelTitle: cicoWaitPanelTitle, waitPanelTextPrimary: cicoPrimaryProgressText, waitPanelValuePrimary: cicoPrimaryProgressValue, waitPanelMaxValuePrimary: cicoPrimaryProgressMax, isCancelable: true, abortController: abortControllerLocal, children: (groupId && groupId.length > 0) ?
|
|
791
|
+
_jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showSearchResultSidebar })
|
|
792
|
+
:
|
|
793
|
+
_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) => {
|
|
832
794
|
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}`));
|
|
833
|
-
})] }), _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 }) }), 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: () => {
|
|
795
|
+
})] }), _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) }) }), 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: () => {
|
|
834
796
|
setIsOpenArchiveRelationForm(false);
|
|
835
797
|
setArchiveType(undefined);
|
|
836
798
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
@@ -841,19 +803,20 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
841
803
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
842
804
|
setArchiveRelatedDcmtFormMids([]);
|
|
843
805
|
await onRefreshSearchAsync?.();
|
|
844
|
-
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (showSignSettingsForm && fromDTD) && _jsx(TMSignSettingsForm, { fromDTD: fromDTD, inputDcmts: allFieldSelectedDocs, onCloseSignSettingsForm: closeSignSettingsForm, onSavedAsyncCallback: handleSavedAsyncCallback }), (showHistory && fromDTD && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(
|
|
806
|
+
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (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)] })] }));
|
|
845
807
|
};
|
|
846
808
|
export default TMSearchResult;
|
|
847
|
-
const
|
|
848
|
-
return _jsx(TMDcmtIcon, { tid: cellData.data.TID, did: cellData.data.DID, fileExtension: cellData.data.FILEEXT, fileCount: cellData.data.FILECOUNT, isLexProt: cellData.data.IsLexProt, isMail: cellData.data.ISMAIL, isShared: cellData.data.ISSHARED, isSigned: cellData.data.ISSIGNED, downloadMode: 'openInNewWindow', onDownloadDcmtsAsync: onDownloadDcmtsAsync, openInOffice: openInOffice });
|
|
849
|
-
};
|
|
850
|
-
const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem, showSearch, allowMultipleSelection = true, showExportForm = false, onCloseExportForm, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, onContextMenuPreparing, onSelectionChanged, onDblClick }) => {
|
|
809
|
+
const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem, showSearch, allowMultipleSelection = true, showExportForm = false, onCloseExportForm, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, floatingMenuItems, onSelectionChanged, onDblClick }) => {
|
|
851
810
|
const [dataSource, setDataSource] = useState();
|
|
852
811
|
const [columns, setColumns] = useState([]);
|
|
853
812
|
// State to store selected row keys
|
|
854
813
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
|
855
814
|
const [focusedItem, setFocusedItem] = useState();
|
|
856
815
|
const [visibleItems, setVisibleItems] = useState([]);
|
|
816
|
+
const [pageSize, setPageSize] = useState(SDKUI_Globals.userSettings.searchSettings?.pageSize ?? TMDataGridPageSize.Large);
|
|
817
|
+
const [isDataGridReady, setIsDataGridReady] = useState(false);
|
|
818
|
+
const { loadDataListsAsync, renderDataListCell, dataListsCache } = useDataListItem();
|
|
819
|
+
const { loadUsersAsync, renderUserIdViewer, usersCache } = useDataUserIdItem();
|
|
857
820
|
useEffect(() => {
|
|
858
821
|
if (deepCompare(inputFocusedItem, focusedItem))
|
|
859
822
|
return;
|
|
@@ -865,6 +828,12 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
865
828
|
return;
|
|
866
829
|
setSelectedRowKeys(inputSelectedItemsRowIndex);
|
|
867
830
|
}, [inputSelectedItems]);
|
|
831
|
+
useEffect(() => {
|
|
832
|
+
const newPageSize = SDKUI_Globals.userSettings.searchSettings?.pageSize ?? TMDataGridPageSize.Large;
|
|
833
|
+
if (newPageSize !== pageSize) {
|
|
834
|
+
setPageSize(newPageSize);
|
|
835
|
+
}
|
|
836
|
+
}, [SDKUI_Globals.userSettings.searchSettings?.pageSize]);
|
|
868
837
|
const onKeyDown = useCallback((e) => {
|
|
869
838
|
// Check if the pressed key is the "Delete" key.
|
|
870
839
|
if (e.event?.key === 'Delete' && !showExportForm) {
|
|
@@ -922,6 +891,9 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
922
891
|
}
|
|
923
892
|
}
|
|
924
893
|
}, [inputSelectedItems, inputFocusedItem, dataSource]);
|
|
894
|
+
const cellRenderDcmtIcon = useCallback((cellData, onDownloadDcmtsAsync, openInOffice) => {
|
|
895
|
+
return _jsx(TMDcmtIcon, { tid: cellData.data.TID, did: cellData.data.DID, fileExtension: cellData.data.FILEEXT, fileCount: cellData.data.FILECOUNT, isLexProt: cellData.data.IsLexProt, isMail: cellData.data.ISMAIL, isShared: cellData.data.ISSHARED, isSigned: cellData.data.ISSIGNED, downloadMode: 'openInNewWindow', onDownloadDcmtsAsync: onDownloadDcmtsAsync, openInOffice: openInOffice });
|
|
896
|
+
}, []);
|
|
925
897
|
const cellRender = useCallback((cellData, dataDomain, dataListID, dataListViewMode) => {
|
|
926
898
|
if (!cellData || cellData.value === undefined)
|
|
927
899
|
return null;
|
|
@@ -929,7 +901,7 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
929
901
|
const isLexProt = cellData.data.IsLexProt == 1;
|
|
930
902
|
// Prima colonna: la colonna numero 2 (dopo icona e selezione)
|
|
931
903
|
const isFirstColumn = cellData.columnIndex === 2;
|
|
932
|
-
const { checkoutStatus } =
|
|
904
|
+
const { checkoutStatus } = getDcmtCicoStatus(cellData.data, allUsers, fromDTD);
|
|
933
905
|
const shouldShowCheckoutIcon = isFirstColumn && checkoutStatus.isCheckedOut && checkoutStatus.icon;
|
|
934
906
|
let style = {};
|
|
935
907
|
if (isLogDel) {
|
|
@@ -943,10 +915,10 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
943
915
|
}
|
|
944
916
|
let child = _jsx("div", { children: cellData.text });
|
|
945
917
|
if (dataDomain === MetadataDataDomains.DataList) {
|
|
946
|
-
child =
|
|
918
|
+
child = renderDataListCell(cellData.value, dataListID, dataListViewMode);
|
|
947
919
|
}
|
|
948
920
|
if (dataDomain === MetadataDataDomains.UserID) {
|
|
949
|
-
child =
|
|
921
|
+
child = renderUserIdViewer(cellData.value, true);
|
|
950
922
|
}
|
|
951
923
|
return (_jsxs("div", { style: style, children: [shouldShowCheckoutIcon && checkoutStatus.icon, child] }));
|
|
952
924
|
}, [fromDTD, allUsers]);
|
|
@@ -999,32 +971,128 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
999
971
|
return { type: 'currency', currency: "JPY" };
|
|
1000
972
|
return undefined;
|
|
1001
973
|
}, []);
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
974
|
+
/**
|
|
975
|
+
* Genera la configurazione delle colonne della griglia con i relativi headerFilter.
|
|
976
|
+
* Per le colonne di tipo DataList e UserID, crea headerFilter con valori leggibili (nomi/descrizioni)
|
|
977
|
+
* invece delle chiavi numeriche, migliorando l'esperienza utente durante il filtraggio.
|
|
978
|
+
*/
|
|
979
|
+
const generateColumns = useCallback(() => {
|
|
980
|
+
// Verifica che esistano colonne da processare
|
|
981
|
+
if (!searchResult?.dtdResult?.columns)
|
|
982
|
+
return [];
|
|
983
|
+
// Genera chiavi univoche per ogni colonna basate sul TID del risultato
|
|
1008
984
|
const uniqueKeys = generateUniqueColumnKeys(searchResult?.dtdResult?.columns, searchResult?.fromTID);
|
|
1009
|
-
|
|
985
|
+
const cols = [];
|
|
986
|
+
// Itera su ogni colonna del risultato di ricerca
|
|
987
|
+
searchResult.dtdResult.columns.map((col, index) => {
|
|
988
|
+
// Determina se la colonna è visibile (non nascosta)
|
|
1010
989
|
const isVisible = col.extendedProperties?.["Visibility"] != "Hidden";
|
|
990
|
+
// Estrae il dominio dati della colonna (es. DataList, UserID, None)
|
|
1011
991
|
const dataDomain = MetadataDataDomains[(col.extendedProperties?.["DataDomain"] ?? "None")];
|
|
992
|
+
// Estrae l'ID della DataList associata (se presente)
|
|
1012
993
|
const dataListID = Number(col.extendedProperties?.["DataListID"]);
|
|
994
|
+
// Estrae la modalità di visualizzazione della DataList
|
|
1013
995
|
const dataListViewMode = DataListViewModes[(col.extendedProperties?.["DataListViewMode"] ?? "None")];
|
|
996
|
+
// Inizializza la configurazione del filtro header
|
|
997
|
+
let headerFilterConfig = undefined;
|
|
998
|
+
// Configurazione headerFilter per colonne DataList
|
|
999
|
+
if (dataDomain === MetadataDataDomains.DataList && dataListID) {
|
|
1000
|
+
// Recupera gli elementi della DataList dalla cache
|
|
1001
|
+
const dataListItems = dataListsCache.current.get(dataListID);
|
|
1002
|
+
if (dataListItems && dataListItems.length > 0) {
|
|
1003
|
+
// Crea il datasource per l'headerFilter mostrando il nome (text) ma filtrando per valore (value)
|
|
1004
|
+
headerFilterConfig = {
|
|
1005
|
+
dataSource: dataListItems
|
|
1006
|
+
.filter(item => item.name != null && item.value != null)
|
|
1007
|
+
.map(item => ({
|
|
1008
|
+
text: item.name,
|
|
1009
|
+
value: item.value
|
|
1010
|
+
}))
|
|
1011
|
+
};
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
// Configurazione headerFilter per colonne UserID
|
|
1015
|
+
if (dataDomain === MetadataDataDomains.UserID) {
|
|
1016
|
+
// Recupera tutti gli utenti dalla cache
|
|
1017
|
+
const users = Array.from(usersCache.current.values());
|
|
1018
|
+
if (users.length > 0) {
|
|
1019
|
+
// Crea il datasource per l'headerFilter mostrando nome utente completo (dominio\nome)
|
|
1020
|
+
headerFilterConfig = {
|
|
1021
|
+
dataSource: users
|
|
1022
|
+
.filter(user => user.name != null && user.id != null)
|
|
1023
|
+
.map(user => ({
|
|
1024
|
+
text: user.domain ? `${user.domain}\\${user.name}` : user.name,
|
|
1025
|
+
value: user.id
|
|
1026
|
+
}))
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
// Aggiunge la configurazione della colonna all'array
|
|
1014
1031
|
cols.push({
|
|
1015
1032
|
dataField: uniqueKeys[index],
|
|
1016
1033
|
dataType: dataType(col),
|
|
1017
1034
|
visible: isVisible,
|
|
1018
1035
|
cellRender: (cellData) => cellRender(cellData, dataDomain, dataListID, dataListViewMode),
|
|
1036
|
+
headerFilter: headerFilterConfig,
|
|
1019
1037
|
caption: col.caption,
|
|
1020
1038
|
format: getDisplayFormat(col),
|
|
1021
1039
|
});
|
|
1022
1040
|
});
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1041
|
+
return cols;
|
|
1042
|
+
}, [searchResult, dataType, cellRender, getDisplayFormat, dataListsCache, usersCache]);
|
|
1043
|
+
/**
|
|
1044
|
+
* Effect che carica i dati necessari e genera le colonne della griglia.
|
|
1045
|
+
* Esegue il caricamento delle cache (DataList e UserID) in parallelo prima di generare le colonne,
|
|
1046
|
+
* garantendo che gli headerFilter abbiano tutti i dati disponibili.
|
|
1047
|
+
*/
|
|
1048
|
+
useEffect(() => {
|
|
1049
|
+
// Verifica che siano disponibili il tipo documento e i risultati di ricerca
|
|
1050
|
+
if (fromDTD === undefined || searchResult === undefined)
|
|
1051
|
+
return;
|
|
1052
|
+
const loadColumnsAndData = async () => {
|
|
1053
|
+
// Resetta l'elemento focalizzato quando si caricano nuovi dati
|
|
1054
|
+
setFocusedItem(undefined);
|
|
1055
|
+
setIsDataGridReady(false);
|
|
1056
|
+
// Set per raccogliere gli ID univoci da precaricare
|
|
1057
|
+
const dataListIDs = new Set();
|
|
1058
|
+
const userIDs = new Set();
|
|
1059
|
+
// Itera sulle colonne per identificare quali DataList devono essere caricate
|
|
1060
|
+
searchResult?.dtdResult?.columns?.forEach((col) => {
|
|
1061
|
+
const dataDomain = MetadataDataDomains[(col.extendedProperties?.["DataDomain"] ?? "None")];
|
|
1062
|
+
const dataListID = Number(col.extendedProperties?.["DataListID"]);
|
|
1063
|
+
// Se la colonna è di tipo DataList, aggiunge l'ID al set per il caricamento
|
|
1064
|
+
if (dataDomain === MetadataDataDomains.DataList && dataListID) {
|
|
1065
|
+
dataListIDs.add(dataListID);
|
|
1066
|
+
}
|
|
1067
|
+
});
|
|
1068
|
+
// Itera sulle righe per identificare quali UserID devono essere caricati
|
|
1069
|
+
searchResult?.dtdResult?.rows?.forEach((row) => {
|
|
1070
|
+
searchResult?.dtdResult?.columns?.forEach((col, colIndex) => {
|
|
1071
|
+
const dataDomain = MetadataDataDomains[(col.extendedProperties?.["DataDomain"] ?? "None")];
|
|
1072
|
+
// Se la colonna è di tipo UserID, estrae l'ID dalla riga e lo aggiunge al set
|
|
1073
|
+
if (dataDomain === MetadataDataDomains.UserID) {
|
|
1074
|
+
const userId = Number(row[colIndex]);
|
|
1075
|
+
if (userId && userId > 0) {
|
|
1076
|
+
userIDs.add(userId);
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
});
|
|
1080
|
+
});
|
|
1081
|
+
// Carica in parallelo le cache di DataList e UserID per ottimizzare le prestazioni
|
|
1082
|
+
await Promise.all([
|
|
1083
|
+
loadDataListsAsync(dataListIDs),
|
|
1084
|
+
loadUsersAsync(userIDs)
|
|
1085
|
+
]);
|
|
1086
|
+
// Genera colonne con cache popolate per garantire headerFilter completi
|
|
1087
|
+
const cols = generateColumns();
|
|
1088
|
+
setColumns(cols);
|
|
1089
|
+
// Converte i risultati di ricerca in un array semplice per la griglia
|
|
1090
|
+
let newDataSource = searchResultDescriptorToSimpleArray(searchResult);
|
|
1091
|
+
setDataSource(newDataSource);
|
|
1092
|
+
setIsDataGridReady(true);
|
|
1093
|
+
};
|
|
1094
|
+
loadColumnsAndData();
|
|
1095
|
+
}, [searchResult, fromDTD, allUsers, loadDataListsAsync, loadUsersAsync, generateColumns]);
|
|
1028
1096
|
useEffect(() => {
|
|
1029
1097
|
let newDataSource = searchResultDescriptorToSimpleArray(searchResult);
|
|
1030
1098
|
setDataSource(newDataSource);
|
|
@@ -1079,9 +1147,10 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
1079
1147
|
caption: '',
|
|
1080
1148
|
visible: true,
|
|
1081
1149
|
width: 50,
|
|
1082
|
-
cellRender: (cellData) =>
|
|
1150
|
+
cellRender: (cellData) => cellRenderDcmtIcon(cellData, onDownloadDcmtsAsync, openInOffice),
|
|
1083
1151
|
allowResizing: false,
|
|
1084
|
-
filterOperations: ['=', "anyof"]
|
|
1152
|
+
filterOperations: ['=', "anyof"],
|
|
1153
|
+
allowHiding: false,
|
|
1085
1154
|
},
|
|
1086
1155
|
...columns.filter(col => col.dataField !== 'FILEEXT')
|
|
1087
1156
|
];
|
|
@@ -1095,7 +1164,7 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
1095
1164
|
setVisibleItems(visibleRows.map((row) => { return row.data; }));
|
|
1096
1165
|
}, []);
|
|
1097
1166
|
useEffect(() => { onVisibleItemChanged?.(visibleItems); }, [visibleItems]);
|
|
1098
|
-
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_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:
|
|
1167
|
+
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 })] });
|
|
1099
1168
|
};
|
|
1100
1169
|
//#region TMSearchResultSelector
|
|
1101
1170
|
const StyledItemTemplate = styled.div `
|