@topconsultnpm/sdkui-react 6.20.0 → 6.21.0-dev1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +7 -1
- package/lib/components/base/TMTreeView.d.ts +2 -1
- package/lib/components/base/TMTreeView.js +8 -3
- package/lib/components/base/TMWaitPanel.js +6 -5
- package/lib/components/choosers/TMUserChooser.js +3 -1
- package/lib/components/features/archive/TMArchive.d.ts +1 -1
- package/lib/components/features/archive/TMArchive.js +2 -2
- package/lib/components/features/documents/TMDcmtBlog.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtBlog.js +2 -1
- package/lib/components/features/documents/TMDcmtForm.d.ts +42 -34
- package/lib/components/features/documents/TMDcmtForm.js +282 -641
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +34 -0
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +124 -0
- package/lib/components/features/documents/TMFileUploader.d.ts +1 -1
- package/lib/components/features/documents/TMFileUploader.js +3 -3
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +27 -2
- package/lib/components/features/documents/TMMasterDetailDcmts.js +239 -18
- package/lib/components/features/documents/TMRelationViewer.d.ts +12 -1
- package/lib/components/features/documents/TMRelationViewer.js +48 -10
- package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
- package/lib/components/features/search/TMSearch.d.ts +3 -2
- package/lib/components/features/search/TMSearch.js +3 -3
- package/lib/components/features/search/TMSearchResult.d.ts +28 -26
- package/lib/components/features/search/TMSearchResult.js +364 -487
- package/lib/components/features/search/TMViewHistoryDcmt.js +6 -0
- package/lib/components/features/tasks/TMTaskForm.d.ts +2 -1
- package/lib/components/features/tasks/TMTaskForm.js +2 -2
- package/lib/helper/checkinCheckoutManager.d.ts +1 -1
- package/lib/helper/checkinCheckoutManager.js +25 -6
- package/lib/hooks/useCheckInOutOperations.d.ts +7 -6
- package/lib/hooks/useCheckInOutOperations.js +9 -16
- package/lib/hooks/useDcmtOperations.d.ts +3 -2
- package/lib/hooks/useDcmtOperations.js +2 -2
- package/lib/hooks/useDocumentOperations.d.ts +140 -0
- package/lib/hooks/useDocumentOperations.js +1307 -0
- package/lib/hooks/useRelatedDocuments.d.ts +1 -1
- package/lib/ts/types.d.ts +2 -1
- package/lib/ts/types.js +1 -0
- package/package.json +2 -2
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +0 -11
- package/lib/components/features/search/TMSearchResultsMenuItems.js +0 -758
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
-
import { DcmtTypeListCacheService, SDK_Globals, DataColumnTypes, MetadataFormats, SystemMIDs, MetadataDataDomains, RelationCacheService, RelationTypes } from "@topconsultnpm/sdk-ts";
|
|
4
|
-
import { genUniqueId, IconFolder, IconBackhandIndexPointingRight, IconCircleInfo } from '../../../helper';
|
|
3
|
+
import { DcmtTypeListCacheService, SDK_Globals, DataColumnTypes, MetadataFormats, SystemMIDs, MetadataDataDomains, RelationCacheService, RelationTypes, UserListCacheService } from "@topconsultnpm/sdk-ts";
|
|
4
|
+
import { genUniqueId, IconFolder, IconBackhandIndexPointingRight, IconCircleInfo, getDcmtCicoStatus } from '../../../helper';
|
|
5
5
|
import { TMColors } from '../../../utils/theme';
|
|
6
6
|
import { StyledDivHorizontal, StyledBadge } from '../../base/Styled';
|
|
7
7
|
import TMTreeView from '../../base/TMTreeView';
|
|
@@ -136,7 +136,7 @@ export const searchResultToDataSource = async (searchResult, hideSysMetadata) =>
|
|
|
136
136
|
}
|
|
137
137
|
return output;
|
|
138
138
|
};
|
|
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, onNoRelationsFound, }) => {
|
|
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, onNoRelationsFound, onItemContextMenu, focusedItemFormData = [] }) => {
|
|
140
140
|
// State
|
|
141
141
|
const [dcmtTypes, setDcmtTypes] = useState([]);
|
|
142
142
|
const [treeData, setTreeData] = useState([]);
|
|
@@ -160,6 +160,16 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
160
160
|
const userInteractedWithStaticItemsRef = React.useRef(false);
|
|
161
161
|
// Ref to track the last inputKey for which we set the focused item
|
|
162
162
|
const lastFocusedInputRef = React.useRef('');
|
|
163
|
+
// State for all users (used for checkout status display)
|
|
164
|
+
const [allUsers, setAllUsers] = useState([]);
|
|
165
|
+
// Load all users for checkout status resolution
|
|
166
|
+
useEffect(() => {
|
|
167
|
+
const fetchAllUsers = async () => {
|
|
168
|
+
const users = await UserListCacheService.GetAllAsync();
|
|
169
|
+
setAllUsers(users ?? []);
|
|
170
|
+
};
|
|
171
|
+
fetchAllUsers();
|
|
172
|
+
}, []);
|
|
163
173
|
/**
|
|
164
174
|
* Generate a stable key from inputDcmts to detect real changes
|
|
165
175
|
*/
|
|
@@ -234,6 +244,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
234
244
|
dcmtDetails.push({
|
|
235
245
|
tid: tid,
|
|
236
246
|
did: did,
|
|
247
|
+
dtd: dtd,
|
|
237
248
|
isLogDel: isLogDel,
|
|
238
249
|
key: `${tid}_${did}_${searchResult.relationID}_${mTID}_${mDID}_${rowGUID}`,
|
|
239
250
|
isDcmt: true,
|
|
@@ -246,7 +257,8 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
246
257
|
// Children will be loaded lazily by calculateItemsForNode when expanded
|
|
247
258
|
expanded: false,
|
|
248
259
|
hidden: false,
|
|
249
|
-
name: row?.SYS_Abstract?.value || row?.SYS_SUBJECT?.value || `Documento ${did}
|
|
260
|
+
name: row?.SYS_Abstract?.value || row?.SYS_SUBJECT?.value || `Documento ${did}`,
|
|
261
|
+
fileExt: row?.FILEEXT?.value,
|
|
250
262
|
// Note: Recursive loading on expansion is handled by calculateItemsForNode
|
|
251
263
|
});
|
|
252
264
|
}
|
|
@@ -259,7 +271,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
259
271
|
console.error('❌ Error loading detail documents:', error);
|
|
260
272
|
}
|
|
261
273
|
return items;
|
|
262
|
-
}, [allowedTIDs]);
|
|
274
|
+
}, [allowedTIDs, focusedItemFormData, focusedItem?.dtd?.id]);
|
|
263
275
|
/**
|
|
264
276
|
* Recursively retrieve master documents
|
|
265
277
|
*/
|
|
@@ -318,6 +330,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
318
330
|
dcmtMasters.push({
|
|
319
331
|
tid: tid,
|
|
320
332
|
did: did,
|
|
333
|
+
dtd: dtd,
|
|
321
334
|
isLogDel: isLogDel,
|
|
322
335
|
key: `${tid}_${did}_${searchResult.relationID}_${dTID}_${dDID}_${rowGUID}`,
|
|
323
336
|
isDcmt: true,
|
|
@@ -375,7 +388,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
375
388
|
isContainer: false,
|
|
376
389
|
isDcmt: false,
|
|
377
390
|
isInfoMessage: true,
|
|
378
|
-
isExpandible: false
|
|
391
|
+
isExpandible: false,
|
|
379
392
|
},
|
|
380
393
|
...filteredChildren
|
|
381
394
|
];
|
|
@@ -608,6 +621,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
608
621
|
name: docRow?.SYS_Abstract?.value || docRow?.SYS_SUBJECT?.value || `Documento ${isForMaster ? 'Dettaglio' : 'Master'}`,
|
|
609
622
|
tid: dcmt.TID,
|
|
610
623
|
did: dcmt.DID,
|
|
624
|
+
dtd: dtd,
|
|
611
625
|
isDcmt: true,
|
|
612
626
|
isContainer: false,
|
|
613
627
|
expanded: false,
|
|
@@ -618,7 +632,8 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
618
632
|
values: docRow,
|
|
619
633
|
searchResult: result ? [result] : [],
|
|
620
634
|
items: relatedDocs,
|
|
621
|
-
itemsCount: relatedDocs.length
|
|
635
|
+
itemsCount: relatedDocs.length,
|
|
636
|
+
fileExt: docRow?.FILEEXT?.value
|
|
622
637
|
};
|
|
623
638
|
// Check if a type container for this TID already exists in the tree
|
|
624
639
|
const existingContainer = tree.find(c => c.tid === dcmt.TID && c.isContainer);
|
|
@@ -1078,8 +1093,31 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
1078
1093
|
const metadataContent = customDocumentContent
|
|
1079
1094
|
? customDocumentContent(item, defaultMetadataContent || _jsx(_Fragment, {}))
|
|
1080
1095
|
: defaultMetadataContent;
|
|
1081
|
-
|
|
1082
|
-
|
|
1096
|
+
// Calculate checkout status for non-root documents
|
|
1097
|
+
let checkoutStatusIcon = null;
|
|
1098
|
+
if (item.values && item.dtd) {
|
|
1099
|
+
// Convert item.values to flat format expected by getDcmtCicoStatus
|
|
1100
|
+
const flatValues = {};
|
|
1101
|
+
if (item.values) {
|
|
1102
|
+
for (const key of Object.keys(item.values)) {
|
|
1103
|
+
const entry = item.values[key];
|
|
1104
|
+
if (entry?.md?.id && item.tid) {
|
|
1105
|
+
// Create TID_MID key format for metadata
|
|
1106
|
+
flatValues[`${item.tid}_${entry.md.id}`] = entry.value;
|
|
1107
|
+
}
|
|
1108
|
+
// Also add direct key for system properties
|
|
1109
|
+
flatValues[key] = entry?.value;
|
|
1110
|
+
}
|
|
1111
|
+
flatValues.TID = item.tid;
|
|
1112
|
+
flatValues.DID = item.did;
|
|
1113
|
+
}
|
|
1114
|
+
const { checkoutStatus } = getDcmtCicoStatus(flatValues, allUsers, item.dtd);
|
|
1115
|
+
if (checkoutStatus.isCheckedOut && checkoutStatus.icon) {
|
|
1116
|
+
checkoutStatusIcon = checkoutStatus.icon;
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
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' })), checkoutStatusIcon, metadataContent] }));
|
|
1120
|
+
}, [onDocumentDoubleClick, showCurrentDcmtIndicator, inputDcmts, customMainContainerContent, customDocumentStyle, customDocumentContent, showMetadataNames, showMainDocument, focusedItemFormData, focusedItem?.dtd, allUsers]);
|
|
1083
1121
|
/**
|
|
1084
1122
|
* Wrapper renderer that handles custom rendering if provided
|
|
1085
1123
|
*/
|
|
@@ -1130,7 +1168,7 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
1130
1168
|
return null;
|
|
1131
1169
|
return _jsx("div", { style: { padding: '20px', textAlign: 'center', color: '#666' }, children: "Nessuna relazione disponibile." });
|
|
1132
1170
|
}
|
|
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) => {
|
|
1171
|
+
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, onItemContextMenu: onItemContextMenu }), 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) => {
|
|
1134
1172
|
setTimeout(() => {
|
|
1135
1173
|
abortController?.abort();
|
|
1136
1174
|
}, 100);
|
|
@@ -201,7 +201,7 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
|
|
|
201
201
|
alignItems: 'center',
|
|
202
202
|
justifyContent: 'center',
|
|
203
203
|
minWidth: 0
|
|
204
|
-
}, children: [_jsx("p", { style: {
|
|
204
|
+
}, children: [_jsx("p", { title: sqd.name, style: {
|
|
205
205
|
fontSize: '1rem',
|
|
206
206
|
fontWeight: sqd.id === 1 ? 600 : 'normal',
|
|
207
207
|
whiteSpace: 'nowrap',
|
|
@@ -24,9 +24,10 @@ interface ITMSearchProps {
|
|
|
24
24
|
onTaskCreateRequest?: (taskContext: TaskContext, onTaskCreated?: (task?: TaskDescriptor) => void) => void;
|
|
25
25
|
openWGsCopyMoveForm?: (mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void;
|
|
26
26
|
editPdfForm?: boolean;
|
|
27
|
-
openEditPdf?: (documents: Array<DcmtInfo>) => void;
|
|
28
27
|
openS4TViewer?: boolean;
|
|
29
|
-
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>,
|
|
28
|
+
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: (() => Promise<void>)) => void;
|
|
29
|
+
onOpenPdfEditorRequest?: ((dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void);
|
|
30
|
+
openFileUploaderPdfEditor?: (fromDTD?: DcmtTypeDescriptor, file?: File | null, handleFile?: (file: File) => void) => void;
|
|
30
31
|
showTodoDcmtForm?: boolean;
|
|
31
32
|
showToppyDraggableHelpCenter?: boolean;
|
|
32
33
|
toppyHelpCenterUsePortal?: boolean;
|
|
@@ -19,7 +19,7 @@ var TMSearchViews;
|
|
|
19
19
|
TMSearchViews[TMSearchViews["Search"] = 0] = "Search";
|
|
20
20
|
TMSearchViews[TMSearchViews["Result"] = 1] = "Result";
|
|
21
21
|
})(TMSearchViews || (TMSearchViews = {}));
|
|
22
|
-
const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, openInOffice, isVisible, inputTID, inputSqdID, inputMids, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm,
|
|
22
|
+
const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, openInOffice, isVisible, inputTID, inputSqdID, inputMids, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm, editPdfForm = false, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor, showTodoDcmtForm, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, passToArchiveCallback, onCurrentTIDChangedCallback, onlyShowSearchQueryPanel, onReferenceClick }) => {
|
|
23
23
|
const [allSQDs, setAllSQDs] = useState([]);
|
|
24
24
|
const [filteredByTIDSQDs, setFilteredByTIDSQDs] = useState([]);
|
|
25
25
|
const [currentSQD, setCurrentSQD] = useState();
|
|
@@ -144,7 +144,7 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
144
144
|
if (sqdToBeSet)
|
|
145
145
|
await setSqdAsync?.(sqdToBeSet);
|
|
146
146
|
}, []);
|
|
147
|
-
const
|
|
147
|
+
const onRefreshSearchAsyncDatagrid = async () => {
|
|
148
148
|
try {
|
|
149
149
|
if (lastQdSearched) {
|
|
150
150
|
lastQdSearched.maxDcmtsToBeReturned = maxDcmtsToBeReturned;
|
|
@@ -258,7 +258,7 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
258
258
|
toolbarOptions: { icon: _jsx(IconSavedQuery, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['TMSavedQuerySelector'] }
|
|
259
259
|
}
|
|
260
260
|
], [tmTreeSelectorElement, showSearchResults, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement, fromDTD, mruTIDs]);
|
|
261
|
-
return (_jsxs(_Fragment, { children: [showSearchResults ? _jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true, minPanelSizePx: !isMobile ? 250 : 150 }) }) }) : tmSearchQueryPanelElement, showSearchResults && _jsx(TMSearchResult, { isVisible: isVisible && currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, openInOffice: openInOffice,
|
|
261
|
+
return (_jsxs(_Fragment, { children: [showSearchResults ? _jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true, minPanelSizePx: !isMobile ? 250 : 150 }) }) }) : tmSearchQueryPanelElement, showSearchResults && _jsx(TMSearchResult, { isVisible: isVisible && currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, openInOffice: openInOffice, onRefreshSearchAsyncDatagrid: onRefreshSearchAsyncDatagrid, onClose: () => { onlyShowSearchQueryPanel ? setShowSearchResults(false) : setCurrentSearchView(TMSearchViews.Search); }, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, openFileUploaderPdfEditor: openFileUploaderPdfEditor, passToArchiveCallback: passToArchiveCallback, onSelectedTIDChanged: onCurrentTIDChangedCallback, showTodoDcmtForm: showTodoDcmtForm, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers })] }));
|
|
262
262
|
};
|
|
263
263
|
export default TMSearch;
|
|
264
264
|
const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DcmtTypeDescriptor, HomeBlogPost, ObjectRef, SearchResultDescriptor, TaskDescriptor, WorkingGroupDescriptor } 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;
|
|
6
6
|
interface ITMSearchResultProps {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
deleteTaskByIdsCallback?: (deletedTaskIds: Array<number>) => Promise<void>;
|
|
10
|
-
addTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
11
|
-
editTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
12
|
-
handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
|
|
13
|
-
handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
|
|
7
|
+
groupId?: string;
|
|
8
|
+
searchResults: SearchResultDescriptor[] | undefined;
|
|
14
9
|
context?: SearchResultContext;
|
|
15
10
|
title?: string;
|
|
16
|
-
|
|
11
|
+
selectedSearchResultTID?: number;
|
|
12
|
+
floatingActionConfig?: TMSearchResultFloatingActionConfig;
|
|
13
|
+
workingGroupContext?: WorkingGroupDescriptor;
|
|
17
14
|
allowFloatingBar?: boolean;
|
|
18
15
|
allowRelations?: boolean;
|
|
19
16
|
isClosable?: boolean;
|
|
@@ -24,35 +21,40 @@ interface ITMSearchResultProps {
|
|
|
24
21
|
showSelector?: boolean;
|
|
25
22
|
showToolbarHeader?: boolean;
|
|
26
23
|
showBackButton?: boolean;
|
|
27
|
-
groupId?: string;
|
|
28
|
-
selectedSearchResultTID?: number;
|
|
29
|
-
workingGroupContext?: WorkingGroupDescriptor;
|
|
30
24
|
disableAccordionIfSingleCategory?: boolean;
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
enablePinIcons?: boolean;
|
|
26
|
+
editPdfForm?: boolean;
|
|
27
|
+
openS4TViewer?: boolean;
|
|
28
|
+
showTodoDcmtForm?: boolean;
|
|
29
|
+
showToppyDraggableHelpCenter?: boolean;
|
|
30
|
+
toppyHelpCenterUsePortal?: boolean;
|
|
31
|
+
showNoDcmtFoundMessage?: boolean;
|
|
33
32
|
onClose?: () => void;
|
|
33
|
+
openInOffice?: (selectedDcmtsOrFocused: Array<DcmtInfo>) => Promise<void>;
|
|
34
34
|
onWFOperationCompleted?: () => Promise<void>;
|
|
35
35
|
onSelectedTIDChanged?: (TID: number) => void;
|
|
36
|
-
|
|
36
|
+
onRefreshSearchAsyncDatagrid?: () => Promise<void>;
|
|
37
37
|
onRefreshAfterAddDcmtToFavs?: () => void;
|
|
38
38
|
onFileOpened?: (blob: File | undefined) => void;
|
|
39
39
|
onTaskCreateRequest?: (taskContext: TaskContext, onTaskCreated?: (task?: TaskDescriptor) => void) => void;
|
|
40
40
|
openWGsCopyMoveForm?: (mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void;
|
|
41
|
-
|
|
42
|
-
openEditPdf?: (documents: Array<DcmtInfo>) => void;
|
|
43
|
-
openCommentFormCallback?: (documents: Array<DcmtInfo>) => void;
|
|
44
|
-
openAddDocumentForm?: () => void;
|
|
45
|
-
openS4TViewer?: boolean;
|
|
46
|
-
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, onRefreshSearchAsync?: (() => Promise<void>)) => void;
|
|
41
|
+
onReferenceClick?: (ref: ObjectRef) => void;
|
|
47
42
|
passToArchiveCallback?: (outputMids: Array<{
|
|
48
43
|
mid: number;
|
|
49
44
|
value: string;
|
|
50
45
|
}>, tid?: number) => void;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void;
|
|
47
|
+
onOpenPdfEditorRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void;
|
|
48
|
+
openFileUploaderPdfEditor?: (fromDTD?: DcmtTypeDescriptor, file?: File | null, handleFile?: (file: File) => void) => void;
|
|
49
|
+
openCommentFormCallback?: (documents: Array<DcmtInfo>) => void;
|
|
50
|
+
openAddDocumentForm?: () => void;
|
|
51
|
+
allTasks?: Array<TaskDescriptor>;
|
|
52
|
+
getAllTasks?: () => Promise<void>;
|
|
53
|
+
deleteTaskByIdsCallback?: (deletedTaskIds: Array<number>) => Promise<void>;
|
|
54
|
+
addTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
55
|
+
editTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
56
|
+
handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
|
|
57
|
+
handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
|
|
56
58
|
}
|
|
57
59
|
declare const TMSearchResult: React.FC<ITMSearchResultProps>;
|
|
58
60
|
export default TMSearchResult;
|