@topconsultnpm/sdkui-react 6.19.0-dev1.5 → 6.19.0-dev1.50
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/base/Styled.d.ts +1 -0
- package/lib/components/base/Styled.js +40 -0
- package/lib/components/base/TMFileManagerDataGridView.js +4 -1
- package/lib/components/base/TMTreeView.js +3 -2
- package/lib/components/editors/TMHtmlEditor.d.ts +5 -0
- package/lib/components/editors/TMHtmlEditor.js +72 -12
- package/lib/components/editors/TMMetadataValues.js +90 -40
- package/lib/components/features/archive/TMArchive.d.ts +2 -0
- package/lib/components/features/archive/TMArchive.js +56 -25
- package/lib/components/features/blog/TMBlogCommentForm.js +57 -41
- package/lib/components/features/documents/TMDcmtForm.d.ts +10 -3
- package/lib/components/features/documents/TMDcmtForm.js +134 -36
- package/lib/components/features/documents/TMDragDropOverlay.js +2 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.js +1 -1
- package/lib/components/features/documents/TMRelationViewer.d.ts +53 -3
- package/lib/components/features/documents/TMRelationViewer.js +232 -85
- package/lib/components/features/search/TMSearch.d.ts +3 -1
- package/lib/components/features/search/TMSearch.js +13 -4
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -1
- package/lib/components/features/search/TMSearchQueryPanel.js +36 -7
- package/lib/components/features/search/TMSearchResult.d.ts +3 -1
- package/lib/components/features/search/TMSearchResult.js +102 -328
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -2
- package/lib/components/features/search/TMSearchResultsMenuItems.js +32 -15
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +3 -1
- package/lib/components/features/workflow/TMWorkflowPopup.js +17 -4
- package/lib/components/forms/TMChooserForm.d.ts +1 -1
- package/lib/components/forms/TMChooserForm.js +2 -2
- package/lib/components/grids/TMBlogsUtils.d.ts +1 -0
- package/lib/components/grids/TMBlogsUtils.js +40 -4
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.js +3 -0
- package/lib/components/viewers/TMTidViewer.js +29 -4
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +2 -1
- package/lib/helper/SDKUI_Globals.js +1 -0
- package/lib/helper/SDKUI_Localizator.d.ts +4 -0
- package/lib/helper/SDKUI_Localizator.js +46 -0
- package/lib/helper/TMIcons.d.ts +2 -0
- package/lib/helper/TMIcons.js +6 -0
- package/lib/helper/TMToppyMessage.d.ts +7 -0
- package/lib/helper/TMToppyMessage.js +42 -0
- package/lib/helper/TMUtils.d.ts +7 -0
- package/lib/helper/TMUtils.js +16 -0
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useRelatedDocuments.d.ts +72 -0
- package/lib/hooks/useRelatedDocuments.js +655 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/ts/types.d.ts +14 -0
- package/lib/ts/types.js +15 -0
- package/lib/utils/theme.d.ts +1 -0
- package/lib/utils/theme.js +1 -0
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { DcmtTypeListCacheService, SDK_Globals, DataColumnTypes, MetadataFormats, SystemMIDs, MetadataDataDomains, RelationCacheService, RelationTypes } from "@topconsultnpm/sdk-ts";
|
|
4
|
-
import { genUniqueId,
|
|
4
|
+
import { genUniqueId, IconFolder, IconBackhandIndexPointingRight } from '../../../helper';
|
|
5
5
|
import { TMColors } from '../../../utils/theme';
|
|
6
6
|
import { StyledDivHorizontal, StyledBadge } from '../../base/Styled';
|
|
7
7
|
import TMTreeView from '../../base/TMTreeView';
|
|
@@ -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
|
*/
|
|
@@ -47,26 +44,32 @@ const isManyToManyRelation = async (relationID) => {
|
|
|
47
44
|
/**
|
|
48
45
|
* Get metadata keys excluding system metadata
|
|
49
46
|
*/
|
|
50
|
-
|
|
47
|
+
export const getMetadataKeys = (obj) => {
|
|
51
48
|
if (!obj)
|
|
52
49
|
return [];
|
|
53
50
|
const keys = Object.keys(obj);
|
|
51
|
+
// Escludi metadati di sistema (MID < 100 che sono uppercase) e altri campi tecnici
|
|
54
52
|
const sysMIDs = Object.values(SystemMIDs).map(o => o.toUpperCase());
|
|
55
53
|
return keys.filter(k => obj?.[k].value && !sysMIDs.includes(k)).filter(o => o !== "rowIndex" && o !== "ISLEXPROT");
|
|
56
|
-
}
|
|
54
|
+
};
|
|
57
55
|
/**
|
|
58
56
|
* Get display value keys for a document (max 5, prioritize SYS_Abstract)
|
|
59
57
|
*/
|
|
60
|
-
|
|
58
|
+
export const getDcmtDisplayValue = (obj) => {
|
|
59
|
+
if (!obj)
|
|
60
|
+
return [];
|
|
61
|
+
// Prima cerca SYS_Abstract
|
|
62
|
+
if (obj['SYS_Abstract']?.value) {
|
|
63
|
+
return ['SYS_Abstract'];
|
|
64
|
+
}
|
|
65
|
+
// Altrimenti prendi i primi 5 metadati non di sistema
|
|
61
66
|
const mdKeys = getMetadataKeys(obj);
|
|
62
|
-
if (mdKeys.includes("SYS_Abstract"))
|
|
63
|
-
return ["SYS_Abstract"];
|
|
64
67
|
return mdKeys.slice(0, 5);
|
|
65
|
-
}
|
|
68
|
+
};
|
|
66
69
|
/**
|
|
67
70
|
* Get display value formatted by column type
|
|
68
71
|
*/
|
|
69
|
-
const getDisplayValueByColumn = (col, value) => {
|
|
72
|
+
export const getDisplayValueByColumn = (col, value) => {
|
|
70
73
|
if (!value)
|
|
71
74
|
return value;
|
|
72
75
|
if (!col)
|
|
@@ -107,7 +110,7 @@ const getDisplayValueByColumn = (col, value) => {
|
|
|
107
110
|
/**
|
|
108
111
|
* Convert SearchResultDescriptor to structured data source with metadata
|
|
109
112
|
*/
|
|
110
|
-
const searchResultToDataSource = async (searchResult, hideSysMetadata) => {
|
|
113
|
+
export const searchResultToDataSource = async (searchResult, hideSysMetadata) => {
|
|
111
114
|
const rows = searchResult?.dtdResult?.rows ?? [];
|
|
112
115
|
const tid = searchResult?.fromTID;
|
|
113
116
|
const dtd = await DcmtTypeListCacheService.GetAsync(tid);
|
|
@@ -133,11 +136,12 @@ const searchResultToDataSource = async (searchResult, hideSysMetadata) => {
|
|
|
133
136
|
}
|
|
134
137
|
return output;
|
|
135
138
|
};
|
|
136
|
-
const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndicator = true, allowShowZeroDcmts = true, initialShowZeroDcmts = false, allowedTIDs, allowMultipleSelection = false, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onDocumentDoubleClick, customItemRender, maxDepthLevel = 2, invertMasterNavigation = true, }) => {
|
|
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, }) => {
|
|
137
140
|
// State
|
|
138
141
|
const [dcmtTypes, setDcmtTypes] = useState([]);
|
|
139
142
|
const [treeData, setTreeData] = useState([]);
|
|
140
143
|
const [showZeroDcmts, setShowZeroDcmts] = useState(initialShowZeroDcmts);
|
|
144
|
+
const [staticItemsState, setStaticItemsState] = useState([]);
|
|
141
145
|
// Wait Panel State (only used if allowWaitPanel is true)
|
|
142
146
|
const [showWaitPanel, setShowWaitPanel] = useState(false);
|
|
143
147
|
const [waitPanelTextPrimary, setWaitPanelTextPrimary] = useState('');
|
|
@@ -146,6 +150,8 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
146
150
|
const [abortController] = useState(new AbortController());
|
|
147
151
|
// Ref to track last loaded input to prevent unnecessary reloads
|
|
148
152
|
const lastLoadedInputRef = React.useRef('');
|
|
153
|
+
// Ref to track if user has manually expanded/collapsed static items
|
|
154
|
+
const userInteractedWithStaticItemsRef = React.useRef(false);
|
|
149
155
|
/**
|
|
150
156
|
* Generate a stable key from inputDcmts to detect real changes
|
|
151
157
|
*/
|
|
@@ -386,48 +392,86 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
386
392
|
const relatedDocs = isForMaster
|
|
387
393
|
? await getMasterDcmtsAsync(dcmt.TID, dcmt.DID, maxDepthLevel)
|
|
388
394
|
: await getDetailDcmtsAsync(dcmt.TID, dcmt.DID, maxDepthLevel);
|
|
389
|
-
//
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
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
|
-
|
|
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
|
+
}
|
|
424
454
|
}
|
|
425
455
|
// Update progress counter
|
|
426
456
|
processedCount++;
|
|
427
457
|
setWaitPanelValuePrimary(processedCount);
|
|
428
458
|
}
|
|
429
459
|
setTreeData(updateHiddenProperty(tree));
|
|
430
|
-
}, [inputDcmts, dcmtTypes, maxDepthLevel, isForMaster, invertMasterNavigation, getDetailDcmtsAsync, getMasterDcmtsAsync, abortController, updateHiddenProperty]);
|
|
460
|
+
}, [inputDcmts, dcmtTypes, maxDepthLevel, isForMaster, invertMasterNavigation, getDetailDcmtsAsync, getMasterDcmtsAsync, abortController, updateHiddenProperty, showMainDocument, labelMainContainer]);
|
|
461
|
+
/**
|
|
462
|
+
* Merge main tree data with additional static items
|
|
463
|
+
*/
|
|
464
|
+
const mergedTreeData = useMemo(() => {
|
|
465
|
+
if (!additionalStaticItems || additionalStaticItems.length === 0) {
|
|
466
|
+
return treeData;
|
|
467
|
+
}
|
|
468
|
+
// Use staticItemsState if available (preserves expanded state), otherwise use fresh additionalStaticItems
|
|
469
|
+
const itemsToMerge = staticItemsState.length > 0 ? staticItemsState : additionalStaticItems;
|
|
470
|
+
// Append additional static items at the end
|
|
471
|
+
// NOTE: Do NOT call updateHiddenProperty on static items - they are pre-processed by the parent
|
|
472
|
+
// and may contain custom properties that would be lost by the spread operator
|
|
473
|
+
return [...treeData, ...itemsToMerge];
|
|
474
|
+
}, [treeData, additionalStaticItems, staticItemsState]);
|
|
431
475
|
/**
|
|
432
476
|
* Load data when inputs change
|
|
433
477
|
*/
|
|
@@ -435,6 +479,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
435
479
|
if (!inputDcmts || inputDcmts.length === 0 || dcmtTypes.length === 0) {
|
|
436
480
|
setTreeData([]);
|
|
437
481
|
lastLoadedInputRef.current = '';
|
|
482
|
+
userInteractedWithStaticItemsRef.current = false; // Reset interaction flag
|
|
438
483
|
return;
|
|
439
484
|
}
|
|
440
485
|
// Generate current input key
|
|
@@ -445,6 +490,8 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
445
490
|
}
|
|
446
491
|
// Mark as loading this key
|
|
447
492
|
lastLoadedInputRef.current = currentKey;
|
|
493
|
+
// Reset interaction flag when loading new data
|
|
494
|
+
userInteractedWithStaticItemsRef.current = false;
|
|
448
495
|
setShowWaitPanel(true);
|
|
449
496
|
setWaitPanelMaxValuePrimary(inputDcmts.length);
|
|
450
497
|
setWaitPanelValuePrimary(0);
|
|
@@ -462,10 +509,51 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
462
509
|
useEffect(() => {
|
|
463
510
|
setTreeData(prevData => updateHiddenProperty(prevData));
|
|
464
511
|
}, [showZeroDcmts, updateHiddenProperty]);
|
|
512
|
+
/**
|
|
513
|
+
* Sync static items state when additionalStaticItems change
|
|
514
|
+
* IMPORTANT: Only update if user hasn't manually interacted with the tree,
|
|
515
|
+
* to preserve expand/collapse state
|
|
516
|
+
*/
|
|
517
|
+
useEffect(() => {
|
|
518
|
+
// If user hasn't interacted yet, sync with incoming additionalStaticItems
|
|
519
|
+
if (!userInteractedWithStaticItemsRef.current) {
|
|
520
|
+
setStaticItemsState(additionalStaticItems || []);
|
|
521
|
+
}
|
|
522
|
+
// If user has interacted, we need to merge the new data with existing state
|
|
523
|
+
// to preserve expanded/collapsed state while updating content
|
|
524
|
+
else if (additionalStaticItems && additionalStaticItems.length > 0) {
|
|
525
|
+
setStaticItemsState(prevState => {
|
|
526
|
+
// Create a map of existing state by key
|
|
527
|
+
const stateMap = new Map(prevState.map(item => [item.key, item]));
|
|
528
|
+
// Merge: use existing state if available (preserves expanded), otherwise use new item
|
|
529
|
+
return additionalStaticItems.map(newItem => {
|
|
530
|
+
const existingItem = stateMap.get(newItem.key);
|
|
531
|
+
if (existingItem) {
|
|
532
|
+
// Preserve expanded state but update content
|
|
533
|
+
return {
|
|
534
|
+
...newItem,
|
|
535
|
+
expanded: existingItem.expanded,
|
|
536
|
+
items: newItem.items // Always use fresh items from parent
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
return newItem;
|
|
540
|
+
});
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
}, [additionalStaticItems]);
|
|
465
544
|
/**
|
|
466
545
|
* Calculate items for node when expanded (lazy loading)
|
|
546
|
+
* Note: additionalStaticItems are already fully loaded, so skip calculation for them
|
|
467
547
|
*/
|
|
468
548
|
const calculateItemsForNode = useCallback(async (node) => {
|
|
549
|
+
// Skip calculation for separator (it has no children)
|
|
550
|
+
if (node.isSeparator) {
|
|
551
|
+
return undefined;
|
|
552
|
+
}
|
|
553
|
+
// Skip calculation for additional static items (they're pre-loaded and should not trigger dynamic loading)
|
|
554
|
+
if (node.isStaticItem || node.isAdditionalContainer || node.isAdditional) {
|
|
555
|
+
return node.items;
|
|
556
|
+
}
|
|
469
557
|
// If it's a document, return existing items
|
|
470
558
|
if (node.isDcmt)
|
|
471
559
|
return node.items;
|
|
@@ -511,45 +599,92 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
511
599
|
};
|
|
512
600
|
// Container rendering
|
|
513
601
|
if (item.isContainer || !item.isDcmt) {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
602
|
+
const defaultContainerStyle = {
|
|
603
|
+
display: 'flex',
|
|
604
|
+
alignItems: 'center',
|
|
605
|
+
gap: '10px',
|
|
606
|
+
height: '32px',
|
|
607
|
+
padding: '6px 0',
|
|
608
|
+
opacity: item.isZero ? 0.4 : 1,
|
|
609
|
+
transition: 'opacity 0.2s ease-in-out'
|
|
610
|
+
};
|
|
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);
|
|
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: {
|
|
523
615
|
whiteSpace: 'nowrap',
|
|
524
616
|
textOverflow: 'ellipsis',
|
|
525
617
|
fontSize: '1rem',
|
|
526
618
|
color: 'inherit'
|
|
527
|
-
}, children: item.name }), _jsx(StyledBadge, { "$backgroundColor": TMColors.info, children: item.items?.length ?? 0 })] })] }));
|
|
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)
|
|
623
|
+
: defaultContent;
|
|
624
|
+
return (_jsx("div", { style: defaultContainerStyle, children: content }));
|
|
528
625
|
}
|
|
529
626
|
// Document rendering with full metadata display
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
627
|
+
const defaultDocumentStyle = {
|
|
628
|
+
minWidth: '90px',
|
|
629
|
+
width: '100%',
|
|
630
|
+
display: 'flex',
|
|
631
|
+
marginLeft: '5px',
|
|
632
|
+
marginTop: '5px',
|
|
633
|
+
marginBottom: '5px',
|
|
634
|
+
gap: '15px',
|
|
635
|
+
alignItems: 'center',
|
|
636
|
+
cursor: 'pointer',
|
|
637
|
+
userSelect: 'none',
|
|
638
|
+
opacity: item.isZero ? 0.4 : 1,
|
|
639
|
+
transition: 'opacity 0.2s ease-in-out'
|
|
640
|
+
};
|
|
641
|
+
const documentStyle = customDocumentStyle
|
|
642
|
+
? { ...defaultDocumentStyle, ...customDocumentStyle(item) }
|
|
643
|
+
: defaultDocumentStyle;
|
|
644
|
+
const defaultMetadataContent = item.values && (_jsx(StyledDivHorizontal, { style: {
|
|
645
|
+
fontSize: '1rem',
|
|
646
|
+
overflow: 'hidden',
|
|
647
|
+
flex: 1,
|
|
648
|
+
minWidth: 0,
|
|
649
|
+
whiteSpace: 'nowrap'
|
|
650
|
+
}, children: getDcmtDisplayValue(item.values).map((key, index) => {
|
|
651
|
+
const md = item.values?.[key]?.md;
|
|
652
|
+
const value = item.values?.[key]?.value;
|
|
653
|
+
const displayValues = getDcmtDisplayValue(item.values);
|
|
654
|
+
const isLast = index === displayValues.length - 1;
|
|
655
|
+
return (_jsxs(StyledDivHorizontal, { style: {
|
|
656
|
+
flexShrink: isLast ? 1 : 0,
|
|
657
|
+
minWidth: isLast ? 0 : 'auto',
|
|
658
|
+
overflow: isLast ? 'hidden' : 'visible'
|
|
659
|
+
}, children: [index > 0 && _jsx("span", { style: { margin: '0 5px', color: '#999' }, children: "\u2022" }), showMetadataNames && (_jsxs("span", { style: { color: '#666', marginRight: '5px' }, children: [md?.name || key, ":"] })), md?.dataDomain === MetadataDataDomains.DataList ? (_jsx(TMDataListItemViewer, { dataListId: md.dataListID, viewMode: md.dataListViewMode, value: value })) : md?.dataDomain === MetadataDataDomains.UserID ? (_jsx(TMUserIdViewer, { userId: value, showIcon: true, noneSelectionText: '' })) : (_jsx("span", { style: {
|
|
660
|
+
fontWeight: 500,
|
|
661
|
+
overflow: isLast ? 'hidden' : 'visible',
|
|
662
|
+
textOverflow: isLast ? 'ellipsis' : 'clip',
|
|
663
|
+
whiteSpace: 'nowrap'
|
|
664
|
+
}, children: value }))] }, `${key}_${index}`));
|
|
665
|
+
}) }));
|
|
666
|
+
const metadataContent = customDocumentContent
|
|
667
|
+
? customDocumentContent(item, defaultMetadataContent || _jsx(_Fragment, {}))
|
|
668
|
+
: defaultMetadataContent;
|
|
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] }));
|
|
670
|
+
}, [onDocumentDoubleClick, showCurrentDcmtIndicator, inputDcmts, customMainContainerContent, customDocumentStyle, customDocumentContent, showMetadataNames, showMainDocument]);
|
|
671
|
+
/**
|
|
672
|
+
* Wrapper renderer that handles custom rendering if provided
|
|
673
|
+
*/
|
|
674
|
+
const finalItemRender = useCallback((item) => {
|
|
675
|
+
if (!item)
|
|
676
|
+
return _jsx("span", { children: "-" });
|
|
677
|
+
// If customItemRender is provided, try it first
|
|
678
|
+
if (customItemRender) {
|
|
679
|
+
const customResult = customItemRender(item);
|
|
680
|
+
// If custom renderer returns something (not undefined), use it
|
|
681
|
+
if (customResult !== undefined) {
|
|
682
|
+
return customResult;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
// Otherwise use default renderer
|
|
686
|
+
return defaultItemRender(item);
|
|
687
|
+
}, [customItemRender, defaultItemRender]);
|
|
553
688
|
/**
|
|
554
689
|
* Handle focused item changed
|
|
555
690
|
*/
|
|
@@ -562,12 +697,24 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
562
697
|
const handleSelectedItemsChanged = useCallback((items) => {
|
|
563
698
|
onSelectedItemsChanged?.(items);
|
|
564
699
|
}, [onSelectedItemsChanged]);
|
|
700
|
+
/**
|
|
701
|
+
* Handle data changed - separate static items from dynamic tree data
|
|
702
|
+
*/
|
|
703
|
+
const handleDataChanged = useCallback((updatedData) => {
|
|
704
|
+
// Separate static items, separator, and dynamic correlations
|
|
705
|
+
const dynamicItems = updatedData.filter(item => !item.isStaticItem && !item.isSeparator);
|
|
706
|
+
const staticItems = updatedData.filter(item => item.isStaticItem);
|
|
707
|
+
setTreeData(dynamicItems);
|
|
708
|
+
setStaticItemsState(staticItems); // Preserve static items state (expanded/collapsed)
|
|
709
|
+
// Mark that user has interacted with the tree (expanded/collapsed nodes)
|
|
710
|
+
userInteractedWithStaticItemsRef.current = true;
|
|
711
|
+
}, []);
|
|
565
712
|
if (showWaitPanel) {
|
|
566
713
|
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); } }) });
|
|
567
714
|
}
|
|
568
|
-
if (
|
|
715
|
+
if (mergedTreeData.length === 0) {
|
|
569
716
|
return _jsx("div", { style: { padding: '20px', textAlign: 'center', color: '#666' }, children: "Nessuna relazione disponibile." });
|
|
570
717
|
}
|
|
571
|
-
return (_jsx(TMTreeView, { dataSource:
|
|
718
|
+
return (_jsx(TMTreeView, { dataSource: mergedTreeData, itemRender: finalItemRender, calculateItemsForNode: calculateItemsForNode, onDataChanged: handleDataChanged, focusedItem: focusedItem, onFocusedItemChanged: handleFocusedItemChanged, allowMultipleSelection: allowMultipleSelection, selectedItems: selectedItems, onSelectionChanged: handleSelectedItemsChanged }));
|
|
572
719
|
};
|
|
573
720
|
export default TMRelationViewer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DcmtTypeDescriptor, TaskDescriptor } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
import { DcmtTypeDescriptor, TaskDescriptor, ObjectRef } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { DcmtInfo, TaskContext } from '../../../ts';
|
|
4
4
|
import { TMSearchResultFloatingActionConfig } from './TMSearchResultFloatingActionButton';
|
|
5
5
|
interface ITMSearchProps {
|
|
@@ -26,6 +26,8 @@ interface ITMSearchProps {
|
|
|
26
26
|
value: string;
|
|
27
27
|
}>, tid?: number) => void;
|
|
28
28
|
onCurrentTIDChangedCallback?: (tid: number | undefined) => void;
|
|
29
|
+
onlyShowSearchQueryPanel?: boolean;
|
|
30
|
+
onReferenceClick?: (ref: ObjectRef) => void;
|
|
29
31
|
}
|
|
30
32
|
declare const TMSearch: React.FunctionComponent<ITMSearchProps>;
|
|
31
33
|
export default TMSearch;
|
|
@@ -18,7 +18,7 @@ var TMSearchViews;
|
|
|
18
18
|
TMSearchViews[TMSearchViews["Search"] = 0] = "Search";
|
|
19
19
|
TMSearchViews[TMSearchViews["Result"] = 1] = "Result";
|
|
20
20
|
})(TMSearchViews || (TMSearchViews = {}));
|
|
21
|
-
const TMSearch = ({ openInOffice, isVisible, inputTID, inputSqdID, inputMids, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm, openEditPdf, openS4TViewer, onOpenS4TViewerRequest, showTodoDcmtForm, passToArchiveCallback, onCurrentTIDChangedCallback }) => {
|
|
21
|
+
const TMSearch = ({ openInOffice, isVisible, inputTID, inputSqdID, inputMids, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm, openEditPdf, openS4TViewer, onOpenS4TViewerRequest, showTodoDcmtForm, passToArchiveCallback, onCurrentTIDChangedCallback, onlyShowSearchQueryPanel, onReferenceClick }) => {
|
|
22
22
|
const [allSQDs, setAllSQDs] = useState([]);
|
|
23
23
|
const [filteredByTIDSQDs, setFilteredByTIDSQDs] = useState([]);
|
|
24
24
|
const [currentSQD, setCurrentSQD] = useState();
|
|
@@ -30,6 +30,7 @@ const TMSearch = ({ openInOffice, isVisible, inputTID, inputSqdID, inputMids, is
|
|
|
30
30
|
const [currentSearchView, setCurrentSearchView] = useState(TMSearchViews.Search);
|
|
31
31
|
const [currentSQDMode, setCurrentSQDMode] = useState(1);
|
|
32
32
|
const [lastQdSearched, setLastQdSearched] = useState();
|
|
33
|
+
const [showSearchResults, setShowSearchResults] = useState(true);
|
|
33
34
|
const deviceType = useDeviceType();
|
|
34
35
|
useEffect(() => {
|
|
35
36
|
if (onCurrentTIDChangedCallback) {
|
|
@@ -76,6 +77,13 @@ const TMSearch = ({ openInOffice, isVisible, inputTID, inputSqdID, inputMids, is
|
|
|
76
77
|
});
|
|
77
78
|
}
|
|
78
79
|
}, [currentSQD]);
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (onlyShowSearchQueryPanel === undefined)
|
|
82
|
+
return;
|
|
83
|
+
if (onlyShowSearchQueryPanel) {
|
|
84
|
+
setShowSearchResults(false);
|
|
85
|
+
}
|
|
86
|
+
}, [onlyShowSearchQueryPanel]);
|
|
79
87
|
const loadDataSQDsAsync = async (refreshCache, curTID) => {
|
|
80
88
|
if (refreshCache) {
|
|
81
89
|
SavedQueryCacheService.RemoveAll();
|
|
@@ -162,10 +170,11 @@ const TMSearch = ({ openInOffice, isVisible, inputTID, inputSqdID, inputMids, is
|
|
|
162
170
|
SDKUI_Globals.userSettings.searchSettings.mruTIDs = newMruTIDS;
|
|
163
171
|
setMruTIDs(newMruTIDS);
|
|
164
172
|
setCurrentMruTID(fromTID);
|
|
173
|
+
setShowSearchResults(true);
|
|
165
174
|
}, onSqdSaved: async (newSqd) => {
|
|
166
175
|
await loadDataSQDsAsync(true, newSqd.masterTID);
|
|
167
176
|
await setSQDAsync(newSqd);
|
|
168
|
-
} }), [fromDTD, currentSQD, isExpertMode, mruTIDs, searchResult, passToArchiveCallback, inputMids]);
|
|
177
|
+
} }), [fromDTD, showSearchResults, setShowSearchResults, currentSQD, isExpertMode, mruTIDs, searchResult, passToArchiveCallback, inputMids]);
|
|
169
178
|
const tmSavedQuerySelectorElement = useMemo(() => _jsxs(TabPanel, { width: "100%", height: "100%", showNavButtons: true, repaintChangesOnly: true, selectedIndex: currentSQDMode, onSelectedIndexChange: (index) => setCurrentSQDMode(index), children: [(currentTID || currentSQD) ? _jsx(Item, { title: fromDTD?.nameLoc, children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: false, items: filteredByTIDSQDs, selectedId: currentSQD?.id, onRefreshData: () => { loadDataSQDsAsync(true); }, onItemClick: (sqd) => {
|
|
170
179
|
onSQDItemClick(sqd, setSQDAsync);
|
|
171
180
|
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? filteredByTIDSQDs.find(o => o.id == 1) : currentSQD, setSQDAsync) }) }) : _jsx(_Fragment, {}), _jsx(Item, { title: SDKUI_Localizator.Alls2, children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: true, items: allSQDs, manageDefault: false, onItemClick: (sqd) => {
|
|
@@ -209,8 +218,8 @@ const TMSearch = ({ openInOffice, isVisible, inputTID, inputSqdID, inputMids, is
|
|
|
209
218
|
contentOptions: { component: tmSavedQuerySelectorElement, panelContainer: { title: SDK_Localizator.SavedQueries } },
|
|
210
219
|
toolbarOptions: { icon: _jsx(IconSavedQuery, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['TMSavedQuerySelector'] }
|
|
211
220
|
}
|
|
212
|
-
], [tmTreeSelectorElement, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement, fromDTD, mruTIDs]);
|
|
213
|
-
return (_jsxs(_Fragment, { children: [_jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }), _jsx(TMSearchResult, { isVisible: isVisible && currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, openInOffice: openInOffice, onRefreshSearchAsync: onRefreshSearchAsync, onClose: () => { setCurrentSearchView(TMSearchViews.Search); }, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, openEditPdf: openEditPdf, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, passToArchiveCallback: passToArchiveCallback, onSelectedTIDChanged: onCurrentTIDChangedCallback, showTodoDcmtForm: showTodoDcmtForm })] }));
|
|
221
|
+
], [tmTreeSelectorElement, showSearchResults, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement, fromDTD, mruTIDs]);
|
|
222
|
+
return (_jsxs(_Fragment, { children: [showSearchResults ? _jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }) : tmSearchQueryPanelElement, showSearchResults && _jsx(TMSearchResult, { isVisible: isVisible && currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, openInOffice: openInOffice, onRefreshSearchAsync: onRefreshSearchAsync, onClose: () => { onlyShowSearchQueryPanel ? setShowSearchResults(false) : setCurrentSearchView(TMSearchViews.Search); }, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, openEditPdf: openEditPdf, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, passToArchiveCallback: passToArchiveCallback, onSelectedTIDChanged: onCurrentTIDChangedCallback, showTodoDcmtForm: showTodoDcmtForm, onReferenceClick: onReferenceClick })] }));
|
|
214
223
|
};
|
|
215
224
|
export default TMSearch;
|
|
216
225
|
const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
|
|
@@ -19,7 +19,7 @@ interface ITMSearchQueryPanelProps {
|
|
|
19
19
|
passToArchiveCallback?: (outputMids: Array<{
|
|
20
20
|
mid: number;
|
|
21
21
|
value: string;
|
|
22
|
-
}
|
|
22
|
+
}>, tid?: number) => void;
|
|
23
23
|
}
|
|
24
24
|
declare const TMSearchQueryPanel: React.FunctionComponent<ITMSearchQueryPanelProps>;
|
|
25
25
|
export default TMSearchQueryPanel;
|
|
@@ -42,24 +42,53 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
|
|
|
42
42
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
43
43
|
let initialMaxItems = deviceType === DeviceType.MOBILE ? 8 : 12;
|
|
44
44
|
const appliedInputMidsRef = useRef(null);
|
|
45
|
+
const pendingMidsRef = useRef(null);
|
|
45
46
|
useEffect(() => {
|
|
46
47
|
if (!SQD)
|
|
47
48
|
return;
|
|
48
49
|
setDataAsync(SQD);
|
|
49
50
|
}, [SQD]);
|
|
50
51
|
useEffect(() => {
|
|
51
|
-
|
|
52
|
+
pendingMidsRef.current = inputMids ?? null;
|
|
53
|
+
}, [inputMids]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (!fromDTD)
|
|
52
56
|
return;
|
|
53
|
-
|
|
57
|
+
// Reset appliedInputMidsRef when TID changes so pending mids can be applied to new TID
|
|
58
|
+
appliedInputMidsRef.current = null;
|
|
59
|
+
const initQd = async () => {
|
|
60
|
+
// Only initialize if qd doesn't exist or is for a different TID
|
|
61
|
+
if (!qd || qd.from?.tid !== fromDTD.id) {
|
|
62
|
+
const newQd = await getQD(fromDTD.id, false);
|
|
63
|
+
if (newQd) {
|
|
64
|
+
setQd(newQd);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
initQd();
|
|
69
|
+
}, [fromDTD?.id]);
|
|
70
|
+
// Apply inputMids when qd is ready and matches fromDTD
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (!qd || !fromDTD || qd.from?.tid !== fromDTD.id)
|
|
54
73
|
return;
|
|
55
|
-
|
|
74
|
+
const midsToApply = pendingMidsRef.current;
|
|
75
|
+
if (!midsToApply || midsToApply.length === 0)
|
|
76
|
+
return;
|
|
77
|
+
if (appliedInputMidsRef.current && deepCompare(appliedInputMidsRef.current, midsToApply))
|
|
78
|
+
return;
|
|
79
|
+
appliedInputMidsRef.current = midsToApply;
|
|
56
80
|
const newWhere = qd.where?.map((curItem) => {
|
|
57
81
|
let newWi = new WhereItem();
|
|
58
82
|
newWi.init({ ...curItem, value1: undefined, value2: undefined });
|
|
59
83
|
return newWi;
|
|
60
84
|
}) || [];
|
|
61
|
-
|
|
85
|
+
midsToApply.forEach(im => {
|
|
62
86
|
const md = fromDTD.metadata?.find(m => m.id === im.mid);
|
|
87
|
+
// Skip MIDs that don't belong to this TID
|
|
88
|
+
if (!md) {
|
|
89
|
+
console.warn(`MID ${im.mid} does not belong to TID ${fromDTD.id}, skipping`);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
63
92
|
const defaultOperator = getDefaultOperator(md?.dataDomain, md?.dataType);
|
|
64
93
|
let existingWi = newWhere.find(wi => wi.mid === im.mid);
|
|
65
94
|
if (existingWi) {
|
|
@@ -78,7 +107,7 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
|
|
|
78
107
|
});
|
|
79
108
|
setQd({ ...qd, where: newWhere });
|
|
80
109
|
setShowAllMdWhere(true);
|
|
81
|
-
}, [
|
|
110
|
+
}, [qd, fromDTD, inputMids]);
|
|
82
111
|
// Eseguire la ricerca quando shouldSearch è true e qd è definito
|
|
83
112
|
useEffect(() => {
|
|
84
113
|
if (shouldSearch && qd) {
|
|
@@ -193,8 +222,8 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
|
|
|
193
222
|
const outputMids = qd.where
|
|
194
223
|
.filter(wi => wi.mid && wi.value1 && wi.value1.length > 0)
|
|
195
224
|
.map(wi => ({ mid: wi.mid, value: wi.value1 }));
|
|
196
|
-
passToArchiveCallback(outputMids);
|
|
197
|
-
}, [passToArchiveCallback, qd?.where]);
|
|
225
|
+
passToArchiveCallback(outputMids, fromDTD?.id);
|
|
226
|
+
}, [passToArchiveCallback, qd?.where, fromDTD?.id]);
|
|
198
227
|
const handleCloseFiltersConfig = useCallback(() => setShowFiltersConfig(false), []);
|
|
199
228
|
const handleChooseFilters = useCallback((tid_mids) => {
|
|
200
229
|
if (!fromDTD?.metadata)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SearchResultDescriptor, DcmtTypeDescriptor, TaskDescriptor, WorkingGroupDescriptor } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
import { SearchResultDescriptor, DcmtTypeDescriptor, TaskDescriptor, WorkingGroupDescriptor, ObjectRef } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { DcmtInfo, SearchResultContext, TaskContext } from '../../../ts';
|
|
4
4
|
import { TMSearchResultFloatingActionConfig } from './TMSearchResultFloatingActionButton';
|
|
5
5
|
export declare const getSearchResultCountersSingleCategory: (searchResults: SearchResultDescriptor[]) => string;
|
|
@@ -15,6 +15,7 @@ interface ITMSearchResultProps {
|
|
|
15
15
|
showSearchResultSidebar?: boolean;
|
|
16
16
|
showSelector?: boolean;
|
|
17
17
|
showToolbarHeader?: boolean;
|
|
18
|
+
showBackButton?: boolean;
|
|
18
19
|
groupId?: string;
|
|
19
20
|
selectedSearchResultTID?: number;
|
|
20
21
|
workingGroupContext?: WorkingGroupDescriptor;
|
|
@@ -39,6 +40,7 @@ interface ITMSearchResultProps {
|
|
|
39
40
|
value: string;
|
|
40
41
|
}>, tid?: number) => void;
|
|
41
42
|
showTodoDcmtForm?: boolean;
|
|
43
|
+
onReferenceClick?: (ref: ObjectRef) => void;
|
|
42
44
|
}
|
|
43
45
|
declare const TMSearchResult: React.FC<ITMSearchResultProps>;
|
|
44
46
|
export default TMSearchResult;
|