@topconsultnpm/sdkui-react 6.22.0-dev2.9 → 6.22.0-dev3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +3 -3
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +1 -1
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +14 -14
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +6 -6
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +31 -31
- package/lib/components/base/Styled.d.ts +4 -4
- package/lib/components/base/Styled.js +7 -5
- package/lib/components/base/TMAccordionNew.js +7 -7
- package/lib/components/base/TMAlert.d.ts +32 -32
- package/lib/components/base/TMAreaManager.js +1 -1
- package/lib/components/base/TMButton.js +4 -4
- package/lib/components/base/TMClosableList.js +3 -3
- package/lib/components/base/TMCustomButton.js +1 -1
- package/lib/components/base/TMDataGrid.d.ts +4 -0
- package/lib/components/base/TMDataGrid.js +292 -12
- package/lib/components/base/TMDropDownMenu.js +1 -1
- package/lib/components/base/TMEditorBase.d.ts +2 -0
- package/lib/components/base/TMFileManager.js +5 -3
- package/lib/components/base/TMFileManagerDataGridView.js +12 -3
- package/lib/components/base/TMFileManagerThumbnailItems.js +20 -10
- package/lib/components/base/TMFileManagerUtils.d.ts +4 -2
- package/lib/components/base/TMFileManagerUtils.js +37 -1
- package/lib/components/base/TMLayout.d.ts +2 -2
- package/lib/components/base/TMLayout.js +3 -3
- package/lib/components/base/TMList.js +1 -1
- package/lib/components/base/TMListView.js +3 -3
- package/lib/components/base/TMModal.d.ts +11 -0
- package/lib/components/base/TMModal.js +47 -13
- package/lib/components/base/TMPanel.d.ts +6 -0
- package/lib/components/base/TMPanel.js +141 -28
- package/lib/components/base/TMPopUp.js +5 -2
- package/lib/components/base/TMResizableMenu.js +2 -2
- package/lib/components/base/TMRightSidebar.js +1 -1
- package/lib/components/base/TMShowAllOrMaxItemsButton.js +1 -1
- package/lib/components/base/TMSpinner.js +2 -2
- package/lib/components/base/TMTab.js +2 -2
- package/lib/components/base/TMTabControl.d.ts +101 -0
- package/lib/components/base/TMTabControl.js +653 -0
- package/lib/components/base/TMToggleButton.js +2 -2
- package/lib/components/base/TMToolbarCard.js +3 -3
- package/lib/components/base/TMTooltip.d.ts +2 -1
- package/lib/components/base/TMTooltip.js +24 -8
- package/lib/components/base/TMTreeView.js +123 -70
- package/lib/components/base/TMWaitPanel.js +2 -2
- package/lib/components/choosers/TMCultureIDPicker.js +2 -2
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDataListItemPicker.js +2 -2
- package/lib/components/choosers/TMDcmtTypeChooser.js +5 -4
- package/lib/components/choosers/TMDiskChooser.js +1 -1
- package/lib/components/choosers/TMDistinctValues.d.ts +9 -7
- package/lib/components/choosers/TMDistinctValues.js +157 -141
- package/lib/components/choosers/TMDynDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMImageIDChooser.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.js +3 -3
- package/lib/components/choosers/TMQuickSearchInfo.d.ts +12 -0
- package/lib/components/choosers/TMQuickSearchInfo.js +279 -0
- package/lib/components/choosers/TMQuickSearchSettingsForm.d.ts +16 -0
- package/lib/components/choosers/TMQuickSearchSettingsForm.js +94 -0
- package/lib/components/choosers/TMRelationChooser.js +1 -1
- package/lib/components/choosers/TMSelectedValuesSummary.d.ts +13 -0
- package/lib/components/choosers/TMSelectedValuesSummary.js +89 -0
- package/lib/components/choosers/TMUserChooser.js +1 -1
- package/lib/components/editors/TMCheckBox.js +1 -1
- package/lib/components/editors/TMDropDown.d.ts +3 -0
- package/lib/components/editors/TMDropDown.js +197 -5
- package/lib/components/editors/TMEditorStyled.d.ts +10 -10
- package/lib/components/editors/TMFormulaEditor.js +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.js +1 -1
- package/lib/components/editors/TMLocalizedTextBox.js +1 -1
- package/lib/components/editors/TMMetadataValues.js +6 -6
- package/lib/components/editors/TMRadioButton.js +2 -2
- package/lib/components/editors/TMSummary.js +3 -3
- package/lib/components/editors/TMTextArea.js +3 -3
- package/lib/components/editors/TMTextBox.js +3 -3
- package/lib/components/editors/TMTextExpression.js +1 -1
- package/lib/components/features/archive/TMArchive.js +17 -3
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
- package/lib/components/features/assistant/TMToppySpeechBubble.js +1 -1
- package/lib/components/features/documents/TMBatchUpdateForm.js +20 -6
- package/lib/components/features/documents/TMCopyToFolderForm.js +61 -22
- package/lib/components/features/documents/TMDcmtBlog.d.ts +3 -0
- package/lib/components/features/documents/TMDcmtBlog.js +4 -4
- package/lib/components/features/documents/TMDcmtForm.d.ts +7 -0
- package/lib/components/features/documents/TMDcmtForm.js +181 -54
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +11 -0
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +79 -9
- package/lib/components/features/documents/TMDcmtIcon.js +5 -3
- package/lib/components/features/documents/TMDcmtPreview.js +12 -8
- package/lib/components/features/documents/TMDownloadRelationViewerSection.js +1 -1
- package/lib/components/features/documents/TMFileUploader.js +3 -3
- package/lib/components/features/documents/TMMasterDetailDcmts.js +116 -34
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +19 -0
- package/lib/components/features/documents/TMMasterInfoFields.js +184 -0
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
- package/lib/components/features/documents/TMMergeToPdfForm.js +42 -10
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +45 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +321 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +370 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +283 -0
- package/lib/components/features/documents/TMRelationViewer.d.ts +24 -3
- package/lib/components/features/documents/TMRelationViewer.js +110 -52
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +1 -1
- package/lib/components/features/search/TMMetadataOutputForm.js +1 -1
- package/lib/components/features/search/TMMetadataSorterForm.js +1 -1
- package/lib/components/features/search/TMSavedQuerySelector.js +2 -2
- package/lib/components/features/search/TMSearch.d.ts +1 -2
- package/lib/components/features/search/TMSearch.js +146 -21
- package/lib/components/features/search/TMSearchQueryEditor.js +7 -5
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +4 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +142 -68
- package/lib/components/features/search/TMSearchResult.d.ts +16 -0
- package/lib/components/features/search/TMSearchResult.js +439 -110
- package/lib/components/features/search/TMSignatureInfoContent.js +1 -1
- package/lib/components/features/search/TMTreeSelector.js +121 -70
- package/lib/components/features/tasks/TMTaskForm.js +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.js +3 -3
- package/lib/components/features/tasks/TMTasksAgenda.js +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.js +1 -1
- package/lib/components/features/tasks/TMTasksHeader.js +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.js +1 -1
- package/lib/components/features/tasks/TMTasksView.js +7 -13
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +1 -1
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +10 -0
- package/lib/components/features/workflow/TMWorkflowPopup.js +9 -5
- package/lib/components/features/workflow/diagram/ConnectionComponent.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +1 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +1 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +4 -4
- package/lib/components/forms/Login/Menu.js +1 -1
- package/lib/components/forms/Login/OTPReader.js +1 -1
- package/lib/components/forms/Login/PasswordStrengthChecker.js +1 -1
- package/lib/components/forms/Login/RapidAccessLogin.js +2 -2
- package/lib/components/forms/Login/RecoverPasswordFlow.js +2 -2
- package/lib/components/forms/Login/SelectBox.js +1 -1
- package/lib/components/forms/Login/StepIndicator.js +1 -1
- package/lib/components/forms/Login/TMLoginForm.js +7 -7
- package/lib/components/forms/Login/TextBox.js +1 -1
- package/lib/components/forms/TMApplyForm.js +3 -3
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/forms/TMSaveForm.js +3 -3
- package/lib/components/grids/TMBlogAttachments.js +14 -3
- package/lib/components/grids/TMBlogHeader.js +5 -1
- package/lib/components/grids/TMBlogsPost.d.ts +2 -0
- package/lib/components/grids/TMBlogsPost.js +31 -4
- package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
- package/lib/components/grids/TMBlogsPostUtils.js +15 -4
- package/lib/components/grids/TMRecentsManager.js +4 -4
- package/lib/components/grids/TMValidationItemsList.js +1 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +2 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +25 -15
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +68 -93
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +1 -1
- package/lib/components/layout/panelManager/TMPanelWrapper.js +3 -3
- package/lib/components/layout/panelManager/types.d.ts +3 -0
- package/lib/components/layout/panelManager/utils.js +13 -11
- package/lib/components/pages/TMPage.js +1 -1
- package/lib/components/query/TMQueryCountButton.js +1 -1
- package/lib/components/query/TMQueryEditor.js +7 -7
- package/lib/components/sidebar/TMCommandsPanel.js +1 -1
- package/lib/components/sidebar/TMHeader.js +36 -26
- package/lib/components/sidebar/TMSidebar.js +1 -1
- package/lib/components/sidebar/TMSidebarItem.js +1 -1
- package/lib/components/viewers/TMMidViewer.js +6 -3
- package/lib/components/viewers/TMTidViewer.js +89 -28
- package/lib/components/wizard/TMStepIndicator.js +3 -3
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/devextreme-license.d.ts +1 -0
- package/lib/devextreme-license.js +3 -0
- package/lib/helper/Enum_Localizator.d.ts +4 -4
- package/lib/helper/Globalization.d.ts +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +110 -0
- package/lib/helper/SDKUI_Globals.js +151 -0
- package/lib/helper/SDKUI_Localizator.d.ts +735 -687
- package/lib/helper/SDKUI_Localizator.js +480 -0
- package/lib/helper/TMAppUpdatedModal.d.ts +1 -0
- package/lib/helper/TMAppUpdatedModal.js +134 -0
- package/lib/helper/TMIcons.d.ts +1 -0
- package/lib/helper/TMIcons.js +4 -3
- package/lib/helper/TMPdfViewer.js +1 -1
- package/lib/helper/TMToppyMessage.js +1 -1
- package/lib/helper/TMUtils.d.ts +13 -0
- package/lib/helper/TMUtils.js +25 -3
- package/lib/helper/checkinCheckoutManager.d.ts +1 -1
- package/lib/helper/checkinCheckoutManager.js +1 -1
- package/lib/helper/dataGridSearchHelper.d.ts +28 -0
- package/lib/helper/dataGridSearchHelper.js +51 -0
- package/lib/helper/dcmtsHelper.d.ts +20 -0
- package/lib/helper/dcmtsHelper.js +58 -1
- package/lib/helper/helpers.d.ts +12 -1
- package/lib/helper/helpers.js +27 -3
- package/lib/helper/index.d.ts +2 -0
- package/lib/helper/index.js +2 -0
- package/lib/helper/queryHelper.d.ts +6 -1
- package/lib/helper/queryHelper.js +8 -3
- package/lib/hooks/tmDistinctValuesGridHelper.d.ts +16 -0
- package/lib/hooks/tmDistinctValuesGridHelper.js +31 -0
- package/lib/hooks/useArchiveListForm.d.ts +39 -0
- package/lib/hooks/useArchiveListForm.js +46 -0
- package/lib/hooks/useCaseFlowApprove.d.ts +56 -0
- package/lib/hooks/useCaseFlowApprove.js +157 -0
- package/lib/hooks/useDataUserIdItem.d.ts +1 -0
- package/lib/hooks/useDataUserIdItem.js +1 -0
- package/lib/hooks/useDcmtOperations.d.ts +7 -0
- package/lib/hooks/useDcmtOperations.js +141 -71
- package/lib/hooks/useDocumentOperations.d.ts +4 -0
- package/lib/hooks/useDocumentOperations.js +53 -11
- package/lib/hooks/useInputDialog.js +1 -1
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +113 -0
- package/lib/hooks/useMultiMasterDetailDcmts.js +760 -0
- package/lib/hooks/useQueryParametersDialog.js +1 -1
- package/lib/hooks/useRelatedDocuments.d.ts +1 -0
- package/lib/hooks/useRelatedDocuments.js +22 -27
- package/lib/hooks/useShowDossiersV5.d.ts +12 -0
- package/lib/hooks/useShowDossiersV5.js +37 -0
- package/lib/hooks/useTMDistinctValuesMetadataDisplay.d.ts +18 -0
- package/lib/hooks/useTMDistinctValuesMetadataDisplay.js +103 -0
- package/lib/hooks/useTMDistinctValuesQuickSearch.d.ts +49 -0
- package/lib/hooks/useTMDistinctValuesQuickSearch.js +307 -0
- package/lib/hooks/useTMDistinctValuesSelection.d.ts +42 -0
- package/lib/hooks/useTMDistinctValuesSelection.js +103 -0
- package/lib/hooks/useTMDistinctValuesSource.d.ts +29 -0
- package/lib/hooks/useTMDistinctValuesSource.js +105 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +5 -2
- package/lib/services/caseflow/CaseFlowService.d.ts +247 -0
- package/lib/services/caseflow/CaseFlowService.js +720 -0
- package/lib/services/caseflow/CaseFlowTemplateCacheService.d.ts +28 -0
- package/lib/services/caseflow/CaseFlowTemplateCacheService.js +121 -0
- package/lib/services/caseflow/caseFlowNameCache.d.ts +32 -0
- package/lib/services/caseflow/caseFlowNameCache.js +116 -0
- package/lib/services/caseflow/caseFlowWorkItemUtils.d.ts +61 -0
- package/lib/services/caseflow/caseFlowWorkItemUtils.js +113 -0
- package/lib/services/index.d.ts +4 -0
- package/lib/services/index.js +4 -0
- package/lib/services/platform_services.d.ts +4 -4
- package/package.json +16 -13
|
@@ -132,6 +132,25 @@ export interface TMRelationViewerProps {
|
|
|
132
132
|
* Useful to disable interactions (like context menu) during loading.
|
|
133
133
|
*/
|
|
134
134
|
onLoadingStateChanged?: (isLoading: boolean) => void;
|
|
135
|
+
/**
|
|
136
|
+
* Invoked while the initial correlations load progresses, with how many input
|
|
137
|
+
* documents have been processed out of the total.
|
|
138
|
+
*/
|
|
139
|
+
onLoadingProgress?: (value: number, max: number) => void;
|
|
140
|
+
/**
|
|
141
|
+
* Invoked on mount to hand over a function that stops the ongoing correlations
|
|
142
|
+
* calculation: no further GetMetadata calls are performed and only the
|
|
143
|
+
* correlations already calculated are kept.
|
|
144
|
+
* The function is synchronous, so it can be safely called right before
|
|
145
|
+
* unmounting the viewer (e.g. when navigating back).
|
|
146
|
+
*/
|
|
147
|
+
onStopCalculationReady?: (stopCalculation: () => void) => void;
|
|
148
|
+
/**
|
|
149
|
+
* Callback invoked when the calculation has actually been stopped
|
|
150
|
+
* (loadData terminated after an abort request).
|
|
151
|
+
* Riceve quanti documenti di input sono stati completati sul totale.
|
|
152
|
+
*/
|
|
153
|
+
onCalculationStopped?: (loadedCount: number, totalCount: number) => void;
|
|
135
154
|
}
|
|
136
155
|
/**
|
|
137
156
|
* Check if document type has detail relations
|
|
@@ -147,10 +166,12 @@ export declare const hasMasterRelations: (dTID: number | undefined) => Promise<b
|
|
|
147
166
|
export declare const getDisplayValueByColumn: (col: DataColumnDescriptor | undefined, value: any) => any;
|
|
148
167
|
/**
|
|
149
168
|
* Convert SearchResultDescriptor to structured data source with metadata
|
|
150
|
-
*
|
|
151
|
-
*
|
|
169
|
+
* I valori dei documenti sono GIÀ presenti nelle righe restituite dalla ricerca:
|
|
170
|
+
* qui vengono solo abbinati ai rispettivi MetadataDescriptor (perm,
|
|
171
|
+
* isSpecialSearchOutput, ...), risolti UNA SOLA VOLTA per tipo documento.
|
|
172
|
+
* Nessuna chiamata al server per riga.
|
|
152
173
|
*/
|
|
153
|
-
export declare const searchResultToDataSource: (searchResult: SearchResultDescriptor | undefined, hideSysMetadata?: boolean) => Promise<any[]>;
|
|
174
|
+
export declare const searchResultToDataSource: (searchResult: SearchResultDescriptor | undefined, hideSysMetadata?: boolean, signal?: AbortSignal) => Promise<any[]>;
|
|
154
175
|
export declare const DEFAULT_RELATION_EXPAND_LEVEL = 4;
|
|
155
176
|
declare const TMRelationViewer: React.FC<TMRelationViewerProps>;
|
|
156
177
|
export default TMRelationViewer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { DcmtTypeListCacheService, SDK_Globals, DataColumnTypes, MetadataDataDomains, RelationCacheService, RelationTypes, UserListCacheService, LayoutModes } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { genUniqueId, IconFolder, IconBackhandIndexPointingRight, IconCircleInfo, getDcmtCicoStatus, IconChevronDown, IconChevronRight, SDKUI_Localizator, buildDcmtDisplayName, SDKUI_Globals, searchResultToMetadataValues, getColumnFormatInfo, formatDateTimeByMetadataFormat, formatNumberByMetadataFormat } from '../../../helper';
|
|
@@ -67,34 +67,40 @@ export const getDisplayValueByColumn = (col, value) => {
|
|
|
67
67
|
};
|
|
68
68
|
/**
|
|
69
69
|
* Convert SearchResultDescriptor to structured data source with metadata
|
|
70
|
-
*
|
|
71
|
-
*
|
|
70
|
+
* I valori dei documenti sono GIÀ presenti nelle righe restituite dalla ricerca:
|
|
71
|
+
* qui vengono solo abbinati ai rispettivi MetadataDescriptor (perm,
|
|
72
|
+
* isSpecialSearchOutput, ...), risolti UNA SOLA VOLTA per tipo documento.
|
|
73
|
+
* Nessuna chiamata al server per riga.
|
|
72
74
|
*/
|
|
73
|
-
export const searchResultToDataSource = async (searchResult, hideSysMetadata) => {
|
|
75
|
+
export const searchResultToDataSource = async (searchResult, hideSysMetadata, signal) => {
|
|
74
76
|
const rows = searchResult?.dtdResult?.rows ?? [];
|
|
75
77
|
const output = [];
|
|
76
78
|
// Find TID and DID column indices
|
|
77
79
|
const columns = searchResult?.dtdResult?.columns ?? [];
|
|
78
80
|
const tidColIndex = columns.findIndex(col => col.caption?.toUpperCase() === 'TID');
|
|
79
81
|
const didColIndex = columns.findIndex(col => col.caption?.toUpperCase() === 'DID');
|
|
82
|
+
const firstRow = rows[0] ?? [];
|
|
83
|
+
const tid = tidColIndex >= 0 && firstRow.length > 0 ? Number(firstRow[tidColIndex]) : searchResult?.fromTID;
|
|
84
|
+
const firstDid = didColIndex >= 0 && firstRow.length > 0 ? Number(firstRow[didColIndex]) : undefined;
|
|
85
|
+
const dtdWithMetadata = await DcmtTypeListCacheService.GetWithNotGrantedAsync(tid, firstDid, searchResult);
|
|
86
|
+
const mdList = dtdWithMetadata?.metadata ?? [];
|
|
87
|
+
// Posizione di ogni MID nelle colonne del risultato: identica per tutte le righe,
|
|
88
|
+
// quindi calcolata una volta sola invece di una find() per metadato per riga.
|
|
89
|
+
const mids = columns.map(col => Number(col.extendedProperties?.["MID"] ?? "0"));
|
|
90
|
+
const columnByMid = new Map();
|
|
91
|
+
columns.forEach((col, i) => { if (!columnByMid.has(mids[i]))
|
|
92
|
+
columnByMid.set(mids[i], col); });
|
|
93
|
+
const dtdResult = searchResult?.dtdResult;
|
|
80
94
|
for (let index = 0; index < rows.length; index++) {
|
|
95
|
+
// Interruzione richiesta dall'utente: restituisce i documenti già elaborati
|
|
96
|
+
if (signal?.aborted)
|
|
97
|
+
break;
|
|
81
98
|
const row = rows[index];
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const did = didColIndex >= 0 ? Number(row[didColIndex]) : undefined;
|
|
85
|
-
// Fetch complete metadata for this specific document (like getFilteredMetadata does)
|
|
86
|
-
const metadata = await SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(tid, did, true);
|
|
87
|
-
if (metadata) {
|
|
88
|
-
// Get full DTD with metadata for this document
|
|
89
|
-
const dtdResult = metadata.dtdResult;
|
|
90
|
-
const metadataRows = dtdResult?.rows?.[0] ?? [];
|
|
91
|
-
const mids = metadata.selectMIDs;
|
|
92
|
-
const dtdWithMetadata = await DcmtTypeListCacheService.GetWithNotGrantedAsync(tid, did, metadata);
|
|
93
|
-
const mdList = dtdWithMetadata?.metadata ?? [];
|
|
99
|
+
const item = { rowIndex: index };
|
|
100
|
+
if (mdList.length > 0) {
|
|
94
101
|
// Convert to MetadataValueDescriptorEx array
|
|
95
|
-
const metadataList = searchResultToMetadataValues(tid, dtdResult,
|
|
102
|
+
const metadataList = searchResultToMetadataValues(tid, dtdResult, row, mids, mdList, LayoutModes.Update);
|
|
96
103
|
// Convert to DcmtMetadataMap format (like getFilteredMetadata does)
|
|
97
|
-
const item = { rowIndex: index };
|
|
98
104
|
for (const mvd of metadataList) {
|
|
99
105
|
if (hideSysMetadata && mvd.mid !== undefined && mvd.mid < 100)
|
|
100
106
|
continue;
|
|
@@ -103,23 +109,18 @@ export const searchResultToDataSource = async (searchResult, hideSysMetadata) =>
|
|
|
103
109
|
: (mvd.md?.name ?? '');
|
|
104
110
|
if (key) {
|
|
105
111
|
// Find the corresponding column by MID to format the value
|
|
106
|
-
const column = dtdResult?.columns?.find(c => Number(c.extendedProperties?.["MID"] ?? "0") === mvd.mid);
|
|
107
112
|
item[key] = {
|
|
108
113
|
md: mvd.md,
|
|
109
|
-
value: getDisplayValueByColumn(
|
|
114
|
+
value: getDisplayValueByColumn(columnByMid.get(mvd.mid ?? 0), mvd.value)
|
|
110
115
|
};
|
|
111
116
|
}
|
|
112
117
|
}
|
|
113
|
-
output.push(item);
|
|
114
118
|
}
|
|
115
119
|
else {
|
|
116
|
-
// Fallback:
|
|
117
|
-
const item = { rowIndex: index };
|
|
118
|
-
const fallbackTid = searchResult?.fromTID;
|
|
119
|
-
const dtd = await DcmtTypeListCacheService.GetWithNotGrantedAsync(fallbackTid, undefined, searchResult);
|
|
120
|
+
// Fallback: il DTD non è risolvibile, usa le colonne grezze del risultato
|
|
120
121
|
for (let i = 0; i < row.length; i++) {
|
|
121
|
-
const column =
|
|
122
|
-
const mid =
|
|
122
|
+
const column = columns[i];
|
|
123
|
+
const mid = mids[i];
|
|
123
124
|
if (hideSysMetadata && mid < 100)
|
|
124
125
|
continue;
|
|
125
126
|
let key = column?.caption ?? '';
|
|
@@ -131,20 +132,18 @@ export const searchResultToDataSource = async (searchResult, hideSysMetadata) =>
|
|
|
131
132
|
key = `${key}_${mid}`;
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
|
-
const value = row[i];
|
|
135
|
-
const md = dtd?.metadata?.find(o => o.id == mid);
|
|
136
135
|
item[key] = {
|
|
137
|
-
md:
|
|
138
|
-
value: getDisplayValueByColumn(column,
|
|
136
|
+
md: undefined,
|
|
137
|
+
value: getDisplayValueByColumn(column, row[i])
|
|
139
138
|
};
|
|
140
139
|
}
|
|
141
|
-
output.push(item);
|
|
142
140
|
}
|
|
141
|
+
output.push(item);
|
|
143
142
|
}
|
|
144
143
|
return output;
|
|
145
144
|
};
|
|
146
145
|
export const DEFAULT_RELATION_EXPAND_LEVEL = 4; // Default maximum depth level for expansion (can be adjusted)
|
|
147
|
-
const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndicator = true, allowShowZeroDcmts = true, initialShowZeroDcmts = false, allowedTIDs, allowMultipleSelection = false, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onAllItemsChanged, onDocumentDoubleClick, customItemRender, customDocumentStyle, customMainContainerContent, customDocumentContent, showMetadataNames = false, maxDepthLevel = 2, invertMasterNavigation = true, additionalStaticItems, showMainDocument = true, labelMainContainer, onNoRelationsFound, onItemContextMenu, focusedItemFormData = [], showExpandAllButton = false, defaultExpandAll = false, onLoadingStateChanged }) => {
|
|
146
|
+
const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndicator = true, allowShowZeroDcmts = true, initialShowZeroDcmts = false, allowedTIDs, allowMultipleSelection = false, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onAllItemsChanged, onDocumentDoubleClick, customItemRender, customDocumentStyle, customMainContainerContent, customDocumentContent, showMetadataNames = false, maxDepthLevel = 2, invertMasterNavigation = true, additionalStaticItems, showMainDocument = true, labelMainContainer, onNoRelationsFound, onItemContextMenu, focusedItemFormData = [], showExpandAllButton = false, defaultExpandAll = false, onLoadingStateChanged, onLoadingProgress, onStopCalculationReady, onCalculationStopped }) => {
|
|
148
147
|
// State
|
|
149
148
|
const [dcmtTypes, setDcmtTypes] = useState([]);
|
|
150
149
|
const [treeData, setTreeData] = useState([]);
|
|
@@ -159,6 +158,8 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
159
158
|
const [waitPanelValuePrimary, setWaitPanelValuePrimary] = useState(0);
|
|
160
159
|
const [waitPanelMaxValuePrimary, setWaitPanelMaxValuePrimary] = useState(0);
|
|
161
160
|
const [abortController] = useState(new AbortController());
|
|
161
|
+
// True quando l'utente ha interrotto il calcolo delle correlazioni (pulsante "Interrompi")
|
|
162
|
+
const [loadStoppedByUser, setLoadStoppedByUser] = useState(false);
|
|
162
163
|
const [showExpansionWaitPanel, setShowExpansionWaitPanel] = useState(false);
|
|
163
164
|
const [expansionWaitPanelText, setExpansionWaitPanelText] = useState('');
|
|
164
165
|
const [expansionWaitPanelValue, setExpansionWaitPanelValue] = useState(0);
|
|
@@ -191,6 +192,32 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
191
192
|
const isLoading = showWaitPanel || showExpansionWaitPanel;
|
|
192
193
|
onLoadingStateChanged?.(isLoading);
|
|
193
194
|
}, [showWaitPanel, showExpansionWaitPanel, onLoadingStateChanged]);
|
|
195
|
+
// Notifica al padre l'avanzamento del caricamento iniziale (documenti processati
|
|
196
|
+
// sul totale), così può mostrarlo nel proprio overlay che copre il wait panel interno
|
|
197
|
+
useEffect(() => {
|
|
198
|
+
onLoadingProgress?.(waitPanelValuePrimary, waitPanelMaxValuePrimary);
|
|
199
|
+
}, [waitPanelValuePrimary, waitPanelMaxValuePrimary, onLoadingProgress]);
|
|
200
|
+
// Mantiene l'AbortController dell'espansione in corso accessibile da callback stabili
|
|
201
|
+
const expansionAbortControllerRef = React.useRef(undefined);
|
|
202
|
+
useEffect(() => {
|
|
203
|
+
expansionAbortControllerRef.current = expansionAbortController;
|
|
204
|
+
}, [expansionAbortController]);
|
|
205
|
+
/**
|
|
206
|
+
* Interrompe il calcolo delle correlazioni (iniziale e/o espansione in corso):
|
|
207
|
+
* non vengono eseguite ulteriori chiamate GetMetadata e vengono mantenute
|
|
208
|
+
* solo le correlazioni già calcolate.
|
|
209
|
+
* È sincrona: può essere invocata immediatamente prima di smontare il viewer
|
|
210
|
+
* (es. pulsante "Indietro"), quando un effect non farebbe in tempo.
|
|
211
|
+
*/
|
|
212
|
+
const stopCalculation = useCallback(() => {
|
|
213
|
+
if (!abortController.signal.aborted)
|
|
214
|
+
abortController.abort();
|
|
215
|
+
expansionAbortControllerRef.current?.abort();
|
|
216
|
+
}, [abortController]);
|
|
217
|
+
// Espone la funzione di interruzione al componente padre
|
|
218
|
+
useEffect(() => {
|
|
219
|
+
onStopCalculationReady?.(stopCalculation);
|
|
220
|
+
}, [onStopCalculationReady, stopCalculation]);
|
|
194
221
|
// Sincronizza expandLevel quando userSettings.searchSettings.relationExpandLevel cambia
|
|
195
222
|
useEffect(() => {
|
|
196
223
|
const globalExpandLevel = SDKUI_Globals.userSettings?.searchSettings?.relationExpandLevel;
|
|
@@ -220,7 +247,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
220
247
|
/**
|
|
221
248
|
* Recursively retrieve detail documents (adapted from TMMasterDetailDcmts.tsx)
|
|
222
249
|
*/
|
|
223
|
-
const getDetailDcmtsAsync = useCallback(async (mTID, mDID, maxLevel) => {
|
|
250
|
+
const getDetailDcmtsAsync = useCallback(async (mTID, mDID, maxLevel, signal) => {
|
|
224
251
|
const items = [];
|
|
225
252
|
if (!mTID)
|
|
226
253
|
return [];
|
|
@@ -240,6 +267,9 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
240
267
|
return items;
|
|
241
268
|
const results = await searchEngine.GetAllDetailDcmtsAsync(mTID, mDID) ?? [];
|
|
242
269
|
for (const searchResult of results) {
|
|
270
|
+
// Interruzione richiesta dall'utente: restituisce le correlazioni già calcolate
|
|
271
|
+
if (signal?.aborted)
|
|
272
|
+
break;
|
|
243
273
|
// Skip if allowedTIDs is set and this TID is not allowed
|
|
244
274
|
if (allowedTIDs && searchResult.fromTID && !allowedTIDs.includes(searchResult.fromTID)) {
|
|
245
275
|
continue;
|
|
@@ -261,7 +291,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
261
291
|
expanded: false,
|
|
262
292
|
hidden: false
|
|
263
293
|
};
|
|
264
|
-
const source = await searchResultToDataSource(searchResult);
|
|
294
|
+
const source = await searchResultToDataSource(searchResult, undefined, signal);
|
|
265
295
|
if (source && source.length > 0) {
|
|
266
296
|
const dcmtDetails = [];
|
|
267
297
|
// Check once if this document type can have detail relations
|
|
@@ -307,7 +337,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
307
337
|
/**
|
|
308
338
|
* Recursively retrieve master documents
|
|
309
339
|
*/
|
|
310
|
-
const getMasterDcmtsAsync = useCallback(async (dTID, dDID, maxLevel) => {
|
|
340
|
+
const getMasterDcmtsAsync = useCallback(async (dTID, dDID, maxLevel, signal) => {
|
|
311
341
|
const items = [];
|
|
312
342
|
if (!dTID)
|
|
313
343
|
return [];
|
|
@@ -327,6 +357,9 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
327
357
|
return items;
|
|
328
358
|
const results = await searchEngine.GetAllMasterDcmtsAsync(dTID, dDID) ?? [];
|
|
329
359
|
for (const searchResult of results) {
|
|
360
|
+
// Interruzione richiesta dall'utente: restituisce le correlazioni già calcolate
|
|
361
|
+
if (signal?.aborted)
|
|
362
|
+
break;
|
|
330
363
|
// Skip if allowedTIDs is set and this TID is not allowed
|
|
331
364
|
if (allowedTIDs && searchResult.fromTID && !allowedTIDs.includes(searchResult.fromTID)) {
|
|
332
365
|
continue;
|
|
@@ -348,7 +381,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
348
381
|
expanded: false,
|
|
349
382
|
hidden: false
|
|
350
383
|
};
|
|
351
|
-
const source = await searchResultToDataSource(searchResult);
|
|
384
|
+
const source = await searchResultToDataSource(searchResult, undefined, signal);
|
|
352
385
|
if (source && source.length > 0) {
|
|
353
386
|
const dcmtMasters = [];
|
|
354
387
|
// Check once if this document type can have master relations (for inverted mode)
|
|
@@ -576,7 +609,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
576
609
|
}
|
|
577
610
|
const dtd = await DcmtTypeListCacheService.GetAsync(dcmt.TID);
|
|
578
611
|
// Parse document values
|
|
579
|
-
const docValues = await searchResultToDataSource(result);
|
|
612
|
+
const docValues = await searchResultToDataSource(result, undefined, abortController.signal);
|
|
580
613
|
const docRow = docValues.length > 0 ? docValues[0] : undefined;
|
|
581
614
|
// Generate unique GUID for this container
|
|
582
615
|
const containerGUID = genUniqueId();
|
|
@@ -585,22 +618,32 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
585
618
|
// ========================================================================
|
|
586
619
|
if (isForMaster && !invertMasterNavigation) {
|
|
587
620
|
// Carica i master documents
|
|
588
|
-
const masterDocs = await getMasterDcmtsAsync(dcmt.TID, dcmt.DID, maxDepthLevel);
|
|
621
|
+
const masterDocs = await getMasterDcmtsAsync(dcmt.TID, dcmt.DID, maxDepthLevel, abortController.signal);
|
|
589
622
|
// Per ogni master, carica i suoi detail (incluso il documento corrente)
|
|
590
623
|
for (const masterContainer of masterDocs) {
|
|
624
|
+
if (abortController.signal.aborted)
|
|
625
|
+
break;
|
|
591
626
|
if (!masterContainer.items)
|
|
592
627
|
continue;
|
|
593
628
|
// Per ogni master document nel container, carica i detail
|
|
594
629
|
for (const masterDoc of masterContainer.items) {
|
|
630
|
+
// Interruzione richiesta dall'utente: mantiene i dati già calcolati
|
|
631
|
+
if (abortController.signal.aborted)
|
|
632
|
+
break;
|
|
595
633
|
if (masterDoc.tid && masterDoc.did) {
|
|
596
634
|
// Carica i detail del master (incluso il documento di partenza)
|
|
597
|
-
const detailDocs = await getDetailDcmtsAsync(masterDoc.tid, masterDoc.did, 1);
|
|
635
|
+
const detailDocs = await getDetailDcmtsAsync(masterDoc.tid, masterDoc.did, 1, abortController.signal);
|
|
598
636
|
masterDoc.items = detailDocs;
|
|
599
637
|
masterDoc.itemsCount = detailDocs.length;
|
|
600
638
|
masterDoc.isLoaded = true;
|
|
601
639
|
}
|
|
602
640
|
}
|
|
603
641
|
}
|
|
642
|
+
// Interruzione richiesta dall'utente: il documento corrente non è stato
|
|
643
|
+
// caricato per intero, quindi non viene aggiunto all'albero. Il parziale
|
|
644
|
+
// resta così a granularità di documento (es. 3 completi su 10).
|
|
645
|
+
if (abortController.signal.aborted)
|
|
646
|
+
break;
|
|
604
647
|
// Aggiungi i master come root, raggruppando per TID e relationId
|
|
605
648
|
for (const masterContainer of masterDocs) {
|
|
606
649
|
const existingContainer = tree.find(c => c.tid === masterContainer.tid && c.relationId === masterContainer.relationId && c.isContainer);
|
|
@@ -627,8 +670,11 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
627
670
|
else {
|
|
628
671
|
// Load related documents (detail or master based on isForMaster flag)
|
|
629
672
|
const relatedDocs = isForMaster
|
|
630
|
-
? await getMasterDcmtsAsync(dcmt.TID, dcmt.DID, maxDepthLevel)
|
|
631
|
-
: await getDetailDcmtsAsync(dcmt.TID, dcmt.DID, maxDepthLevel);
|
|
673
|
+
? await getMasterDcmtsAsync(dcmt.TID, dcmt.DID, maxDepthLevel, abortController.signal)
|
|
674
|
+
: await getDetailDcmtsAsync(dcmt.TID, dcmt.DID, maxDepthLevel, abortController.signal);
|
|
675
|
+
// Interruzione richiesta dall'utente
|
|
676
|
+
if (abortController.signal.aborted)
|
|
677
|
+
break;
|
|
632
678
|
// Se showMainDocument è false, mostra i container dei dettagli direttamente sotto il container principale
|
|
633
679
|
if (!showMainDocument) {
|
|
634
680
|
// Check if a container for this TID already exists in the tree
|
|
@@ -775,8 +821,15 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
775
821
|
// Check recursively if there are any actual documents
|
|
776
822
|
return hasNoActualDocuments(container.items);
|
|
777
823
|
});
|
|
824
|
+
// Calcolo interrotto dall'utente: mostra solo ciò che è stato calcolato,
|
|
825
|
+
// senza notificare l'assenza di correlazioni (il risultato è parziale, non definitivo)
|
|
826
|
+
const wasStopped = abortController.signal.aborted;
|
|
827
|
+
if (wasStopped) {
|
|
828
|
+
setLoadStoppedByUser(true);
|
|
829
|
+
onCalculationStopped?.(processedCount, inputDcmts.length);
|
|
830
|
+
}
|
|
778
831
|
// If no relations found, notify parent
|
|
779
|
-
if (hasNoRelations && onNoRelationsFound) {
|
|
832
|
+
if (!wasStopped && hasNoRelations && onNoRelationsFound) {
|
|
780
833
|
onNoRelationsFound();
|
|
781
834
|
}
|
|
782
835
|
// Update metadata error count state
|
|
@@ -804,7 +857,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
804
857
|
// Now it will correctly detect expanded nodes and add infoMessage if all children are hidden
|
|
805
858
|
const processedTree = updateHiddenProperty(expandedTree);
|
|
806
859
|
setTreeData(processedTree);
|
|
807
|
-
}, [inputDcmts, dcmtTypes, maxDepthLevel, isForMaster, invertMasterNavigation, getDetailDcmtsAsync, getMasterDcmtsAsync, abortController, updateHiddenProperty, showMainDocument, labelMainContainer, onNoRelationsFound]);
|
|
860
|
+
}, [inputDcmts, dcmtTypes, maxDepthLevel, isForMaster, invertMasterNavigation, getDetailDcmtsAsync, getMasterDcmtsAsync, abortController, updateHiddenProperty, showMainDocument, labelMainContainer, onNoRelationsFound, onCalculationStopped]);
|
|
808
861
|
/**
|
|
809
862
|
* Merge main tree data with additional static items
|
|
810
863
|
*/
|
|
@@ -1047,15 +1100,15 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
1047
1100
|
let loadedItems = [];
|
|
1048
1101
|
if (isForMaster && !invertMasterNavigation) {
|
|
1049
1102
|
// Original mode: detail documents load detail documents (natural detail→detail navigation)
|
|
1050
|
-
loadedItems = await getDetailDcmtsAsync(node.tid, node.did, 1);
|
|
1103
|
+
loadedItems = await getDetailDcmtsAsync(node.tid, node.did, 1, newAbortController.signal);
|
|
1051
1104
|
}
|
|
1052
1105
|
else if (isForMaster) {
|
|
1053
1106
|
// Inverted master mode: load master documents
|
|
1054
|
-
loadedItems = await getMasterDcmtsAsync(node.tid, node.did, 1);
|
|
1107
|
+
loadedItems = await getMasterDcmtsAsync(node.tid, node.did, 1, newAbortController.signal);
|
|
1055
1108
|
}
|
|
1056
1109
|
else {
|
|
1057
1110
|
// Standard mode: load detail documents
|
|
1058
|
-
loadedItems = await getDetailDcmtsAsync(node.tid, node.did, 1);
|
|
1111
|
+
loadedItems = await getDetailDcmtsAsync(node.tid, node.did, 1, newAbortController.signal);
|
|
1059
1112
|
}
|
|
1060
1113
|
// Espandi automaticamente il primo container se ci sono documenti correlati
|
|
1061
1114
|
if (loadedItems.length > 0 && loadedItems[0].isContainer) {
|
|
@@ -1137,7 +1190,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
1137
1190
|
textOverflow: 'ellipsis',
|
|
1138
1191
|
fontSize: '1rem',
|
|
1139
1192
|
color: 'inherit'
|
|
1140
|
-
}, children: item.name }), shouldShowBadge && (_jsx(StyledBadge, {
|
|
1193
|
+
}, children: item.name }), shouldShowBadge && (_jsx(StyledBadge, { $backgroundColor: TMColors.info, children: item.items?.length ?? 0 }))] })] }));
|
|
1141
1194
|
// Se è il container principale (root) e abbiamo un custom renderer, usalo
|
|
1142
1195
|
const content = (item.isRoot && customMainContainerContent)
|
|
1143
1196
|
? customMainContainerContent(item, defaultContent)
|
|
@@ -1417,13 +1470,13 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
1417
1470
|
let loadedItems = [];
|
|
1418
1471
|
// Carica i documenti correlati (detail o master in base alla modalità)
|
|
1419
1472
|
if (isForMaster && !invertMasterNavigation) {
|
|
1420
|
-
loadedItems = await getDetailDcmtsAsync(node.tid, node.did, 1);
|
|
1473
|
+
loadedItems = await getDetailDcmtsAsync(node.tid, node.did, 1, newAbortController.signal);
|
|
1421
1474
|
}
|
|
1422
1475
|
else if (isForMaster) {
|
|
1423
|
-
loadedItems = await getMasterDcmtsAsync(node.tid, node.did, 1);
|
|
1476
|
+
loadedItems = await getMasterDcmtsAsync(node.tid, node.did, 1, newAbortController.signal);
|
|
1424
1477
|
}
|
|
1425
1478
|
else {
|
|
1426
|
-
loadedItems = await getDetailDcmtsAsync(node.tid, node.did, 1);
|
|
1479
|
+
loadedItems = await getDetailDcmtsAsync(node.tid, node.did, 1, newAbortController.signal);
|
|
1427
1480
|
}
|
|
1428
1481
|
// Applica le regole di visibilità (showZeroDcmts)
|
|
1429
1482
|
expandedNode.items = updateHiddenProperty(loadedItems);
|
|
@@ -1524,6 +1577,10 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
1524
1577
|
return _jsx("div", { style: { padding: '20px', textAlign: 'center' }, children: _jsx(TMWaitPanel, { title: SDKUI_Localizator.LoadingDetailDocuments, showPrimary: true, textPrimary: waitPanelTextPrimary, valuePrimary: waitPanelValuePrimary, maxValuePrimary: waitPanelMaxValuePrimary, isCancelable: true, abortController: abortController, onAbortClick: () => { setTimeout(() => { abortController.abort(); }, 1000); } }) });
|
|
1525
1578
|
}
|
|
1526
1579
|
if (mergedTreeData.length === 0) {
|
|
1580
|
+
// Calcolo interrotto dall'utente prima di aver calcolato qualsiasi correlazione
|
|
1581
|
+
if (loadStoppedByUser) {
|
|
1582
|
+
return _jsx(TMToppyMessage, { message: SDKUI_Localizator.RelationsCalculationStopped });
|
|
1583
|
+
}
|
|
1527
1584
|
// Se NON isForMaster e tutti i GetMetadataAsync sono falliti
|
|
1528
1585
|
if (!isForMaster && metadataErrorCount === inputDcmts.length) {
|
|
1529
1586
|
return _jsx(TMToppyMessage, { message: SDKUI_Localizator.DocumentsNotAvailableOrNoCorrelations });
|
|
@@ -1534,7 +1591,8 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
1534
1591
|
return _jsx("div", { style: { padding: '20px', textAlign: 'center', color: '#666' }, children: SDKUI_Localizator.NoRelationsAvailable });
|
|
1535
1592
|
}
|
|
1536
1593
|
// Se isForMaster e non ci sono master documents disponibili
|
|
1537
|
-
|
|
1594
|
+
// (se il calcolo è stato interrotto l'albero parziale viene comunque mostrato)
|
|
1595
|
+
if (isForMaster && totalMasterDocuments === 0 && !loadStoppedByUser) {
|
|
1538
1596
|
return _jsx(TMToppyMessage, { message: SDKUI_Localizator.NoMasterDocumentsAvailable });
|
|
1539
1597
|
}
|
|
1540
1598
|
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', height: '100%', minHeight: 0, width: '100%' }, children: [showExpandAllButton && (_jsxs("div", { style: { flexShrink: 0, display: 'flex', alignItems: 'center', gap: '6px', height: '40px', paddingLeft: '10px', backgroundColor: TMColors.toolbar_background }, children: [_jsx(TMTooltip, { content: expandLevel === 0
|
|
@@ -56,4 +56,4 @@ export declare const getDcmtInfosToDownload: (selectedDcmtInfos: Array<DcmtInfo>
|
|
|
56
56
|
* - i default della classe
|
|
57
57
|
* Nota: destinationFolder e zipPassword vengono sempre resettati per sicurezza.
|
|
58
58
|
*/
|
|
59
|
-
export declare const buildInitialDownloadSettings: (saved: DocumentDownloadSettings | undefined, defaultInvoiceFormat: DocumentDownloadSettings[
|
|
59
|
+
export declare const buildInitialDownloadSettings: (saved: DocumentDownloadSettings | undefined, defaultInvoiceFormat: DocumentDownloadSettings['invoiceFormat'], defaultOrderFormat: DocumentDownloadSettings['orderFormat']) => DocumentDownloadSettings;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { SDK_Localizator, SelectItem, SelectItemVisibilities } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { IconAddCircleOutline, IconApply, IconClear, IconDelete, IconDraggabledots, IconUndo, SDKUI_Localizator } from "../../../helper";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { OrderByItem, SDK_Localizator } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { IconAddCircleOutline, IconApply, IconClear, IconDelete, IconDraggabledots, IconUndo, SDKUI_Localizator } from "../../../helper";
|
|
@@ -181,7 +181,7 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
|
|
|
181
181
|
overflow: 'auto'
|
|
182
182
|
}, children: dataSource.slice(0, showAllRoot || searchText.length > 0 ? dataSource.length : initialSQDsMaxItems).filter(o => searchText.length <= 0 || (searchText.length > 0 && o.name?.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())) || o.description?.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())).map((sqd, index) => {
|
|
183
183
|
const isCurrent = selectedItem?.id == sqd.id;
|
|
184
|
-
return (_jsx(StyledSqdItem, { id: `sqd-item-${sqd.id}`,
|
|
184
|
+
return (_jsx(StyledSqdItem, { id: `sqd-item-${sqd.id}`, $isMobile: isMobile, onClick: () => {
|
|
185
185
|
setSelectedItem(sqd);
|
|
186
186
|
onItemClick?.(sqd);
|
|
187
187
|
}, onContextMenu: (e) => {
|
|
@@ -227,6 +227,6 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
|
|
|
227
227
|
visible: contextMenuState.visible,
|
|
228
228
|
position: contextMenuState.position,
|
|
229
229
|
onClose: () => setContextMenuState(prev => ({ ...prev, visible: false, sqd: null }))
|
|
230
|
-
} }), _jsxs(StyledOffCanvasPanel, { ref: panelRef,
|
|
230
|
+
} }), _jsxs(StyledOffCanvasPanel, { ref: panelRef, $isOpen: isMobile && infoSQD !== undefined, children: [_jsxs(StyledDivHorizontal, { style: { gap: 10, padding: '10px 8px', width: '100%', alignItems: 'center' }, children: [_jsx("p", { style: { fontSize: '1.1rem', fontWeight: 'bold' }, children: `${SDK_Localizator.SavedQuery} - ${SDKUI_Localizator.About}` }), _jsx(IconCloseOutline, { style: { marginLeft: 'auto', cursor: 'pointer' }, onClick: () => setInfoSQD(undefined) })] }), getTooltipBySqd(infoSQD)] })] }));
|
|
231
231
|
});
|
|
232
232
|
export default TMSavedQuerySelector;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { SavedQueryDescriptor, DcmtTypeDescriptor, TaskDescriptor, ObjectRef, HomeBlogPost } from '@topconsultnpm/sdk-ts';
|
|
3
2
|
import { IntesiCertificateData } from '../../../helper';
|
|
4
3
|
import { DcmtInfo, IGraphometricManagerProp, TaskContext } from '../../../ts';
|
|
@@ -46,5 +45,5 @@ interface ITMSearchProps {
|
|
|
46
45
|
fetchRemoteCertificates?: (email: string) => Promise<IntesiCertificateData[]>;
|
|
47
46
|
graphometricManager?: IGraphometricManagerProp;
|
|
48
47
|
}
|
|
49
|
-
declare const TMSearch:
|
|
48
|
+
declare const TMSearch: (props: ITMSearchProps) => import("react/jsx-runtime").JSX.Element;
|
|
50
49
|
export default TMSearch;
|