@topconsultnpm/sdkui-react 6.20.0-dev1.13 → 6.20.0-dev1.130
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/assets/headergradient.svg +87 -0
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +322 -30
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +8 -1
- package/lib/components/NewComponents/ContextMenu/hooks.js +80 -8
- package/lib/components/NewComponents/ContextMenu/index.d.ts +3 -0
- package/lib/components/NewComponents/ContextMenu/index.js +2 -0
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +9 -1
- package/lib/components/NewComponents/ContextMenu/styles.js +146 -47
- package/lib/components/NewComponents/ContextMenu/types.d.ts +22 -3
- 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.js +620 -125
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +25 -5
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +215 -59
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +12 -3
- package/lib/components/base/TMAccordionNew.js +35 -14
- package/lib/components/base/TMButton.js +6 -0
- package/lib/components/base/TMClosableList.js +4 -0
- 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 +21 -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 +4 -2
- package/lib/components/base/TMPopUp.js +6 -0
- package/lib/components/base/TMToolbarCard.js +2 -0
- package/lib/components/base/TMTreeView.d.ts +2 -1
- package/lib/components/base/TMTreeView.js +33 -26
- package/lib/components/choosers/TMDataListItemChooser.d.ts +2 -0
- package/lib/components/choosers/TMDataListItemChooser.js +8 -2
- package/lib/components/choosers/TMDcmtTypeChooser.d.ts +1 -0
- package/lib/components/choosers/TMDcmtTypeChooser.js +11 -3
- package/lib/components/choosers/TMDistinctValues.js +2 -2
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +2 -0
- package/lib/components/choosers/TMDynDataListItemChooser.js +8 -2
- package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.d.ts +2 -0
- package/lib/components/choosers/TMMetadataChooser.js +19 -4
- package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMUserChooser.d.ts +2 -5
- package/lib/components/choosers/TMUserChooser.js +33 -47
- package/lib/components/editors/TMCheckBox.js +2 -0
- package/lib/components/editors/TMDateBox.js +18 -9
- package/lib/components/editors/TMEditorStyled.js +7 -0
- package/lib/components/editors/TMLocalizedTextBox.d.ts +3 -1
- package/lib/components/editors/TMLocalizedTextBox.js +16 -14
- package/lib/components/editors/TMMetadataEditor.d.ts +1 -0
- package/lib/components/editors/TMMetadataEditor.js +4 -4
- package/lib/components/editors/TMMetadataTextBox.d.ts +9 -0
- package/lib/components/editors/TMMetadataTextBox.js +92 -0
- package/lib/components/editors/TMMetadataValues.d.ts +2 -0
- package/lib/components/editors/TMMetadataValues.js +26 -8
- package/lib/components/editors/TMRadioButton.js +2 -0
- package/lib/components/editors/TMTextArea.js +18 -30
- package/lib/components/editors/TMTextBox.d.ts +1 -1
- package/lib/components/editors/TMTextBox.js +29 -4
- package/lib/components/editors/TMTextExpression.js +6 -91
- 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 +462 -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.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.d.ts +14 -2
- package/lib/components/features/documents/TMDcmtForm.js +576 -292
- package/lib/components/features/documents/TMDcmtPreview.js +42 -155
- 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} +2 -2
- 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 +50 -11
- package/lib/components/features/search/TMSearchQueryEditor.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryEditor.js +10 -10
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +40 -25
- package/lib/components/features/search/TMSearchResult.d.ts +3 -0
- package/lib/components/features/search/TMSearchResult.js +370 -252
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
- package/lib/components/features/search/TMSearchResultsMenuItems.js +227 -171
- 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/TMViewHistoryDcmt.js +47 -52
- package/lib/components/features/tasks/TMTaskForm.js +75 -25
- 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 +57 -37
- 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 +140 -34
- package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +2 -0
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +14 -7
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- 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 +35 -7
- 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/grids/TMValidationItemsList.js +6 -0
- package/lib/components/index.d.ts +6 -3
- package/lib/components/index.js +6 -3
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +13 -5
- package/lib/components/query/TMQueryEditor.d.ts +6 -1
- package/lib/components/query/TMQueryEditor.js +105 -101
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/settings/SettingsAppearance.js +99 -30
- package/lib/components/sidebar/TMHeader.js +11 -7
- package/lib/components/sidebar/TMSidebar.d.ts +0 -1
- package/lib/components/sidebar/TMSidebar.js +16 -44
- package/lib/components/sidebar/TMSidebarItem.js +36 -17
- 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 -0
- package/lib/helper/SDKUI_Globals.js +10 -1
- package/lib/helper/SDKUI_Localizator.d.ts +21 -3
- package/lib/helper/SDKUI_Localizator.js +196 -10
- 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/TMToppyMessage.js +4 -0
- package/lib/helper/checkinCheckoutManager.d.ts +31 -1
- package/lib/helper/checkinCheckoutManager.js +112 -30
- package/lib/helper/devextremeCustomMessages.d.ts +30 -0
- package/lib/helper/devextremeCustomMessages.js +30 -0
- package/lib/helper/helpers.d.ts +30 -2
- package/lib/helper/helpers.js +132 -4
- package/lib/helper/index.d.ts +2 -0
- package/lib/helper/index.js +2 -0
- package/lib/helper/queryHelper.d.ts +2 -2
- package/lib/helper/queryHelper.js +80 -24
- 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/useFloatingBarPinnedItems.d.ts +11 -0
- package/lib/hooks/useFloatingBarPinnedItems.js +54 -0
- package/lib/hooks/useMetadataExpression.d.ts +19 -0
- package/lib/hooks/useMetadataExpression.js +99 -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 +6 -5
- package/lib/components/NewComponents/Notification/Notification.d.ts +0 -4
- package/lib/components/NewComponents/Notification/Notification.js +0 -60
- package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +0 -8
- package/lib/components/NewComponents/Notification/NotificationContainer.js +0 -33
- package/lib/components/NewComponents/Notification/index.d.ts +0 -2
- package/lib/components/NewComponents/Notification/index.js +0 -2
- package/lib/components/NewComponents/Notification/styles.d.ts +0 -21
- package/lib/components/NewComponents/Notification/styles.js +0 -180
- package/lib/components/NewComponents/Notification/types.d.ts +0 -18
- package/lib/components/NewComponents/Notification/types.js +0 -1
- 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
|
@@ -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, IconInfo, IconCache } 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';
|
|
@@ -37,16 +36,21 @@ import ShowAlert from '../../base/TMAlert';
|
|
|
37
36
|
import TMSpinner from '../../base/TMSpinner';
|
|
38
37
|
import TMChooserForm from '../../forms/TMChooserForm';
|
|
39
38
|
import TMModal from '../../base/TMModal';
|
|
39
|
+
import TMTooltip from '../../base/TMTooltip';
|
|
40
40
|
import TMSearch from './TMSearch';
|
|
41
41
|
import TMArchive from '../archive/TMArchive';
|
|
42
|
-
import { TMResultManager } from '../../forms/TMResultDialog';
|
|
43
42
|
import TMCustomButton from '../../base/TMCustomButton';
|
|
44
|
-
import ToppyDraggableHelpCenter from '../assistant/ToppyDraggableHelpCenter';
|
|
45
43
|
import TMSignSettingsForm from './TMSignSettingsForm';
|
|
46
|
-
import { getDcmtCicoStatus
|
|
47
|
-
import TMSearchResultCheckoutInfoForm from './TMSearchResultCheckoutInfoForm';
|
|
44
|
+
import { getDcmtCicoStatus } from '../../../helper/checkinCheckoutManager';
|
|
48
45
|
import TMViewHistoryDcmt from './TMViewHistoryDcmt';
|
|
49
46
|
import TMBlogCommentForm from '../blog/TMBlogCommentForm';
|
|
47
|
+
import { useCheckInOutOperations } from '../../../hooks/useCheckInOutOperations';
|
|
48
|
+
import { useFloatingBarPinnedItems } from '../../../hooks/useFloatingBarPinnedItems';
|
|
49
|
+
import TMDcmtCheckoutInfoForm from './TMDcmtCheckoutInfoForm';
|
|
50
|
+
import { useDataListItem } from '../../../hooks/useDataListItem';
|
|
51
|
+
import { useDataUserIdItem } from '../../../hooks/useDataUserIdItem';
|
|
52
|
+
import { LoadIndicator } from 'devextreme-react';
|
|
53
|
+
import TMToppyDraggableHelpCenter from '../assistant/TMToppyDraggableHelpCenter';
|
|
50
54
|
let abortControllerLocal = new AbortController();
|
|
51
55
|
//#region Helper Methods
|
|
52
56
|
export const getSearchResultCountersSingleCategory = (searchResults) => {
|
|
@@ -65,7 +69,7 @@ const orderByName = (array) => {
|
|
|
65
69
|
return 1;
|
|
66
70
|
} return 0; });
|
|
67
71
|
};
|
|
68
|
-
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, }) => {
|
|
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, }) => {
|
|
69
73
|
const [id, setID] = useState('');
|
|
70
74
|
const [showApprovePopup, setShowApprovePopup] = useState(false);
|
|
71
75
|
const [showRejectPopup, setShowRejectPopup] = useState(false);
|
|
@@ -94,15 +98,21 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
94
98
|
// State to control whether the export form (for exporting to Excel/CSV/txt and others) should be shown
|
|
95
99
|
const [showExportForm, setShowExportForm] = useState(false);
|
|
96
100
|
const [showSignSettingsForm, setShowSignSettingsForm] = useState(false);
|
|
101
|
+
const [indexingInfoCache, setIndexingInfoCache] = useState(new Map());
|
|
102
|
+
const [showIndexingInfo, setShowIndexingInfo] = useState(false);
|
|
103
|
+
const [loadingIndexingInfo, setLoadingIndexingInfo] = useState(false);
|
|
104
|
+
const floatingBarContainerRef = useRef(null);
|
|
97
105
|
const [confirmFormat, ConfirmFormatDialog] = useInputCvtFormatDialog();
|
|
98
106
|
const { openConfirmAttachmentsDialog, ConfirmAttachmentsDialog } = useInputAttachmentsDialog();
|
|
99
107
|
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync, getDcmtFileAsync } = useDcmtOperations();
|
|
108
|
+
const { showHistory, showHistoryCallback, hideHistoryCallback, showCheckoutInformationForm, commentFormState, hideCommentFormCallback, showCheckoutInformationFormCallback, hideCheckoutInformationFormCallback, copyCheckoutPathToClipboardCallback, handleCheckOutCallback, handleCheckInCallback, refreshPreviewTrigger, showCicoWaitPanel, cicoWaitPanelTitle, showCicoPrimaryProgress, cicoPrimaryProgressText, cicoPrimaryProgressValue, cicoPrimaryProgressMax, } = useCheckInOutOperations();
|
|
100
109
|
const relatedDocuments = useRelatedDocuments({ selectedSearchResult, focusedItem, currentSearchResults });
|
|
101
110
|
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;
|
|
102
111
|
const [customButtonsLayout, setCustomButtonsLayout] = useState();
|
|
103
112
|
const [customButton, setCustomButton] = useState();
|
|
104
113
|
const deviceType = useDeviceType();
|
|
105
114
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
115
|
+
const { pinnedItemIds, togglePin, setPinnedItemIds } = useFloatingBarPinnedItems();
|
|
106
116
|
const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
107
117
|
const allFieldSelectedDocs = useMemo(() => getAllFieldSelectedDcmtsOrFocused(selectedItems, focusedItem), [selectedItems, focusedItem]);
|
|
108
118
|
// Disable the "Sign/Approve" button if:
|
|
@@ -111,39 +121,12 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
111
121
|
const disableSignApproveDisable = selectedDocs.length !== 1 || (selectedDocs.length === 1 && selectedDocs[0].FILEEXT === null);
|
|
112
122
|
const dcmtsReturned = (searchResults?.length > 1 ? selectedSearchResult?.dcmtsReturned : searchResults[0]?.dcmtsReturned ?? 0);
|
|
113
123
|
const dcmtsFound = (searchResults?.length > 1 ? selectedSearchResult?.dcmtsFound : searchResults[0]?.dcmtsFound ?? 0);
|
|
114
|
-
// State to manage show history selected file
|
|
115
|
-
const [showHistory, setShowHistory] = useState(false);
|
|
116
124
|
const [allUsers, setAllUsers] = useState([]);
|
|
117
|
-
// State to manage show history selected file
|
|
118
|
-
const [showCheckoutInformationForm, setShowCheckoutInformationForm] = useState(false);
|
|
119
|
-
// State variable to control the visibility of the wait panel
|
|
120
|
-
const [showLocalWaitPanel, setShowLocalWaitPanel] = useState(false);
|
|
121
|
-
// State variable to store the title of the wait panel
|
|
122
|
-
const [localWaitPanelTitle, setLocalWaitPanelTitle] = useState('');
|
|
123
|
-
// State variable to control the visibility of the primary section of the wait panel
|
|
124
|
-
const [localShowPrimary, setLocalShowPrimary] = useState(false);
|
|
125
|
-
// State variable to store the primary text of the wait panel
|
|
126
|
-
const [localWaitPanelTextPrimary, setLocalWaitPanelTextPrimary] = useState('');
|
|
127
|
-
// State variable to track the current value of the primary progress indicator in the wait panel
|
|
128
|
-
const [localWaitPanelValuePrimary, setLocalWaitPanelValuePrimary] = useState(0);
|
|
129
|
-
// State variable to define the maximum value for the primary progress indicator in the wait panel
|
|
130
|
-
const [localWaitPanelMaxValuePrimary, setLocalWaitPanelMaxValuePrimary] = useState(0);
|
|
131
|
-
/* State to manage show attachment badge on comment form */
|
|
132
|
-
const [removeAndEditAttachmentCommentForm, setRemoveAndEditAttachmentCommentForm] = useState(true);
|
|
133
|
-
// State to manage show comment form selected file
|
|
134
|
-
const [showCommentForm, setShowCommentForm] = useState(false);
|
|
135
|
-
// State to manage show comment form close button
|
|
136
|
-
const [isCommentRequired, setIsCommentRequired] = useState(false);
|
|
137
125
|
// Stato per triggerare il refresh del blog dall'esterno
|
|
138
126
|
const [refreshBlogTrigger, setRefreshBlogTrigger] = useState(0);
|
|
139
|
-
// Stato per triggerare il refresh della preview dall'esterno
|
|
140
|
-
const [refreshPreviewTrigger, setRefreshPreviewTrigger] = useState(0);
|
|
141
127
|
const triggerBlogRefresh = useCallback(async () => {
|
|
142
128
|
setRefreshBlogTrigger(prev => prev + 1);
|
|
143
129
|
}, []);
|
|
144
|
-
const triggerPreviewRefresh = useCallback(() => {
|
|
145
|
-
setRefreshPreviewTrigger(prev => prev + 1);
|
|
146
|
-
}, []);
|
|
147
130
|
useEffect(() => {
|
|
148
131
|
const fetchAllUsers = async () => {
|
|
149
132
|
const users = await UserListCacheService.GetAllAsync();
|
|
@@ -285,7 +268,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
285
268
|
try {
|
|
286
269
|
const dtd = await DcmtTypeListCacheService.GetWithNotGrantedAsync(item.TID, item?.DID);
|
|
287
270
|
if (dtd) {
|
|
288
|
-
const isWorkItem = dtd
|
|
271
|
+
const isWorkItem = isApprovalWorkflowView(dtd);
|
|
289
272
|
const name = `${dtd.name ?? '-'} (DID: ${item.DID})`;
|
|
290
273
|
onTaskCreateRequest?.(isWorkItem
|
|
291
274
|
? { workItem: { tid: item.TID, did: item.DID, name } }
|
|
@@ -317,33 +300,12 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
317
300
|
const closeSignSettingsForm = useCallback(() => {
|
|
318
301
|
setShowSignSettingsForm(false);
|
|
319
302
|
}, []);
|
|
320
|
-
const
|
|
321
|
-
setShowHistory(true);
|
|
322
|
-
}, []);
|
|
323
|
-
const showCheckoutInformationFormCallback = useCallback(() => {
|
|
324
|
-
setShowCheckoutInformationForm(true);
|
|
325
|
-
}, []);
|
|
326
|
-
const showCommentFormCallback = useCallback(() => {
|
|
327
|
-
setShowCommentForm(true);
|
|
328
|
-
}, []);
|
|
329
|
-
const infoCheckCopyToClipboard = () => {
|
|
303
|
+
const copyCheckoutPathToClipboardOperationCallback = () => {
|
|
330
304
|
const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
331
305
|
const firstDoc = selectedDocs?.[0];
|
|
332
306
|
if (!firstDoc)
|
|
333
307
|
return;
|
|
334
|
-
|
|
335
|
-
const wGSDraftCheckoutItemCurrentItems = [...SDKUI_Globals.userSettings.dcmtCheckoutInfo];
|
|
336
|
-
const existingItem = wGSDraftCheckoutItemCurrentItems.find((item) => item.TID === firstDoc.TID.toString() && item.DID === firstDoc.DID.toString());
|
|
337
|
-
const folder = existingItem && existingItem.checkoutFolder && existingItem.checkoutFolder !== "" ? existingItem.checkoutFolder : defaultCheckInOutFolder;
|
|
338
|
-
const name = existingItem?.checkoutName ?? getCicoDownloadFileName({ type: 'dcmtInfo', dcmtInfo: firstDoc, originalFileName: fromDTD?.name ?? SDKUI_Localizator.SearchResult }, true, false);
|
|
339
|
-
const textToCopy = folder ? `${folder}\\${name}` : name;
|
|
340
|
-
navigator.clipboard.writeText(textToCopy)
|
|
341
|
-
.then(() => {
|
|
342
|
-
ShowAlert({ message: SDKUI_Localizator.OperationSuccess, mode: 'success', duration: 5000, title: SDKUI_Localizator.CopyToClipboard });
|
|
343
|
-
})
|
|
344
|
-
.catch(err => {
|
|
345
|
-
ShowAlert({ message: err, mode: 'error', duration: 5000, title: SDKUI_Localizator.OperationResult });
|
|
346
|
-
});
|
|
308
|
+
copyCheckoutPathToClipboardCallback(firstDoc, fromDTD?.name ?? SDKUI_Localizator.SearchResult);
|
|
347
309
|
};
|
|
348
310
|
const getTitleHeader = () => {
|
|
349
311
|
let counters = (showSelector && disableAccordionIfSingleCategory && searchResults.length > 1) ? getSearchResultCountersSingleCategory(searchResults) : "";
|
|
@@ -405,168 +367,31 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
405
367
|
const customButtonMenuItems = () => {
|
|
406
368
|
const customButtonsItems = customButtonsLayout?.customButtons?.filter((customButton) => customButton.isForSearchResult && customButton.isForSearchResult > 0)
|
|
407
369
|
.map((customButton) => ({
|
|
408
|
-
icon:
|
|
409
|
-
|
|
370
|
+
icon: TMImageLibrary({ imageID: customButton.glyphID }),
|
|
371
|
+
name: customButton.title || 'Bottone personalizzato',
|
|
410
372
|
onClick: () => setCustomButton(customButton)
|
|
411
373
|
}));
|
|
412
|
-
return {
|
|
413
|
-
icon:
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
};
|
|
417
|
-
};
|
|
418
|
-
const onContextMenuPreparing = (e) => {
|
|
419
|
-
if (e === undefined)
|
|
420
|
-
return;
|
|
421
|
-
if (e.target === 'content') {
|
|
422
|
-
e.items = e.items || [];
|
|
423
|
-
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, handleCheckInOperationCallback, showCheckoutInformationFormCallback, viewHistoryCallback, infoCheckCopyToClipboard, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation);
|
|
424
|
-
e.items.push(...menuItems);
|
|
425
|
-
e.items.push(customButtonMenuItems());
|
|
426
|
-
}
|
|
374
|
+
return customButtonsItems && customButtonsItems.length > 0 ? {
|
|
375
|
+
icon: _jsx(IconCustom, {}),
|
|
376
|
+
name: SDKUI_Localizator.CustomButtons,
|
|
377
|
+
submenu: customButtonsItems
|
|
378
|
+
} : {};
|
|
427
379
|
};
|
|
428
380
|
const handleCheckOutOperationCallback = async (checkout) => {
|
|
429
381
|
const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
430
382
|
const firstDoc = selectedDocs?.[0];
|
|
431
383
|
if (!firstDoc)
|
|
432
384
|
return;
|
|
433
|
-
|
|
434
|
-
const msg = checkout ? SDKUI_Localizator.ExecuteCheckOutQuestion : SDKUI_Localizator.ExecuteCancelCheckOutQuestion;
|
|
435
|
-
TMMessageBoxManager.show({
|
|
436
|
-
title: title,
|
|
437
|
-
message: msg,
|
|
438
|
-
buttons: [ButtonNames.YES, ButtonNames.NO],
|
|
439
|
-
onButtonClick: async (e) => {
|
|
440
|
-
if (e !== ButtonNames.YES)
|
|
441
|
-
return;
|
|
442
|
-
let result = [];
|
|
443
|
-
try {
|
|
444
|
-
setLocalWaitPanelTitle(title);
|
|
445
|
-
setShowLocalWaitPanel(true);
|
|
446
|
-
setLocalShowPrimary(true);
|
|
447
|
-
abortControllerLocal = new AbortController();
|
|
448
|
-
let i = 0;
|
|
449
|
-
const ue = SDK_Globals.tmSession?.NewUpdateEngineByID();
|
|
450
|
-
if (ue) {
|
|
451
|
-
ue.TID = firstDoc.TID;
|
|
452
|
-
ue.DID = firstDoc.DID;
|
|
453
|
-
if (checkout) {
|
|
454
|
-
await ue.CheckOutAsync()
|
|
455
|
-
.then(async () => {
|
|
456
|
-
const filename = fromDTD?.nameLoc || SDKUI_Localizator.SearchResult;
|
|
457
|
-
await cicoDownloadFilesCallback([{ type: 'dcmtInfo', dcmtInfo: firstDoc, originalFileName: filename }], true, downloadDcmtsAsync);
|
|
458
|
-
result.push({ rowIndex: i, id1: firstDoc.TID, id2: firstDoc.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
459
|
-
await refreshFocusedDataRowAsync(firstDoc.TID, firstDoc.DID, true);
|
|
460
|
-
})
|
|
461
|
-
.catch((error) => {
|
|
462
|
-
result.push({ rowIndex: i, id1: firstDoc.TID, id2: firstDoc.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
463
|
-
throw error;
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
|
-
else {
|
|
467
|
-
await ue.UndoCheckOutAsync()
|
|
468
|
-
.then(async () => {
|
|
469
|
-
result.push({ rowIndex: i, id1: firstDoc.TID, id2: firstDoc.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
470
|
-
// Remove the corresponding draft checkout item
|
|
471
|
-
updateCicoCheckoutStorageItem({ TID: firstDoc.TID.toString(), DID: firstDoc.DID.toString(), checkoutFolder: "", checkoutName: "" }, "dcmtInfo", "remove");
|
|
472
|
-
await refreshFocusedDataRowAsync(firstDoc.TID, firstDoc.DID, true);
|
|
473
|
-
})
|
|
474
|
-
.catch((error) => {
|
|
475
|
-
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
476
|
-
throw error;
|
|
477
|
-
});
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
catch (error) {
|
|
482
|
-
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
483
|
-
}
|
|
484
|
-
finally {
|
|
485
|
-
setLocalWaitPanelTextPrimary('');
|
|
486
|
-
setLocalWaitPanelMaxValuePrimary(0);
|
|
487
|
-
setLocalWaitPanelValuePrimary(0);
|
|
488
|
-
setShowLocalWaitPanel(false);
|
|
489
|
-
TMResultManager.show(result, title, "ID", undefined);
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
});
|
|
493
|
-
};
|
|
494
|
-
const triggerCommentOnFileAdd = (addedFiles) => {
|
|
495
|
-
if (addedFiles.length > 0) {
|
|
496
|
-
showCommentFormCallback();
|
|
497
|
-
setIsCommentRequired(true);
|
|
498
|
-
setRemoveAndEditAttachmentCommentForm(false);
|
|
499
|
-
}
|
|
385
|
+
await handleCheckOutCallback(firstDoc, checkout, fromDTD?.name ?? SDKUI_Localizator.SearchResult, downloadDcmtsAsync, undefined, refreshFocusedDataRowAsync);
|
|
500
386
|
};
|
|
501
|
-
const handleCheckInOperationCallback =
|
|
387
|
+
const handleCheckInOperationCallback = async () => {
|
|
502
388
|
const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
503
389
|
const firstDoc = selectedDocs?.[0];
|
|
504
390
|
if (!firstDoc)
|
|
505
391
|
return;
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
input.type = "file";
|
|
510
|
-
// Set the accepted file types (e.g., images, PDFs, etc.)
|
|
511
|
-
input.accept = "*/*";
|
|
512
|
-
// Enable the input to accept one file at once
|
|
513
|
-
input.multiple = false;
|
|
514
|
-
// Add an event listener for when the file selection changes
|
|
515
|
-
input.addEventListener('change', async (event) => {
|
|
516
|
-
const fileInput = event.target;
|
|
517
|
-
if (!fileInput.files || fileInput.files.length === 0)
|
|
518
|
-
return;
|
|
519
|
-
const file = fileInput.files[0];
|
|
520
|
-
firstDoc.fileName = fromDTD?.name ?? SDKUI_Localizator.SearchResult;
|
|
521
|
-
const validateFileName = validateCicoFileName({ type: 'dcmtInfo', dcmtInfo: firstDoc, originalFileName: firstDoc.fileName }, file.name);
|
|
522
|
-
TMMessageBoxManager.show({
|
|
523
|
-
resizable: true,
|
|
524
|
-
buttons: [ButtonNames.YES, ButtonNames.NO],
|
|
525
|
-
message: renderCicoCheckInContent({ type: 'dcmtInfo', dcmtInfo: firstDoc, originalFileName: firstDoc.fileName }, file, validateFileName.isValid, validateFileName.validationResults),
|
|
526
|
-
title: "Check in",
|
|
527
|
-
onButtonClick: async (e) => {
|
|
528
|
-
if (e !== ButtonNames.YES)
|
|
529
|
-
return;
|
|
530
|
-
setLocalWaitPanelTitle('Check in');
|
|
531
|
-
setShowLocalWaitPanel(true);
|
|
532
|
-
setLocalShowPrimary(true);
|
|
533
|
-
abortControllerLocal = new AbortController();
|
|
534
|
-
let result = [];
|
|
535
|
-
let i = 0;
|
|
536
|
-
if (firstDoc.TID && firstDoc.DID) {
|
|
537
|
-
try {
|
|
538
|
-
const ue = SDK_Globals.tmSession?.NewUpdateEngineByID();
|
|
539
|
-
if (ue) {
|
|
540
|
-
ue.TID = firstDoc.TID;
|
|
541
|
-
ue.DID = firstDoc.DID;
|
|
542
|
-
await ue.CheckInAsync(file, "", abortControllerLocal.signal);
|
|
543
|
-
// Remove the corresponding draft checkout item
|
|
544
|
-
updateCicoCheckoutStorageItem({ TID: firstDoc.TID.toString(), DID: firstDoc.DID.toString(), checkoutFolder: "", checkoutName: "" }, "dcmtInfo", "remove");
|
|
545
|
-
result.push({ rowIndex: i, id1: firstDoc.DID, id2: firstDoc.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
546
|
-
await refreshFocusedDataRowAsync(firstDoc.TID, firstDoc.DID, true);
|
|
547
|
-
const cacheKey = `${firstDoc.TID}-${firstDoc.DID}`;
|
|
548
|
-
if (dcmtsFileCachePreview.has(cacheKey))
|
|
549
|
-
removeDcmtsFileCache(cacheKey);
|
|
550
|
-
triggerPreviewRefresh();
|
|
551
|
-
triggerCommentOnFileAdd([firstDoc.DID]);
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
catch (err) {
|
|
555
|
-
result.push({ rowIndex: i, id1: i, id2: i, resultType: ResultTypes.ERROR, description: getExceptionMessage(err) });
|
|
556
|
-
}
|
|
557
|
-
finally {
|
|
558
|
-
setLocalWaitPanelTextPrimary('');
|
|
559
|
-
setLocalWaitPanelMaxValuePrimary(0);
|
|
560
|
-
setLocalWaitPanelValuePrimary(0);
|
|
561
|
-
setShowLocalWaitPanel(false);
|
|
562
|
-
TMResultManager.show(result, 'Check in', "ID", undefined, SDKUI_Localizator.CheckInSuccessMessage, 6000);
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
},
|
|
566
|
-
});
|
|
567
|
-
});
|
|
568
|
-
input.click();
|
|
569
|
-
}, [selectedItems, focusedItem, getSelectedDcmtsOrFocused]);
|
|
392
|
+
firstDoc.fileName = fromDTD?.name ?? SDKUI_Localizator.SearchResult;
|
|
393
|
+
await handleCheckInCallback(firstDoc, undefined, refreshFocusedDataRowAsync);
|
|
394
|
+
};
|
|
570
395
|
const refreshDataGridAfterRemoveAsync = async () => {
|
|
571
396
|
let index = selectedSearchResult?.dtdResult?.columns?.findIndex(col => col.caption === 'DID');
|
|
572
397
|
let selectedRows = [];
|
|
@@ -744,8 +569,6 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
744
569
|
break;
|
|
745
570
|
}
|
|
746
571
|
};
|
|
747
|
-
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 &&
|
|
748
|
-
_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, handleCheckInOperationCallback, showCheckoutInformationFormCallback, viewHistoryCallback, infoCheckCopyToClipboard, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation).concat([customButtonMenuItems()]) })] });
|
|
749
572
|
const handleAddItem = (tid, did) => {
|
|
750
573
|
let newItem = { TID: tid ?? 0, DID: did ?? 0 };
|
|
751
574
|
setSecondaryMasterDcmts((prevItems) => [...prevItems, newItem]);
|
|
@@ -755,22 +578,53 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
755
578
|
};
|
|
756
579
|
const handleSavedAsyncCallback = useCallback(async (tid, did, metadataResult) => {
|
|
757
580
|
await refreshFocusedDataRowAsync(tid, did, true, metadataResult);
|
|
758
|
-
}, []);
|
|
759
|
-
const showToppyForApprove = (
|
|
581
|
+
}, [refreshFocusedDataRowAsync]);
|
|
582
|
+
const showToppyForApprove = useMemo(() => {
|
|
583
|
+
return Boolean(isVisible && fromDTD && isApprovalWorkflowView(fromDTD) && !isOpenDcmtForm && !isOpenDetails && !isOpenMaster);
|
|
584
|
+
}, [isVisible, fromDTD, isOpenDcmtForm, isOpenDetails, isOpenMaster]);
|
|
585
|
+
/**
|
|
586
|
+
* TMToppyDraggableHelpCenter viene nascosto quando è aperto qualsiasi altro popup o modale che potrebbe
|
|
587
|
+
* interferire con l'interazione dell'utente (approvazione, rifiuto, riassegnazione, info aggiuntive,
|
|
588
|
+
* modifica PDF, visualizzatore S4T, form todo documento).
|
|
589
|
+
*/
|
|
590
|
+
const isToppyHelpCenterVisible = useMemo(() => {
|
|
591
|
+
return Boolean(showToppyForApprove
|
|
592
|
+
&& showToppyDraggableHelpCenter
|
|
593
|
+
&& selectedDocs.length > 0
|
|
594
|
+
&& !showApprovePopup
|
|
595
|
+
&& !showRejectPopup
|
|
596
|
+
&& !showReAssignPopup
|
|
597
|
+
&& !showMoreInfoPopup
|
|
598
|
+
&& !editPdfForm
|
|
599
|
+
&& !openS4TViewer
|
|
600
|
+
&& !showTodoDcmtForm);
|
|
601
|
+
}, [showToppyForApprove, showToppyDraggableHelpCenter, selectedDocs, showApprovePopup, showRejectPopup, showReAssignPopup, showMoreInfoPopup, editPdfForm, openS4TViewer, showTodoDcmtForm]);
|
|
602
|
+
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, openSignSettingsForm, handleCheckOutOperationCallback, handleCheckInOperationCallback, showCheckoutInformationFormCallback, showHistoryCallback, copyCheckoutPathToClipboardOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation, pinnedItemIds, togglePin);
|
|
604
|
+
const customButtons = customButtonMenuItems();
|
|
605
|
+
return customButtons.name ? baseMenuItems.concat([customButtons]) : baseMenuItems;
|
|
606
|
+
}, [
|
|
607
|
+
isMobile, fromDTD, allUsers, selectedItems, focusedItem, context,
|
|
608
|
+
showFloatingBar, workingGroupContext, showSearch, currentTIDHasMasterRelations,
|
|
609
|
+
currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation,
|
|
610
|
+
hasManyToManyRelation, customButtonsLayout, pinnedItemIds, togglePin
|
|
611
|
+
]);
|
|
612
|
+
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
|
+
_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' }) })] });
|
|
760
614
|
const tmSearchResult = useMemo(() => (!searchResults || searchResults.length <= 0)
|
|
761
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 }) })] })
|
|
762
616
|
:
|
|
763
|
-
_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 ?
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
617
|
+
_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
|
+
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, selectedSearchResult: selectedSearchResult, autoSelectFirst: !isMobile || currentSearchResults.length === 1, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
619
|
+
:
|
|
620
|
+
_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: () => {
|
|
768
622
|
setIsOpenBatchUpdate(false);
|
|
769
623
|
}, onSavedCallbackAsync: async () => {
|
|
770
624
|
setIsOpenBatchUpdate(false);
|
|
771
625
|
setIsModifiedBatchUpdate(false);
|
|
772
626
|
await refreshSelectionDataRowsAsync();
|
|
773
|
-
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), _jsx(
|
|
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: () => {
|
|
774
628
|
setShowApprovePopup(true);
|
|
775
629
|
}, onSignApprove: () => {
|
|
776
630
|
handleSignApprove();
|
|
@@ -813,7 +667,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
813
667
|
TMSpinner.hide();
|
|
814
668
|
}
|
|
815
669
|
}, onClose: () => setShowManyToManyChooser(false), manageUseLocalizedName: false }), showPairDcmtsModal &&
|
|
816
|
-
_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 &&
|
|
670
|
+
_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 &&
|
|
817
671
|
_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: () => {
|
|
818
672
|
setIsOpenSharedArchive(false);
|
|
819
673
|
}, 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) => {
|
|
@@ -823,7 +677,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
823
677
|
_jsx(TMModal, { title: "Documenti condivisi", onClose: () => {
|
|
824
678
|
setSharedDcmtSearchResults([]);
|
|
825
679
|
}, 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) &&
|
|
826
|
-
_jsx(
|
|
680
|
+
_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 })] }), [
|
|
827
681
|
searchResults,
|
|
828
682
|
selectedSearchResult,
|
|
829
683
|
lastUpdateSearchTime,
|
|
@@ -874,22 +728,73 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
874
728
|
isMobile,
|
|
875
729
|
currentMetadataValues,
|
|
876
730
|
sharedDcmtFile,
|
|
877
|
-
onRefreshSearchAsync
|
|
731
|
+
onRefreshSearchAsync,
|
|
732
|
+
handleNavigateToWGs,
|
|
733
|
+
handleNavigateToDossiers,
|
|
734
|
+
editPdfForm
|
|
878
735
|
]);
|
|
879
|
-
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]);
|
|
736
|
+
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]);
|
|
880
737
|
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]);
|
|
881
738
|
const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { currentDcmt: currentDcmt }, refreshPreviewTrigger), [currentDcmt, refreshPreviewTrigger]);
|
|
739
|
+
const handleToggleIndexingInfo = async () => {
|
|
740
|
+
if (!focusedItem)
|
|
741
|
+
return;
|
|
742
|
+
if (showIndexingInfo) {
|
|
743
|
+
setShowIndexingInfo(false);
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
const cacheKey = `${focusedItem.TID}-${focusedItem.DID}`;
|
|
747
|
+
if (indexingInfoCache.has(cacheKey)) {
|
|
748
|
+
setShowIndexingInfo(true);
|
|
749
|
+
return;
|
|
750
|
+
}
|
|
751
|
+
try {
|
|
752
|
+
setLoadingIndexingInfo(true);
|
|
753
|
+
const msg = await SDK_Globals.tmSession?.NewSearchEngine().FreeSearchGetDcmtInfoAsync(focusedItem.TID, focusedItem.DID);
|
|
754
|
+
setIndexingInfoCache(prev => new Map(prev).set(cacheKey, msg ?? ''));
|
|
755
|
+
setShowIndexingInfo(true);
|
|
756
|
+
}
|
|
757
|
+
catch (e) {
|
|
758
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
759
|
+
}
|
|
760
|
+
finally {
|
|
761
|
+
setLoadingIndexingInfo(false);
|
|
762
|
+
}
|
|
763
|
+
};
|
|
764
|
+
const tmFullTextSearch = useMemo(() => {
|
|
765
|
+
if (!focusedItem) {
|
|
766
|
+
return (_jsxs(StyledPlaceholder, { children: [" ", _jsx("p", { children: "Seleziona un documento per visualizzare i dettagli della ricerca full-text" }), " "] }));
|
|
767
|
+
}
|
|
768
|
+
// const ftExplanationsColumnIndex = selectedSearchResult?.dtdResult?.columns?.findIndex( col => col.caption === 'FTExplanations' );
|
|
769
|
+
const ftExplanationsColumnIndex = selectedSearchResult?.selectMIDs?.findIndex(mid => mid === 0); //nosonar
|
|
770
|
+
if (ftExplanationsColumnIndex === undefined || ftExplanationsColumnIndex < 0) {
|
|
771
|
+
return (_jsxs(StyledPlaceholder, { children: [" ", _jsx("p", { children: "Nessuna info full-text disponibile" }), " "] }));
|
|
772
|
+
}
|
|
773
|
+
const row = selectedSearchResult?.dtdResult?.rows?.[focusedItem.rowIndex];
|
|
774
|
+
if (!row) {
|
|
775
|
+
return (_jsxs(StyledPlaceholder, { children: [" ", _jsx("p", { children: "Documento non trovato" }), " "] }));
|
|
776
|
+
}
|
|
777
|
+
const ftExplanation = row[ftExplanationsColumnIndex];
|
|
778
|
+
if (!ftExplanation) {
|
|
779
|
+
return (_jsxs(StyledPlaceholder, { children: [" ", _jsx("p", { children: "Nessuna info disponibile per questo documento" }), " "] }));
|
|
780
|
+
}
|
|
781
|
+
const cacheKey = `${focusedItem.TID}-${focusedItem.DID}`;
|
|
782
|
+
const cachedInfo = indexingInfoCache.get(cacheKey);
|
|
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]);
|
|
882
785
|
const allInitialPanelVisibility = {
|
|
883
786
|
'tmSearchResult': true,
|
|
884
787
|
'tmBlog': false,
|
|
885
788
|
'tmSysMetadata': false,
|
|
886
789
|
'tmDcmtPreview': false,
|
|
790
|
+
// 'tmFullTextSearch': false,
|
|
887
791
|
};
|
|
888
792
|
const initialPanelDimensions = {
|
|
889
793
|
'tmSearchResult': { width: '25%', height: '100%' },
|
|
890
794
|
'tmBlog': { width: '25%', height: '100%' },
|
|
891
795
|
'tmSysMetadata': { width: '25%', height: '100%' },
|
|
892
796
|
'tmDcmtPreview': { width: '25%', height: '100%' },
|
|
797
|
+
// 'tmFullTextSearch': { width: '25%', height: '100%' },
|
|
893
798
|
};
|
|
894
799
|
const initialPanels = useMemo(() => [
|
|
895
800
|
{
|
|
@@ -927,8 +832,16 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
927
832
|
name: SDKUI_Localizator.PreviewDocument,
|
|
928
833
|
contentOptions: { component: tmDcmtPreview },
|
|
929
834
|
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
|
|
930
|
-
}
|
|
931
|
-
|
|
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
|
+
// ] : [])
|
|
844
|
+
], [tmSearchResult, tmBlog, tmSysMetadata, tmDcmtPreview, tmFullTextSearch, showToolbarHeader, context, isMobile]);
|
|
932
845
|
return (_jsxs(StyledMultiViewPanel, { "$isVisible": isVisible, children: [_jsx(StyledMultiViewPanel, { "$isVisible": !isOpenDcmtForm && !isOpenDetails && !isOpenMaster, style: {
|
|
933
846
|
display: 'flex',
|
|
934
847
|
flexDirection: isMobile ? 'column' : 'row',
|
|
@@ -936,12 +849,12 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
936
849
|
gap: Gutters.getGutters(),
|
|
937
850
|
width: '100%',
|
|
938
851
|
height: '100%',
|
|
939
|
-
}, 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:
|
|
852
|
+
}, 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) ?
|
|
940
853
|
_jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showSearchResultSidebar })
|
|
941
854
|
:
|
|
942
855
|
_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) => {
|
|
943
856
|
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}`));
|
|
944
|
-
})] }), _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: () => {
|
|
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: showSearchResultSidebar }) }), isOpenArchiveRelationForm && _jsx(TMDcmtForm, { isModal: true, titleModal: SDKUI_Localizator.Archive + ' - ' + (archiveType === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster), TID: archiveRelatedDcmtFormTID, layoutMode: LayoutModes.Ark, inputMids: archiveRelatedDcmtFormMids, showBackButton: false, allowButtonsRefs: false, onClose: () => {
|
|
945
858
|
setIsOpenArchiveRelationForm(false);
|
|
946
859
|
setArchiveType(undefined);
|
|
947
860
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
@@ -952,19 +865,20 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
952
865
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
953
866
|
setArchiveRelatedDcmtFormMids([]);
|
|
954
867
|
await onRefreshSearchAsync?.();
|
|
955
|
-
}, 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:
|
|
868
|
+
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showSearchResultSidebar }), (showSignSettingsForm && fromDTD) && _jsx(TMSignSettingsForm, { fromDTD: fromDTD, inputDcmts: allFieldSelectedDocs, onCloseSignSettingsForm: closeSignSettingsForm, onSavedAsyncCallback: handleSavedAsyncCallback }), (showHistory && fromDTD && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMViewHistoryDcmt, { fromDTD: fromDTD, deviceType: deviceType, inputDcmt: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0], onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (commentFormState.show && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].TID, did: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID } }, onClose: hideCommentFormCallback, refreshCallback: triggerBlogRefresh, participants: [], showAttachmentsSection: true, allArchivedDocumentsFileItems: convertSearchResultDescriptorToFileItems(currentSearchResults ?? []), isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment, selectedAttachmentDid: [Number(getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID)] })] }));
|
|
956
869
|
};
|
|
957
870
|
export default TMSearchResult;
|
|
958
|
-
const
|
|
959
|
-
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 });
|
|
960
|
-
};
|
|
961
|
-
const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem, showSearch, allowMultipleSelection = true, showExportForm = false, onCloseExportForm, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, onContextMenuPreparing, onSelectionChanged, onDblClick }) => {
|
|
871
|
+
const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem, showSearch, allowMultipleSelection = true, showExportForm = false, onCloseExportForm, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, floatingMenuItems, onSelectionChanged, onDblClick }) => {
|
|
962
872
|
const [dataSource, setDataSource] = useState();
|
|
963
873
|
const [columns, setColumns] = useState([]);
|
|
964
874
|
// State to store selected row keys
|
|
965
875
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
|
966
876
|
const [focusedItem, setFocusedItem] = useState();
|
|
967
877
|
const [visibleItems, setVisibleItems] = useState([]);
|
|
878
|
+
const [pageSize, setPageSize] = useState(SDKUI_Globals.userSettings.searchSettings?.pageSize ?? TMDataGridPageSize.Large);
|
|
879
|
+
const [isDataGridReady, setIsDataGridReady] = useState(false);
|
|
880
|
+
const { loadDataListsAsync, renderDataListCell, dataListsCache } = useDataListItem();
|
|
881
|
+
const { loadUsersAsync, renderUserIdViewer, usersCache } = useDataUserIdItem();
|
|
968
882
|
useEffect(() => {
|
|
969
883
|
if (deepCompare(inputFocusedItem, focusedItem))
|
|
970
884
|
return;
|
|
@@ -976,6 +890,12 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
976
890
|
return;
|
|
977
891
|
setSelectedRowKeys(inputSelectedItemsRowIndex);
|
|
978
892
|
}, [inputSelectedItems]);
|
|
893
|
+
useEffect(() => {
|
|
894
|
+
const newPageSize = SDKUI_Globals.userSettings.searchSettings?.pageSize ?? TMDataGridPageSize.Large;
|
|
895
|
+
if (newPageSize !== pageSize) {
|
|
896
|
+
setPageSize(newPageSize);
|
|
897
|
+
}
|
|
898
|
+
}, [SDKUI_Globals.userSettings.searchSettings?.pageSize]);
|
|
979
899
|
const onKeyDown = useCallback((e) => {
|
|
980
900
|
// Check if the pressed key is the "Delete" key.
|
|
981
901
|
if (e.event?.key === 'Delete' && !showExportForm) {
|
|
@@ -1033,6 +953,9 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
1033
953
|
}
|
|
1034
954
|
}
|
|
1035
955
|
}, [inputSelectedItems, inputFocusedItem, dataSource]);
|
|
956
|
+
const cellRenderDcmtIcon = useCallback((cellData, onDownloadDcmtsAsync, openInOffice) => {
|
|
957
|
+
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 });
|
|
958
|
+
}, []);
|
|
1036
959
|
const cellRender = useCallback((cellData, dataDomain, dataListID, dataListViewMode) => {
|
|
1037
960
|
if (!cellData || cellData.value === undefined)
|
|
1038
961
|
return null;
|
|
@@ -1054,10 +977,10 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
1054
977
|
}
|
|
1055
978
|
let child = _jsx("div", { children: cellData.text });
|
|
1056
979
|
if (dataDomain === MetadataDataDomains.DataList) {
|
|
1057
|
-
child =
|
|
980
|
+
child = renderDataListCell(cellData.value, dataListID, dataListViewMode);
|
|
1058
981
|
}
|
|
1059
982
|
if (dataDomain === MetadataDataDomains.UserID) {
|
|
1060
|
-
child =
|
|
983
|
+
child = renderUserIdViewer(cellData.value, true);
|
|
1061
984
|
}
|
|
1062
985
|
return (_jsxs("div", { style: style, children: [shouldShowCheckoutIcon && checkoutStatus.icon, child] }));
|
|
1063
986
|
}, [fromDTD, allUsers]);
|
|
@@ -1110,32 +1033,128 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
1110
1033
|
return { type: 'currency', currency: "JPY" };
|
|
1111
1034
|
return undefined;
|
|
1112
1035
|
}, []);
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1036
|
+
/**
|
|
1037
|
+
* Genera la configurazione delle colonne della griglia con i relativi headerFilter.
|
|
1038
|
+
* Per le colonne di tipo DataList e UserID, crea headerFilter con valori leggibili (nomi/descrizioni)
|
|
1039
|
+
* invece delle chiavi numeriche, migliorando l'esperienza utente durante il filtraggio.
|
|
1040
|
+
*/
|
|
1041
|
+
const generateColumns = useCallback(() => {
|
|
1042
|
+
// Verifica che esistano colonne da processare
|
|
1043
|
+
if (!searchResult?.dtdResult?.columns)
|
|
1044
|
+
return [];
|
|
1045
|
+
// Genera chiavi univoche per ogni colonna basate sul TID del risultato
|
|
1119
1046
|
const uniqueKeys = generateUniqueColumnKeys(searchResult?.dtdResult?.columns, searchResult?.fromTID);
|
|
1120
|
-
|
|
1047
|
+
const cols = [];
|
|
1048
|
+
// Itera su ogni colonna del risultato di ricerca
|
|
1049
|
+
searchResult.dtdResult.columns.map((col, index) => {
|
|
1050
|
+
// Determina se la colonna è visibile (non nascosta)
|
|
1121
1051
|
const isVisible = col.extendedProperties?.["Visibility"] != "Hidden";
|
|
1052
|
+
// Estrae il dominio dati della colonna (es. DataList, UserID, None)
|
|
1122
1053
|
const dataDomain = MetadataDataDomains[(col.extendedProperties?.["DataDomain"] ?? "None")];
|
|
1054
|
+
// Estrae l'ID della DataList associata (se presente)
|
|
1123
1055
|
const dataListID = Number(col.extendedProperties?.["DataListID"]);
|
|
1056
|
+
// Estrae la modalità di visualizzazione della DataList
|
|
1124
1057
|
const dataListViewMode = DataListViewModes[(col.extendedProperties?.["DataListViewMode"] ?? "None")];
|
|
1058
|
+
// Inizializza la configurazione del filtro header
|
|
1059
|
+
let headerFilterConfig = undefined;
|
|
1060
|
+
// Configurazione headerFilter per colonne DataList
|
|
1061
|
+
if (dataDomain === MetadataDataDomains.DataList && dataListID) {
|
|
1062
|
+
// Recupera gli elementi della DataList dalla cache
|
|
1063
|
+
const dataListItems = dataListsCache.current.get(dataListID);
|
|
1064
|
+
if (dataListItems && dataListItems.length > 0) {
|
|
1065
|
+
// Crea il datasource per l'headerFilter mostrando il nome (text) ma filtrando per valore (value)
|
|
1066
|
+
headerFilterConfig = {
|
|
1067
|
+
dataSource: dataListItems
|
|
1068
|
+
.filter(item => item.name != null && item.value != null)
|
|
1069
|
+
.map(item => ({
|
|
1070
|
+
text: item.name,
|
|
1071
|
+
value: item.value
|
|
1072
|
+
}))
|
|
1073
|
+
};
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
// Configurazione headerFilter per colonne UserID
|
|
1077
|
+
if (dataDomain === MetadataDataDomains.UserID) {
|
|
1078
|
+
// Recupera tutti gli utenti dalla cache
|
|
1079
|
+
const users = Array.from(usersCache.current.values());
|
|
1080
|
+
if (users.length > 0) {
|
|
1081
|
+
// Crea il datasource per l'headerFilter mostrando nome utente completo (dominio\nome)
|
|
1082
|
+
headerFilterConfig = {
|
|
1083
|
+
dataSource: users
|
|
1084
|
+
.filter(user => user.name != null && user.id != null)
|
|
1085
|
+
.map(user => ({
|
|
1086
|
+
text: user.domain ? `${user.domain}\\${user.name}` : user.name,
|
|
1087
|
+
value: user.id
|
|
1088
|
+
}))
|
|
1089
|
+
};
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
// Aggiunge la configurazione della colonna all'array
|
|
1125
1093
|
cols.push({
|
|
1126
1094
|
dataField: uniqueKeys[index],
|
|
1127
1095
|
dataType: dataType(col),
|
|
1128
1096
|
visible: isVisible,
|
|
1129
1097
|
cellRender: (cellData) => cellRender(cellData, dataDomain, dataListID, dataListViewMode),
|
|
1098
|
+
headerFilter: headerFilterConfig,
|
|
1130
1099
|
caption: col.caption,
|
|
1131
1100
|
format: getDisplayFormat(col),
|
|
1132
1101
|
});
|
|
1133
1102
|
});
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1103
|
+
return cols;
|
|
1104
|
+
}, [searchResult, dataType, cellRender, getDisplayFormat, dataListsCache, usersCache]);
|
|
1105
|
+
/**
|
|
1106
|
+
* Effect che carica i dati necessari e genera le colonne della griglia.
|
|
1107
|
+
* Esegue il caricamento delle cache (DataList e UserID) in parallelo prima di generare le colonne,
|
|
1108
|
+
* garantendo che gli headerFilter abbiano tutti i dati disponibili.
|
|
1109
|
+
*/
|
|
1110
|
+
useEffect(() => {
|
|
1111
|
+
// Verifica che siano disponibili il tipo documento e i risultati di ricerca
|
|
1112
|
+
if (fromDTD === undefined || searchResult === undefined)
|
|
1113
|
+
return;
|
|
1114
|
+
const loadColumnsAndData = async () => {
|
|
1115
|
+
// Resetta l'elemento focalizzato quando si caricano nuovi dati
|
|
1116
|
+
setFocusedItem(undefined);
|
|
1117
|
+
setIsDataGridReady(false);
|
|
1118
|
+
// Set per raccogliere gli ID univoci da precaricare
|
|
1119
|
+
const dataListIDs = new Set();
|
|
1120
|
+
const userIDs = new Set();
|
|
1121
|
+
// Itera sulle colonne per identificare quali DataList devono essere caricate
|
|
1122
|
+
searchResult?.dtdResult?.columns?.forEach((col) => {
|
|
1123
|
+
const dataDomain = MetadataDataDomains[(col.extendedProperties?.["DataDomain"] ?? "None")];
|
|
1124
|
+
const dataListID = Number(col.extendedProperties?.["DataListID"]);
|
|
1125
|
+
// Se la colonna è di tipo DataList, aggiunge l'ID al set per il caricamento
|
|
1126
|
+
if (dataDomain === MetadataDataDomains.DataList && dataListID) {
|
|
1127
|
+
dataListIDs.add(dataListID);
|
|
1128
|
+
}
|
|
1129
|
+
});
|
|
1130
|
+
// Itera sulle righe per identificare quali UserID devono essere caricati
|
|
1131
|
+
searchResult?.dtdResult?.rows?.forEach((row) => {
|
|
1132
|
+
searchResult?.dtdResult?.columns?.forEach((col, colIndex) => {
|
|
1133
|
+
const dataDomain = MetadataDataDomains[(col.extendedProperties?.["DataDomain"] ?? "None")];
|
|
1134
|
+
// Se la colonna è di tipo UserID, estrae l'ID dalla riga e lo aggiunge al set
|
|
1135
|
+
if (dataDomain === MetadataDataDomains.UserID) {
|
|
1136
|
+
const userId = Number(row[colIndex]);
|
|
1137
|
+
if (userId && userId > 0) {
|
|
1138
|
+
userIDs.add(userId);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
});
|
|
1142
|
+
});
|
|
1143
|
+
// Carica in parallelo le cache di DataList e UserID per ottimizzare le prestazioni
|
|
1144
|
+
await Promise.all([
|
|
1145
|
+
loadDataListsAsync(dataListIDs),
|
|
1146
|
+
loadUsersAsync(userIDs)
|
|
1147
|
+
]);
|
|
1148
|
+
// Genera colonne con cache popolate per garantire headerFilter completi
|
|
1149
|
+
const cols = generateColumns();
|
|
1150
|
+
setColumns(cols);
|
|
1151
|
+
// Converte i risultati di ricerca in un array semplice per la griglia
|
|
1152
|
+
let newDataSource = searchResultDescriptorToSimpleArray(searchResult);
|
|
1153
|
+
setDataSource(newDataSource);
|
|
1154
|
+
setIsDataGridReady(true);
|
|
1155
|
+
};
|
|
1156
|
+
loadColumnsAndData();
|
|
1157
|
+
}, [searchResult, fromDTD, allUsers, loadDataListsAsync, loadUsersAsync, generateColumns]);
|
|
1139
1158
|
useEffect(() => {
|
|
1140
1159
|
let newDataSource = searchResultDescriptorToSimpleArray(searchResult);
|
|
1141
1160
|
setDataSource(newDataSource);
|
|
@@ -1190,9 +1209,10 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
1190
1209
|
caption: '',
|
|
1191
1210
|
visible: true,
|
|
1192
1211
|
width: 50,
|
|
1193
|
-
cellRender: (cellData) =>
|
|
1212
|
+
cellRender: (cellData) => cellRenderDcmtIcon(cellData, onDownloadDcmtsAsync, openInOffice),
|
|
1194
1213
|
allowResizing: false,
|
|
1195
|
-
filterOperations: ['=', "anyof"]
|
|
1214
|
+
filterOperations: ['=', "anyof"],
|
|
1215
|
+
allowHiding: false,
|
|
1196
1216
|
},
|
|
1197
1217
|
...columns.filter(col => col.dataField !== 'FILEEXT')
|
|
1198
1218
|
];
|
|
@@ -1206,7 +1226,7 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
1206
1226
|
setVisibleItems(visibleRows.map((row) => { return row.data; }));
|
|
1207
1227
|
}, []);
|
|
1208
1228
|
useEffect(() => { onVisibleItemChanged?.(visibleItems); }, [visibleItems]);
|
|
1209
|
-
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:
|
|
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 })] });
|
|
1210
1230
|
};
|
|
1211
1231
|
//#region TMSearchResultSelector
|
|
1212
1232
|
const StyledItemTemplate = styled.div `
|
|
@@ -1325,3 +1345,101 @@ const TMDcmtPreviewWrapper = ({ currentDcmt, isVisible }) => {
|
|
|
1325
1345
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
1326
1346
|
return (_jsx(TMDcmtPreview, { onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("tmDcmtPreview") : undefined, dcmtData: currentDcmt, isResizingActive: isResizingActive, isVisible: isVisible }));
|
|
1327
1347
|
};
|
|
1348
|
+
// Styled Components
|
|
1349
|
+
const StyledPlaceholder = styled.div `
|
|
1350
|
+
padding: 20px;
|
|
1351
|
+
text-align: center;
|
|
1352
|
+
color: #888;
|
|
1353
|
+
`;
|
|
1354
|
+
const StyledIndexingInfoSection = styled.div `
|
|
1355
|
+
padding: 15px;
|
|
1356
|
+
border-top: 1px solid #e0e0e0;
|
|
1357
|
+
background: linear-gradient(to bottom, #f9f9f9, #f5f5f5);
|
|
1358
|
+
display: flex;
|
|
1359
|
+
flex-direction: column;
|
|
1360
|
+
gap: 10px;
|
|
1361
|
+
`;
|
|
1362
|
+
const StyledIndexingToggle = styled.button `
|
|
1363
|
+
display: flex;
|
|
1364
|
+
align-items: center;
|
|
1365
|
+
justify-content: space-between;
|
|
1366
|
+
width: 100%;
|
|
1367
|
+
padding: 10px 16px;
|
|
1368
|
+
background: white;
|
|
1369
|
+
border: 1px solid #d0d0d0;
|
|
1370
|
+
border-radius: 6px;
|
|
1371
|
+
cursor: ${props => props.disabled ? 'not-allowed' : 'pointer'};
|
|
1372
|
+
transition: all 0.2s ease;
|
|
1373
|
+
font-size: 14px;
|
|
1374
|
+
font-weight: 500;
|
|
1375
|
+
color: #333;
|
|
1376
|
+
opacity: ${props => props.disabled ? 0.6 : 1};
|
|
1377
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
1378
|
+
|
|
1379
|
+
&:hover:not(:disabled) {
|
|
1380
|
+
background: #f8f8f8;
|
|
1381
|
+
border-color: #2196F3;
|
|
1382
|
+
box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
&:active:not(:disabled) {
|
|
1386
|
+
transform: translateY(1px);
|
|
1387
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
svg {
|
|
1391
|
+
color: #2196F3;
|
|
1392
|
+
font-size: 18px;
|
|
1393
|
+
}
|
|
1394
|
+
`;
|
|
1395
|
+
const StyledLeftContent = styled.div `
|
|
1396
|
+
display: flex;
|
|
1397
|
+
align-items: center;
|
|
1398
|
+
gap: 8px;
|
|
1399
|
+
`;
|
|
1400
|
+
const StyledRightContent = styled.div `
|
|
1401
|
+
display: flex;
|
|
1402
|
+
align-items: center;
|
|
1403
|
+
gap: 8px;
|
|
1404
|
+
`;
|
|
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
|
+
const StyledChevron = styled.span `
|
|
1417
|
+
transition: transform 0.2s ease;
|
|
1418
|
+
transform: ${props => props.$isOpen ? 'rotate(180deg)' : 'rotate(0deg)'};
|
|
1419
|
+
color: #666;
|
|
1420
|
+
font-size: 12px;
|
|
1421
|
+
`;
|
|
1422
|
+
const StyledIndexingInfoBox = styled.div `
|
|
1423
|
+
background: white;
|
|
1424
|
+
border: 1px solid #e0e0e0;
|
|
1425
|
+
border-radius: 6px;
|
|
1426
|
+
padding: 12px;
|
|
1427
|
+
max-height: 200px;
|
|
1428
|
+
overflow: auto;
|
|
1429
|
+
font-family: 'Courier New', monospace;
|
|
1430
|
+
font-size: 12px;
|
|
1431
|
+
color: #333;
|
|
1432
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
1433
|
+
animation: slideDown 0.2s ease;
|
|
1434
|
+
|
|
1435
|
+
@keyframes slideDown {
|
|
1436
|
+
from {
|
|
1437
|
+
opacity: 0;
|
|
1438
|
+
transform: translateY(-10px);
|
|
1439
|
+
}
|
|
1440
|
+
to {
|
|
1441
|
+
opacity: 1;
|
|
1442
|
+
transform: translateY(0);
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
`;
|