@topconsultnpm/sdkui-react 6.20.0-dev3.8 → 6.20.0-dev4.2

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.
Files changed (40) hide show
  1. package/lib/components/base/TMPopUp.js +4 -0
  2. package/lib/components/base/TMTreeView.js +12 -8
  3. package/lib/components/choosers/TMDataListItemChooser.js +1 -1
  4. package/lib/components/choosers/TMDataListItemFields.js +1 -1
  5. package/lib/components/choosers/TMDataListItemPicker.d.ts +1 -0
  6. package/lib/components/choosers/TMDataListItemPicker.js +5 -1
  7. package/lib/components/choosers/TMUserChooser.js +1 -1
  8. package/lib/components/editors/TMMetadataValues.js +200 -40
  9. package/lib/components/editors/TMTextArea.d.ts +1 -0
  10. package/lib/components/editors/TMTextArea.js +6 -6
  11. package/lib/components/features/documents/TMDcmtForm.js +13 -4
  12. package/lib/components/features/documents/TMFileUploader.js +12 -2
  13. package/lib/components/features/documents/TMMasterDetailDcmts.js +25 -63
  14. package/lib/components/features/documents/TMRelationViewer.js +109 -40
  15. package/lib/components/features/search/TMSearchQueryPanel.js +3 -3
  16. package/lib/components/features/search/TMSearchResult.js +2 -10
  17. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +1 -1
  18. package/lib/components/features/search/TMSearchResultsMenuItems.js +1 -8
  19. package/lib/components/features/search/TMSignatureInfoContent.js +10 -6
  20. package/lib/components/features/tasks/TMTaskFormUtils.js +1 -1
  21. package/lib/components/features/workflow/TMWorkflowPopup.js +9 -19
  22. package/lib/components/features/workflow/diagram/DiagramItemForm.d.ts +2 -0
  23. package/lib/components/features/workflow/diagram/DiagramItemForm.js +32 -25
  24. package/lib/components/features/workflow/diagram/RecipientList.d.ts +3 -1
  25. package/lib/components/features/workflow/diagram/RecipientList.js +13 -9
  26. package/lib/components/features/workflow/diagram/WFDiagram.js +29 -2
  27. package/lib/components/features/workflow/diagram/workflowHelpers.js +31 -19
  28. package/lib/components/viewers/TMMidViewer.js +2 -1
  29. package/lib/components/viewers/TMTidViewer.js +2 -1
  30. package/lib/helper/SDKUI_Globals.d.ts +4 -0
  31. package/lib/helper/SDKUI_Globals.js +9 -1
  32. package/lib/helper/SDKUI_Localizator.d.ts +12 -4
  33. package/lib/helper/SDKUI_Localizator.js +104 -24
  34. package/lib/helper/TMUtils.d.ts +6 -40
  35. package/lib/helper/TMUtils.js +69 -166
  36. package/lib/hooks/useDataUserIdItem.js +2 -2
  37. package/lib/hooks/useRelatedDocuments.js +30 -31
  38. package/package.json +55 -55
  39. package/lib/components/features/search/TMSignSettingsForm.d.ts +0 -9
  40. package/lib/components/features/search/TMSignSettingsForm.js +0 -621
@@ -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, useRef, useState } from 'react';
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 { genUniqueId, IconMultipleSelection, IconCheckFile, IconDetailDcmts, SDKUI_Localizator, IconMenuVertical, IconDataList, IconPreview, IconSearchCheck, IconBoard, IconDcmtTypeSys, IconShow, getMoreInfoTasksForDocument } from '../../../helper';
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 TMButton from '../../base/TMButton';
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 [showNoRelationsModal, setShowNoRelationsModal] = useState(false);
63
- const [shouldGoBackOnClose, setShouldGoBackOnClose] = useState(false);
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
- isFirstLoadRef.current = false;
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
- // Show modal only on first load, not during navigation with onPrev/onNext
95
- if (isFirstLoadRef.current) {
96
- setShowNoRelationsModal(true);
97
- setShouldGoBackOnClose(true);
52
+ if (isCheckingFirstLoad) {
53
+ setNoRelationsOnFirstLoad(true);
98
54
  }
99
- // Mark as no longer first load
100
- isFirstLoadRef.current = false;
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(_Fragment, { children: [_jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmTreeView', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }), showNoRelationsModal && (_jsx(StyledNoRelationsOverlay, { children: _jsxs(StyledNoRelationsPanel, { children: [_jsx(StyledNoRelationsTitle, { children: SDKUI_Localizator.RelationsNotFound }), _jsx(StyledNoRelationsMessage, { children: SDKUI_Localizator.RelatedDcmtsNotFound }), _jsx(TMButton, { caption: "OK", showTooltip: false, onClick: () => {
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), first correlation folder expanded
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 (child of the document)
430
+ // 3. Expand first correlation folder ONLY if there's exactly one
430
431
  const docItems = newFirstDoc.items;
431
- if (docItems && docItems.length > 0 && docItems[0].isContainer) {
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) - expand it
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: true
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
- tree.push(...masterDocs);
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
- // Create type container that contains detail containers directly
534
- const typeContainer = {
535
- key: `${isForMaster ? 'detail' : 'master'}-type-${dcmt.TID}-${containerGUID}`,
536
- name: labelMainContainer || result?.fromName || dtd?.name || `TID: ${dcmt.TID}`,
537
- tid: dcmt.TID,
538
- dtd,
539
- isContainer: true,
540
- isLoaded: true,
541
- isZero: false,
542
- searchResult: result ? [result] : [],
543
- items: relatedDocs, // Directly show detail containers
544
- itemsCount: relatedDocs.length,
545
- expanded: false,
546
- hidden: false
547
- };
548
- tree.push(typeContainer);
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
- // Create type container with unique key
571
- const typeContainer = {
572
- key: `${isForMaster ? 'detail' : 'master'}-type-${dcmt.TID}-${containerGUID}`,
573
- name: labelMainContainer || result?.fromName || dtd?.name || `TID: ${dcmt.TID}`,
574
- tid: dcmt.TID,
575
- dtd,
576
- isContainer: true,
577
- isLoaded: true,
578
- isZero: false, // Type container is never zero (contains documents)
579
- searchResult: result ? [result] : [],
580
- items: [docNode],
581
- itemsCount: 1,
582
- expanded: false,
583
- hidden: false
584
- };
585
- tree.push(typeContainer);
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 === inputDcmts?.[0].DID ? _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] }));
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) => {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
- import { PlatformObjectValidator, QueryDescriptor, WhereItem, SDK_Localizator, OrderByItem, SelectItem, SelectItemVisibilities, SDK_Globals, SavedQueryCacheService, SearchEngine, QueryOperators } from '@topconsultnpm/sdk-ts';
3
+ import { PlatformObjectValidator, QueryDescriptor, WhereItem, SDK_Localizator, OrderByItem, SelectItem, SelectItemVisibilities, SDK_Globals, SavedQueryCacheService, SearchEngine, QueryOperators, AccessLevelsEx } from '@topconsultnpm/sdk-ts';
4
4
  import styled from 'styled-components';
5
5
  import TMSearchQueryEditor from './TMSearchQueryEditor';
6
6
  import { getDcmtTypesByQdAsync, SDKUI_Localizator, getQD, IconMenuVertical, IconAddCircleOutline, IconEdit, IconEasy, IconAdvanced, deepCompare, IconSearch, IconClear, getDefaultOperator, prepareQdForSearchAsync, IsParametricQuery, SDKUI_Globals, IconArrowRight, IconMenuCAArchive, getListMaxItems, DEFAULT_MAX_DCMTS_TO_BE_RETURNED } from '../../../helper';
@@ -319,8 +319,8 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
319
319
  { icon: _jsx(IconEdit, {}), name: `${SDKUI_Localizator.Configure} - ${SDK_Localizator.QueryWhere}`, beginGroup: true, onClick: () => { setShowFiltersConfig(true); } },
320
320
  { icon: _jsx(IconEdit, {}), name: `${SDKUI_Localizator.Configure} - ${SDK_Localizator.QuerySelect}`, onClick: () => { setShowOutputConfig(true); } },
321
321
  { icon: _jsx(IconEdit, {}), name: `${SDKUI_Localizator.Configure} - ${SDK_Localizator.QueryOrderBy}`, onClick: () => { setShowOrderByConfig(true); } },
322
- { icon: _jsx(IconMenuCAArchive, { viewBox: '11 11.5 26 27', fontSize: 16, strokeWidth: 2, color: 'black' }), beginGroup: true, name: SDKUI_Localizator.PassToArchive, onClick: handlePassToArchive }
323
- ], [showBackToResultButton, showAdvancedSearch, SQD, onBackToResult, openSqdForm, changeAdvancedSearchAsync, setShowFiltersConfig, setShowOutputConfig, setShowOrderByConfig, handlePassToArchive]);
322
+ { icon: _jsx(IconMenuCAArchive, { viewBox: '11 11.5 26 27', fontSize: 16, strokeWidth: 2, color: 'black' }), beginGroup: true, name: SDKUI_Localizator.PassToArchive, disabled: fromDTD?.perm?.canArchive !== AccessLevelsEx.Yes && fromDTD?.perm?.canArchive !== AccessLevelsEx.Mixed, onClick: handlePassToArchive }
323
+ ], [showBackToResultButton, showAdvancedSearch, SQD, onBackToResult, openSqdForm, changeAdvancedSearchAsync, setShowFiltersConfig, setShowOutputConfig, setShowOrderByConfig, handlePassToArchive, fromDTD?.perm?.canArchive]);
324
324
  const captionText = showAllMdWhere ? SDKUI_Localizator.ShowLess : SDKUI_Localizator.ShowAll;
325
325
  let maxItems = getListMaxItems(deviceType ?? DeviceType.DESKTOP);
326
326
  const diff = (qd?.where?.length ?? 0) - maxItems;
@@ -39,7 +39,6 @@ import TMModal from '../../base/TMModal';
39
39
  import TMSearch from './TMSearch';
40
40
  import TMArchive from '../archive/TMArchive';
41
41
  import TMCustomButton from '../../base/TMCustomButton';
42
- import TMSignSettingsForm from './TMSignSettingsForm';
43
42
  import { getDcmtCicoStatus } from '../../../helper/checkinCheckoutManager';
44
43
  import TMViewHistoryDcmt from './TMViewHistoryDcmt';
45
44
  import TMBlogCommentForm from '../blog/TMBlogCommentForm';
@@ -96,7 +95,6 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
96
95
  const [sharedDcmtFile, setSharedDcmtFile] = useState(undefined);
97
96
  // State to control whether the export form (for exporting to Excel/CSV/txt and others) should be shown
98
97
  const [showExportForm, setShowExportForm] = useState(false);
99
- const [showSignSettingsForm, setShowSignSettingsForm] = useState(false);
100
98
  const [showIndexingInfo, setShowIndexingInfo] = useState(false);
101
99
  const [loadingIndexingInfo, setLoadingIndexingInfo] = useState(false);
102
100
  const [indexingInfo, setIndexingInfo] = useState('');
@@ -304,12 +302,6 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
304
302
  const handleToggleSearch = () => {
305
303
  setShowSearch(prev => !prev);
306
304
  };
307
- const openSignSettingsForm = () => {
308
- setShowSignSettingsForm(true);
309
- };
310
- const closeSignSettingsForm = useCallback(() => {
311
- setShowSignSettingsForm(false);
312
- }, []);
313
305
  const copyCheckoutPathToClipboardOperationCallback = () => {
314
306
  const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
315
307
  const firstDoc = selectedDocs?.[0];
@@ -610,7 +602,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
610
602
  && !showTodoDcmtForm);
611
603
  }, [showToppyForApprove, showToppyDraggableHelpCenter, selectedDocs, showApprovePopup, showRejectPopup, showReAssignPopup, showMoreInfoPopup, editPdfForm, openS4TViewer, showTodoDcmtForm]);
612
604
  const floatingMenuItems = useMemo(() => {
613
- const baseMenuItems = getCommandsMenuItems(isMobile, fromDTD, allUsers, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openSignSettingsForm, handleCheckOutOperationCallback, handleCheckInOperationCallback, showCheckoutInformationFormCallback, showHistoryCallback, copyCheckoutPathToClipboardOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation, pinnedItemIds, togglePin);
605
+ const baseMenuItems = getCommandsMenuItems(isMobile, fromDTD, allUsers, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, handleCheckOutOperationCallback, handleCheckInOperationCallback, showCheckoutInformationFormCallback, showHistoryCallback, copyCheckoutPathToClipboardOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation, pinnedItemIds, togglePin);
614
606
  const customButtons = customButtonMenuItems();
615
607
  return customButtons.name ? baseMenuItems.concat([customButtons]) : baseMenuItems;
616
608
  }, [
@@ -886,7 +878,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
886
878
  setArchiveRelatedDcmtFormTID(undefined);
887
879
  setArchiveRelatedDcmtFormMids([]);
888
880
  await onRefreshSearchAsync?.();
889
- }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar }), (showSignSettingsForm && fromDTD) && _jsx(TMSignSettingsForm, { fromDTD: fromDTD, inputDcmts: allFieldSelectedDocs, onCloseSignSettingsForm: closeSignSettingsForm, onSavedAsyncCallback: handleSavedAsyncCallback }), (showHistory && fromDTD && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMViewHistoryDcmt, { fromDTD: fromDTD, deviceType: deviceType, inputDcmt: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0], onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (commentFormState.show && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].TID, did: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID } }, onClose: hideCommentFormCallback, refreshCallback: triggerBlogRefresh, participants: [], showAttachmentsSection: true, allArchivedDocumentsFileItems: convertSearchResultDescriptorToFileItems(currentSearchResults ?? []), isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment, selectedAttachmentDid: [Number(getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID)] })] }));
881
+ }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar }), (showHistory && fromDTD && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMViewHistoryDcmt, { fromDTD: fromDTD, deviceType: deviceType, inputDcmt: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0], onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (commentFormState.show && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].TID, did: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID } }, onClose: hideCommentFormCallback, refreshCallback: triggerBlogRefresh, participants: [], showAttachmentsSection: true, allArchivedDocumentsFileItems: convertSearchResultDescriptorToFileItems(currentSearchResults ?? []), isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment, selectedAttachmentDid: [Number(getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID)] })] }));
890
882
  };
891
883
  export default TMSearchResult;
892
884
  const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem, showSearch, allowMultipleSelection = true, showExportForm = false, onCloseExportForm, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, floatingMenuItems, onSelectionChanged, onDblClick }) => {
@@ -5,7 +5,7 @@ import { DcmtInfo, DcmtOperationTypes, DownloadModes, DownloadTypes, SearchResul
5
5
  export declare const getSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => DcmtInfo[];
6
6
  export declare const getAllFieldSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => any[];
7
7
  export declare const signatureInformationCallback: (isMobile: boolean, inputDcmts: DcmtInfo[] | undefined) => Promise<void>;
8
- export declare const getCommandsMenuItems: (isMobile: boolean, dtd: DcmtTypeDescriptor | undefined, allUsers: Array<UserDescriptor>, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, workingGroupContext: WorkingGroupDescriptor | undefined, showSearch: boolean, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, openSharedArchiveHandler: () => Promise<void>, showSharedDcmtsHandler: () => Promise<void>, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean) => Promise<void>, runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>, onRefreshSearchAsync: (() => Promise<void>) | undefined, onRefreshDataRowsAsync: (() => Promise<void>) | undefined, onRefreshAfterAddDcmtToFavs: (() => void) | undefined, confirmFormat: () => Promise<FileFormats>, confirmAttachments: (list: FileDescriptor[]) => Promise<string[] | undefined>, openTaskFormHandler: () => void, openDetailDcmtsFormHandler: (value: boolean) => void, openMasterDcmtsFormHandler: (value: boolean) => void, openBatchUpdateFormHandler: (value: boolean) => void, openExportForm: () => void, handleToggleSearch: () => void, handleSignApprove: () => void, openSignSettingsForm: () => void, handleCheckOutOperationCallback: (checkout: boolean) => Promise<void>, handleCheckInOperationCallback: () => void, showCheckoutInformationFormCallback: () => void, viewHistoryCallback: () => void, copyCheckoutPathToClipboardOperationCallback: () => void, openWGsCopyMoveForm?: ((mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void), openCommentFormCallback?: ((documents: Array<DcmtInfo>) => void), openEditPdf?: ((documents: Array<DcmtInfo>) => void), openAddDocumentForm?: () => void, passToArchiveCallback?: (outputMids: Array<{
8
+ export declare const getCommandsMenuItems: (isMobile: boolean, dtd: DcmtTypeDescriptor | undefined, allUsers: Array<UserDescriptor>, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, workingGroupContext: WorkingGroupDescriptor | undefined, showSearch: boolean, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, openSharedArchiveHandler: () => Promise<void>, showSharedDcmtsHandler: () => Promise<void>, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean) => Promise<void>, runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>, onRefreshSearchAsync: (() => Promise<void>) | undefined, onRefreshDataRowsAsync: (() => Promise<void>) | undefined, onRefreshAfterAddDcmtToFavs: (() => void) | undefined, confirmFormat: () => Promise<FileFormats>, confirmAttachments: (list: FileDescriptor[]) => Promise<string[] | undefined>, openTaskFormHandler: () => void, openDetailDcmtsFormHandler: (value: boolean) => void, openMasterDcmtsFormHandler: (value: boolean) => void, openBatchUpdateFormHandler: (value: boolean) => void, openExportForm: () => void, handleToggleSearch: () => void, handleSignApprove: () => void, handleCheckOutOperationCallback: (checkout: boolean) => Promise<void>, handleCheckInOperationCallback: () => void, showCheckoutInformationFormCallback: () => void, viewHistoryCallback: () => void, copyCheckoutPathToClipboardOperationCallback: () => void, openWGsCopyMoveForm?: ((mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void), openCommentFormCallback?: ((documents: Array<DcmtInfo>) => void), openEditPdf?: ((documents: Array<DcmtInfo>) => void), openAddDocumentForm?: () => void, passToArchiveCallback?: (outputMids: Array<{
9
9
  mid: number;
10
10
  value: string;
11
11
  }>, tid?: number) => void, archiveMasterDocuments?: (tid: number | undefined) => Promise<void>, archiveDetailDocuments?: (tid: number | undefined) => Promise<void>, hasMasterRelation?: boolean, hasDetailRelation?: boolean, canArchiveMasterRelation?: boolean, canArchiveDetailRelation?: boolean, pairManyToManyDocuments?: (isPairing: boolean) => Promise<void>, hasManyToManyRelation?: boolean, pinnedItemIds?: string[], onTogglePin?: (id: string) => void) => Array<TMContextMenuItemProps>;
@@ -80,7 +80,7 @@ export const signatureInformationCallback = async (isMobile, inputDcmts) => {
80
80
  TMSpinner.hide();
81
81
  }
82
82
  };
83
- export const getCommandsMenuItems = (isMobile, dtd, allUsers, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openSignSettingsForm, handleCheckOutOperationCallback, handleCheckInOperationCallback, showCheckoutInformationFormCallback, viewHistoryCallback, copyCheckoutPathToClipboardOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, hasMasterRelation, hasDetailRelation, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToManyDocuments, hasManyToManyRelation, pinnedItemIds, onTogglePin) => {
83
+ export const getCommandsMenuItems = (isMobile, dtd, allUsers, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, handleCheckOutOperationCallback, handleCheckInOperationCallback, showCheckoutInformationFormCallback, viewHistoryCallback, copyCheckoutPathToClipboardOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, hasMasterRelation, hasDetailRelation, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToManyDocuments, hasManyToManyRelation, pinnedItemIds, onTogglePin) => {
84
84
  const addPinIconToItems = (items) => {
85
85
  if (isMobile || !onTogglePin)
86
86
  return items;
@@ -315,13 +315,6 @@ export const getCommandsMenuItems = (isMobile, dtd, allUsers, selectedItems, foc
315
315
  name: SDKUI_Localizator.Signature,
316
316
  onClick: handleSignApprove
317
317
  },
318
- /* {
319
- icon: <IconSettings />,
320
- operationType: 'singleRow',
321
- disabled: disabledForSingleRow(selectedItems, focusedItem),
322
- name: SDKUI_Localizator.SignatureSettings,
323
- onClick: openSignSettingsForm
324
- }, */
325
318
  {
326
319
  id: 'sign-info',
327
320
  icon: _jsx(IconCircleInfo, {}),
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from "react";
3
3
  import { SDK_Globals } from "@topconsultnpm/sdk-ts";
4
- import { IconCopy, getExceptionMessage } from "../../../helper";
4
+ import { IconCopy, getExceptionMessage, SDKUI_Localizator } from "../../../helper";
5
5
  import TMSpinner from "../../base/TMSpinner";
6
6
  const TMSignatureInfoContent = (props) => {
7
7
  const { inputDcmt } = props;
@@ -105,12 +105,16 @@ const TMSignatureInfoContent = (props) => {
105
105
  gap: '10px',
106
106
  fontSize: '13px'
107
107
  }, children: [_jsxs("div", { children: [_jsx("strong", { style: { color: '#555' }, children: "Intestatario:" }), _jsx("div", { style: { marginTop: '4px', color: '#333' }, children: signer.info1 ?? '-' })] }), _jsxs("div", { children: [_jsx("strong", { style: { color: '#555' }, children: "Riferimento temporale:" }), _jsx("div", { style: { marginTop: '4px', color: '#333' }, children: signer.info2 ?? '-' })] }), _jsxs("div", { children: [_jsx("strong", { style: { color: '#555' }, children: "Dettagli:" }), _jsx("div", { style: { marginTop: '4px', color: '#333' }, children: signer.info3 ?? '-' })] })] })] }, idx)))] })) : (_jsx("div", { style: {
108
- padding: '20px',
108
+ border: "1px solid #d0d0d0",
109
+ borderRadius: "8px",
110
+ padding: "16px",
111
+ marginBottom: "12px",
112
+ background: "linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%)",
113
+ boxShadow: "0 2px 4px rgba(0,0,0,0.08)",
114
+ userSelect: 'text',
109
115
  textAlign: 'center',
110
- color: '#666',
111
- background: '#f5f5f5',
112
- borderRadius: '8px'
113
- }, children: "Nessuna firma trovata" })), signerInfo.shA256 && (_jsxs("div", { style: {
116
+ color: '#666'
117
+ }, children: SDKUI_Localizator.NoSignatureFound })), signerInfo.shA256 && (_jsxs("div", { style: {
114
118
  marginBottom: '12px',
115
119
  padding: '16px',
116
120
  background: '#f5f5f5',
@@ -358,7 +358,7 @@ const TaskFormResponseComment = (props) => {
358
358
  }, children: currentResponse && currentResponse.length > 0
359
359
  ? _jsx(TMHtmlContentDisplay, { markup: currentResponse ?? '-', isSelected: false })
360
360
  : _jsx("span", { style: { color: '#6c757d', fontStyle: 'italic' }, children: SDKUI_Localizator.NoAnswerProvided }) }) }))] })
361
- : (_jsxs(ResponseCommentWrapper, { children: [_jsx(ResponseCommentTextArea, { id: "responseId", name: "response", "$isValid": true, value: currentResponse ?? '', onChange: onAnswerChange ? onAnswerChange : undefined, "$isModifiedWhen": currentResponse !== originalResponse }), _jsx(ResponseCommentLabel, { htmlFor: "responseId", "$isModifiedWhen": currentResponse !== originalResponse, children: SDKUI_Localizator.Answer }), _jsx(ResponseCommentCharacterCounter, { children: `${500 - (currentResponse ?? '').length} ${SDKUI_Localizator.CharactersRemaining}` })] })) }));
361
+ : (_jsxs(ResponseCommentWrapper, { children: [_jsx(ResponseCommentTextArea, { id: "responseId", name: "response", "$isValid": true, value: currentResponse ?? '', onChange: onAnswerChange ? onAnswerChange : undefined }), _jsx(ResponseCommentLabel, { htmlFor: "responseId", children: SDKUI_Localizator.Answer }), _jsx(ResponseCommentCharacterCounter, { children: `${500 - (currentResponse ?? '').length} ${SDKUI_Localizator.CharactersRemaining}` })] })) }));
362
362
  };
363
363
  // Stile comune per i container dei campi
364
364
  const fieldContainerStyle = { width: '100%' };