@topconsultnpm/sdkui-react 6.20.0-dev3.11 → 6.20.0-dev3.13
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.
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useMemo,
|
|
2
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { DcmtTypeListCacheService, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
4
|
import TMRelationViewer from './TMRelationViewer';
|
|
6
5
|
import TMContextMenu from '../../NewComponents/ContextMenu/TMContextMenu';
|
|
7
|
-
import {
|
|
6
|
+
import { IconMultipleSelection, IconCheckFile, IconDetailDcmts, SDKUI_Localizator, IconMenuVertical, IconDataList, IconPreview, IconSearchCheck, IconBoard, IconDcmtTypeSys, IconShow, getMoreInfoTasksForDocument } from '../../../helper';
|
|
8
7
|
import { FormModes, SearchResultContext } from '../../../ts';
|
|
9
8
|
import { TMColors } from '../../../utils/theme';
|
|
9
|
+
import ShowAlert from '../../base/TMAlert';
|
|
10
10
|
import { DeviceType } from '../../base/TMDeviceProvider';
|
|
11
11
|
import { TMSaveFormButtonPrevious, TMSaveFormButtonNext } from '../../forms/TMSaveForm';
|
|
12
12
|
import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
|
|
@@ -14,56 +14,15 @@ import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/p
|
|
|
14
14
|
import TMSearchResult from '../search/TMSearchResult';
|
|
15
15
|
import TMDcmtForm from './TMDcmtForm';
|
|
16
16
|
import { TMNothingToShow } from './TMDcmtPreview';
|
|
17
|
-
import
|
|
18
|
-
const StyledNoRelationsOverlay = styled.div `
|
|
19
|
-
width: 100%;
|
|
20
|
-
height: 100%;
|
|
21
|
-
position: fixed;
|
|
22
|
-
top: 0;
|
|
23
|
-
left: 0;
|
|
24
|
-
z-index: 1501;
|
|
25
|
-
overflow: visible;
|
|
26
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
27
|
-
backdrop-filter: blur(8px);
|
|
28
|
-
`;
|
|
29
|
-
const StyledNoRelationsPanel = styled.div `
|
|
30
|
-
position: absolute;
|
|
31
|
-
top: 50%;
|
|
32
|
-
left: 50%;
|
|
33
|
-
transform: translate(-50%, -50%);
|
|
34
|
-
width: 400px;
|
|
35
|
-
background: white;
|
|
36
|
-
border-radius: 8px;
|
|
37
|
-
padding: 20px;
|
|
38
|
-
text-align: center;
|
|
39
|
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
|
40
|
-
display: flex;
|
|
41
|
-
flex-direction: column;
|
|
42
|
-
align-items: center;
|
|
43
|
-
`;
|
|
44
|
-
const StyledNoRelationsTitle = styled.h2 `
|
|
45
|
-
margin: 0 0 20px 0;
|
|
46
|
-
font-size: 1.3em;
|
|
47
|
-
color: #333;
|
|
48
|
-
`;
|
|
49
|
-
const StyledNoRelationsMessage = styled.p `
|
|
50
|
-
color: #666;
|
|
51
|
-
font-size: 1em;
|
|
52
|
-
margin: 0 0 25px 0;
|
|
53
|
-
line-height: 1.4;
|
|
54
|
-
`;
|
|
17
|
+
import { Spinner } from '../..';
|
|
55
18
|
const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, deviceType, inputDcmts, isForMaster, showCurrentDcmtIndicator = true, allowNavigation, canNext, canPrev, onNext, onPrev, onBack, appendMasterDcmts, onTaskCreateRequest }) => {
|
|
56
|
-
const [id, setID] = useState('');
|
|
57
19
|
const [focusedItem, setFocusedItem] = useState();
|
|
58
20
|
const [selectedItems, setSelectedItems] = useState([]);
|
|
59
21
|
const [showZeroDcmts, setShowZeroDcmts] = useState(false);
|
|
60
22
|
const [allowMultipleSelection, setAllowMultipleSelection] = useState(false);
|
|
61
23
|
const [dtdMaster, setDtdMaster] = useState();
|
|
62
|
-
const [
|
|
63
|
-
const [
|
|
64
|
-
// Ref to track if this is the first load (vs navigation with onPrev/onNext)
|
|
65
|
-
const isFirstLoadRef = useRef(true);
|
|
66
|
-
useEffect(() => { setID(genUniqueId()); }, []);
|
|
24
|
+
const [noRelationsOnFirstLoad, setNoRelationsOnFirstLoad] = useState(false);
|
|
25
|
+
const [isCheckingFirstLoad, setIsCheckingFirstLoad] = useState(true);
|
|
67
26
|
// Load dtdMaster when inputDcmts changes
|
|
68
27
|
useEffect(() => {
|
|
69
28
|
const loadDtdMaster = async () => {
|
|
@@ -82,23 +41,31 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
82
41
|
}, [inputDcmts?.length, inputDcmts?.[0]?.TID, isForMaster]);
|
|
83
42
|
const handleFocusedItemChanged = useCallback((item) => {
|
|
84
43
|
setFocusedItem(item);
|
|
85
|
-
// When data is loaded and an item is focused, mark as no longer first load
|
|
86
44
|
if (item) {
|
|
87
|
-
|
|
45
|
+
setIsCheckingFirstLoad(false);
|
|
88
46
|
}
|
|
89
47
|
}, []);
|
|
90
48
|
const handleSelectedItemsChanged = useCallback((items) => {
|
|
91
49
|
setSelectedItems(items);
|
|
92
50
|
}, []);
|
|
93
51
|
const handleNoRelationsFound = useCallback(() => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
setShowNoRelationsModal(true);
|
|
97
|
-
setShouldGoBackOnClose(true);
|
|
52
|
+
if (isCheckingFirstLoad) {
|
|
53
|
+
setNoRelationsOnFirstLoad(true);
|
|
98
54
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
55
|
+
}, [isCheckingFirstLoad]);
|
|
56
|
+
// Show warning alert and navigate back when no relations found on first load
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (noRelationsOnFirstLoad) {
|
|
59
|
+
setNoRelationsOnFirstLoad(false);
|
|
60
|
+
ShowAlert({
|
|
61
|
+
message: SDKUI_Localizator.RelatedDcmtsNotFound,
|
|
62
|
+
title: SDKUI_Localizator.RelationsNotFound,
|
|
63
|
+
duration: 3000,
|
|
64
|
+
mode: 'warning',
|
|
65
|
+
});
|
|
66
|
+
onBack?.();
|
|
67
|
+
}
|
|
68
|
+
}, [noRelationsOnFirstLoad, onBack]);
|
|
102
69
|
const commandsMenuItems = [
|
|
103
70
|
{
|
|
104
71
|
icon: _jsx(IconMultipleSelection, { color: allowMultipleSelection ? TMColors.tertiary : TMColors.text_normal }),
|
|
@@ -123,7 +90,7 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
123
90
|
}
|
|
124
91
|
}
|
|
125
92
|
];
|
|
126
|
-
const toolbar = _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [allowMultipleSelection && _jsx("p", { style: { color: TMColors.colorHeader, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${selectedItems.length} selezionati` }), allowNavigation && canPrev != undefined && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), allowNavigation && canNext != undefined && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(TMContextMenu, { items: commandsMenuItems, trigger: 'left', children: _jsx(IconMenuVertical, { color: 'white', cursor: 'pointer' }) })] });
|
|
93
|
+
const toolbar = _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [allowMultipleSelection && _jsx("p", { style: { color: TMColors.colorHeader, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${selectedItems.filter(item => item.isDcmt).length} selezionati` }), allowNavigation && canPrev != undefined && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), allowNavigation && canNext != undefined && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(TMContextMenu, { items: commandsMenuItems, trigger: 'left', children: _jsx(IconMenuVertical, { color: 'white', cursor: 'pointer' }) })] });
|
|
127
94
|
const getTitle = () => isForMaster ? `${SDKUI_Localizator.DcmtsMaster} - ${dtdMaster?.nameLoc}` : SDKUI_Localizator.DcmtsDetail;
|
|
128
95
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
129
96
|
const tmTreeView = useMemo(() => _jsx(_Fragment, { children: !inputDcmts || inputDcmts.length === 0
|
|
@@ -210,12 +177,7 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
210
177
|
toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: false, orderNumber: 2, isActive: allInitialPanelVisibility['tmFormOrResult'] }
|
|
211
178
|
}
|
|
212
179
|
], [tmTreeView, tmFormOrResult, focusedItem?.isDcmt, dtdMaster]);
|
|
213
|
-
return (_jsxs(
|
|
214
|
-
setShowNoRelationsModal(false);
|
|
215
|
-
if (shouldGoBackOnClose) {
|
|
216
|
-
onBack?.();
|
|
217
|
-
}
|
|
218
|
-
}, btnStyle: "normal" })] }) }))] }));
|
|
180
|
+
return (_jsxs("div", { style: { width: '100%', height: '100%', position: 'relative' }, children: [isCheckingFirstLoad && (_jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: true })), _jsx("div", { style: isCheckingFirstLoad ? { position: 'absolute', width: 0, height: 0, overflow: 'hidden', opacity: 0, pointerEvents: 'none' } : { width: '100%', height: '100%' }, children: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmTreeView', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) })] }));
|
|
219
181
|
};
|
|
220
182
|
export default TMMasterDetailDcmts;
|
|
221
183
|
/**
|
|
@@ -399,7 +399,8 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
399
399
|
/**
|
|
400
400
|
* Helper function to set up initial tree expansion state.
|
|
401
401
|
* Called after all data is loaded but before setTreeData.
|
|
402
|
-
* Ensures: root container expanded, first document expanded with isRoot=true (for focus),
|
|
402
|
+
* Ensures: root container expanded, first document expanded with isRoot=true (for focus),
|
|
403
|
+
* first correlation folder expanded ONLY if it's the only one (single correlation type)
|
|
403
404
|
* Returns a NEW tree with the modifications (immutable approach)
|
|
404
405
|
*/
|
|
405
406
|
const setupInitialTreeExpansion = (tree) => {
|
|
@@ -426,9 +427,10 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
426
427
|
expanded: true,
|
|
427
428
|
isRoot: true
|
|
428
429
|
};
|
|
429
|
-
// 3. Expand first correlation folder
|
|
430
|
+
// 3. Expand first correlation folder ONLY if there's exactly one
|
|
430
431
|
const docItems = newFirstDoc.items;
|
|
431
|
-
|
|
432
|
+
const containerChildren = docItems?.filter(child => child.isContainer) ?? [];
|
|
433
|
+
if (containerChildren.length === 1 && docItems && docItems.length > 0 && docItems[0].isContainer) {
|
|
432
434
|
const newFirstCorrelation = { ...docItems[0], expanded: true };
|
|
433
435
|
newFirstDoc = {
|
|
434
436
|
...newFirstDoc,
|
|
@@ -442,10 +444,13 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
442
444
|
};
|
|
443
445
|
}
|
|
444
446
|
else if (firstDocOrContainer.isContainer) {
|
|
445
|
-
// First item is a container (correlation folder)
|
|
447
|
+
// First item is a container (correlation folder)
|
|
448
|
+
// Count how many sibling containers there are
|
|
449
|
+
const siblingContainers = firstRootItems.filter(child => child.isContainer);
|
|
450
|
+
const shouldExpand = siblingContainers.length === 1;
|
|
446
451
|
let newFirstCorrelation = {
|
|
447
452
|
...firstDocOrContainer,
|
|
448
|
-
expanded:
|
|
453
|
+
expanded: shouldExpand
|
|
449
454
|
};
|
|
450
455
|
// Find first document inside this container and mark for focus
|
|
451
456
|
const containerItems = newFirstCorrelation.items;
|
|
@@ -517,8 +522,25 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
517
522
|
}
|
|
518
523
|
}
|
|
519
524
|
}
|
|
520
|
-
// Aggiungi i master come root
|
|
521
|
-
|
|
525
|
+
// Aggiungi i master come root, raggruppando per TID e relationId
|
|
526
|
+
for (const masterContainer of masterDocs) {
|
|
527
|
+
const existingContainer = tree.find(c => c.tid === masterContainer.tid && c.relationId === masterContainer.relationId && c.isContainer);
|
|
528
|
+
if (existingContainer) {
|
|
529
|
+
// Merge documents into existing container, deduplicating by DID
|
|
530
|
+
const existingItems = existingContainer.items ?? [];
|
|
531
|
+
const existingDIDs = new Set(existingItems.map(item => item.did));
|
|
532
|
+
const newItems = (masterContainer.items ?? []).filter(item => !existingDIDs.has(item.did));
|
|
533
|
+
existingContainer.items = [...existingItems, ...newItems];
|
|
534
|
+
existingContainer.itemsCount = existingContainer.items.length;
|
|
535
|
+
existingContainer.isZero = existingContainer.items.length === 0;
|
|
536
|
+
if (masterContainer.searchResult) {
|
|
537
|
+
existingContainer.searchResult = [...(existingContainer.searchResult ?? []), ...masterContainer.searchResult];
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
else {
|
|
541
|
+
tree.push(masterContainer);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
522
544
|
}
|
|
523
545
|
// ========================================================================
|
|
524
546
|
// MODALITÀ STANDARD (detail o master invertito)
|
|
@@ -530,22 +552,53 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
530
552
|
: await getDetailDcmtsAsync(dcmt.TID, dcmt.DID, maxDepthLevel);
|
|
531
553
|
// Se showMainDocument è false, mostra i container dei dettagli direttamente sotto il container principale
|
|
532
554
|
if (!showMainDocument) {
|
|
533
|
-
//
|
|
534
|
-
const
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
555
|
+
// Check if a container for this TID already exists in the tree
|
|
556
|
+
const existingContainer = tree.find(c => c.tid === dcmt.TID && c.isContainer);
|
|
557
|
+
if (existingContainer) {
|
|
558
|
+
// Merge relatedDocs into existing container, grouping sub-containers by TID+relationId
|
|
559
|
+
const existingItems = existingContainer.items ?? [];
|
|
560
|
+
for (const relDoc of relatedDocs) {
|
|
561
|
+
const existingSub = existingItems.find(s => s.tid === relDoc.tid && s.relationId === relDoc.relationId && s.isContainer);
|
|
562
|
+
if (existingSub) {
|
|
563
|
+
// Merge documents into existing sub-container, deduplicating by DID
|
|
564
|
+
const subItems = existingSub.items ?? [];
|
|
565
|
+
const existingDIDs = new Set(subItems.map(item => item.did));
|
|
566
|
+
const newItems = (relDoc.items ?? []).filter(item => !existingDIDs.has(item.did));
|
|
567
|
+
existingSub.items = [...subItems, ...newItems];
|
|
568
|
+
existingSub.itemsCount = existingSub.items.length;
|
|
569
|
+
existingSub.isZero = existingSub.items.length === 0;
|
|
570
|
+
if (relDoc.searchResult) {
|
|
571
|
+
existingSub.searchResult = [...(existingSub.searchResult ?? []), ...relDoc.searchResult];
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
existingItems.push(relDoc);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
existingContainer.items = existingItems;
|
|
579
|
+
existingContainer.itemsCount = existingItems.length;
|
|
580
|
+
if (result) {
|
|
581
|
+
existingContainer.searchResult = [...(existingContainer.searchResult ?? []), result];
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
else {
|
|
585
|
+
// Create type container that contains detail containers directly
|
|
586
|
+
const typeContainer = {
|
|
587
|
+
key: `${isForMaster ? 'detail' : 'master'}-type-${dcmt.TID}-${containerGUID}`,
|
|
588
|
+
name: labelMainContainer || result?.fromName || dtd?.name || `TID: ${dcmt.TID}`,
|
|
589
|
+
tid: dcmt.TID,
|
|
590
|
+
dtd,
|
|
591
|
+
isContainer: true,
|
|
592
|
+
isLoaded: true,
|
|
593
|
+
isZero: false,
|
|
594
|
+
searchResult: result ? [result] : [],
|
|
595
|
+
items: relatedDocs, // Directly show detail containers
|
|
596
|
+
itemsCount: relatedDocs.length,
|
|
597
|
+
expanded: false,
|
|
598
|
+
hidden: false
|
|
599
|
+
};
|
|
600
|
+
tree.push(typeContainer);
|
|
601
|
+
}
|
|
549
602
|
}
|
|
550
603
|
else {
|
|
551
604
|
// MODALITÀ ORIGINALE: mostra il documento master come nodo intermedio
|
|
@@ -567,22 +620,35 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
567
620
|
items: relatedDocs,
|
|
568
621
|
itemsCount: relatedDocs.length
|
|
569
622
|
};
|
|
570
|
-
//
|
|
571
|
-
const
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
623
|
+
// Check if a type container for this TID already exists in the tree
|
|
624
|
+
const existingContainer = tree.find(c => c.tid === dcmt.TID && c.isContainer);
|
|
625
|
+
if (existingContainer) {
|
|
626
|
+
// Add document to existing container
|
|
627
|
+
const existingItems = existingContainer.items ?? [];
|
|
628
|
+
existingContainer.items = [...existingItems, docNode];
|
|
629
|
+
existingContainer.itemsCount = existingContainer.items.length;
|
|
630
|
+
if (result) {
|
|
631
|
+
existingContainer.searchResult = [...(existingContainer.searchResult ?? []), result];
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
else {
|
|
635
|
+
// Create type container with unique key
|
|
636
|
+
const typeContainer = {
|
|
637
|
+
key: `${isForMaster ? 'detail' : 'master'}-type-${dcmt.TID}-${containerGUID}`,
|
|
638
|
+
name: labelMainContainer || result?.fromName || dtd?.name || `TID: ${dcmt.TID}`,
|
|
639
|
+
tid: dcmt.TID,
|
|
640
|
+
dtd,
|
|
641
|
+
isContainer: true,
|
|
642
|
+
isLoaded: true,
|
|
643
|
+
isZero: false, // Type container is never zero (contains documents)
|
|
644
|
+
searchResult: result ? [result] : [],
|
|
645
|
+
items: [docNode],
|
|
646
|
+
itemsCount: 1,
|
|
647
|
+
expanded: false,
|
|
648
|
+
hidden: false
|
|
649
|
+
};
|
|
650
|
+
tree.push(typeContainer);
|
|
651
|
+
}
|
|
586
652
|
}
|
|
587
653
|
}
|
|
588
654
|
// Update progress counter
|
|
@@ -1012,7 +1078,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
1012
1078
|
const metadataContent = customDocumentContent
|
|
1013
1079
|
? customDocumentContent(item, defaultMetadataContent || _jsx(_Fragment, {}))
|
|
1014
1080
|
: defaultMetadataContent;
|
|
1015
|
-
return (_jsxs("div", { onDoubleClick: handleDoubleClick, style: documentStyle, children: [item.did && showCurrentDcmtIndicator && item.did ===
|
|
1081
|
+
return (_jsxs("div", { onDoubleClick: handleDoubleClick, style: documentStyle, children: [item.did && item.tid && showCurrentDcmtIndicator && inputDcmts?.some(d => d.DID === item.did && d.TID === item.tid) ? _jsx(IconBackhandIndexPointingRight, { fontSize: 22, overflow: 'visible' }) : _jsx(_Fragment, {}), item.values && (_jsx(TMDcmtIcon, { tid: item.values?.TID?.value, did: item.values?.DID?.value, fileExtension: item.values?.FILEEXT?.value, fileCount: item.values?.FILECOUNT?.value, isLexProt: item.values?.IsLexProt?.value, isMail: item.values?.ISMAIL?.value, isShared: item.values?.ISSHARED?.value, isSigned: item.values?.ISSIGNED?.value, downloadMode: 'openInNewWindow' })), metadataContent] }));
|
|
1016
1082
|
}, [onDocumentDoubleClick, showCurrentDcmtIndicator, inputDcmts, customMainContainerContent, customDocumentStyle, customDocumentContent, showMetadataNames, showMainDocument]);
|
|
1017
1083
|
/**
|
|
1018
1084
|
* Wrapper renderer that handles custom rendering if provided
|
|
@@ -1059,6 +1125,9 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
1059
1125
|
return _jsx("div", { style: { padding: '20px', textAlign: 'center' }, children: _jsx(TMWaitPanel, { title: 'Caricamento documenti dettaglio', showPrimary: true, textPrimary: waitPanelTextPrimary, valuePrimary: waitPanelValuePrimary, maxValuePrimary: waitPanelMaxValuePrimary, isCancelable: true, abortController: abortController, onAbortClick: (abortController) => { setTimeout(() => { abortController?.abort(); }, 1000); } }) });
|
|
1060
1126
|
}
|
|
1061
1127
|
if (mergedTreeData.length === 0) {
|
|
1128
|
+
// If parent handles no-relations via callback, render nothing to avoid UI flash
|
|
1129
|
+
if (onNoRelationsFound)
|
|
1130
|
+
return null;
|
|
1062
1131
|
return _jsx("div", { style: { padding: '20px', textAlign: 'center', color: '#666' }, children: "Nessuna relazione disponibile." });
|
|
1063
1132
|
}
|
|
1064
1133
|
return (_jsxs(_Fragment, { children: [_jsx(TMTreeView, { dataSource: mergedTreeData, itemRender: finalItemRender, calculateItemsForNode: calculateItemsForNode, onDataChanged: handleDataChanged, focusedItem: focusedItem, onFocusedItemChanged: handleFocusedItemChanged, allowMultipleSelection: allowMultipleSelection, selectedItems: selectedItems, itemsPerPage: 100, onSelectionChanged: handleSelectedItemsChanged }), showExpansionWaitPanel && (_jsx(TMWaitPanel, { title: isForMaster ? 'Caricamento documenti master' : 'Caricamento documenti dettaglio', showPrimary: true, textPrimary: expansionWaitPanelText, valuePrimary: expansionWaitPanelValue, maxValuePrimary: expansionWaitPanelMaxValue, isCancelable: true, abortController: expansionAbortController, onAbortClick: (abortController) => {
|
|
@@ -91,10 +91,14 @@ export declare class DevSettings {
|
|
|
91
91
|
}
|
|
92
92
|
export declare class AdvancedSettings {
|
|
93
93
|
private _expertMode;
|
|
94
|
+
private _scannerLicense;
|
|
94
95
|
get expertMode(): number;
|
|
95
96
|
set expertMode(value: number);
|
|
97
|
+
get scannerLicense(): string;
|
|
98
|
+
set scannerLicense(value: string);
|
|
96
99
|
toJSON(): {
|
|
97
100
|
expertMode: number;
|
|
101
|
+
scannerLicense: string;
|
|
98
102
|
};
|
|
99
103
|
}
|
|
100
104
|
export declare class CtrlWfSettings {
|
|
@@ -130,6 +130,7 @@ export class DevSettings {
|
|
|
130
130
|
export class AdvancedSettings {
|
|
131
131
|
constructor() {
|
|
132
132
|
this._expertMode = 0;
|
|
133
|
+
this._scannerLicense = '';
|
|
133
134
|
}
|
|
134
135
|
get expertMode() {
|
|
135
136
|
return this._expertMode;
|
|
@@ -142,10 +143,17 @@ export class AdvancedSettings {
|
|
|
142
143
|
window.dispatchEvent(event);
|
|
143
144
|
}
|
|
144
145
|
}
|
|
146
|
+
get scannerLicense() {
|
|
147
|
+
return this._scannerLicense;
|
|
148
|
+
}
|
|
149
|
+
set scannerLicense(value) {
|
|
150
|
+
this._scannerLicense = value;
|
|
151
|
+
}
|
|
145
152
|
// Override toJSON to control serialization (called by JSON.stringify)
|
|
146
153
|
toJSON() {
|
|
147
154
|
return {
|
|
148
|
-
expertMode: this._expertMode,
|
|
155
|
+
expertMode: this._expertMode,
|
|
156
|
+
scannerLicense: this._scannerLicense,
|
|
149
157
|
};
|
|
150
158
|
}
|
|
151
159
|
}
|