@topconsultnpm/sdkui-react 6.22.0-dev2.19 → 6.22.0-dev2.20
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/ContextMenu/TMContextMenu.js +1 -1
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +1 -1
- package/lib/components/base/TMDataGrid.d.ts +2 -0
- package/lib/components/base/TMDataGrid.js +68 -4
- package/lib/components/base/TMModal.d.ts +4 -0
- package/lib/components/base/TMModal.js +42 -11
- package/lib/components/features/documents/TMDcmtForm.d.ts +7 -0
- package/lib/components/features/documents/TMDcmtForm.js +94 -40
- package/lib/components/features/documents/TMMasterDetailDcmts.js +88 -30
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +19 -0
- package/lib/components/features/documents/TMMasterInfoFields.js +172 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +40 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +256 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +352 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +221 -0
- package/lib/components/features/documents/TMRelationViewer.d.ts +14 -1
- package/lib/components/features/documents/TMRelationViewer.js +69 -20
- package/lib/components/features/search/TMSearchResult.d.ts +8 -0
- package/lib/components/features/search/TMSearchResult.js +131 -23
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +24 -14
- package/lib/components/layout/panelManager/TMPanelWrapper.js +2 -2
- package/lib/components/layout/panelManager/types.d.ts +3 -0
- package/lib/helper/SDKUI_Globals.d.ts +34 -0
- package/lib/helper/SDKUI_Globals.js +37 -0
- package/lib/helper/SDKUI_Localizator.d.ts +18 -0
- package/lib/helper/SDKUI_Localizator.js +180 -0
- package/lib/helper/TMIcons.d.ts +1 -0
- package/lib/helper/TMIcons.js +3 -0
- package/lib/helper/dcmtsHelper.d.ts +20 -0
- package/lib/helper/dcmtsHelper.js +58 -1
- package/lib/helper/helpers.d.ts +9 -0
- package/lib/helper/helpers.js +8 -0
- package/lib/hooks/useArchiveListForm.d.ts +39 -0
- package/lib/hooks/useArchiveListForm.js +46 -0
- package/lib/hooks/useDocumentOperations.d.ts +1 -0
- package/lib/hooks/useDocumentOperations.js +16 -4
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +97 -0
- package/lib/hooks/useMultiMasterDetailDcmts.js +555 -0
- package/lib/hooks/useRelatedDocuments.js +2 -26
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useCallback, useMemo, useEffect } from 'react';
|
|
3
3
|
import { SDKUI_Localizator } from '../helper/SDKUI_Localizator';
|
|
4
4
|
import { IconPair, IconUnpair } from '../helper/TMIcons';
|
|
5
|
-
import { hasDetailRelations, hasMasterRelations } from '../helper/dcmtsHelper';
|
|
5
|
+
import { hasDetailRelations, hasMasterRelations, mapRelationAssociationsToMids } from '../helper/dcmtsHelper';
|
|
6
6
|
import { SDK_Globals, SearchEngine, RelationCacheService, RelationTypes, DcmtTypeListCacheService, SystemMIDsAsNumber, AccessLevelsEx } from '@topconsultnpm/sdk-ts';
|
|
7
7
|
import { TMSpinner, TMExceptionBoxManager, ShowAlert } from '../components';
|
|
8
8
|
export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, currentSearchResults }) => {
|
|
@@ -224,31 +224,7 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
|
|
|
224
224
|
};
|
|
225
225
|
//This ensures archive master/detail works correctly regardless of output metadata configuration.
|
|
226
226
|
const mapAssociationsToMidsAsync = useCallback(async (relation, type) => {
|
|
227
|
-
|
|
228
|
-
return [];
|
|
229
|
-
if (!focusedItem?.TID || !focusedItem?.DID)
|
|
230
|
-
return [];
|
|
231
|
-
const searchEngine = SDK_Globals.tmSession?.NewSearchEngine();
|
|
232
|
-
if (!searchEngine)
|
|
233
|
-
return [];
|
|
234
|
-
const allMetadata = await searchEngine.GetMetadataAsync(focusedItem.TID, focusedItem.DID, false);
|
|
235
|
-
if (!allMetadata?.dtdResult?.rows?.[0] || !allMetadata.selectMIDs)
|
|
236
|
-
return [];
|
|
237
|
-
const row = allMetadata.dtdResult.rows[0];
|
|
238
|
-
const mids = allMetadata.selectMIDs;
|
|
239
|
-
const metadataMap = new Map();
|
|
240
|
-
mids.forEach((mid, index) => {
|
|
241
|
-
const value = row[index];
|
|
242
|
-
if (value !== undefined && value !== null) {
|
|
243
|
-
metadataMap.set(mid, value.toString());
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
return relation.associations.map(assoc => {
|
|
247
|
-
const sourceMid = type === 'detail' ? (assoc.item1 ?? 0) : (assoc.item2 ?? 0);
|
|
248
|
-
const targetMid = type === 'detail' ? (assoc.item2 ?? 0) : (assoc.item1 ?? 0);
|
|
249
|
-
const value = metadataMap.get(sourceMid) ?? '';
|
|
250
|
-
return { mid: targetMid, value };
|
|
251
|
-
});
|
|
227
|
+
return mapRelationAssociationsToMids(relation, type, focusedItem);
|
|
252
228
|
}, [focusedItem]);
|
|
253
229
|
const archiveRelatedDcmtHandler = useCallback(async (relation, type) => {
|
|
254
230
|
const targetTID = type === 'detail' ? relation.detailTID : relation.masterTID;
|