@topconsultnpm/sdkui-react 6.21.0-t2 → 6.21.0-t4
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 +28 -2
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +4 -4
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +6 -6
- package/lib/components/base/Styled.d.ts +1 -1
- package/lib/components/base/TMAreaManager.js +11 -0
- package/lib/components/base/TMCounterBar.d.ts +2 -2
- package/lib/components/base/TMCounterContainer.d.ts +2 -1
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMDataGrid.js +12 -2
- package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
- package/lib/components/base/TMDataGridExportForm.js +19 -8
- package/lib/components/base/TMFileManager.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.js +4 -4
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +3 -3
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
- package/lib/components/base/TMFileManagerUtils.d.ts +7 -0
- package/lib/components/base/TMFileManagerUtils.js +14 -1
- package/lib/components/base/TMLayout.d.ts +4 -4
- package/lib/components/base/TMList.d.ts +2 -1
- package/lib/components/base/TMListView.d.ts +1 -1
- package/lib/components/base/TMModal.js +2 -2
- package/lib/components/base/TMPopUp.d.ts +1 -0
- package/lib/components/base/TMPopUp.js +59 -2
- package/lib/components/base/TMSpinner.d.ts +5 -2
- package/lib/components/base/TMSpinner.js +33 -6
- package/lib/components/base/TMTab.d.ts +4 -3
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTreeView.d.ts +16 -13
- package/lib/components/base/TMTreeView.js +242 -79
- package/lib/components/base/TMUserAvatar.d.ts +2 -1
- package/lib/components/base/TMVilViewer.d.ts +2 -1
- package/lib/components/base/TMWaitPanel.d.ts +5 -2
- package/lib/components/base/TMWaitPanel.js +8 -6
- package/lib/components/choosers/TMDistinctValues.js +1 -1
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMDynDataListItemChooser.js +6 -1
- package/lib/components/choosers/TMGroupChooser.js +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
- package/lib/components/choosers/TMUserChooser.d.ts +2 -2
- package/lib/components/editors/TMEditorStyled.d.ts +6 -6
- package/lib/components/editors/TMFormulaEditor.d.ts +2 -1
- package/lib/components/editors/TMFormulaEditor.js +98 -49
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
- package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
- package/lib/components/editors/TMMetadataEditor.js +6 -2
- package/lib/components/editors/TMMetadataValues.js +23 -6
- package/lib/components/editors/TMTextBox.d.ts +1 -0
- package/lib/components/editors/TMTextBox.js +2 -1
- package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
- package/lib/components/features/blog/TMBlogCommentForm.js +5 -2
- package/lib/components/features/documents/TMCopyToFolderForm.js +46 -24
- package/lib/components/features/documents/TMDcmtForm.d.ts +2 -0
- package/lib/components/features/documents/TMDcmtForm.js +21 -10
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtIcon.d.ts +4 -1
- package/lib/components/features/documents/TMDcmtIcon.js +6 -33
- package/lib/components/features/documents/TMDcmtPreview.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtTasks.d.ts +2 -1
- package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
- package/lib/components/features/documents/TMFileUploader.js +1 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -2
- package/lib/components/features/documents/TMMasterDetailDcmts.js +55 -16
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +2 -3
- package/lib/components/features/documents/TMMergeToPdfForm.js +115 -56
- package/lib/components/features/documents/TMRelationViewer.d.ts +12 -10
- package/lib/components/features/documents/TMRelationViewer.js +405 -95
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +4 -16
- package/lib/components/features/documents/copyAndMergeDcmtsShared.js +47 -61
- package/lib/components/features/documents/mergePdfUtils.d.ts +52 -0
- package/lib/components/features/documents/mergePdfUtils.js +268 -0
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +18 -0
- package/lib/components/features/search/TMMetadataOutputForm.js +225 -0
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +18 -0
- package/lib/components/features/search/TMMetadataSorterForm.js +243 -0
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSearch.d.ts +2 -2
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchQueryEditor.js +14 -8
- package/lib/components/features/search/TMSearchQueryPanel.js +249 -58
- package/lib/components/features/search/TMSearchResult.d.ts +3 -2
- package/lib/components/features/search/TMSearchResult.js +94 -25
- package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +2 -1
- package/lib/components/features/search/TMViewHistoryDcmt.d.ts +2 -1
- package/lib/components/features/search/TMViewHistoryDcmt.js +1 -1
- package/lib/components/features/search/metadataFormHelper.d.ts +16 -0
- package/lib/components/features/search/metadataFormHelper.js +77 -0
- package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
- package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
- package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +3 -2
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +8 -7
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- package/lib/components/forms/Login/TMLoginForm.js +15 -3
- package/lib/components/forms/TMChooserForm.d.ts +2 -1
- package/lib/components/forms/TMSaveForm.d.ts +4 -4
- package/lib/components/grids/TMBlogAttachments.d.ts +2 -1
- package/lib/components/grids/TMBlogAttachments.js +2 -2
- package/lib/components/grids/TMBlogHeader.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.js +5 -3
- package/lib/components/grids/TMBlogsPostUtils.d.ts +10 -9
- package/lib/components/grids/TMBlogsPostUtils.js +3 -1
- package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +1 -1
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
- package/lib/components/pages/TMPage.d.ts +1 -1
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
- package/lib/components/sidebar/TMHeader.d.ts +3 -3
- package/lib/components/viewers/TMDataListItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMMidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.js +14 -2
- package/lib/components/wizard/TMWizard.d.ts +1 -0
- package/lib/components/wizard/TMWizard.js +5 -3
- package/lib/helper/Enum_Localizator.js +2 -0
- package/lib/helper/MergePdfManager.d.ts +45 -0
- package/lib/helper/MergePdfManager.js +148 -0
- package/lib/helper/SDKUI_Globals.d.ts +1 -0
- package/lib/helper/SDKUI_Globals.js +3 -1
- package/lib/helper/SDKUI_Localizator.d.ts +40 -0
- package/lib/helper/SDKUI_Localizator.js +412 -12
- package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
- package/lib/helper/TMIcons.d.ts +278 -278
- package/lib/helper/TMPdfViewer.d.ts +2 -1
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +57 -21
- package/lib/helper/TMUtils.js +159 -1
- package/lib/helper/certificateImportHelper.d.ts +43 -0
- package/lib/helper/certificateImportHelper.js +403 -0
- package/lib/helper/checkinCheckoutManager.d.ts +4 -3
- package/lib/helper/checkinCheckoutManager.js +29 -11
- package/lib/helper/helpers.d.ts +3 -2
- package/lib/helper/helpers.js +10 -0
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +4 -3
- package/lib/hooks/useDataUserIdItem.js +1 -1
- package/lib/hooks/useDcmtOperations.d.ts +20 -2
- package/lib/hooks/useDcmtOperations.js +244 -25
- package/lib/hooks/useDocumentOperations.d.ts +2 -2
- package/lib/hooks/useDocumentOperations.js +52 -13
- package/lib/hooks/useInputDialog.d.ts +2 -1
- package/lib/hooks/useRelatedDocuments.js +4 -4
- package/lib/services/platform_services.d.ts +7 -6
- package/lib/ts/types.d.ts +3 -1
- package/lib/ts/types.js +2 -0
- package/package.json +15 -7
|
@@ -3,7 +3,8 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { LoadIndicator } from 'devextreme-react';
|
|
5
5
|
import { AppModules, DataColumnTypes, DataListViewModes, DcmtTypeListCacheService, LayoutCacheService, LayoutModes, MetadataDataDomains, MetadataFormats, SDK_Globals, SystemMIDsAsNumber, UserListCacheService, } from '@topconsultnpm/sdk-ts';
|
|
6
|
-
import { deepCompare, generateUniqueColumnKeys, genUniqueId, getSearchToolbarVisibility, IconBoard, IconDcmtTypeSys, IconDelete, IconMenuVertical, IconPlatform, IconRefresh, IconSearchCheck, IconShow, isApprovalWorkflowView, isSign4TopEnabled, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, SDKUI_Globals, SDKUI_Localizator
|
|
6
|
+
import { deepCompare, generateUniqueColumnKeys, genUniqueId, getSearchToolbarVisibility, IconAll, IconBoard, IconDcmtTypeSys, IconDelete, IconMenuVertical, IconPlatform, IconRefresh, IconSearchCheck, IconShow, isApprovalWorkflowView, isSign4TopEnabled, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, SDKUI_Globals, SDKUI_Localizator } from '../../../helper';
|
|
7
|
+
import { CounterItemKey } from '../../base/TMCounterContainer';
|
|
7
8
|
import { getDcmtCicoStatus } from '../../../helper/checkinCheckoutManager';
|
|
8
9
|
import { DcmtOperationTypes, SearchResultContext, } from '../../../ts';
|
|
9
10
|
import { Gutters } from '../../../utils/theme';
|
|
@@ -54,15 +55,20 @@ const TMSearchResult = ({
|
|
|
54
55
|
// Data
|
|
55
56
|
groupId, searchResults = [], context = SearchResultContext.METADATA_SEARCH, title, selectedSearchResultTID, floatingActionConfig, workingGroupContext = undefined, inputDID,
|
|
56
57
|
// Boolean flags to enable/disable features
|
|
57
|
-
formAutoOpen, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, showSearchResultSidebar = true, showDcmtFormSidebar = true, showSelector = false, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, showBackButton = true, disableAccordionIfSingleCategory = false, editPdfForm = false, openS4TViewer = false, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, showNoDcmtFoundMessage = true, enablePinIcons = true,
|
|
58
|
+
autoFocusFirstRow = true, formAutoOpen, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, showSearchResultSidebar = true, showDcmtFormSidebar = true, showSelector = false, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, showBackButton = true, disableAccordionIfSingleCategory = false, editPdfForm = false, openS4TViewer = false, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, showNoDcmtFoundMessage = true, enablePinIcons = true,
|
|
58
59
|
// Callbacks (optional)
|
|
59
60
|
openInOffice, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsyncDatagrid, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onTaskCreateRequest, openWGsCopyMoveForm, openCommentFormCallback, openAddDocumentForm, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor, passToArchiveCallback, onReferenceClick,
|
|
60
61
|
// Tasks
|
|
61
62
|
allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback,
|
|
62
63
|
// Navigation
|
|
63
|
-
handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
64
|
+
handleNavigateToWGs, handleNavigateToDossiers, fetchRemoteCertificates, }) => {
|
|
64
65
|
// Ref for the floating bar container (used to position the floating action buttons)
|
|
65
66
|
const floatingBarContainerRef = useRef(null);
|
|
67
|
+
// Ref per tracciare se autoFocusFirstRow=false deve bloccare l'auto-focus.
|
|
68
|
+
// Resta true finché l'utente non clicca manualmente sulla griglia per selezionare una riga.
|
|
69
|
+
// Quando l'utente seleziona manualmente, il ref viene settato a false e il focus automatico
|
|
70
|
+
// torna al comportamento normale.
|
|
71
|
+
const isFirstAutoFocusRef = useRef(true);
|
|
66
72
|
// ID state to force remount of components
|
|
67
73
|
const [id, setID] = useState('');
|
|
68
74
|
// Document type descriptor of the currently document
|
|
@@ -139,6 +145,12 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
139
145
|
}
|
|
140
146
|
}
|
|
141
147
|
};
|
|
148
|
+
// Handler unico per tutte le azioni utente che cambiano il focus (click, navigazione, etc.).
|
|
149
|
+
// Resetta isFirstAutoFocusRef perché da questo momento autoFocusFirstRow non deve più essere considerato.
|
|
150
|
+
const handleFocusedItemChangedFromGrid = useCallback((item) => {
|
|
151
|
+
isFirstAutoFocusRef.current = false;
|
|
152
|
+
setFocusedItem(item);
|
|
153
|
+
}, []);
|
|
142
154
|
const onNavigateHandler = (dir) => {
|
|
143
155
|
let index = -1;
|
|
144
156
|
if (visibleItems && focusedItem) {
|
|
@@ -146,10 +158,10 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
146
158
|
}
|
|
147
159
|
switch (dir) {
|
|
148
160
|
case 'next':
|
|
149
|
-
|
|
161
|
+
handleFocusedItemChangedFromGrid(visibleItems[index + 1]);
|
|
150
162
|
break;
|
|
151
163
|
default:
|
|
152
|
-
|
|
164
|
+
handleFocusedItemChangedFromGrid(visibleItems[index - 1]);
|
|
153
165
|
break;
|
|
154
166
|
}
|
|
155
167
|
};
|
|
@@ -300,6 +312,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
300
312
|
currentSearchResults,
|
|
301
313
|
currentMetadataValues,
|
|
302
314
|
allUsers,
|
|
315
|
+
fetchRemoteCertificates,
|
|
303
316
|
searchResult: selectedSearchResult,
|
|
304
317
|
datagridUtility: {
|
|
305
318
|
visibleItems,
|
|
@@ -361,7 +374,6 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
361
374
|
onTaskCreateRequest,
|
|
362
375
|
openTaskFormHandler,
|
|
363
376
|
},
|
|
364
|
-
mergePdfManager,
|
|
365
377
|
});
|
|
366
378
|
const { isOpenDcmtForm, openFormHandler, dcmtFormLayoutMode, onDcmtFormOpenChange, showSearchTMDatagrid, showExportForm, isOpenBatchUpdate, isModifiedBatchUpdate, updateBatchUpdateForm, closeDcmtFormHandler, handleSignApprove, checkoutInfo: { showCicoWaitPanel, cicoWaitPanelTitle, showCicoPrimaryProgress, cicoPrimaryProgressText, cicoPrimaryProgressValue, cicoPrimaryProgressMax, }, dcmtOperations: { abortController, showWaitPanel, showPrimary, waitPanelTitle, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync, }, relatedDocumentsInfo: { isOpenDetails, isOpenMaster, checkRelatedDcmtsArchiveCapability, checkManyToManyCapability, }, toppyOperations: { showApprovePopup, showRejectPopup, showReAssignPopup, showMoreInfoPopup, updateShowApprovePopup, updateShowRejectPopup, updateShowReAssignPopup, updateShowMoreInfoPopup } } = features;
|
|
367
379
|
const deviceType = useDeviceType();
|
|
@@ -379,6 +391,9 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
379
391
|
updateBatchUpdateForm(false);
|
|
380
392
|
closeDcmtFormHandler();
|
|
381
393
|
setCurrentSearchResults(searchResults);
|
|
394
|
+
// Resetta il ref quando arrivano nuovi risultati di ricerca,
|
|
395
|
+
// così la logica autoFocusFirstRow=false si riapplica per ogni nuova ricerca
|
|
396
|
+
isFirstAutoFocusRef.current = true;
|
|
382
397
|
if (searchResults.length <= 0) {
|
|
383
398
|
setSelectedSearchResult(undefined);
|
|
384
399
|
return;
|
|
@@ -414,6 +429,12 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
414
429
|
});
|
|
415
430
|
checkRelatedDcmtsArchiveCapability();
|
|
416
431
|
checkManyToManyCapability();
|
|
432
|
+
// se autoFocusFirstRow è false, non selezionare automaticamente la prima riga del nuovo risultato della ricerca
|
|
433
|
+
// Il ref resta true finché l'utente non clicca manualmente sulla griglia
|
|
434
|
+
if (autoFocusFirstRow === false && isFirstAutoFocusRef.current) {
|
|
435
|
+
setFocusedItem(undefined);
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
417
438
|
// Ricava il nuovo dataSource
|
|
418
439
|
const newDataSource = searchResultDescriptorToSimpleArray(selectedSearchResult);
|
|
419
440
|
// Se esiste almeno una riga, seleziona la prima
|
|
@@ -421,6 +442,12 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
421
442
|
}, [selectedSearchResult, checkRelatedDcmtsArchiveCapability, checkManyToManyCapability]);
|
|
422
443
|
// Quando inputDID è fornito e i dati della griglia sono pronti, seleziona il documento corrispondente
|
|
423
444
|
useEffect(() => {
|
|
445
|
+
// Se autoFocusFirstRow è false, non selezionare automaticamente la riga corrispondente a inputDID
|
|
446
|
+
// Il ref resta true finché l'utente non clicca manualmente sulla griglia
|
|
447
|
+
if (autoFocusFirstRow === false && isFirstAutoFocusRef.current) {
|
|
448
|
+
setFocusedItem(undefined);
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
424
451
|
if (!inputDID || visibleItems.length === 0)
|
|
425
452
|
return;
|
|
426
453
|
const targetItem = visibleItems.find((item) => item.DID == inputDID);
|
|
@@ -468,8 +495,10 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
468
495
|
onOpenS4TViewerRequest?.([{ TID: focusedItem.TID, DID: focusedItem.DID }]);
|
|
469
496
|
}, [openS4TViewer, inputDID, focusedItem, fromDTD]);
|
|
470
497
|
useEffect(() => {
|
|
471
|
-
if (!focusedItem)
|
|
498
|
+
if (!focusedItem) {
|
|
499
|
+
setCurrentDcmt(undefined);
|
|
472
500
|
return;
|
|
501
|
+
}
|
|
473
502
|
if (!fromDTD)
|
|
474
503
|
return;
|
|
475
504
|
let dtd = searchResults.length > 1 ? searchResults.find(res => res.fromTID == focusedItem?.TID)?.dtdResult : searchResults[0]?.dtdResult;
|
|
@@ -628,7 +657,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
628
657
|
&& !openS4TViewer
|
|
629
658
|
&& !showTodoDcmtForm);
|
|
630
659
|
}, [showToppyForApprove, showToppyDraggableHelpCenter, selectedDocs, showApprovePopup, showRejectPopup, showReAssignPopup, showMoreInfoPopup, editPdfForm, openS4TViewer, showTodoDcmtForm]);
|
|
631
|
-
const searchResutlToolbar = _jsxs(_Fragment, { children: [
|
|
660
|
+
const searchResutlToolbar = _jsxs(_Fragment, { children: [context === SearchResultContext.FAVORITES_AND_RECENTS &&
|
|
632
661
|
_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: onRefreshSearchAsyncDatagrid }), _jsx(TMContextMenu, { items: operationItems, trigger: "left", children: _jsx(IconMenuVertical, { color: 'white', cursor: 'pointer' }) })] });
|
|
633
662
|
const tmSearchResult = useMemo(() => (!searchResults || searchResults.length <= 0)
|
|
634
663
|
? _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%' }, children: [_jsx(IconBoard, { fontSize: 96 }), showNoDcmtFoundMessage && _jsx("div", { style: { fontSize: "15px", marginTop: "10px" }, children: SDKUI_Localizator.NoDcmtFound }), openAddDocumentForm && _jsx("div", { style: { marginTop: "10px" }, children: _jsx(TMButton, { fontSize: "15px", icon: _jsx("i", { className: 'dx-icon-share' }), caption: SDKUI_Localizator.Share, onClick: openAddDocumentForm }) })] })
|
|
@@ -636,7 +665,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
636
665
|
_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 ?
|
|
637
666
|
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, selectedSearchResult: selectedSearchResult, autoSelectFirst: !isMobile || currentSearchResults.length === 1, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
638
667
|
:
|
|
639
|
-
_jsx(_Fragment, {}), _jsx(TMLayoutItem, { children: _jsx(TMSearchResultGrid, { openInOffice: openInOffice, fromDTD: fromDTD, operationItems: operationItems, allUsers: allUsers, inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, showExportForm: showExportForm, onFocusedItemChanged:
|
|
668
|
+
_jsx(_Fragment, {}), _jsx(TMLayoutItem, { children: _jsx(TMSearchResultGrid, { openInOffice: openInOffice, fromDTD: fromDTD, operationItems: operationItems, allUsers: allUsers, inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, showExportForm: showExportForm, onFocusedItemChanged: handleFocusedItemChangedFromGrid, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync({ inputDcmts, downloadType, downloadMode, onFileDownloaded: onFileOpened, confirmAttachments }), lastUpdateSearchTime: lastUpdateSearchTime, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], onSelectionChanged: (items) => { setSelectedItems(items); }, onDblClick: () => openFormHandler(LayoutModes.Update), showSearchTMDatagrid: showSearchTMDatagrid, onVisibleItemChanged: setVisibleItems, updateDataColumnsFromDataGrid: updateDataColumnsFromDataGrid, updateDataSourceFromDataGrid: updateDataSourceFromDataGrid, updateSelectedRowKeysFromDataGrid: updateSelectedRowKeysFromDataGrid, disableAutoFocus: autoFocusFirstRow === false && isFirstAutoFocusRef.current, dcmtsReturned: dcmtsReturned, dcmtsFound: dcmtsFound }) })] }), renderFloatingBar] }), _jsx(TMToppyDraggableHelpCenter, { usePortal: toppyHelpCenterUsePortal, isVisible: isToppyHelpCenterVisible, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { dtd: fromDTD, deviceType: deviceType, onApprove: () => {
|
|
640
669
|
updateShowApprovePopup(true);
|
|
641
670
|
}, onSignApprove: () => {
|
|
642
671
|
handleSignApprove();
|
|
@@ -827,7 +856,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
827
856
|
_jsxs(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmSearchResult', children: [_jsx(PanelDisabledStateHandler, { isBoardDisabled: isBoardDisabled }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showSearchResultSidebar })] }) }) }) }), renderDcmtOperations] }));
|
|
828
857
|
};
|
|
829
858
|
export default TMSearchResult;
|
|
830
|
-
const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, inputFocusedItem, allowMultipleSelection = true, showExportForm = false, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, onSelectionChanged, onDblClick, showSearchTMDatagrid, updateDataColumnsFromDataGrid, updateDataSourceFromDataGrid, updateSelectedRowKeysFromDataGrid }) => {
|
|
859
|
+
const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, inputFocusedItem, allowMultipleSelection = true, showExportForm = false, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, onSelectionChanged, onDblClick, showSearchTMDatagrid, updateDataColumnsFromDataGrid, updateDataSourceFromDataGrid, updateSelectedRowKeysFromDataGrid, disableAutoFocus = false, dcmtsReturned, dcmtsFound }) => {
|
|
831
860
|
const [dataSource, setDataSource] = useState();
|
|
832
861
|
const [columns, setColumns] = useState([]);
|
|
833
862
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
|
@@ -851,6 +880,7 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, i
|
|
|
851
880
|
const { loadDataListsAsync, renderDataListCell, dataListsCache } = useDataListItem();
|
|
852
881
|
const { loadUsersAsync, renderUserIdViewer, usersCache } = useDataUserIdItem();
|
|
853
882
|
useEffect(() => {
|
|
883
|
+
// Sincronizza focusedItem con inputFocusedItem dal padre
|
|
854
884
|
if (deepCompare(inputFocusedItem, focusedItem))
|
|
855
885
|
return;
|
|
856
886
|
setFocusedItem(inputFocusedItem);
|
|
@@ -1035,10 +1065,25 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, i
|
|
|
1035
1065
|
// Recupera gli elementi della DataList dalla cache
|
|
1036
1066
|
const dataListItems = dataListsCache.current.get(dataListID);
|
|
1037
1067
|
if (dataListItems && dataListItems.length > 0) {
|
|
1038
|
-
//
|
|
1068
|
+
// Raccoglie i valori unici presenti nei risultati di ricerca per questa colonna
|
|
1069
|
+
let valuesInResults;
|
|
1070
|
+
try {
|
|
1071
|
+
valuesInResults = new Set();
|
|
1072
|
+
searchResult?.dtdResult?.rows?.forEach(row => {
|
|
1073
|
+
const cellValue = row[index];
|
|
1074
|
+
if (cellValue != null) {
|
|
1075
|
+
valuesInResults.add(String(cellValue));
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1079
|
+
catch {
|
|
1080
|
+
// Fallback: mostra tutti i valori della DataList
|
|
1081
|
+
valuesInResults = undefined;
|
|
1082
|
+
}
|
|
1083
|
+
// Crea il datasource per l'headerFilter
|
|
1039
1084
|
headerFilterConfig = {
|
|
1040
1085
|
dataSource: dataListItems
|
|
1041
|
-
.filter(item => item.name != null && item.value != null)
|
|
1086
|
+
.filter(item => item.name != null && item.value != null && (valuesInResults === undefined || valuesInResults.has(String(item.value))))
|
|
1042
1087
|
.map(item => ({
|
|
1043
1088
|
text: item.name,
|
|
1044
1089
|
value: item.value
|
|
@@ -1051,10 +1096,28 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, i
|
|
|
1051
1096
|
// Recupera tutti gli utenti dalla cache
|
|
1052
1097
|
const users = Array.from(usersCache.current.values());
|
|
1053
1098
|
if (users.length > 0) {
|
|
1099
|
+
// Raccoglie gli ID utente presenti nei risultati di ricerca per questa colonna
|
|
1100
|
+
let userIdsInResults;
|
|
1101
|
+
try {
|
|
1102
|
+
userIdsInResults = new Set();
|
|
1103
|
+
searchResult?.dtdResult?.rows?.forEach(row => {
|
|
1104
|
+
const cellValue = row[index];
|
|
1105
|
+
if (cellValue != null) {
|
|
1106
|
+
const userId = Number(cellValue);
|
|
1107
|
+
if (userId > 0) {
|
|
1108
|
+
userIdsInResults.add(userId);
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
catch {
|
|
1114
|
+
// Fallback: mostra tutti gli utenti
|
|
1115
|
+
userIdsInResults = undefined;
|
|
1116
|
+
}
|
|
1054
1117
|
// Crea il datasource per l'headerFilter mostrando nome utente completo (dominio\nome)
|
|
1055
1118
|
headerFilterConfig = {
|
|
1056
1119
|
dataSource: users
|
|
1057
|
-
.filter(user => user.name != null && user.id != null)
|
|
1120
|
+
.filter(user => user.name != null && user.id != null && (userIdsInResults === undefined || userIdsInResults.has(user.id)))
|
|
1058
1121
|
.map(user => ({
|
|
1059
1122
|
text: user.domain ? `${user.domain}\\${user.name}` : user.name,
|
|
1060
1123
|
value: user.id
|
|
@@ -1125,8 +1188,7 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, i
|
|
|
1125
1188
|
// Previene l'errore E1047 quando il filtro riferisce campi non più presenti nelle nuove colonne.
|
|
1126
1189
|
const oldFields = columns.map(c => c.dataField);
|
|
1127
1190
|
const newFields = cols.map(c => c.dataField);
|
|
1128
|
-
const columnsChanged = oldFields.length !== newFields.length ||
|
|
1129
|
-
oldFields.some((f, i) => f !== newFields[i]);
|
|
1191
|
+
const columnsChanged = oldFields.length !== newFields.length || oldFields.some((f, i) => f !== newFields[i]);
|
|
1130
1192
|
if (columnsChanged) {
|
|
1131
1193
|
const gridInstance = dataGridRef.current?.instance();
|
|
1132
1194
|
if (gridInstance) {
|
|
@@ -1144,7 +1206,6 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, i
|
|
|
1144
1206
|
useEffect(() => {
|
|
1145
1207
|
let newDataSource = searchResultDescriptorToSimpleArray(searchResult);
|
|
1146
1208
|
setDataSource(newDataSource);
|
|
1147
|
-
// setFocusedItem(newDataSource?.find(o => o?.rowIndex === focusedItem?.rowIndex));
|
|
1148
1209
|
}, [lastUpdateSearchTime]);
|
|
1149
1210
|
// Handles selection change in the data grid
|
|
1150
1211
|
const handleSelectionChange = useCallback((e) => {
|
|
@@ -1155,14 +1216,9 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, i
|
|
|
1155
1216
|
}, [onSelectionChanged]);
|
|
1156
1217
|
// Handles focus change in the data grid
|
|
1157
1218
|
const handleFocusedRowChange = useCallback((e) => {
|
|
1158
|
-
//
|
|
1159
|
-
// if (e.row === undefined) { setFocusedItem(undefined); return; }
|
|
1160
|
-
// setFocusedItem(e.row.data);
|
|
1219
|
+
// Non bloccare mai questo handler: è chiamato quando l'utente clicca su una riga
|
|
1161
1220
|
onFocusedItemChanged?.(e.row?.data);
|
|
1162
|
-
}, [
|
|
1163
|
-
// useEffect(() => {
|
|
1164
|
-
// onFocusedItemChanged?.(focusedItem)
|
|
1165
|
-
// }, [focusedItem])
|
|
1221
|
+
}, [onFocusedItemChanged]);
|
|
1166
1222
|
// Handler for double-click row event
|
|
1167
1223
|
const onRowDblClick = useCallback((e) => {
|
|
1168
1224
|
if (onDblClick === undefined)
|
|
@@ -1183,7 +1239,6 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, i
|
|
|
1183
1239
|
});
|
|
1184
1240
|
return;
|
|
1185
1241
|
}
|
|
1186
|
-
// setFocusedItem(e.data);
|
|
1187
1242
|
onFocusedItemChanged?.(e.data);
|
|
1188
1243
|
onDblClick();
|
|
1189
1244
|
}, [onDblClick]);
|
|
@@ -1213,7 +1268,21 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, i
|
|
|
1213
1268
|
setVisibleItems(visibleData);
|
|
1214
1269
|
}, []);
|
|
1215
1270
|
useEffect(() => { onVisibleItemChanged?.(visibleItems); }, [visibleItems]);
|
|
1216
|
-
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [!isDataGridReady && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: '10px' }, children: [_jsx(LoadIndicator, { height: 60, width: 60 }), _jsx("div", { children: SDKUI_Localizator.Loading })] })), isDataGridReady && _jsx(TMDataGrid, { ref: dataGridRef, id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearchTMDatagrid, 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: operationItems, counterConfig: {
|
|
1271
|
+
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [!isDataGridReady && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: '10px' }, children: [_jsx(LoadIndicator, { height: 60, width: 60 }), _jsx("div", { children: SDKUI_Localizator.Loading })] })), isDataGridReady && _jsx(TMDataGrid, { ref: dataGridRef, id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: disableAutoFocus ? undefined : Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearchTMDatagrid, 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: operationItems, counterConfig: {
|
|
1272
|
+
show: true,
|
|
1273
|
+
items: dcmtsReturned !== undefined && dcmtsFound !== undefined
|
|
1274
|
+
? new Map([
|
|
1275
|
+
[CounterItemKey.allItems, {
|
|
1276
|
+
key: CounterItemKey.allItems,
|
|
1277
|
+
show: true,
|
|
1278
|
+
caption: `${dcmtsReturned} restituiti su ${dcmtsFound} trovati`,
|
|
1279
|
+
value: `${dcmtsReturned}/${dcmtsFound}`,
|
|
1280
|
+
icon: _jsx(IconAll, {}),
|
|
1281
|
+
order: -1
|
|
1282
|
+
}]
|
|
1283
|
+
])
|
|
1284
|
+
: undefined
|
|
1285
|
+
} })] });
|
|
1217
1286
|
};
|
|
1218
1287
|
//#region TMSearchResultSelector
|
|
1219
1288
|
const StyledItemTemplate = styled.div `
|
|
@@ -12,5 +12,5 @@ interface TMSearchResultFloatingActionButtonProps {
|
|
|
12
12
|
selectedDcmtsOrFocused: Array<DcmtInfo>;
|
|
13
13
|
config: TMSearchResultFloatingActionConfig;
|
|
14
14
|
}
|
|
15
|
-
export declare const TMSearchResultFloatingActionButton: (props: TMSearchResultFloatingActionButtonProps) =>
|
|
15
|
+
export declare const TMSearchResultFloatingActionButton: (props: TMSearchResultFloatingActionButtonProps) => React.JSX.Element;
|
|
16
16
|
export default TMSearchResultFloatingActionButton;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { DcmtInfo } from "../../../ts";
|
|
2
3
|
interface TMSignatureInfoContentProps {
|
|
3
4
|
inputDcmt: DcmtInfo;
|
|
4
5
|
}
|
|
5
|
-
declare const TMSignatureInfoContent: (props: TMSignatureInfoContentProps) =>
|
|
6
|
+
declare const TMSignatureInfoContent: (props: TMSignatureInfoContentProps) => React.JSX.Element | null;
|
|
6
7
|
export default TMSignatureInfoContent;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { DcmtInfo } from "../../../ts/types";
|
|
2
3
|
import { DeviceType } from "../../base/TMDeviceProvider";
|
|
3
4
|
import { DcmtTypeDescriptor, HomeBlogPost, TaskDescriptor } from "@topconsultnpm/sdk-ts";
|
|
@@ -14,5 +15,5 @@ interface TMViewHistoryDcmtProps {
|
|
|
14
15
|
handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
|
|
15
16
|
handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
|
|
16
17
|
}
|
|
17
|
-
declare const TMViewHistoryDcmt: (props: TMViewHistoryDcmtProps) =>
|
|
18
|
+
declare const TMViewHistoryDcmt: (props: TMViewHistoryDcmtProps) => React.JSX.Element;
|
|
18
19
|
export default TMViewHistoryDcmt;
|
|
@@ -142,7 +142,7 @@ const TMViewHistoryDcmt = (props) => {
|
|
|
142
142
|
files.push({ TID: Number(focusedRow.TID), DID: Number(focusedRow.DID), FILEEXT: focusedRow.FileExt });
|
|
143
143
|
}
|
|
144
144
|
if (files.length > 0)
|
|
145
|
-
await downloadDcmtsAsync(files, DownloadTypes.Dcmt, "download");
|
|
145
|
+
await downloadDcmtsAsync({ inputDcmts: files, downloadType: DownloadTypes.Dcmt, downloadMode: "download" });
|
|
146
146
|
};
|
|
147
147
|
const deleteFilesCallback = () => {
|
|
148
148
|
if (!focusedRowKey)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DcmtTypeDescriptor, MetadataDescriptor, QueryDescriptor } from "@topconsultnpm/sdk-ts";
|
|
2
|
+
export type MetadataDescriptorWithKey = MetadataDescriptor & {
|
|
3
|
+
uniqueKey: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function removeDuplicatesByTidMid<T extends {
|
|
6
|
+
tid?: number;
|
|
7
|
+
mid?: number;
|
|
8
|
+
}>(items: T[]): T[];
|
|
9
|
+
export declare function loadMetadataFromQd(qd: QueryDescriptor | undefined, filterMetadata?: (value: MetadataDescriptor, index: number, array: MetadataDescriptor[]) => unknown): Promise<{
|
|
10
|
+
metadata: MetadataDescriptorWithKey[];
|
|
11
|
+
dcmtTypes: DcmtTypeDescriptor[];
|
|
12
|
+
}>;
|
|
13
|
+
export declare function areArraysEqual<T extends {
|
|
14
|
+
tid?: number;
|
|
15
|
+
mid?: number;
|
|
16
|
+
}>(arr1: T[], arr2: T[], additionalCompare?: (a: T, b: T) => boolean): boolean;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { DcmtTypeDescriptor, DcmtTypeListCacheService, SDK_Localizator } from "@topconsultnpm/sdk-ts";
|
|
2
|
+
import { getTIDsByQd } from "../../../helper/queryHelper";
|
|
3
|
+
import { SDKUI_Localizator } from "../../../helper";
|
|
4
|
+
import TMSpinner from "../../base/TMSpinner";
|
|
5
|
+
// =============================================================================
|
|
6
|
+
// HELPER: Rimuove duplicati dalla lista (basato su tid + mid)
|
|
7
|
+
// =============================================================================
|
|
8
|
+
export function removeDuplicatesByTidMid(items) {
|
|
9
|
+
const seen = new Set();
|
|
10
|
+
return items.filter(item => {
|
|
11
|
+
const key = `${item.tid}_${item.mid}`;
|
|
12
|
+
if (seen.has(key))
|
|
13
|
+
return false;
|
|
14
|
+
seen.add(key);
|
|
15
|
+
return true;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
// =============================================================================
|
|
19
|
+
// FUNZIONE PRINCIPALE: Estrae i metadati dal QueryDescriptor
|
|
20
|
+
// =============================================================================
|
|
21
|
+
export async function loadMetadataFromQd(qd, filterMetadata) {
|
|
22
|
+
if (!qd)
|
|
23
|
+
return { metadata: [], dcmtTypes: [] };
|
|
24
|
+
const dtdList = [];
|
|
25
|
+
const metadata = [];
|
|
26
|
+
try {
|
|
27
|
+
const tidsFromQd = getTIDsByQd(qd);
|
|
28
|
+
const inputTIDs = tidsFromQd.map((item) => item.tid);
|
|
29
|
+
if (inputTIDs.length === 0)
|
|
30
|
+
return { metadata: [], dcmtTypes: [] };
|
|
31
|
+
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.DcmtType} ...` });
|
|
32
|
+
const dtds = await DcmtTypeListCacheService.GetFromTIDsAsync(inputTIDs, true, undefined, false, false);
|
|
33
|
+
for (let i = 0; i < dtds.length; i++) {
|
|
34
|
+
const dtd = new DcmtTypeDescriptor();
|
|
35
|
+
dtd.init({ ...dtds[i] });
|
|
36
|
+
const alias = tidsFromQd?.[i]?.alias ?? '';
|
|
37
|
+
dtd.customData2 = alias;
|
|
38
|
+
dtd.metadata?.forEach((md) => {
|
|
39
|
+
const mdWithKey = md;
|
|
40
|
+
mdWithKey.customData1 = dtd.id;
|
|
41
|
+
mdWithKey.customData2 = alias;
|
|
42
|
+
mdWithKey.uniqueKey = `${dtd.id}_${md.id}_${alias}`;
|
|
43
|
+
});
|
|
44
|
+
const filteredMetadata = filterMetadata
|
|
45
|
+
? dtd.metadata?.filter(filterMetadata)
|
|
46
|
+
: dtd.metadata;
|
|
47
|
+
dtdList.push({ ...dtd, metadata: filteredMetadata });
|
|
48
|
+
}
|
|
49
|
+
for (const dtd of dtdList) {
|
|
50
|
+
if (!dtd.metadata)
|
|
51
|
+
continue;
|
|
52
|
+
for (const md of dtd.metadata) {
|
|
53
|
+
metadata.push(md);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return { metadata, dcmtTypes: dtdList };
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
TMSpinner.hide();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// =============================================================================
|
|
63
|
+
// HELPER: Confronta due array per determinare se sono stati modificati
|
|
64
|
+
// =============================================================================
|
|
65
|
+
export function areArraysEqual(arr1, arr2, additionalCompare) {
|
|
66
|
+
if (arr1.length !== arr2.length)
|
|
67
|
+
return false;
|
|
68
|
+
for (let i = 0; i < arr1.length; i++) {
|
|
69
|
+
const a = arr1[i];
|
|
70
|
+
const b = arr2[i];
|
|
71
|
+
if (a.tid !== b.tid || a.mid !== b.mid)
|
|
72
|
+
return false;
|
|
73
|
+
if (additionalCompare && !additionalCompare(a, b))
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
@@ -36,5 +36,5 @@ export interface TMTaskFormProps {
|
|
|
36
36
|
onOpenPdfEditorRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void;
|
|
37
37
|
s4TViewerDialogComponent?: React.ReactNode;
|
|
38
38
|
}
|
|
39
|
-
declare const TMTaskForm: (props: TMTaskFormProps) =>
|
|
39
|
+
declare const TMTaskForm: (props: TMTaskFormProps) => React.JSX.Element;
|
|
40
40
|
export default TMTaskForm;
|
|
@@ -8,7 +8,7 @@ interface TaskFormAssignmentNoticeSectionProps {
|
|
|
8
8
|
users: Array<UserDescriptor>;
|
|
9
9
|
requestMoreInfo?: boolean;
|
|
10
10
|
}
|
|
11
|
-
export declare const TaskFormAssignmentNoticeBadge: (props: TaskFormAssignmentNoticeSectionProps) =>
|
|
11
|
+
export declare const TaskFormAssignmentNoticeBadge: (props: TaskFormAssignmentNoticeSectionProps) => React.JSX.Element | null;
|
|
12
12
|
interface RenderContextBlockParams {
|
|
13
13
|
condition: boolean;
|
|
14
14
|
pdg: PdGs;
|
|
@@ -19,7 +19,7 @@ interface TaskFormContextualAttachmentsProps {
|
|
|
19
19
|
currentTask: TaskDescriptor | undefined;
|
|
20
20
|
taskContext: TaskContext | undefined;
|
|
21
21
|
}
|
|
22
|
-
export declare const TaskFormContextualAttachments: (props: TaskFormContextualAttachmentsProps) =>
|
|
22
|
+
export declare const TaskFormContextualAttachments: (props: TaskFormContextualAttachmentsProps) => React.JSX.Element;
|
|
23
23
|
interface TaskFormAssignedToProps {
|
|
24
24
|
formMode: FormModes;
|
|
25
25
|
formData: TaskDescriptor | undefined;
|
|
@@ -31,7 +31,7 @@ interface TaskFormAssignedToProps {
|
|
|
31
31
|
label?: string;
|
|
32
32
|
onValueChanged: (newValue: Array<number> | undefined) => void;
|
|
33
33
|
}
|
|
34
|
-
export declare const TaskAssigneeField: (props: TaskFormAssignedToProps) =>
|
|
34
|
+
export declare const TaskAssigneeField: (props: TaskFormAssignedToProps) => React.JSX.Element;
|
|
35
35
|
interface RenderFieldBaseProps {
|
|
36
36
|
fieldsReadOnly: IFieldsEditability;
|
|
37
37
|
formDataOrig?: TaskDescriptor;
|
|
@@ -50,12 +50,12 @@ interface RenderDateFieldProps extends RenderFieldProps {
|
|
|
50
50
|
label?: string;
|
|
51
51
|
onContentReady?: () => void;
|
|
52
52
|
}
|
|
53
|
-
export declare const RenderNameField: ({ requestMoreInfo, validationItems, setFormData, formData, formDataOrig, fieldsReadOnly }: RenderFieldProps) =>
|
|
54
|
-
export declare const RenderDescriptionField: ({ validationItems, setFormData, formData, formDataOrig, fieldsReadOnly }: RenderFieldProps) =>
|
|
55
|
-
export declare const RenderPriorityField: ({ formData, formDataOrig, fieldsReadOnly, onPriorityValueChange }: RenderPriorityFieldProps) =>
|
|
56
|
-
export declare const RenderStartDateField: ({ label, validationItems, setFormData, formData, formDataOrig, fieldsReadOnly, onContentReady }: RenderDateFieldProps) =>
|
|
57
|
-
export declare const RenderEndDateField: ({ label, validationItems, setFormData, formData, formDataOrig, fieldsReadOnly, onContentReady }: RenderDateFieldProps) =>
|
|
58
|
-
export declare const RenderRemindDateField: ({ validationItems, setFormData, formData, formDataOrig, fieldsReadOnly }: RenderFieldProps) =>
|
|
53
|
+
export declare const RenderNameField: ({ requestMoreInfo, validationItems, setFormData, formData, formDataOrig, fieldsReadOnly }: RenderFieldProps) => React.JSX.Element;
|
|
54
|
+
export declare const RenderDescriptionField: ({ validationItems, setFormData, formData, formDataOrig, fieldsReadOnly }: RenderFieldProps) => React.JSX.Element;
|
|
55
|
+
export declare const RenderPriorityField: ({ formData, formDataOrig, fieldsReadOnly, onPriorityValueChange }: RenderPriorityFieldProps) => React.JSX.Element;
|
|
56
|
+
export declare const RenderStartDateField: ({ label, validationItems, setFormData, formData, formDataOrig, fieldsReadOnly, onContentReady }: RenderDateFieldProps) => React.JSX.Element;
|
|
57
|
+
export declare const RenderEndDateField: ({ label, validationItems, setFormData, formData, formDataOrig, fieldsReadOnly, onContentReady }: RenderDateFieldProps) => React.JSX.Element;
|
|
58
|
+
export declare const RenderRemindDateField: ({ validationItems, setFormData, formData, formDataOrig, fieldsReadOnly }: RenderFieldProps) => React.JSX.Element;
|
|
59
59
|
interface RenderTaskFormStateFieldProps {
|
|
60
60
|
formDataOrig: TaskDescriptor | undefined;
|
|
61
61
|
formData: TaskDescriptor | undefined;
|
|
@@ -71,7 +71,7 @@ interface TMChangeStateFormProps {
|
|
|
71
71
|
handleShowChangeStateForm: (value: boolean) => void;
|
|
72
72
|
setFormData: React.Dispatch<React.SetStateAction<TaskDescriptor | undefined>>;
|
|
73
73
|
}
|
|
74
|
-
export declare const TMChangeStateForm: (props: TMChangeStateFormProps) =>
|
|
74
|
+
export declare const TMChangeStateForm: (props: TMChangeStateFormProps) => React.JSX.Element;
|
|
75
75
|
type TaskRole = "personal" | "sender" | "receiver";
|
|
76
76
|
type StatusTransitionMap = {
|
|
77
77
|
[key in Task_States]?: Task_States[];
|
|
@@ -15,5 +15,5 @@ interface TMTasksAgendaProps {
|
|
|
15
15
|
handleFocusedRowChange: (row: TaskDescriptor | undefined) => void;
|
|
16
16
|
menuItems: TMContextMenuItemProps[];
|
|
17
17
|
}
|
|
18
|
-
declare const TMTasksAgenda: (props: TMTasksAgendaProps) =>
|
|
18
|
+
declare const TMTasksAgenda: (props: TMTasksAgendaProps) => React.JSX.Element;
|
|
19
19
|
export default TMTasksAgenda;
|
|
@@ -19,5 +19,5 @@ interface TMTasksCalendarProps {
|
|
|
19
19
|
handleFocusedRowChange: (row: TaskDescriptor | undefined) => void;
|
|
20
20
|
menuItems: TMContextMenuItemProps[];
|
|
21
21
|
}
|
|
22
|
-
declare const TMTasksCalendar: (props: TMTasksCalendarProps) =>
|
|
22
|
+
declare const TMTasksCalendar: (props: TMTasksCalendarProps) => React.JSX.Element;
|
|
23
23
|
export default TMTasksCalendar;
|
|
@@ -10,5 +10,5 @@ interface TMTasksHeaderProps {
|
|
|
10
10
|
color?: string;
|
|
11
11
|
height?: string;
|
|
12
12
|
}
|
|
13
|
-
declare const TMTasksHeader: (props: TMTasksHeaderProps) =>
|
|
13
|
+
declare const TMTasksHeader: (props: TMTasksHeaderProps) => React.JSX.Element;
|
|
14
14
|
export default TMTasksHeader;
|
|
@@ -16,5 +16,5 @@ interface TMTasksPanelContentProps {
|
|
|
16
16
|
s4TViewerDialogComponent?: React.ReactNode;
|
|
17
17
|
afterTaskSaved?: (task: TaskDescriptor | undefined, formMode: FormModes | undefined, forceRefresh?: boolean) => Promise<void>;
|
|
18
18
|
}
|
|
19
|
-
declare const TMTasksPanelContent: (props: TMTasksPanelContentProps) =>
|
|
19
|
+
declare const TMTasksPanelContent: (props: TMTasksPanelContentProps) => React.JSX.Element;
|
|
20
20
|
export default TMTasksPanelContent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
import { PdGs, Task_States, TaskDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { FormModes } from "../../../ts";
|
|
4
4
|
export declare const taskStateIconMap: (fontSize?: number) => Map<Task_States, JSX.Element>;
|
|
@@ -12,15 +12,15 @@ export declare const renderTaskIcons: (taskData: {
|
|
|
12
12
|
remTime: Date | undefined;
|
|
13
13
|
isNew: boolean;
|
|
14
14
|
numberOfDays: number;
|
|
15
|
-
}) =>
|
|
15
|
+
}) => React.JSX.Element;
|
|
16
16
|
interface TMActionCalendarProps {
|
|
17
17
|
currentTask: TaskDescriptor;
|
|
18
18
|
openTaskForm: (formMode: FormModes, task?: TaskDescriptor) => void;
|
|
19
19
|
onDeleteCallback: (rowIds: Array<number>) => void;
|
|
20
20
|
}
|
|
21
|
-
export declare const TMActionCalendar: (props: TMActionCalendarProps) =>
|
|
22
|
-
export declare const priorityLegend: () =>
|
|
23
|
-
export declare const highlightTaskText: (text: string, search: string, taskId: number) => string | (string |
|
|
21
|
+
export declare const TMActionCalendar: (props: TMActionCalendarProps) => React.JSX.Element;
|
|
22
|
+
export declare const priorityLegend: () => React.JSX.Element;
|
|
23
|
+
export declare const highlightTaskText: (text: string, search: string, taskId: number) => string | (string | React.JSX.Element)[];
|
|
24
24
|
export declare const treeFilterDataSource: (allTasks: Array<TaskDescriptor>) => Array<{
|
|
25
25
|
id: number;
|
|
26
26
|
label: string;
|
|
@@ -36,5 +36,5 @@ interface TMTasksViewProps {
|
|
|
36
36
|
s4TViewerDialogComponent?: React.ReactNode;
|
|
37
37
|
afterTaskSaved?: (task: TaskDescriptor | undefined, formMode: FormModes | undefined, forceRefresh?: boolean) => Promise<void>;
|
|
38
38
|
}
|
|
39
|
-
declare const TMTasksView: (props: TMTasksViewProps) =>
|
|
39
|
+
declare const TMTasksView: (props: TMTasksViewProps) => React.JSX.Element;
|
|
40
40
|
export default TMTasksView;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { DcmtTypeDescriptor, WorkingGroupDescriptor } from "@topconsultnpm/sdk-ts";
|
|
2
3
|
import { FileItem } from '../../base/TMFileManagerUtils';
|
|
3
4
|
/** Context descriptor for copy/move operations using different engines */
|
|
@@ -24,7 +25,7 @@ interface TMWGsCopyMoveFormProps {
|
|
|
24
25
|
fetchTreeFileSystemForWorkingGroup?: (workingGroupId: number | undefined) => Promise<void>;
|
|
25
26
|
fetchArchivedDocumentsForWorkingGroup?: (workingGroupId: number | undefined) => Promise<void>;
|
|
26
27
|
}
|
|
27
|
-
declare const TMWGsCopyMoveForm: (props: TMWGsCopyMoveFormProps) =>
|
|
28
|
+
declare const TMWGsCopyMoveForm: (props: TMWGsCopyMoveFormProps) => React.JSX.Element;
|
|
28
29
|
export default TMWGsCopyMoveForm;
|
|
29
30
|
interface StepItem {
|
|
30
31
|
id: number | string;
|
|
@@ -36,4 +37,4 @@ interface TMStepNavigatorProps {
|
|
|
36
37
|
currentStep: number;
|
|
37
38
|
onStepChange: (stepIndex: number) => void;
|
|
38
39
|
}
|
|
39
|
-
export declare const TMStepNavigator: (props: TMStepNavigatorProps) =>
|
|
40
|
+
export declare const TMStepNavigator: (props: TMStepNavigatorProps) => React.JSX.Element;
|