@topconsultnpm/sdkui-react-beta 6.17.38 → 6.17.39
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.
|
@@ -75,6 +75,9 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
75
75
|
const [archiveType, setArchiveType] = useState(undefined);
|
|
76
76
|
const [isOpenDetails, setIsOpenDetails] = useState(false);
|
|
77
77
|
const [isOpenMaster, setIsOpenMaster] = useState(false);
|
|
78
|
+
const [isOpenArchiveRelationForm, setIsOpenArchiveRelationForm] = useState(false);
|
|
79
|
+
const [archiveRelatedDcmtFormTID, setArchiveRelatedDcmtFormTID] = useState(undefined);
|
|
80
|
+
const [archiveRelatedDcmtFormMids, setArchiveRelatedDcmtFormMids] = useState([]);
|
|
78
81
|
const [secondaryMasterDcmts, setSecondaryMasterDcmts] = useState([]);
|
|
79
82
|
const [isOpenDcmtForm, setIsOpenDcmtForm] = useState(false);
|
|
80
83
|
const [currentTIDHasDetailRelations, setCurrentTIDHasDetailRelations] = useState();
|
|
@@ -476,13 +479,15 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
476
479
|
value: fetchAssociatedValues(type === 'detail' ? (assoc.item1 ?? 0) : (assoc.item2 ?? 0)) ?? ''
|
|
477
480
|
})) ?? [];
|
|
478
481
|
};
|
|
479
|
-
const
|
|
482
|
+
const archiveRelatedDcmtHandler = (relation, type) => {
|
|
480
483
|
const targetTID = type === 'detail' ? relation.detailTID : relation.masterTID;
|
|
481
484
|
if (!targetTID)
|
|
482
485
|
return;
|
|
483
486
|
const mids = mapAssociationsToMids(relation, type);
|
|
484
|
-
|
|
485
|
-
|
|
487
|
+
setArchiveType(type);
|
|
488
|
+
setArchiveRelatedDcmtFormTID(targetTID);
|
|
489
|
+
setArchiveRelatedDcmtFormMids(mids);
|
|
490
|
+
setIsOpenArchiveRelationForm(true);
|
|
486
491
|
};
|
|
487
492
|
const archiveRelatedDocuments = async (tid, type) => {
|
|
488
493
|
try {
|
|
@@ -506,7 +511,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
506
511
|
setShowRelatedDcmtsChooser(true);
|
|
507
512
|
}
|
|
508
513
|
else {
|
|
509
|
-
|
|
514
|
+
archiveRelatedDcmtHandler(withAssociations[0], type);
|
|
510
515
|
}
|
|
511
516
|
}
|
|
512
517
|
catch (error) {
|
|
@@ -556,7 +561,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
556
561
|
const relation = relatedDcmts?.find(r => r.id === selectedRelation[0]);
|
|
557
562
|
if (!relation || !archiveType)
|
|
558
563
|
return;
|
|
559
|
-
|
|
564
|
+
archiveRelatedDcmtHandler(relation, archiveType);
|
|
560
565
|
}
|
|
561
566
|
catch (error) {
|
|
562
567
|
TMExceptionBoxManager.show({ exception: error });
|
|
@@ -581,6 +586,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
581
586
|
isOpenDetails,
|
|
582
587
|
isOpenMaster,
|
|
583
588
|
isOpenDcmtForm,
|
|
589
|
+
isOpenArchiveRelationForm,
|
|
584
590
|
showToppyForApprove,
|
|
585
591
|
floatingActionConfig,
|
|
586
592
|
disableAccordionIfSingleCategory,
|
|
@@ -655,7 +661,18 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
655
661
|
return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: [dcmt], isForMaster: true, allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID), appendMasterDcmts: handleAddItem }) }, `${index}-${dcmt.DID}`));
|
|
656
662
|
})] }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: isOpenDcmtForm && _jsx(TMDcmtForm, { isModal: openDcmtFormAsModal || (dcmtFormLayoutMode === LayoutModes.Ark && focusedItem?.DID), titleModal: fromDTD?.name ?? '', TID: focusedItem?.TID, DID: focusedItem?.DID, layoutMode: dcmtFormLayoutMode, count: visibleItems.length, itemIndex: visibleItems.findIndex(o => o.rowIndex === focusedItem?.rowIndex) + 1, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onClose: () => { setIsOpenDcmtForm(false); }, onWFOperationCompleted: onWFOperationCompleted, onTaskCreateRequest: onTaskCreateRequest, onSavedAsyncCallback: async (tid, did, metadataResult) => {
|
|
657
663
|
await refreshFocusedDataRowAsync(tid, did, true, metadataResult);
|
|
658
|
-
}, onOpenS4TViewerRequest: onOpenS4TViewerRequest }) })
|
|
664
|
+
}, onOpenS4TViewerRequest: onOpenS4TViewerRequest }) }), isOpenArchiveRelationForm && _jsx(TMDcmtForm, { isModal: true, titleModal: SDKUI_Localizator.Archive + ' - ' + (archiveType === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster), TID: archiveRelatedDcmtFormTID, layoutMode: LayoutModes.Ark, inputMids: archiveRelatedDcmtFormMids, onClose: () => {
|
|
665
|
+
setIsOpenArchiveRelationForm(false);
|
|
666
|
+
setArchiveType(undefined);
|
|
667
|
+
setArchiveRelatedDcmtFormTID(undefined);
|
|
668
|
+
setArchiveRelatedDcmtFormMids([]);
|
|
669
|
+
}, onSavedAsyncCallback: async (tid, did, metadataResult) => {
|
|
670
|
+
setIsOpenArchiveRelationForm(false);
|
|
671
|
+
setArchiveType(undefined);
|
|
672
|
+
setArchiveRelatedDcmtFormTID(undefined);
|
|
673
|
+
setArchiveRelatedDcmtFormMids([]);
|
|
674
|
+
await onRefreshSearchAsync?.();
|
|
675
|
+
} })] }));
|
|
659
676
|
};
|
|
660
677
|
export default TMSearchResult;
|
|
661
678
|
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 });
|
|
@@ -353,33 +353,33 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
353
353
|
operationType: 'multiRow',
|
|
354
354
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
355
355
|
items: [
|
|
356
|
-
// {
|
|
357
|
-
// icon: svgToString(<IconRelation />),
|
|
358
|
-
// text: "Abbina documenti molti a molti",
|
|
359
|
-
// operationType: 'multiRow',
|
|
360
|
-
// disabled: fromDatagrid ? false : disabledForMultiRow(selectedItems, focusedItem),
|
|
361
|
-
// onClick: () => ShowAlert({ message: "TODO Abbina documenti molti a molti", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
362
|
-
// },
|
|
363
|
-
// {
|
|
364
|
-
// icon: svgToString(<IconRelation />),
|
|
365
|
-
// text: "Disabbina documenti molti a molti",
|
|
366
|
-
// operationType: 'multiRow',
|
|
367
|
-
// disabled: fromDatagrid ? false : disabledForMultiRow(selectedItems, focusedItem),
|
|
368
|
-
// onClick: () => ShowAlert({ message: "TODO Disabbina documenti molti a molti", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
369
|
-
// },
|
|
370
356
|
{
|
|
371
357
|
icon: svgToString(_jsx(IconRelation, {})),
|
|
372
|
-
text: "
|
|
358
|
+
text: "Abbina documenti molti a molti",
|
|
373
359
|
operationType: 'multiRow',
|
|
374
|
-
|
|
375
|
-
onClick:
|
|
360
|
+
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
361
|
+
onClick: () => ShowAlert({ message: "TODO Abbina documenti molti a molti", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
icon: svgToString(_jsx(IconRelation, {})),
|
|
365
|
+
text: "Disabbina documenti molti a molti",
|
|
366
|
+
operationType: 'multiRow',
|
|
367
|
+
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
368
|
+
onClick: () => ShowAlert({ message: "TODO Disabbina documenti molti a molti", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
376
369
|
},
|
|
377
370
|
{
|
|
378
371
|
icon: svgToString(_jsx(IconRelation, {})),
|
|
379
372
|
text: "Archivia documento dettaglio",
|
|
380
373
|
operationType: 'multiRow',
|
|
374
|
+
beginGroup: true,
|
|
381
375
|
onClick: async () => await archiveDetailDocuments?.(focusedItem?.TID)
|
|
382
376
|
},
|
|
377
|
+
{
|
|
378
|
+
icon: svgToString(_jsx(IconRelation, {})),
|
|
379
|
+
text: "Archivia documento master",
|
|
380
|
+
operationType: 'multiRow',
|
|
381
|
+
onClick: async () => await archiveMasterDocuments?.(focusedItem?.TID)
|
|
382
|
+
},
|
|
383
383
|
{
|
|
384
384
|
icon: svgToString(_jsx(IconRelation, {})),
|
|
385
385
|
text: SDKUI_Localizator.DcmtsMaster,
|