@topconsultnpm/sdkui-react 6.19.0-dev1.31 → 6.19.0-dev1.33
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/features/archive/TMArchive.d.ts +1 -0
- package/lib/components/features/archive/TMArchive.js +27 -17
- package/lib/components/features/documents/TMRelationViewer.d.ts +16 -4
- package/lib/components/features/documents/TMRelationViewer.js +70 -48
- package/lib/components/features/search/TMSearchResult.js +19 -4
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +1 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +27 -2
- package/lib/helper/SDKUI_Globals.d.ts +2 -1
- package/lib/helper/SDKUI_Globals.js +1 -0
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ import TMTreeSelector from '../search/TMTreeSelector';
|
|
|
12
12
|
import TMPanel from '../../base/TMPanel';
|
|
13
13
|
import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
|
|
14
14
|
import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
|
|
15
|
-
const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, connectorFileSave = undefined, onSavedAsyncCallback, inputMids = [], enableDragDropOverlay = false, passToSearch }) => {
|
|
15
|
+
const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, connectorFileSave = undefined, onSavedAsyncCallback, inputMids = [], enableDragDropOverlay = false, passToSearch, isSharedArchive = false }) => {
|
|
16
16
|
const [currentTID, setCurrentTID] = useState(inputTID ?? 0);
|
|
17
17
|
const [mruTIDs, setMruTIDs] = useState([]);
|
|
18
18
|
const [currentMruTID, setCurrentMruTID] = useState(0);
|
|
@@ -36,21 +36,21 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
|
|
|
36
36
|
});
|
|
37
37
|
}, [currentTID, onDcmtTypeSelect]);
|
|
38
38
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
39
|
-
const tmTreeSelectorElement = useMemo(() => _jsx(TMTreeSelectorWrapper, { isMobile: isMobile, onSelectedTIDChanged: (tid) => {
|
|
39
|
+
const tmTreeSelectorElement = useMemo(() => _jsx(TMTreeSelectorWrapper, { isMobile: isMobile, isSharedArchive: isSharedArchive, onSelectedTIDChanged: (tid) => {
|
|
40
40
|
setCurrentTID(tid);
|
|
41
41
|
if (tid && mruTIDs.includes(tid))
|
|
42
42
|
setCurrentMruTID(tid);
|
|
43
43
|
else
|
|
44
44
|
setCurrentMruTID(0);
|
|
45
|
-
} }), [isMobile, currentTID]);
|
|
46
|
-
const tmRecentsManagerElement = useMemo(() => _jsx(TMRecentsManagerWrapper, { mruTIDs: mruTIDs, currentTID: currentTID, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: (tid) => {
|
|
45
|
+
} }), [isMobile, currentTID, isSharedArchive]);
|
|
46
|
+
const tmRecentsManagerElement = useMemo(() => _jsx(TMRecentsManagerWrapper, { mruTIDs: mruTIDs, currentTID: currentTID, currentMruTID: currentMruTID, deviceType: deviceType, isSharedArchive: isSharedArchive, onSelectedTID: (tid) => {
|
|
47
47
|
setCurrentMruTID(tid);
|
|
48
48
|
setCurrentTID(tid);
|
|
49
49
|
}, onDeletedTID: (tid) => {
|
|
50
50
|
let newMruTIDS = removeMruTid(SDKUI_Globals.userSettings.archivingSettings.mruTIDs, tid);
|
|
51
51
|
SDKUI_Globals.userSettings.archivingSettings.mruTIDs = newMruTIDS;
|
|
52
52
|
setMruTIDs(newMruTIDS);
|
|
53
|
-
} }), [mruTIDs, currentMruTID, deviceType]);
|
|
53
|
+
} }), [mruTIDs, currentMruTID, deviceType, isSharedArchive]);
|
|
54
54
|
const tmFormElement = useMemo(() => currentTID ?
|
|
55
55
|
_jsx(TMDcmtForm, { TID: currentTID, DID: undefined, groupId: 'tmForm', layoutMode: LayoutModes.Ark, onClose: deviceType === DeviceType.MOBILE ? () => setCurrentTID(undefined) : undefined, onSaveRecents: (TIDs) => setMruTIDs(TIDs), showDcmtFormSidebar: false, inputFile: inputFile, connectorFileSave: connectorFileSave, onSavedAsyncCallback: onSavedAsyncCallback, inputMids: inputMids, enableDragDropOverlay: enableDragDropOverlay, passToSearch: passToSearch ? (outputMids) => {
|
|
56
56
|
if (onDcmtTypeSelect)
|
|
@@ -66,13 +66,13 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
|
|
|
66
66
|
'tmDcmtForm': true,
|
|
67
67
|
'tmBlog': false,
|
|
68
68
|
'tmSysMetadata': false,
|
|
69
|
-
'tmDcmtPreview':
|
|
69
|
+
'tmDcmtPreview': !isSharedArchive,
|
|
70
70
|
};
|
|
71
71
|
const initialPanelDimensions = {
|
|
72
72
|
'tmTreeSelector': { width: '20%', height: '100%' },
|
|
73
73
|
'tmRecentsManager': { width: '20%', height: '100%' },
|
|
74
74
|
'tmForm': { width: '60%', height: '100%' },
|
|
75
|
-
'tmDcmtForm': { width: '25%', height: '100%' },
|
|
75
|
+
'tmDcmtForm': { width: isSharedArchive ? '50%' : '25%', height: '100%' },
|
|
76
76
|
'tmBlog': { width: '25%', height: '100%' },
|
|
77
77
|
'tmSysMetadata': { width: '25%', height: '100%' },
|
|
78
78
|
'tmDcmtPreview': { width: '25%', height: '100%' },
|
|
@@ -114,15 +114,15 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
|
|
|
114
114
|
{
|
|
115
115
|
id: 'tmDcmtPreview',
|
|
116
116
|
name: SDKUI_Localizator.PreviewDocument,
|
|
117
|
-
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible: false, orderNumber: 7, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
|
|
117
|
+
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible: false, disabled: isSharedArchive, orderNumber: 7, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
|
|
118
118
|
}
|
|
119
119
|
]
|
|
120
120
|
},
|
|
121
|
-
], [tmTreeSelectorElement, tmRecentsManagerElement, tmFormElement, currentTID, mruTIDs]);
|
|
121
|
+
], [tmTreeSelectorElement, tmRecentsManagerElement, tmFormElement, currentTID, mruTIDs, isSharedArchive]);
|
|
122
122
|
return (_jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmRecentsManager', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }));
|
|
123
123
|
};
|
|
124
124
|
export default TMArchive;
|
|
125
|
-
const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
|
|
125
|
+
const TMTreeSelectorWrapper = ({ isMobile, isSharedArchive, onSelectedTIDChanged }) => {
|
|
126
126
|
const { setPanelVisibilityById, toggleMaximize, setToolbarButtonVisibility, countVisibleLeafPanels } = useTMPanelManagerContext();
|
|
127
127
|
return (_jsx(TMTreeSelector, { layoutMode: LayoutModes.Ark, onClosePanel: !isMobile && countVisibleLeafPanels() > 1 ? () => setPanelVisibilityById('tmTreeSelector', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: !isMobile && countVisibleLeafPanels() > 1 ? () => toggleMaximize("tmTreeSelector") : undefined, onSelectedTIDChanged: (tid) => {
|
|
128
128
|
onSelectedTIDChanged?.(tid);
|
|
@@ -130,21 +130,27 @@ const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
|
|
|
130
130
|
setPanelVisibilityById('tmDcmtForm', true);
|
|
131
131
|
else {
|
|
132
132
|
setPanelVisibilityById('tmDcmtForm', true);
|
|
133
|
-
|
|
133
|
+
if (!isSharedArchive) {
|
|
134
|
+
setPanelVisibilityById('tmDcmtPreview', true);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (!isSharedArchive) {
|
|
138
|
+
setToolbarButtonVisibility('tmDcmtPreview', true);
|
|
134
139
|
}
|
|
135
|
-
setToolbarButtonVisibility('tmDcmtPreview', true);
|
|
136
140
|
setToolbarButtonVisibility('tmDcmtForm', true);
|
|
137
141
|
} }));
|
|
138
142
|
};
|
|
139
|
-
const TMRecentsManagerWrapper = ({ mruTIDs, currentTID, currentMruTID, deviceType, onSelectedTID, onDeletedTID }) => {
|
|
143
|
+
const TMRecentsManagerWrapper = ({ mruTIDs, currentTID, currentMruTID, deviceType, isSharedArchive, onSelectedTID, onDeletedTID }) => {
|
|
140
144
|
const { setPanelVisibilityById, setToolbarButtonVisibility } = useTMPanelManagerContext();
|
|
141
145
|
useEffect(() => {
|
|
142
146
|
if (currentTID) {
|
|
143
147
|
setPanelVisibilityById('tmDcmtForm', true);
|
|
144
|
-
|
|
148
|
+
if (!isSharedArchive) {
|
|
149
|
+
setToolbarButtonVisibility('tmDcmtPreview', true);
|
|
150
|
+
}
|
|
145
151
|
setToolbarButtonVisibility('tmDcmtForm', true);
|
|
146
152
|
}
|
|
147
|
-
}, [currentTID]);
|
|
153
|
+
}, [currentTID, isSharedArchive]);
|
|
148
154
|
return (_jsx(TMRecentsManager, { accessFilter: 'canArchive', mruTIDs: mruTIDs, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: (tid) => {
|
|
149
155
|
onSelectedTID?.(tid);
|
|
150
156
|
if (deviceType === DeviceType.MOBILE) {
|
|
@@ -152,9 +158,13 @@ const TMRecentsManagerWrapper = ({ mruTIDs, currentTID, currentMruTID, deviceTyp
|
|
|
152
158
|
}
|
|
153
159
|
else {
|
|
154
160
|
setPanelVisibilityById('tmDcmtForm', true);
|
|
155
|
-
|
|
161
|
+
if (!isSharedArchive) {
|
|
162
|
+
setPanelVisibilityById('tmDcmtPreview', true);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (!isSharedArchive) {
|
|
166
|
+
setToolbarButtonVisibility('tmDcmtPreview', true);
|
|
156
167
|
}
|
|
157
|
-
setToolbarButtonVisibility('tmDcmtPreview', true);
|
|
158
168
|
setToolbarButtonVisibility('tmDcmtForm', true);
|
|
159
169
|
}, onDeletedTID: (tid) => {
|
|
160
170
|
onDeletedTID?.(tid);
|
|
@@ -52,12 +52,14 @@ export interface TMRelationViewerProps {
|
|
|
52
52
|
onDocumentDoubleClick?: (tid: number, did: number, name?: string) => void;
|
|
53
53
|
/** Custom item renderer (full control). Return undefined to use default renderer. */
|
|
54
54
|
customItemRender?: (item: RelationTreeItem | null) => JSX.Element | undefined;
|
|
55
|
-
/** Custom container style function */
|
|
56
|
-
customContainerStyle?: (item: RelationTreeItem) => React.CSSProperties;
|
|
57
55
|
/** Custom document style function */
|
|
58
56
|
customDocumentStyle?: (item: RelationTreeItem) => React.CSSProperties;
|
|
59
|
-
/**
|
|
60
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Custom content renderer for the main container (when showMainDocument is false).
|
|
59
|
+
* Allows full control over the main container rendering including style and content.
|
|
60
|
+
* This replaces only the main container content, not the detail containers.
|
|
61
|
+
*/
|
|
62
|
+
customMainContainerContent?: (item: RelationTreeItem, defaultContent: JSX.Element) => JSX.Element;
|
|
61
63
|
/** Custom document content renderer (partial control - replaces only metadata display) */
|
|
62
64
|
customDocumentContent?: (item: RelationTreeItem, defaultMetadataContent: JSX.Element) => JSX.Element;
|
|
63
65
|
/**
|
|
@@ -80,6 +82,16 @@ export interface TMRelationViewerProps {
|
|
|
80
82
|
* Can include a separator item by marking it with `isSeparator: true`.
|
|
81
83
|
*/
|
|
82
84
|
additionalStaticItems?: RelationTreeItem[];
|
|
85
|
+
/**
|
|
86
|
+
* If false, hides the main document node and shows detail containers directly under the main container.
|
|
87
|
+
* Default: true (show main document as intermediate node)
|
|
88
|
+
*/
|
|
89
|
+
showMainDocument?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Custom label for the main container when showMainDocument is false.
|
|
92
|
+
* If not provided, uses the document type name.
|
|
93
|
+
*/
|
|
94
|
+
labelMainContainer?: string;
|
|
83
95
|
}
|
|
84
96
|
/**
|
|
85
97
|
* Check if document type has detail relations
|
|
@@ -9,9 +9,6 @@ import { TMWaitPanel } from '../../base/TMWaitPanel';
|
|
|
9
9
|
import { TMUserIdViewer } from '../../choosers/TMUserChooser';
|
|
10
10
|
import TMDataListItemViewer from '../../viewers/TMDataListItemViewer';
|
|
11
11
|
import TMDcmtIcon from './TMDcmtIcon';
|
|
12
|
-
// ============================================================================
|
|
13
|
-
// UTILITY FUNCTIONS
|
|
14
|
-
// ============================================================================
|
|
15
12
|
/**
|
|
16
13
|
* Check if document type has detail relations
|
|
17
14
|
*/
|
|
@@ -139,7 +136,7 @@ export const searchResultToDataSource = async (searchResult, hideSysMetadata) =>
|
|
|
139
136
|
}
|
|
140
137
|
return output;
|
|
141
138
|
};
|
|
142
|
-
const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndicator = true, allowShowZeroDcmts = true, initialShowZeroDcmts = false, allowedTIDs, allowMultipleSelection = false, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onDocumentDoubleClick, customItemRender,
|
|
139
|
+
const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndicator = true, allowShowZeroDcmts = true, initialShowZeroDcmts = false, allowedTIDs, allowMultipleSelection = false, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onDocumentDoubleClick, customItemRender, customDocumentStyle, customMainContainerContent, customDocumentContent, showMetadataNames = false, maxDepthLevel = 2, invertMasterNavigation = true, additionalStaticItems = [], showMainDocument = true, labelMainContainer, }) => {
|
|
143
140
|
// State
|
|
144
141
|
const [dcmtTypes, setDcmtTypes] = useState([]);
|
|
145
142
|
const [treeData, setTreeData] = useState([]);
|
|
@@ -395,48 +392,72 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
395
392
|
const relatedDocs = isForMaster
|
|
396
393
|
? await getMasterDcmtsAsync(dcmt.TID, dcmt.DID, maxDepthLevel)
|
|
397
394
|
: await getDetailDcmtsAsync(dcmt.TID, dcmt.DID, maxDepthLevel);
|
|
398
|
-
//
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
395
|
+
// Se showMainDocument è false, mostra i container dei dettagli direttamente sotto il container principale
|
|
396
|
+
if (!showMainDocument) {
|
|
397
|
+
// Create type container that contains detail containers directly
|
|
398
|
+
const typeContainer = {
|
|
399
|
+
key: `${isForMaster ? 'detail' : 'master'}-type-${dcmt.TID}-${containerGUID}`,
|
|
400
|
+
name: labelMainContainer || result?.fromName || dtd?.name || `TID: ${dcmt.TID}`,
|
|
401
|
+
tid: dcmt.TID,
|
|
402
|
+
dtd,
|
|
403
|
+
isContainer: true,
|
|
404
|
+
isRoot: true,
|
|
405
|
+
isLoaded: true,
|
|
406
|
+
isZero: false,
|
|
407
|
+
searchResult: result ? [result] : [],
|
|
408
|
+
items: relatedDocs, // Directly show detail containers
|
|
409
|
+
itemsCount: relatedDocs.length,
|
|
410
|
+
expanded: tree.length === 0,
|
|
411
|
+
hidden: false
|
|
412
|
+
};
|
|
413
|
+
tree.push(typeContainer);
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
// MODALITÀ ORIGINALE: mostra il documento master come nodo intermedio
|
|
417
|
+
// Create document node WITH VALUES
|
|
418
|
+
const docNode = {
|
|
419
|
+
key: `${isForMaster ? 'detail' : 'master'}-doc-${dcmt.TID}-${dcmt.DID}-${containerGUID}`,
|
|
420
|
+
name: docRow?.SYS_Abstract?.value || docRow?.SYS_SUBJECT?.value || `Documento ${isForMaster ? 'Dettaglio' : 'Master'}`,
|
|
421
|
+
tid: dcmt.TID,
|
|
422
|
+
did: dcmt.DID,
|
|
423
|
+
isDcmt: true,
|
|
424
|
+
isContainer: false,
|
|
425
|
+
expanded: tree.length === 0,
|
|
426
|
+
isZero: dcmt.DID === 0,
|
|
427
|
+
isMaster: !isForMaster,
|
|
428
|
+
isRoot: true,
|
|
429
|
+
isLoaded: true,
|
|
430
|
+
hidden: false,
|
|
431
|
+
values: docRow,
|
|
432
|
+
searchResult: result ? [result] : [],
|
|
433
|
+
items: relatedDocs,
|
|
434
|
+
itemsCount: relatedDocs.length
|
|
435
|
+
};
|
|
436
|
+
// Create type container with unique key
|
|
437
|
+
const typeContainer = {
|
|
438
|
+
key: `${isForMaster ? 'detail' : 'master'}-type-${dcmt.TID}-${containerGUID}`,
|
|
439
|
+
name: labelMainContainer || result?.fromName || dtd?.name || `TID: ${dcmt.TID}`,
|
|
440
|
+
tid: dcmt.TID,
|
|
441
|
+
dtd,
|
|
442
|
+
isContainer: true,
|
|
443
|
+
isRoot: true,
|
|
444
|
+
isLoaded: true,
|
|
445
|
+
isZero: false, // Type container is never zero (contains documents)
|
|
446
|
+
searchResult: result ? [result] : [],
|
|
447
|
+
items: [docNode],
|
|
448
|
+
itemsCount: 1,
|
|
449
|
+
expanded: tree.length === 0,
|
|
450
|
+
hidden: false
|
|
451
|
+
};
|
|
452
|
+
tree.push(typeContainer);
|
|
453
|
+
}
|
|
433
454
|
}
|
|
434
455
|
// Update progress counter
|
|
435
456
|
processedCount++;
|
|
436
457
|
setWaitPanelValuePrimary(processedCount);
|
|
437
458
|
}
|
|
438
459
|
setTreeData(updateHiddenProperty(tree));
|
|
439
|
-
}, [inputDcmts, dcmtTypes, maxDepthLevel, isForMaster, invertMasterNavigation, getDetailDcmtsAsync, getMasterDcmtsAsync, abortController, updateHiddenProperty]);
|
|
460
|
+
}, [inputDcmts, dcmtTypes, maxDepthLevel, isForMaster, invertMasterNavigation, getDetailDcmtsAsync, getMasterDcmtsAsync, abortController, updateHiddenProperty, showMainDocument, labelMainContainer]);
|
|
440
461
|
/**
|
|
441
462
|
* Merge main tree data with additional static items
|
|
442
463
|
*/
|
|
@@ -587,19 +608,20 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
587
608
|
opacity: item.isZero ? 0.4 : 1,
|
|
588
609
|
transition: 'opacity 0.2s ease-in-out'
|
|
589
610
|
};
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
611
|
+
// Se è il container principale (root) e showMainDocument è false,
|
|
612
|
+
// non mostrare il badge perché conterrebbe il numero di sotto-container, non di documenti
|
|
613
|
+
const shouldShowBadge = !(item.isRoot && !showMainDocument);
|
|
593
614
|
const defaultContent = (_jsxs(_Fragment, { children: [_jsx("div", { style: { position: 'relative' }, children: _jsx(IconFolder, { color: item.isManyToMany ? '#ff8f44' : TMColors.iconLight, fontSize: 24 }) }), _jsxs(StyledDivHorizontal, { style: { gap: 5, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }, children: [_jsx("p", { style: {
|
|
594
615
|
whiteSpace: 'nowrap',
|
|
595
616
|
textOverflow: 'ellipsis',
|
|
596
617
|
fontSize: '1rem',
|
|
597
618
|
color: 'inherit'
|
|
598
|
-
}, children: item.name }), _jsx(StyledBadge, { "$backgroundColor": TMColors.info, children: item.items?.length ?? 0 })] })] }));
|
|
599
|
-
|
|
600
|
-
|
|
619
|
+
}, children: item.name }), shouldShowBadge && (_jsx(StyledBadge, { "$backgroundColor": TMColors.info, children: item.items?.length ?? 0 }))] })] }));
|
|
620
|
+
// Se è il container principale (root) e abbiamo un custom renderer, usalo
|
|
621
|
+
const content = (item.isRoot && customMainContainerContent)
|
|
622
|
+
? customMainContainerContent(item, defaultContent)
|
|
601
623
|
: defaultContent;
|
|
602
|
-
return (_jsx("div", { style:
|
|
624
|
+
return (_jsx("div", { style: defaultContainerStyle, children: content }));
|
|
603
625
|
}
|
|
604
626
|
// Document rendering with full metadata display
|
|
605
627
|
const defaultDocumentStyle = {
|
|
@@ -645,7 +667,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
645
667
|
? customDocumentContent(item, defaultMetadataContent || _jsx(_Fragment, {}))
|
|
646
668
|
: defaultMetadataContent;
|
|
647
669
|
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] }));
|
|
648
|
-
}, [onDocumentDoubleClick, showCurrentDcmtIndicator, inputDcmts,
|
|
670
|
+
}, [onDocumentDoubleClick, showCurrentDcmtIndicator, inputDcmts, customMainContainerContent, customDocumentStyle, customDocumentContent, showMetadataNames, showMainDocument]);
|
|
649
671
|
/**
|
|
650
672
|
* Wrapper renderer that handles custom rendering if provided
|
|
651
673
|
*/
|
|
@@ -41,6 +41,7 @@ import TMSpinner from '../../base/TMSpinner';
|
|
|
41
41
|
import TMChooserForm from '../../forms/TMChooserForm';
|
|
42
42
|
import TMModal from '../../base/TMModal';
|
|
43
43
|
import TMSearch from './TMSearch';
|
|
44
|
+
import TMArchive from '../archive/TMArchive';
|
|
44
45
|
//#region Helper Methods
|
|
45
46
|
export const getSearchResultCountersSingleCategory = (searchResults) => {
|
|
46
47
|
// let totDcmtTypes = searchResults.length;
|
|
@@ -74,6 +75,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
74
75
|
const [secondaryMasterDcmts, setSecondaryMasterDcmts] = useState([]);
|
|
75
76
|
const [isOpenDcmtForm, setIsOpenDcmtForm] = useState(false);
|
|
76
77
|
const [isOpenBatchUpdate, setIsOpenBatchUpdate] = useState(false);
|
|
78
|
+
const [isOpenSharedArchive, setIsOpenSharedArchive] = useState(false);
|
|
77
79
|
const [visibleItems, setVisibleItems] = useState([]);
|
|
78
80
|
const [focusedItem, setFocusedItem] = useState();
|
|
79
81
|
const [selectedItems, setSelectedItems] = useState([]);
|
|
@@ -147,6 +149,14 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
147
149
|
});
|
|
148
150
|
}, [currentMetadataValues]);
|
|
149
151
|
const openFormHandler = (layoutMode) => { setIsOpenDcmtForm(true); setDcmtFormLayoutMode(layoutMode); };
|
|
152
|
+
const openSharedArchiveHandler = () => {
|
|
153
|
+
const dcmts = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
154
|
+
if (dcmts.length === 0) {
|
|
155
|
+
ShowAlert({ message: "Nessun documento selezionato", mode: "warning", duration: 3000 });
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
setIsOpenSharedArchive(true);
|
|
159
|
+
};
|
|
150
160
|
const openTaskFormHandler = (onTaskCreated) => {
|
|
151
161
|
if (selectedItems.length > 1)
|
|
152
162
|
return;
|
|
@@ -241,7 +251,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
241
251
|
return;
|
|
242
252
|
if (e.target === 'content') {
|
|
243
253
|
e.items = e.items || [];
|
|
244
|
-
const menuItems = getCommandsMenuItems(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation);
|
|
254
|
+
const menuItems = getCommandsMenuItems(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation);
|
|
245
255
|
e.items.push(...menuItems);
|
|
246
256
|
}
|
|
247
257
|
};
|
|
@@ -406,7 +416,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
406
416
|
}
|
|
407
417
|
};
|
|
408
418
|
const searchResutlToolbar = _jsxs(_Fragment, { children: [(dcmtsReturned != dcmtsFound) && _jsx("p", { style: { backgroundColor: `white`, color: TMColors.primaryColor, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${dcmtsReturned}/${dcmtsFound} restituiti` }), context === SearchResultContext.FAVORITES_AND_RECENTS &&
|
|
409
|
-
_jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconDelete, { color: 'white' }), caption: "Rimuovi da " + (selectedSearchResult?.category === "Favorites" ? '"Preferiti"' : '"Recenti"'), disabled: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length <= 0, onClick: removeDcmtFromFavsOrRecents }) }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconRefresh, { color: 'white' }), caption: SDKUI_Localizator.Refresh, onClick: onRefreshSearchAsync }), _jsx(IconMenuVertical, { id: `commands-header-${id}`, color: 'white', cursor: 'pointer' }), _jsx(TMCommandsContextMenu, { target: `#commands-header-${id}`, showEvent: "click", menuItems: getCommandsMenuItems(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation) })] });
|
|
419
|
+
_jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconDelete, { color: 'white' }), caption: "Rimuovi da " + (selectedSearchResult?.category === "Favorites" ? '"Preferiti"' : '"Recenti"'), disabled: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length <= 0, onClick: removeDcmtFromFavsOrRecents }) }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconRefresh, { color: 'white' }), caption: SDKUI_Localizator.Refresh, onClick: onRefreshSearchAsync }), _jsx(IconMenuVertical, { id: `commands-header-${id}`, color: 'white', cursor: 'pointer' }), _jsx(TMCommandsContextMenu, { target: `#commands-header-${id}`, showEvent: "click", menuItems: getCommandsMenuItems(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation) })] });
|
|
410
420
|
const middlePanelToolbar = _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: '10px' }, children: [_jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', isModified: false, iconColor: TMColors.default_background, formMode: FormModes.ReadOnly, canPrev: canNavigateHandler('prev'), onPrev: () => onNavigateHandler('prev') }), _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', isModified: false, iconColor: TMColors.default_background, formMode: FormModes.ReadOnly, canNext: canNavigateHandler('next'), onNext: () => onNavigateHandler('next') })] });
|
|
411
421
|
const handleAddItem = (tid, did) => {
|
|
412
422
|
let newItem = { TID: tid ?? 0, DID: did ?? 0 };
|
|
@@ -423,7 +433,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
423
433
|
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
424
434
|
:
|
|
425
435
|
_jsx(_Fragment, {}), _jsxs(TMLayoutItem, { children: [_jsx(TMSearchResultGrid, { showSearch: showSearch, inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], lastUpdateSearchTime: lastUpdateSearchTime, openInOffice: openInOffice, onDblClick: () => openFormHandler(LayoutModes.Update), onContextMenuPreparing: onContextMenuPreparing, onSelectionChanged: (items) => { setSelectedItems(items); }, onVisibleItemChanged: setVisibleItems, onFocusedItemChanged: setFocusedItem, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync(inputDcmts, downloadType, downloadMode, onFileOpened, confirmAttachments), showExportForm: showExportForm, onCloseExportForm: onCloseExportForm }), allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE &&
|
|
426
|
-
_jsxs(TMFloatingToolbar, { backgroundColor: TMColors.primaryColor, initialLeft: '10px', initialTop: 'calc(100% - 75px)', children: [fromDTD?.perm?.canRetrieveFile === AccessLevels.Yes && _jsx(TMButton, { btnStyle: 'icon', caption: "Download file", disabled: fromDTD?.perm?.canRetrieveFile !== AccessLevels.Yes || !focusedItem?.DID, icon: _jsx(IconDownload, { color: 'white' }), onClick: () => { downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download"); } }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasDetailRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true) }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasMasterRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white', transform: 'scale(-1, 1)' }), caption: SDKUI_Localizator.DcmtsMaster, onClick: () => setIsOpenMaster(true) }), _jsx(IconMenuVertical, { id: `commands-floating-${id}`, color: 'white', cursor: 'pointer' }), _jsx(TMCommandsContextMenu, { target: `#commands-floating-${id}`, showEvent: "click", menuItems: getCommandsMenuItems(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation) })] })] })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { TID: focusedItem?.TID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: onWFOperationCompleted, onClose: () => setShowMoreInfoPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: `${SDKUI_Localizator.BatchUpdate} (${getSelectionDcmtInfo().length} documenti selezionati)`, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
|
|
436
|
+
_jsxs(TMFloatingToolbar, { backgroundColor: TMColors.primaryColor, initialLeft: '10px', initialTop: 'calc(100% - 75px)', children: [fromDTD?.perm?.canRetrieveFile === AccessLevels.Yes && _jsx(TMButton, { btnStyle: 'icon', caption: "Download file", disabled: fromDTD?.perm?.canRetrieveFile !== AccessLevels.Yes || !focusedItem?.DID, icon: _jsx(IconDownload, { color: 'white' }), onClick: () => { downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download"); } }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasDetailRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true) }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasMasterRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white', transform: 'scale(-1, 1)' }), caption: SDKUI_Localizator.DcmtsMaster, onClick: () => setIsOpenMaster(true) }), _jsx(IconMenuVertical, { id: `commands-floating-${id}`, color: 'white', cursor: 'pointer' }), _jsx(TMCommandsContextMenu, { target: `#commands-floating-${id}`, showEvent: "click", menuItems: getCommandsMenuItems(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation) })] })] })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { TID: focusedItem?.TID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: onWFOperationCompleted, onClose: () => setShowMoreInfoPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: `${SDKUI_Localizator.BatchUpdate} (${getSelectionDcmtInfo().length} documenti selezionati)`, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
|
|
427
437
|
setIsOpenBatchUpdate(false);
|
|
428
438
|
}, onSavedCallbackAsync: async () => {
|
|
429
439
|
setIsOpenBatchUpdate(false);
|
|
@@ -596,7 +606,12 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
596
606
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
597
607
|
setArchiveRelatedDcmtFormMids([]);
|
|
598
608
|
await onRefreshSearchAsync?.();
|
|
599
|
-
} })
|
|
609
|
+
} }), isOpenSharedArchive && _jsx(TMModal, { title: "Archiviazione condivisa", onClose: () => {
|
|
610
|
+
setIsOpenSharedArchive(false);
|
|
611
|
+
}, width: isMobile ? '90%' : '80%', height: isMobile ? '90%' : '80%', children: _jsx(TMArchive, { inputTID: focusedItem?.TID, inputMids: currentMetadataValues.filter(md => md.mid && md.mid > 100).map(md => ({ mid: md.mid, value: md.value ?? '' })), isSharedArchive: true, onSavedAsyncCallback: async (tid, did) => {
|
|
612
|
+
setIsOpenSharedArchive(false);
|
|
613
|
+
await onRefreshSearchAsync?.();
|
|
614
|
+
} }) })] }));
|
|
600
615
|
};
|
|
601
616
|
export default TMSearchResult;
|
|
602
617
|
const renderDcmtIcon = (cellData, onDownloadDcmtsAsync, openInOffice) => _jsx(TMDcmtIcon, { tid: cellData.data.TID, did: cellData.data.DID, fileExtension: cellData.data.FILEEXT, fileCount: cellData.data.FILECOUNT, isLexProt: cellData.data.IsLexProt, isMail: cellData.data.ISMAIL, isShared: cellData.data.ISSHARED, isSigned: cellData.data.ISSIGNED, downloadMode: 'openInNewWindow', onDownloadDcmtsAsync: onDownloadDcmtsAsync, openInOffice: openInOffice });
|
|
@@ -4,7 +4,7 @@ import { TMDataGridContextMenuItem } from '../../base/TMDataGrid';
|
|
|
4
4
|
import { DcmtInfo, DcmtOperationTypes, DownloadModes, DownloadTypes, SearchResultContext } from '../../../ts';
|
|
5
5
|
export declare const getSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => DcmtInfo[];
|
|
6
6
|
export declare const signatureInformationCallback: (isMobile: boolean, inputDcmts: DcmtInfo[] | undefined) => Promise<void>;
|
|
7
|
-
export declare const getCommandsMenuItems: (isMobile: boolean, dtd: DcmtTypeDescriptor | undefined, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, workingGroupContext: WorkingGroupDescriptor | undefined, showSearch: boolean, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>) => 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, 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<{
|
|
7
|
+
export declare const getCommandsMenuItems: (isMobile: boolean, dtd: DcmtTypeDescriptor | undefined, 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: () => void, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>) => 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, 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
8
|
mid: number;
|
|
9
9
|
value: string;
|
|
10
10
|
}>) => 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) => Array<TMDataGridContextMenuItem>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { AccessLevels, AccessLevelsEx, AppModules, FileFormats, LayoutModes, SDK_Globals, DcmtTypeListCacheService, LicenseModuleStatus } from '@topconsultnpm/sdk-ts';
|
|
3
|
-
import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCheckIn, IconCircleInfo, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconEdit, IconExportTo, IconFileDots, IconHide, IconInfo, IconMenuCAArchive, IconPlatform, IconPreview, IconRelation, IconSearch, IconShow, IconStar, IconSubstFile, IconUndo, IconUserGroupOutline, SDKUI_Localizator, svgToString, searchResultToMetadataValues, IconSignaturePencil, IconArchiveMaster, IconArchiveDetail, IconDetailDcmts, isPdfEditorEnabled, IconPair, IconUnpair } from '../../../helper';
|
|
3
|
+
import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCheckIn, IconCircleInfo, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconEdit, IconExportTo, IconFileDots, IconHide, IconInfo, IconMenuCAArchive, IconPlatform, IconPreview, IconRelation, IconSearch, IconShow, IconStar, IconSubstFile, IconUndo, IconUserGroupOutline, SDKUI_Localizator, svgToString, searchResultToMetadataValues, IconSignaturePencil, IconArchiveMaster, IconArchiveDetail, IconDetailDcmts, isPdfEditorEnabled, IconPair, IconUnpair, IconSharedDcmt } from '../../../helper';
|
|
4
4
|
import ShowAlert from '../../base/TMAlert';
|
|
5
5
|
import { TMMessageBoxManager, ButtonNames, TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
6
6
|
import TMSpinner from '../../base/TMSpinner';
|
|
@@ -75,7 +75,7 @@ export const signatureInformationCallback = async (isMobile, inputDcmts) => {
|
|
|
75
75
|
TMExceptionBoxManager.show({ exception: error });
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
|
-
export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, hasMasterRelation, hasDetailRelation, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToManyDocuments, hasManyToManyRelation) => {
|
|
78
|
+
export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, hasMasterRelation, hasDetailRelation, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToManyDocuments, hasManyToManyRelation) => {
|
|
79
79
|
const isPdfEditorLicensed = SDK_Globals?.license?.dcmtArchiveLicenses?.[0]?.siX_60007?.status === LicenseModuleStatus.Licensed;
|
|
80
80
|
let pdfEditorAvailable = false;
|
|
81
81
|
if (dtd && dtd.widgets && dtd.widgets.length > 0) {
|
|
@@ -394,6 +394,30 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
394
394
|
]
|
|
395
395
|
};
|
|
396
396
|
};
|
|
397
|
+
const sharedDcmtsMenuItem = () => {
|
|
398
|
+
return {
|
|
399
|
+
icon: svgToString(_jsx(IconSharedDcmt, {})),
|
|
400
|
+
text: 'Documenti Condivisi',
|
|
401
|
+
operationType: 'multiRow',
|
|
402
|
+
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
403
|
+
items: [
|
|
404
|
+
{
|
|
405
|
+
icon: svgToString(_jsx(IconSharedDcmt, {})),
|
|
406
|
+
text: "Archiviazione condivisa",
|
|
407
|
+
operationType: 'singleRow',
|
|
408
|
+
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
409
|
+
onClick: () => { openSharedArchiveHandler(); }
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
icon: svgToString(_jsx(IconSharedDcmt, {})),
|
|
413
|
+
text: "Mostra documenti condivisi",
|
|
414
|
+
operationType: 'multiRow',
|
|
415
|
+
disabled: !hasManyToManyRelation || disabledForMultiRow(selectedItems, focusedItem),
|
|
416
|
+
onClick: () => ShowAlert({ message: "TODO Mostra documenti condivisi", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
417
|
+
}
|
|
418
|
+
]
|
|
419
|
+
};
|
|
420
|
+
};
|
|
397
421
|
/* const shareMenuItem = (): TMDataGridContextMenuItem => {
|
|
398
422
|
return {
|
|
399
423
|
icon: svgToString(<IconShare />),
|
|
@@ -627,6 +651,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
627
651
|
signatureMenuItem(),
|
|
628
652
|
// checkinMenuItem(),
|
|
629
653
|
relationsMenuItem(),
|
|
654
|
+
sharedDcmtsMenuItem(),
|
|
630
655
|
// shareMenuItem(),
|
|
631
656
|
fullTextSearchMenuItem(),
|
|
632
657
|
otherMenuItem(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InvoiceRetrieveFormats, OrderRetrieveFormats } from "@topconsultnpm/sdk-ts";
|
|
1
|
+
import { InvoiceRetrieveFormats, ObjectClasses, OrderRetrieveFormats } from "@topconsultnpm/sdk-ts";
|
|
2
2
|
export declare const dcmtsFileCacheDownload: Map<string, File>;
|
|
3
3
|
export declare const dcmtsFileCachePreview: Map<string, File>;
|
|
4
4
|
export declare const CACHE_SIZE_LIMIT = 10;
|
|
@@ -44,6 +44,7 @@ export declare class ThemeSettings {
|
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
export declare class SearchSettings {
|
|
47
|
+
autoFindReferences: ObjectClasses[];
|
|
47
48
|
invoiceRetrieveFormat: InvoiceRetrieveFormats;
|
|
48
49
|
orderRetrieveFormat: OrderRetrieveFormats;
|
|
49
50
|
mruTIDs: number[];
|
|
@@ -87,6 +87,7 @@ export class ThemeSettings {
|
|
|
87
87
|
}
|
|
88
88
|
export class SearchSettings {
|
|
89
89
|
constructor() {
|
|
90
|
+
this.autoFindReferences = [];
|
|
90
91
|
this.invoiceRetrieveFormat = InvoiceRetrieveFormats.ASW_HTML;
|
|
91
92
|
this.orderRetrieveFormat = OrderRetrieveFormats.NSO_HTML;
|
|
92
93
|
this.mruTIDs = [];
|