@topconsultnpm/sdkui-react 6.21.0-dev4.5 → 6.21.0-dev4.7
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 +23 -18
- package/lib/components/editors/TMTextBox.d.ts +1 -0
- package/lib/components/editors/TMTextBox.js +2 -1
- package/lib/components/features/documents/TMDcmtForm.d.ts +2 -0
- package/lib/components/features/documents/TMDcmtForm.js +2 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +5 -4
- package/lib/components/features/search/TMSearch.d.ts +2 -0
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchResult.d.ts +2 -0
- package/lib/components/features/search/TMSearchResult.js +2 -1
- package/lib/helper/Enum_Localizator.js +1 -0
- package/lib/helper/SDKUI_Localizator.d.ts +6 -0
- package/lib/helper/SDKUI_Localizator.js +60 -0
- package/lib/helper/certificateImportHelper.d.ts +43 -0
- package/lib/helper/certificateImportHelper.js +403 -0
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useDcmtOperations.d.ts +2 -1
- package/lib/hooks/useDcmtOperations.js +9 -1
- package/lib/hooks/useDocumentOperations.d.ts +2 -0
- package/lib/hooks/useDocumentOperations.js +26 -5
- package/lib/services/platform_services.d.ts +1 -1
- package/lib/ts/types.d.ts +2 -1
- package/lib/ts/types.js +1 -0
- package/package.json +1 -1
|
@@ -395,26 +395,31 @@ const TMContextMenu = ({ items, trigger = 'right', children, target, externalCon
|
|
|
395
395
|
];
|
|
396
396
|
});
|
|
397
397
|
};
|
|
398
|
-
// Caps overflowing submenus with max-height + scroll so every item stays reachable.
|
|
399
398
|
useLayoutEffect(() => {
|
|
400
399
|
if (hoveredSubmenus.length === 0)
|
|
401
400
|
return;
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
401
|
+
const capSubmenus = () => {
|
|
402
|
+
const padding = 8;
|
|
403
|
+
const submenus = document.querySelectorAll('[data-submenu="true"]');
|
|
404
|
+
submenus.forEach(el => {
|
|
405
|
+
el.style.maxHeight = '';
|
|
406
|
+
el.style.overflowY = '';
|
|
407
|
+
el.style.overflowX = '';
|
|
408
|
+
const rect = el.getBoundingClientRect();
|
|
409
|
+
const opensUp = el.dataset.openUp === 'true';
|
|
410
|
+
const available = opensUp
|
|
411
|
+
? rect.bottom - padding
|
|
412
|
+
: window.innerHeight - rect.top - padding;
|
|
413
|
+
if (rect.height <= available)
|
|
414
|
+
return;
|
|
415
|
+
el.style.maxHeight = `${Math.max(80, available)}px`;
|
|
416
|
+
el.style.overflowY = 'auto';
|
|
417
|
+
el.style.overflowX = 'hidden';
|
|
418
|
+
});
|
|
419
|
+
};
|
|
420
|
+
capSubmenus();
|
|
421
|
+
window.addEventListener('resize', capSubmenus);
|
|
422
|
+
return () => window.removeEventListener('resize', capSubmenus);
|
|
418
423
|
}, [hoveredSubmenus]);
|
|
419
424
|
const handleMouseLeave = (depth = 0) => {
|
|
420
425
|
if (isMobile)
|
|
@@ -495,6 +500,6 @@ const TMContextMenu = ({ items, trigger = 'right', children, target, externalCon
|
|
|
495
500
|
// display: 'inline-block',
|
|
496
501
|
WebkitTouchCallout: isIOS ? 'none' : undefined,
|
|
497
502
|
WebkitUserSelect: isIOS ? 'none' : undefined,
|
|
498
|
-
}, children: children })), menuState.visible && createPortal(_jsxs(_Fragment, { children: [_jsxs(S.MenuContainer, { ref: menuRef, "$x": menuState.position.x, "$y": menuState.position.y, "$openLeft": openLeft, "$openUp": openUp, "$isPositioned": isCalculated, "$externalControl": !!externalControl, "$needsScroll": needsScroll, "$maxHeight": maxHeight, children: [isMobile && menuState.parentNames.length > 0 && (_jsxs(S.MobileMenuHeader, { children: [_jsx(S.BackButton, { onClick: handleBack, "aria-label": "Go back", children: _jsx(IconArrowLeft, {}) }), _jsx(S.HeaderTitle, { children: currentParentName })] })), renderMenuItems(currentMenu, 0)] }), !isMobile && hoveredSubmenus.map((submenu, idx) => (_jsx(S.Submenu, { "$parentRect": submenu.parentRect, "$openUp": submenu.openUp, "data-submenu": "true", onMouseEnter: handleSubmenuMouseEnter, onMouseLeave: () => handleMouseLeave(submenu.depth), children: renderMenuItems(submenu.items, submenu.depth) }, `submenu-${submenu.depth}-${idx}`)))] }), document.body)] }));
|
|
503
|
+
}, children: children })), menuState.visible && createPortal(_jsxs(_Fragment, { children: [_jsxs(S.MenuContainer, { ref: menuRef, "$x": menuState.position.x, "$y": menuState.position.y, "$openLeft": openLeft, "$openUp": openUp, "$isPositioned": isCalculated, "$externalControl": !!externalControl, "$needsScroll": needsScroll, "$maxHeight": maxHeight, children: [isMobile && menuState.parentNames.length > 0 && (_jsxs(S.MobileMenuHeader, { children: [_jsx(S.BackButton, { onClick: handleBack, "aria-label": "Go back", children: _jsx(IconArrowLeft, {}) }), _jsx(S.HeaderTitle, { children: currentParentName })] })), renderMenuItems(currentMenu, 0)] }), !isMobile && hoveredSubmenus.map((submenu, idx) => (_jsx(S.Submenu, { "$parentRect": submenu.parentRect, "$openUp": submenu.openUp, "data-submenu": "true", "data-open-up": submenu.openUp ? 'true' : 'false', onMouseEnter: handleSubmenuMouseEnter, onMouseLeave: () => handleMouseLeave(submenu.depth), children: renderMenuItems(submenu.items, submenu.depth) }, `submenu-${submenu.depth}-${idx}`)))] }), document.body)] }));
|
|
499
504
|
};
|
|
500
505
|
export default TMContextMenu;
|
|
@@ -17,6 +17,7 @@ export interface ITMTextBox extends ITMEditorBase {
|
|
|
17
17
|
onClick?: () => void;
|
|
18
18
|
onValueChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
19
19
|
onBlur?: (value: string | undefined) => void;
|
|
20
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
20
21
|
}
|
|
21
22
|
declare const TMTextBox: React.FunctionComponent<ITMTextBox>;
|
|
22
23
|
export default TMTextBox;
|
|
@@ -34,7 +34,7 @@ const StyledTextBoxEditorButton = styled.div `
|
|
|
34
34
|
border-bottom-color: ${TMColors.primary};
|
|
35
35
|
}
|
|
36
36
|
`;
|
|
37
|
-
const TMTextBox = ({ autoComplete = 'off', autoFocus, maxLength, labelColor, precision, fromModal = false, scale, showClearButton, validationItems = [], label = '', readOnly = false, formulaItems = [], buttons = [], isModifiedWhen, placeHolder, elementStyle, width = '100%', maxValue, minValue, fontSize = FontSize.defaultFontSize, icon, labelPosition = 'left', value, disabled = false, type = 'text', onClick, onValueChanged, onBlur, borderRadius, allowedPattern }) => {
|
|
37
|
+
const TMTextBox = ({ autoComplete = 'off', autoFocus, maxLength, labelColor, precision, fromModal = false, scale, showClearButton, validationItems = [], label = '', readOnly = false, formulaItems = [], buttons = [], isModifiedWhen, placeHolder, elementStyle, width = '100%', maxValue, minValue, fontSize = FontSize.defaultFontSize, icon, labelPosition = 'left', value, disabled = false, type = 'text', onClick, onValueChanged, onBlur, onKeyDown, borderRadius, allowedPattern }) => {
|
|
38
38
|
const [initialType, setInitialType] = useState(type);
|
|
39
39
|
const [currentType, setCurrentType] = useState(type);
|
|
40
40
|
const [currentValue, setCurrentValue] = useState(value);
|
|
@@ -283,6 +283,7 @@ const TMTextBox = ({ autoComplete = 'off', autoFocus, maxLength, labelColor, pre
|
|
|
283
283
|
if (!scale && (e.key == "." || e.key == ","))
|
|
284
284
|
e.preventDefault();
|
|
285
285
|
}
|
|
286
|
+
onKeyDown?.(e);
|
|
286
287
|
}, "$isMobile": deviceType === DeviceType.MOBILE, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$maxValue": maxValue, "$width": width, "$type": currentType, "$borderRadius": borderRadius, style: { paddingRight: `${calculateRightPadding()}px`, cursor: onClick ? 'pointer' : undefined } }), (initialType === 'password' || initialType === 'secureText') && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: showPasswordIcon() }), initialType !== 'password' &&
|
|
287
288
|
_jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: type === 'number' ? '25px' : '6px', top: label.length > 0 ? '20px' : '3px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
|
|
288
289
|
_jsx(StyledTextBoxEditorButton, { onClick: () => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DcmtTypeDescriptor, HomeBlogPost, LayoutModes, ObjectRef, SearchResultDescriptor, TaskDescriptor, ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { DcmtInfo, FormModes, MetadataValueDescriptorEx, TaskContext } from '../../../ts';
|
|
4
|
+
import { IntesiCertificateData } from '../../../helper';
|
|
4
5
|
/**
|
|
5
6
|
* Definisce il contesto da cui è stato invocato il TMDcmtForm.
|
|
6
7
|
* Permette di gestire logiche diverse in base alla provenienza.
|
|
@@ -75,6 +76,7 @@ interface ITMDcmtFormProps {
|
|
|
75
76
|
mid: number;
|
|
76
77
|
value: string;
|
|
77
78
|
}>, tid?: number) => void;
|
|
79
|
+
fetchRemoteCertificates?: (email: string) => Promise<IntesiCertificateData[]>;
|
|
78
80
|
datagridUtility?: {
|
|
79
81
|
onRefreshSearchAsyncDatagrid?: () => Promise<void>;
|
|
80
82
|
onRefreshDataRowsAsync?: (() => Promise<void>);
|
|
@@ -57,7 +57,7 @@ export var InvocationContext;
|
|
|
57
57
|
let abortControllerLocal = new AbortController();
|
|
58
58
|
;
|
|
59
59
|
//#endregion
|
|
60
|
-
const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMode = FormModes.Update, invocationContext = InvocationContext.Default, showHeader = true, showBackButton = true, showDcmtFormSidebar = true, isClosable = false, showTodoDcmtForm = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, isModal = false, titleModal, widthModal = "100%", heightModal = "100%", allowNavigation = true, canNext, canPrev, count, itemIndex, onNext, onPrev, inputFile = null, inputMids = [], connectorFileSave = undefined, isSharedDcmt = false, sharedSourceTID, sharedSourceDID, allowRelations = true, allowButtonsRefs = false, openS4TViewer = false, enableDragDropOverlay = false, onClose, onSavedAsyncCallback, onSaveRecents, onWFOperationCompleted, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, onTaskCompleted, onTaskCreateRequest, moreInfoTasks, taskFormDialogComponent, handleNavigateToWGs, handleNavigateToDossiers, onReferenceClick, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor, s4TViewerDialogComponent, onScanRequest, passToSearch, datagridUtility }) => {
|
|
60
|
+
const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMode = FormModes.Update, invocationContext = InvocationContext.Default, showHeader = true, showBackButton = true, showDcmtFormSidebar = true, isClosable = false, showTodoDcmtForm = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, isModal = false, titleModal, widthModal = "100%", heightModal = "100%", allowNavigation = true, canNext, canPrev, count, itemIndex, onNext, onPrev, inputFile = null, inputMids = [], connectorFileSave = undefined, isSharedDcmt = false, sharedSourceTID, sharedSourceDID, allowRelations = true, allowButtonsRefs = false, openS4TViewer = false, enableDragDropOverlay = false, onClose, onSavedAsyncCallback, onSaveRecents, onWFOperationCompleted, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, onTaskCompleted, onTaskCreateRequest, moreInfoTasks, taskFormDialogComponent, handleNavigateToWGs, handleNavigateToDossiers, onReferenceClick, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor, s4TViewerDialogComponent, onScanRequest, passToSearch, fetchRemoteCertificates, datagridUtility }) => {
|
|
61
61
|
const { onRefreshSearchAsyncDatagrid, onRefreshBlogDatagrid, onRefreshPreviewDatagrid } = datagridUtility || {};
|
|
62
62
|
const floatingBarContainerRef = useRef(null);
|
|
63
63
|
const [id, setID] = useState('');
|
|
@@ -395,6 +395,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
395
395
|
currentSearchResults,
|
|
396
396
|
currentMetadataValues: formData,
|
|
397
397
|
allUsers,
|
|
398
|
+
fetchRemoteCertificates,
|
|
398
399
|
datagridUtility: {
|
|
399
400
|
onRefreshBlogDatagrid,
|
|
400
401
|
onRefreshPreviewDatagrid,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { HomeBlogPost, SearchResultDescriptor, TaskDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { RelationTreeItem } from './TMRelationViewer';
|
|
4
|
+
import { IntesiCertificateData } from '../../../helper';
|
|
4
5
|
import { DcmtInfo, TaskContext, MetadataValueDescriptorEx } from '../../../ts';
|
|
5
6
|
import { DeviceContextProps } from '../../base/TMDeviceProvider';
|
|
6
7
|
export type IRelatedDcmt = RelationTreeItem;
|
|
@@ -28,6 +29,7 @@ interface ITMMasterDetailDcmtsProps extends DeviceContextProps {
|
|
|
28
29
|
openS4TViewer?: boolean;
|
|
29
30
|
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: (() => Promise<void>)) => void;
|
|
30
31
|
onOpenPdfEditorRequest?: ((dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void);
|
|
32
|
+
fetchRemoteCertificates?: (email: string) => Promise<IntesiCertificateData[]>;
|
|
31
33
|
datagridUtility?: {
|
|
32
34
|
onRefreshSearchAsyncDatagrid?: () => Promise<void>;
|
|
33
35
|
onRefreshDataRowsAsync?: (() => Promise<void>);
|
|
@@ -16,7 +16,7 @@ import TMDcmtForm from './TMDcmtForm';
|
|
|
16
16
|
import { TMNothingToShow } from './TMDcmtPreview';
|
|
17
17
|
import { Spinner, TMButton } from '../..';
|
|
18
18
|
import { useDocumentOperations } from '../../../hooks/useDocumentOperations';
|
|
19
|
-
const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, deviceType, inputDcmts, isForMaster, showCurrentDcmtIndicator = true, allowNavigation, canNext, canPrev, onNext, onPrev, onBack, appendMasterDcmts, onTaskCreateRequest, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, datagridUtility, dcmtUtility, }) => {
|
|
19
|
+
const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, deviceType, inputDcmts, isForMaster, showCurrentDcmtIndicator = true, allowNavigation, canNext, canPrev, onNext, onPrev, onBack, appendMasterDcmts, onTaskCreateRequest, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, datagridUtility, dcmtUtility, fetchRemoteCertificates }) => {
|
|
20
20
|
const floatingBarContainerRef = useRef(null);
|
|
21
21
|
const [focusedItem, setFocusedItem] = useState();
|
|
22
22
|
const [selectedItems, setSelectedItems] = useState([]);
|
|
@@ -145,6 +145,7 @@ const TMMasterDetailDcmts = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallba
|
|
|
145
145
|
currentSearchResults: [],
|
|
146
146
|
currentMetadataValues: [],
|
|
147
147
|
allUsers: [],
|
|
148
|
+
fetchRemoteCertificates,
|
|
148
149
|
// searchResult: selectedSearchResult,
|
|
149
150
|
datagridUtility: {
|
|
150
151
|
visibleItems: [],
|
|
@@ -423,11 +424,11 @@ const TMRelationViewerWrapper = ({ refreshKey, inputDcmts, isForMaster, showCurr
|
|
|
423
424
|
}, [onItemContextMenu, handleFocusedItemChanged]);
|
|
424
425
|
return (_jsx(TMRelationViewer, { inputDcmts: inputDcmts, isForMaster: isForMaster, showCurrentDcmtIndicator: showCurrentDcmtIndicator, initialShowZeroDcmts: showZeroDcmts, customItemRender: customItemRender, allowMultipleSelection: allowMultipleSelection, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectedItemsChanged: onSelectedItemsChanged, maxDepthLevel: 1, invertMasterNavigation: false, showExpandAllButton: true, onNoRelationsFound: onNoRelationsFound, onItemContextMenu: onContextMenu, focusedItemFormData: focusedItemFormData }, refreshKey));
|
|
425
426
|
};
|
|
426
|
-
const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCreateRequest, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshSearchAsyncDatagrid, onRefreshSearchResults, handleNavigateToReference }) => {
|
|
427
|
+
const TMFormOrResultWrapper = ({ refreshKey, deviceType, focusedItem, onTaskCreateRequest, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, onRefreshAfterAddDcmtToFavs, editPdfForm, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, onRefreshSearchAsyncDatagrid, onRefreshSearchResults, handleNavigateToReference, fetchRemoteCertificates }) => {
|
|
427
428
|
const { setPanelVisibilityById } = useTMPanelManagerContext();
|
|
428
429
|
return (_jsx(_Fragment, { children: focusedItem?.isDcmt ?
|
|
429
430
|
_jsx(TMDcmtForm, { groupId: 'tmFormOrResult', TID: focusedItem?.tid, DID: focusedItem.did, allowButtonsRefs: true, isClosable: deviceType !== DeviceType.MOBILE, allowNavigation: false, allowRelations: deviceType !== DeviceType.MOBILE, showDcmtFormSidebar: false, onClose: () => { setPanelVisibilityById('tmTreeView', true); }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onReferenceClick: handleNavigateToReference, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.tid, focusedItem?.did), openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, datagridUtility: {
|
|
430
431
|
onRefreshSearchAsyncDatagrid,
|
|
431
|
-
} }, refreshKey) :
|
|
432
|
-
_jsx(TMSearchResult, { groupId: 'tmFormOrResult', isClosable: deviceType !== DeviceType.MOBILE, context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, allowRelations: false, openDcmtFormAsModal: true, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, showDcmtFormSidebar: false, autoFocusFirstRow: false, onTaskCreateRequest: onTaskCreateRequest, onClose: () => { setPanelVisibilityById('tmTreeView', true); }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, editPdfForm: editPdfForm, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, enablePinIcons: false, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, showBackButton: false, onRefreshSearchAsyncDatagrid: onRefreshSearchResults, onReferenceClick: handleNavigateToReference }, refreshKey) }));
|
|
432
|
+
}, fetchRemoteCertificates: fetchRemoteCertificates }, refreshKey) :
|
|
433
|
+
_jsx(TMSearchResult, { groupId: 'tmFormOrResult', isClosable: deviceType !== DeviceType.MOBILE, context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, allowRelations: false, openDcmtFormAsModal: true, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, showDcmtFormSidebar: false, autoFocusFirstRow: false, onTaskCreateRequest: onTaskCreateRequest, onClose: () => { setPanelVisibilityById('tmTreeView', true); }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, editPdfForm: editPdfForm, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, enablePinIcons: false, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, showBackButton: false, onRefreshSearchAsyncDatagrid: onRefreshSearchResults, onReferenceClick: handleNavigateToReference, fetchRemoteCertificates: fetchRemoteCertificates }, refreshKey) }));
|
|
433
434
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SavedQueryDescriptor, DcmtTypeDescriptor, TaskDescriptor, ObjectRef, HomeBlogPost } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { IntesiCertificateData } from '../../../helper';
|
|
3
4
|
import { DcmtInfo, TaskContext } from '../../../ts';
|
|
4
5
|
import { TMSearchResultFloatingActionConfig } from './TMSearchResultFloatingActionButton';
|
|
5
6
|
interface ITMSearchProps {
|
|
@@ -42,6 +43,7 @@ interface ITMSearchProps {
|
|
|
42
43
|
onReferenceClick?: (ref: ObjectRef) => void;
|
|
43
44
|
inputDID?: number;
|
|
44
45
|
formAutoOpen?: boolean;
|
|
46
|
+
fetchRemoteCertificates?: (email: string) => Promise<IntesiCertificateData[]>;
|
|
45
47
|
}
|
|
46
48
|
declare const TMSearch: React.FunctionComponent<ITMSearchProps>;
|
|
47
49
|
export default TMSearch;
|
|
@@ -20,7 +20,7 @@ var TMSearchViews;
|
|
|
20
20
|
TMSearchViews[TMSearchViews["Search"] = 0] = "Search";
|
|
21
21
|
TMSearchViews[TMSearchViews["Result"] = 1] = "Result";
|
|
22
22
|
})(TMSearchViews || (TMSearchViews = {}));
|
|
23
|
-
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, refreshFavoriteSavedQueries, inputDID, formAutoOpen }) => {
|
|
23
|
+
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, refreshFavoriteSavedQueries, inputDID, formAutoOpen, fetchRemoteCertificates }) => {
|
|
24
24
|
const [allSQDs, setAllSQDs] = useState([]);
|
|
25
25
|
const [filteredByTIDSQDs, setFilteredByTIDSQDs] = useState([]);
|
|
26
26
|
const [currentSQD, setCurrentSQD] = useState();
|
|
@@ -266,7 +266,7 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
266
266
|
toolbarOptions: { icon: _jsx(IconSavedQuery, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['TMSavedQuerySelector'] }
|
|
267
267
|
}
|
|
268
268
|
], [tmTreeSelectorElement, showSearchResults, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement, fromDTD, mruTIDs]);
|
|
269
|
-
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, inputDID: inputDID, formAutoOpen: formAutoOpen })] }));
|
|
269
|
+
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, inputDID: inputDID, formAutoOpen: formAutoOpen, fetchRemoteCertificates: fetchRemoteCertificates })] }));
|
|
270
270
|
};
|
|
271
271
|
export default TMSearch;
|
|
272
272
|
const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DcmtTypeDescriptor, HomeBlogPost, ObjectRef, SearchResultDescriptor, TaskDescriptor, WorkingGroupDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { IntesiCertificateData } from '../../../helper';
|
|
3
4
|
import { DcmtInfo, SearchResultContext, TaskContext } from '../../../ts';
|
|
4
5
|
import { TMSearchResultFloatingActionConfig } from './TMSearchResultFloatingActionButton';
|
|
5
6
|
export declare const getSearchResultCountersSingleCategory: (searchResults: SearchResultDescriptor[]) => string;
|
|
@@ -51,6 +52,7 @@ interface ITMSearchResultProps {
|
|
|
51
52
|
openFileUploaderPdfEditor?: (fromDTD?: DcmtTypeDescriptor, file?: File | null, handleFile?: (file: File) => void) => void;
|
|
52
53
|
openCommentFormCallback?: (documents: Array<DcmtInfo>) => void;
|
|
53
54
|
openAddDocumentForm?: () => void;
|
|
55
|
+
fetchRemoteCertificates?: (email: string) => Promise<IntesiCertificateData[]>;
|
|
54
56
|
allTasks?: Array<TaskDescriptor>;
|
|
55
57
|
getAllTasks?: () => Promise<void>;
|
|
56
58
|
deleteTaskByIdsCallback?: (deletedTaskIds: Array<number>) => Promise<void>;
|
|
@@ -60,7 +60,7 @@ openInOffice, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsyncDatagrid, onSelec
|
|
|
60
60
|
// Tasks
|
|
61
61
|
allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback,
|
|
62
62
|
// Navigation
|
|
63
|
-
handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
63
|
+
handleNavigateToWGs, handleNavigateToDossiers, fetchRemoteCertificates, }) => {
|
|
64
64
|
// Ref for the floating bar container (used to position the floating action buttons)
|
|
65
65
|
const floatingBarContainerRef = useRef(null);
|
|
66
66
|
// Ref per tracciare se autoFocusFirstRow=false deve bloccare l'auto-focus.
|
|
@@ -311,6 +311,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
|
|
|
311
311
|
currentSearchResults,
|
|
312
312
|
currentMetadataValues,
|
|
313
313
|
allUsers,
|
|
314
|
+
fetchRemoteCertificates,
|
|
314
315
|
searchResult: selectedSearchResult,
|
|
315
316
|
datagridUtility: {
|
|
316
317
|
visibleItems,
|
|
@@ -29,6 +29,7 @@ export function LocalizeDcmtOperationTypes(value) {
|
|
|
29
29
|
case DcmtOperationTypes.FreeSearchPurge: return SDKUI_Localizator.IndexingDelete;
|
|
30
30
|
case DcmtOperationTypes.BatchUpdate: return SDKUI_Localizator.BatchUpdate;
|
|
31
31
|
case DcmtOperationTypes.RemoveFromWorkgroup: return SDKUI_Localizator.RemoveFromWorkgroup;
|
|
32
|
+
case DcmtOperationTypes.ImportCertificates: return SDKUI_Localizator.ImportCertificates;
|
|
32
33
|
default: return value;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
@@ -390,6 +390,7 @@ export declare class SDKUI_Localizator {
|
|
|
390
390
|
static get ID_Hide(): "Ausblenden ID" | "Hide ID" | "Ocultar ID" | "Masquer ID" | "Nascondi ID";
|
|
391
391
|
static get ID_Show(): "ID anzeigen" | "Show ID" | "Mostrar ID" | "Afficher ID" | "Visualizza ID";
|
|
392
392
|
static get Import(): "Importieren" | "Import" | "Importar" | "Importer" | "Importa";
|
|
393
|
+
static get ImportCertificates(): string;
|
|
393
394
|
static get ImportExport(): "Importieren/Exportieren" | "Import/Export" | "Importar/Exportar" | "Importer/Exporter" | "Importa/Esporta";
|
|
394
395
|
static get ImportMRN(): "Importieren MRN" | "Import MRN" | "Importar MRN" | "Importer MRN";
|
|
395
396
|
static get ImportMRNNDayBack(): "Anzahl der Tage für die Importdatenwiederherstellung (MRN)" | "Number of days for import data recovery (MRN)" | "Número de días para la recuperación de datos de importación (MRN)" | "Nombre de jours pour la récupération des données d'importation (MRN)" | "Número de dias para recuperação de dados de importação (MRN)" | "Numero di giorni per il recupero dei dati di Import (MRN)";
|
|
@@ -420,6 +421,11 @@ export declare class SDKUI_Localizator {
|
|
|
420
421
|
static get LoadingWorkGroups(): string;
|
|
421
422
|
static get LoadingParticipants(): string;
|
|
422
423
|
static get Login(): string;
|
|
424
|
+
static get LoginAuth_ImplicitPINWithOTP(): string;
|
|
425
|
+
static get LoginAuth_ImplicitPINWithoutOTP(): string;
|
|
426
|
+
static get LoginAuth_PINWithOTP(): string;
|
|
427
|
+
static get LoginAuth_PINWithoutOTP(): string;
|
|
428
|
+
static get LoginAuth_Unknown(): string;
|
|
423
429
|
static get LogDelete(): "Löschen der Logik" | "Logical delete" | "Cancelación lógica" | "Suppression logique" | "Lógica de cancelamento" | "Cancellazione logica";
|
|
424
430
|
static get Logout(): "Abmelden" | "Logout" | "Cerrar sesión" | "Déconnexion" | "Sair" | "Esci";
|
|
425
431
|
static get LogFolder(): "Protokollordner" | "Log folder" | "Carpeta de registro" | "Dossier de journal" | "Pasta de registro" | "Cartella di log";
|
|
@@ -3868,6 +3868,16 @@ export class SDKUI_Localizator {
|
|
|
3868
3868
|
default: return "Importa";
|
|
3869
3869
|
}
|
|
3870
3870
|
}
|
|
3871
|
+
static get ImportCertificates() {
|
|
3872
|
+
switch (this._cultureID) {
|
|
3873
|
+
case CultureIDs.De_DE: return "Zertifikate importieren";
|
|
3874
|
+
case CultureIDs.En_US: return "Import certificates";
|
|
3875
|
+
case CultureIDs.Es_ES: return "Importar certificados";
|
|
3876
|
+
case CultureIDs.Fr_FR: return "Importer les certificats";
|
|
3877
|
+
case CultureIDs.Pt_PT: return "Importar certificados";
|
|
3878
|
+
default: return "Importa certificati";
|
|
3879
|
+
}
|
|
3880
|
+
}
|
|
3871
3881
|
static get ImportExport() {
|
|
3872
3882
|
switch (this._cultureID) {
|
|
3873
3883
|
case CultureIDs.De_DE: return "Importieren/Exportieren";
|
|
@@ -4168,6 +4178,56 @@ export class SDKUI_Localizator {
|
|
|
4168
4178
|
default: return "Accedi";
|
|
4169
4179
|
}
|
|
4170
4180
|
}
|
|
4181
|
+
static get LoginAuth_ImplicitPINWithOTP() {
|
|
4182
|
+
switch (this._cultureID) {
|
|
4183
|
+
case CultureIDs.De_DE: return "Implicit PIN mit OTP (4)";
|
|
4184
|
+
case CultureIDs.En_US: return "Implicit PIN with OTP (4)";
|
|
4185
|
+
case CultureIDs.Es_ES: return "PIN implícito con OTP (4)";
|
|
4186
|
+
case CultureIDs.Fr_FR: return "PIN implicite avec OTP (4)";
|
|
4187
|
+
case CultureIDs.Pt_PT: return "PIN implícito com OTP (4)";
|
|
4188
|
+
default: return "Implicit PIN con OTP (4)";
|
|
4189
|
+
}
|
|
4190
|
+
}
|
|
4191
|
+
static get LoginAuth_ImplicitPINWithoutOTP() {
|
|
4192
|
+
switch (this._cultureID) {
|
|
4193
|
+
case CultureIDs.De_DE: return "Implicit PIN ohne OTP (5)";
|
|
4194
|
+
case CultureIDs.En_US: return "Implicit PIN without OTP (5)";
|
|
4195
|
+
case CultureIDs.Es_ES: return "PIN implícito sin OTP (5)";
|
|
4196
|
+
case CultureIDs.Fr_FR: return "PIN implicite sans OTP (5)";
|
|
4197
|
+
case CultureIDs.Pt_PT: return "PIN implícito sem OTP (5)";
|
|
4198
|
+
default: return "Implicit PIN senza OTP (5)";
|
|
4199
|
+
}
|
|
4200
|
+
}
|
|
4201
|
+
static get LoginAuth_PINWithOTP() {
|
|
4202
|
+
switch (this._cultureID) {
|
|
4203
|
+
case CultureIDs.De_DE: return "PIN mit OTP (2)";
|
|
4204
|
+
case CultureIDs.En_US: return "PIN with OTP (2)";
|
|
4205
|
+
case CultureIDs.Es_ES: return "PIN con OTP (2)";
|
|
4206
|
+
case CultureIDs.Fr_FR: return "PIN avec OTP (2)";
|
|
4207
|
+
case CultureIDs.Pt_PT: return "PIN com OTP (2)";
|
|
4208
|
+
default: return "PIN con OTP (2)";
|
|
4209
|
+
}
|
|
4210
|
+
}
|
|
4211
|
+
static get LoginAuth_PINWithoutOTP() {
|
|
4212
|
+
switch (this._cultureID) {
|
|
4213
|
+
case CultureIDs.De_DE: return "PIN ohne OTP (0)";
|
|
4214
|
+
case CultureIDs.En_US: return "PIN without OTP (0)";
|
|
4215
|
+
case CultureIDs.Es_ES: return "PIN sin OTP (0)";
|
|
4216
|
+
case CultureIDs.Fr_FR: return "PIN sans OTP (0)";
|
|
4217
|
+
case CultureIDs.Pt_PT: return "PIN sem OTP (0)";
|
|
4218
|
+
default: return "PIN senza OTP (0)";
|
|
4219
|
+
}
|
|
4220
|
+
}
|
|
4221
|
+
static get LoginAuth_Unknown() {
|
|
4222
|
+
switch (this._cultureID) {
|
|
4223
|
+
case CultureIDs.De_DE: return "Unbekannt";
|
|
4224
|
+
case CultureIDs.En_US: return "Unknown";
|
|
4225
|
+
case CultureIDs.Es_ES: return "Desconocido";
|
|
4226
|
+
case CultureIDs.Fr_FR: return "Inconnu";
|
|
4227
|
+
case CultureIDs.Pt_PT: return "Desconhecido";
|
|
4228
|
+
default: return "Sconosciuto";
|
|
4229
|
+
}
|
|
4230
|
+
}
|
|
4171
4231
|
static get LogDelete() {
|
|
4172
4232
|
switch (this._cultureID) {
|
|
4173
4233
|
case CultureIDs.De_DE: return "Löschen der Logik";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ResultTypes } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
import { DcmtInfo } from '../ts';
|
|
3
|
+
export declare const S4T_USER_REGISTRY_MASTER: string;
|
|
4
|
+
export declare const S4T_CERTIFICATE_REGISTRY_DETAIL: string;
|
|
5
|
+
export interface IntesiCertificateData {
|
|
6
|
+
cid?: number;
|
|
7
|
+
alias?: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
description?: any;
|
|
10
|
+
domain?: string;
|
|
11
|
+
providerName?: string;
|
|
12
|
+
providerDescription?: string;
|
|
13
|
+
loginAuth?: number;
|
|
14
|
+
creationDate?: any;
|
|
15
|
+
validFrom?: any;
|
|
16
|
+
validTo?: any;
|
|
17
|
+
certificateStatus?: any;
|
|
18
|
+
revokeDate?: any;
|
|
19
|
+
}
|
|
20
|
+
interface ImportResultInfo {
|
|
21
|
+
rowIndex: number;
|
|
22
|
+
id1: number;
|
|
23
|
+
id2: number;
|
|
24
|
+
resultType: typeof ResultTypes[keyof typeof ResultTypes];
|
|
25
|
+
description?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Importa i certificati remoti per il documento corrente.
|
|
29
|
+
* Verifica se esistono già certificati nel sistema e li aggiorna o crea nuovi.
|
|
30
|
+
* Aggiorna il documento master con i metadati di elaborazione.
|
|
31
|
+
*
|
|
32
|
+
* @returns Array di ImportResultInfo con eventuali warning, o undefined se tutto ok
|
|
33
|
+
*/
|
|
34
|
+
export declare const importCertificatesAsync: (inputDcmt: DcmtInfo, rowIndex: number, fetchRemoteCertificates: ((email: string) => Promise<Array<IntesiCertificateData>>) | undefined, abortSignal?: AbortSignal) => Promise<ImportResultInfo[] | undefined>;
|
|
35
|
+
export declare const archiveUserRegistryDocument: (abortSignal: AbortSignal, params: {
|
|
36
|
+
email: string;
|
|
37
|
+
fiscalCode: string;
|
|
38
|
+
phoneNumber: string;
|
|
39
|
+
name: string;
|
|
40
|
+
surname: string;
|
|
41
|
+
type: string;
|
|
42
|
+
}) => Promise<void>;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import { MetadataDataTypes, DcmtTypeListCacheService, SDK_Globals, QueryDescriptor, FromItem, SelectItem, SystemMIDsAsNumber, WhereItem, QueryOperators, ArchiveEngineByID, ResultTypes, DataListCacheService } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
import { SDKUI_Localizator } from './SDKUI_Localizator';
|
|
3
|
+
// Costanti DTD usate nell'importazione certificati
|
|
4
|
+
export const S4T_USER_REGISTRY_MASTER = 'S4T_UserRegistry'.toLowerCase();
|
|
5
|
+
export const S4T_CERTIFICATE_REGISTRY_DETAIL = 'S4T_CertificateRegistry'.toLowerCase();
|
|
6
|
+
/**
|
|
7
|
+
* Formatta il valore di LoginAuth con la descrizione testuale
|
|
8
|
+
* 0 = PIN senza OTP, 2 = PIN con OTP, 4 = Implicit PIN con OTP, 5 = Implicit PIN senza OTP
|
|
9
|
+
*/
|
|
10
|
+
const formatLoginAuth = (value) => {
|
|
11
|
+
if (value === undefined || value === null)
|
|
12
|
+
return undefined;
|
|
13
|
+
switch (value) {
|
|
14
|
+
case 0: return SDKUI_Localizator.LoginAuth_PINWithoutOTP;
|
|
15
|
+
case 2: return SDKUI_Localizator.LoginAuth_PINWithOTP;
|
|
16
|
+
case 4: return SDKUI_Localizator.LoginAuth_ImplicitPINWithOTP;
|
|
17
|
+
case 5: return SDKUI_Localizator.LoginAuth_ImplicitPINWithoutOTP;
|
|
18
|
+
default: return `${SDKUI_Localizator.LoginAuth_Unknown} (${value})`;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Mapping tra nome metadato (lowercase) e proprietà di IntesiCertificateData
|
|
23
|
+
*/
|
|
24
|
+
const getCredentialValue = (cert, fieldName) => {
|
|
25
|
+
switch (fieldName) {
|
|
26
|
+
case 'ig_cid': return cert.cid;
|
|
27
|
+
case 'ig_alias': return cert.alias;
|
|
28
|
+
case 'ig_label': return cert.label;
|
|
29
|
+
case 'ig_description': return cert.description;
|
|
30
|
+
case 'ig_domain': return cert.domain;
|
|
31
|
+
case 'ig_providername': return cert.providerName;
|
|
32
|
+
case 'ig_providerdescription': return cert.providerDescription;
|
|
33
|
+
case 'ig_loginauth': return formatLoginAuth(cert.loginAuth);
|
|
34
|
+
case 'ig_creationdate': return cert.creationDate;
|
|
35
|
+
case 'ig_validfrom': return cert.validFrom;
|
|
36
|
+
case 'ig_validto': return cert.validTo;
|
|
37
|
+
case 'ig_certificatestatus': return cert.certificateStatus;
|
|
38
|
+
case 'ig_revokedate': return cert.revokeDate;
|
|
39
|
+
default: return undefined;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Popola i metadati dell'engine (Archive o Update) dal certificato
|
|
44
|
+
*/
|
|
45
|
+
const setEngineMetadataFromCertificate = (engine, metadata, cert, email) => {
|
|
46
|
+
for (const md of metadata) {
|
|
47
|
+
const mdNameLower = md.name?.toLowerCase();
|
|
48
|
+
const value = getCredentialValue(cert, mdNameLower ?? '');
|
|
49
|
+
if (value !== undefined && value !== null) {
|
|
50
|
+
switch (md.dataType) {
|
|
51
|
+
case MetadataDataTypes.DateTime:
|
|
52
|
+
// I valori arrivano sempre come timestamp in millisecondi
|
|
53
|
+
engine.Metadata_AddDateTime(md.id, new Date(value));
|
|
54
|
+
break;
|
|
55
|
+
case MetadataDataTypes.Number:
|
|
56
|
+
engine.Metadata_AddNumber(md.id, typeof value === 'number' ? value : parseFloat(value));
|
|
57
|
+
break;
|
|
58
|
+
case MetadataDataTypes.Varchar:
|
|
59
|
+
default:
|
|
60
|
+
engine.Metadata_AddString(md.id, String(value));
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Aggiungi il riferimento all'email del documento principale (email) se specificato
|
|
66
|
+
if (email !== undefined) {
|
|
67
|
+
const emailMetadata = metadata.find(md => md.name?.toLowerCase() === 'email');
|
|
68
|
+
if (emailMetadata) {
|
|
69
|
+
engine.Metadata_AddString(emailMetadata.id, email);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Recupera il contesto necessario per l'importazione certificati.
|
|
75
|
+
* Legge i metadati freschi dal backend per ottenere l'email corrente.
|
|
76
|
+
*/
|
|
77
|
+
const getCertificateImportContext = async (dcmtInfo) => {
|
|
78
|
+
const dtdMaster = await DcmtTypeListCacheService.GetAsync(dcmtInfo.TID);
|
|
79
|
+
const emailDescriptor = dtdMaster?.metadata?.find(md => md.name?.toLowerCase() === 'email');
|
|
80
|
+
// Legge i metadati freschi dal backend per ottenere l'email aggiornata
|
|
81
|
+
let email;
|
|
82
|
+
if (emailDescriptor) {
|
|
83
|
+
const metadataResult = await SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(dcmtInfo.TID, dcmtInfo.DID, true);
|
|
84
|
+
if (metadataResult?.selectMIDs && metadataResult?.dtdResult?.rows?.[0]) {
|
|
85
|
+
const midIndex = metadataResult.selectMIDs.indexOf(emailDescriptor.id);
|
|
86
|
+
if (midIndex >= 0) {
|
|
87
|
+
email = metadataResult.dtdResult.rows[0][midIndex];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const allDtds = await DcmtTypeListCacheService.GetAllWithoutMetadataAsync();
|
|
92
|
+
const dtdDetailWithoutMetadata = allDtds.find(d => d.name?.toLowerCase() === S4T_CERTIFICATE_REGISTRY_DETAIL);
|
|
93
|
+
const dtdDetail = dtdDetailWithoutMetadata ? await DcmtTypeListCacheService.GetAsync(dtdDetailWithoutMetadata.id) : undefined;
|
|
94
|
+
if (!email || !dtdMaster || !dtdDetail) {
|
|
95
|
+
const missingItems = [];
|
|
96
|
+
if (!email)
|
|
97
|
+
missingItems.push('email');
|
|
98
|
+
if (!dtdMaster)
|
|
99
|
+
missingItems.push('dtdMaster');
|
|
100
|
+
if (!dtdDetail)
|
|
101
|
+
missingItems.push('dtdDetail');
|
|
102
|
+
return { missingItems };
|
|
103
|
+
}
|
|
104
|
+
return { email, dtdMaster, dtdDetail };
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Costruisce la query per cercare certificati esistenti.
|
|
108
|
+
*/
|
|
109
|
+
const buildCertificateSearchQuery = (certificateTid, emailMid, cidMid, email, certificateCid) => {
|
|
110
|
+
const query = new QueryDescriptor();
|
|
111
|
+
query.from = new FromItem();
|
|
112
|
+
query.from.tid = certificateTid;
|
|
113
|
+
query.select = [];
|
|
114
|
+
const didSelectField = new SelectItem();
|
|
115
|
+
didSelectField.tid = query.from.tid;
|
|
116
|
+
didSelectField.mid = SystemMIDsAsNumber.DID;
|
|
117
|
+
query.select.push(didSelectField);
|
|
118
|
+
query.where = [];
|
|
119
|
+
// Condizione: email = email del documento padre
|
|
120
|
+
const emailCondition = new WhereItem();
|
|
121
|
+
emailCondition.tid = query.from.tid;
|
|
122
|
+
emailCondition.mid = emailMid;
|
|
123
|
+
emailCondition.value1 = email.toString();
|
|
124
|
+
emailCondition.or = false;
|
|
125
|
+
emailCondition.operator = QueryOperators.Equal;
|
|
126
|
+
query.where.push(emailCondition);
|
|
127
|
+
// Condizione: cid = CID del certificato remoto
|
|
128
|
+
const cidCondition = new WhereItem();
|
|
129
|
+
cidCondition.tid = query.from.tid;
|
|
130
|
+
cidCondition.mid = cidMid;
|
|
131
|
+
cidCondition.value1 = certificateCid.toString();
|
|
132
|
+
cidCondition.or = false;
|
|
133
|
+
cidCondition.operator = QueryOperators.Equal;
|
|
134
|
+
query.where.push(cidCondition);
|
|
135
|
+
return query;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Crea un nuovo documento certificato nel sistema.
|
|
139
|
+
*/
|
|
140
|
+
const createNewCertificateDocument = async (dtdDetail, remoteCertificate, email, abortSignal) => {
|
|
141
|
+
if (!dtdDetail)
|
|
142
|
+
throw new Error("DTD Detail non disponibile");
|
|
143
|
+
const ae = new ArchiveEngineByID(SDK_Globals.tmSession);
|
|
144
|
+
ae.TID = dtdDetail.id;
|
|
145
|
+
ae.Metadata_ClearAll();
|
|
146
|
+
setEngineMetadataFromCertificate(ae, dtdDetail.metadata ?? [], remoteCertificate, email);
|
|
147
|
+
await ae.ArchiveAsync(abortSignal);
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Aggiorna i certificati esistenti con i dati del certificato remoto.
|
|
151
|
+
*/
|
|
152
|
+
const updateExistingCertificates = async (rows, dtdDetail, remoteCertificate, email) => {
|
|
153
|
+
if (!dtdDetail)
|
|
154
|
+
throw new Error("DTD Detail non disponibile");
|
|
155
|
+
await Promise.all(rows.map(async (row) => {
|
|
156
|
+
const did = row?.[0];
|
|
157
|
+
if (did === undefined)
|
|
158
|
+
return;
|
|
159
|
+
const ue = SDK_Globals.tmSession?.NewUpdateEngineByID();
|
|
160
|
+
if (!ue)
|
|
161
|
+
throw new Error("Update Engine not available");
|
|
162
|
+
ue.DID = Number(did);
|
|
163
|
+
ue.TID = dtdDetail.id;
|
|
164
|
+
ue.Metadata_ClearAll();
|
|
165
|
+
setEngineMetadataFromCertificate(ue, dtdDetail.metadata ?? [], remoteCertificate, email);
|
|
166
|
+
await ue.UpdateAsync();
|
|
167
|
+
}));
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* Risultato dell'importazione certificati per determinare come aggiornare il master.
|
|
171
|
+
* Valori corrispondenti alla datalist "SYSTEM - Flusso base":
|
|
172
|
+
* - 2: Elaborato con successo
|
|
173
|
+
* - 3: Elaborato con warning (es. nessun certificato trovato)
|
|
174
|
+
* - 4: Elaborato con errori
|
|
175
|
+
*/
|
|
176
|
+
var ProcessingResult;
|
|
177
|
+
(function (ProcessingResult) {
|
|
178
|
+
ProcessingResult[ProcessingResult["SUCCESS"] = 2] = "SUCCESS";
|
|
179
|
+
ProcessingResult[ProcessingResult["WARNING"] = 3] = "WARNING";
|
|
180
|
+
ProcessingResult[ProcessingResult["ERROR"] = 4] = "ERROR";
|
|
181
|
+
})(ProcessingResult || (ProcessingResult = {}));
|
|
182
|
+
/** Lunghezza massima del campo processingResultDescription */
|
|
183
|
+
const MAX_PROCESSING_RESULT_DESCRIPTION_LENGTH = 500;
|
|
184
|
+
/** Tronca una stringa alla lunghezza massima consentita per processingResultDescription */
|
|
185
|
+
const truncateProcessingResultDescription = (message) => {
|
|
186
|
+
if (message.length <= MAX_PROCESSING_RESULT_DESCRIPTION_LENGTH)
|
|
187
|
+
return message;
|
|
188
|
+
return message.substring(0, MAX_PROCESSING_RESULT_DESCRIPTION_LENGTH - 3) + '...';
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Aggiorna il documento master con i metadati di elaborazione.
|
|
192
|
+
* - processingdate: data/ora corrente (solo se certificati trovati)
|
|
193
|
+
* - processingdatedescription: descrizione esito
|
|
194
|
+
* - guid: resettato (svuotato)
|
|
195
|
+
*/
|
|
196
|
+
const updateMasterDocument = async (dcmtInfo, dtdMaster, outcome, certificatesCount = 0, errorMessage) => {
|
|
197
|
+
const ue = SDK_Globals.tmSession?.NewUpdateEngineByID();
|
|
198
|
+
if (!ue)
|
|
199
|
+
throw new Error("Update Engine not available");
|
|
200
|
+
ue.DID = dcmtInfo.DID;
|
|
201
|
+
ue.TID = dcmtInfo.TID;
|
|
202
|
+
ue.Metadata_ClearAll();
|
|
203
|
+
const metadata = dtdMaster?.metadata ?? [];
|
|
204
|
+
// Trova i descrittori dei metadati (sempre in lowercase)
|
|
205
|
+
const processingDateDescriptor = metadata.find(md => md.name?.toLowerCase() === 'processingdate');
|
|
206
|
+
const processingResultDescriptor = metadata.find(md => md.name?.toLowerCase() === 'processingresult');
|
|
207
|
+
const processingResultDescriptionDescriptor = metadata.find(md => md.name?.toLowerCase() === 'processingresultdescription');
|
|
208
|
+
const guidDescriptor = metadata.find(md => md.name?.toLowerCase() === 'guid');
|
|
209
|
+
// Resetta sempre il metadato guid
|
|
210
|
+
if (guidDescriptor) {
|
|
211
|
+
ue.Metadata_AddString(guidDescriptor.id, '');
|
|
212
|
+
}
|
|
213
|
+
// Salva il risultato dell'elaborazione
|
|
214
|
+
if (processingResultDescriptor) {
|
|
215
|
+
if (processingResultDescriptor.dataListID) {
|
|
216
|
+
// Se esiste una datalist associata, usa il valore numerico
|
|
217
|
+
const dataList = await DataListCacheService.GetAsync(processingResultDescriptor.dataListID);
|
|
218
|
+
if (dataList && dataList.items) {
|
|
219
|
+
const itemExists = dataList.items.some((item) => Number(item.value) === outcome);
|
|
220
|
+
if (itemExists) {
|
|
221
|
+
ue.Metadata_AddNumber(processingResultDescriptor.id, outcome);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
// Se non c'è datalist, salva come stringa
|
|
227
|
+
const outcomeString = ProcessingResult[outcome]; // "SUCCESS", "WARNING", "ERROR"
|
|
228
|
+
ue.Metadata_AddString(processingResultDescriptor.id, outcomeString);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
// Aggiorna sempre la data di elaborazione
|
|
232
|
+
if (processingDateDescriptor) {
|
|
233
|
+
ue.Metadata_AddDateTime(processingDateDescriptor.id, new Date());
|
|
234
|
+
}
|
|
235
|
+
switch (outcome) {
|
|
236
|
+
case ProcessingResult.SUCCESS:
|
|
237
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
238
|
+
// CASO 1: CERTIFICATI TROVATI
|
|
239
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
240
|
+
// I certificati remoti sono stati trovati e importati con successo.
|
|
241
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
242
|
+
if (processingResultDescriptionDescriptor) {
|
|
243
|
+
const message = certificatesCount === 1
|
|
244
|
+
? 'Importazione completata con successo: 1 certificato elaborato'
|
|
245
|
+
: `Importazione completata con successo: ${certificatesCount} certificati elaborati`;
|
|
246
|
+
ue.Metadata_AddString(processingResultDescriptionDescriptor.id, truncateProcessingResultDescription(message));
|
|
247
|
+
}
|
|
248
|
+
break;
|
|
249
|
+
case ProcessingResult.WARNING:
|
|
250
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
251
|
+
// CASO 2: NESSUN CERTIFICATO TROVATO (WARNING)
|
|
252
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
253
|
+
// La chiamata al servizio remoto è andata a buon fine, ma non sono stati
|
|
254
|
+
// restituiti certificati per l'email associata al documento.
|
|
255
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
256
|
+
if (processingResultDescriptionDescriptor) {
|
|
257
|
+
ue.Metadata_AddString(processingResultDescriptionDescriptor.id, truncateProcessingResultDescription('Nessun certificato trovato'));
|
|
258
|
+
}
|
|
259
|
+
break;
|
|
260
|
+
case ProcessingResult.ERROR:
|
|
261
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
262
|
+
// CASO 3: ERRORE DI COMUNICAZIONE O RISPOSTA NON VALIDA
|
|
263
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
264
|
+
// Si è verificato un errore durante la comunicazione con il servizio remoto
|
|
265
|
+
// (es: timeout chiamata API, errore 500, risposta malformata, ecc.)
|
|
266
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
267
|
+
if (processingResultDescriptionDescriptor) {
|
|
268
|
+
ue.Metadata_AddString(processingResultDescriptionDescriptor.id, truncateProcessingResultDescription(errorMessage ?? 'Errore durante l\'importazione dei certificati'));
|
|
269
|
+
}
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
await ue.UpdateAsync();
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* Importa i certificati remoti per il documento corrente.
|
|
276
|
+
* Verifica se esistono già certificati nel sistema e li aggiorna o crea nuovi.
|
|
277
|
+
* Aggiorna il documento master con i metadati di elaborazione.
|
|
278
|
+
*
|
|
279
|
+
* @returns Array di ImportResultInfo con eventuali warning, o undefined se tutto ok
|
|
280
|
+
*/
|
|
281
|
+
export const importCertificatesAsync = async (inputDcmt, rowIndex, fetchRemoteCertificates, abortSignal) => {
|
|
282
|
+
const warnings = [];
|
|
283
|
+
// Recupera il contesto di importazione (email e DTD del certificato)
|
|
284
|
+
const importContext = await getCertificateImportContext(inputDcmt);
|
|
285
|
+
if ('missingItems' in importContext) {
|
|
286
|
+
return [{ rowIndex, id1: inputDcmt.TID, id2: inputDcmt.DID, resultType: ResultTypes.WARNING, description: `Impossibile importare i certificati. Valori mancanti: ${importContext.missingItems.join(', ')}` }];
|
|
287
|
+
}
|
|
288
|
+
if (!fetchRemoteCertificates) {
|
|
289
|
+
return [{ rowIndex, id1: inputDcmt.TID, id2: inputDcmt.DID, resultType: ResultTypes.WARNING, description: 'Callback fetchRemoteCertificates non definita. Impossibile importare i certificati.' }];
|
|
290
|
+
}
|
|
291
|
+
const { email, dtdMaster, dtdDetail } = importContext;
|
|
292
|
+
// Recupera i certificati remoti con gestione errori
|
|
293
|
+
let remoteCertificates;
|
|
294
|
+
try {
|
|
295
|
+
remoteCertificates = await fetchRemoteCertificates(email);
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
// Caso 3: errore di comunicazione o risposta non valida
|
|
299
|
+
const errorMessage = error instanceof Error ? error.message : 'Errore sconosciuto durante il recupero dei certificati';
|
|
300
|
+
await updateMasterDocument(inputDcmt, dtdMaster, ProcessingResult.ERROR, 0, errorMessage);
|
|
301
|
+
return [{ rowIndex, id1: inputDcmt.TID, id2: inputDcmt.DID, resultType: ResultTypes.WARNING, description: errorMessage }];
|
|
302
|
+
}
|
|
303
|
+
// Recupera i descrittori dei metadati necessari dal DTD
|
|
304
|
+
const dtd = await DcmtTypeListCacheService.GetAsync(dtdDetail?.id);
|
|
305
|
+
const emailDescriptor = dtd?.metadata?.find(md => md.name?.toLowerCase() === 'email');
|
|
306
|
+
const cidDescriptor = dtd?.metadata?.find(md => md.name?.toLowerCase() === 'ig_cid');
|
|
307
|
+
if (!emailDescriptor || !cidDescriptor) {
|
|
308
|
+
await updateMasterDocument(inputDcmt, dtdMaster, ProcessingResult.ERROR, 0, 'Metadati necessari per l\'importazione dei certificati non trovati nel DTD.');
|
|
309
|
+
return [{ rowIndex, id1: inputDcmt.TID, id2: inputDcmt.DID, resultType: ResultTypes.WARNING, description: 'Metadati necessari per l\'importazione dei certificati non trovati nel DTD.' }];
|
|
310
|
+
}
|
|
311
|
+
if (!remoteCertificates || remoteCertificates.length === 0) {
|
|
312
|
+
// Caso 2: nessun certificato trovato (warning)
|
|
313
|
+
await updateMasterDocument(inputDcmt, dtdMaster, ProcessingResult.WARNING);
|
|
314
|
+
return [{ rowIndex, id1: inputDcmt.TID, id2: inputDcmt.DID, resultType: ResultTypes.WARNING, description: 'Nessun certificato remoto trovato per questo documento.' }];
|
|
315
|
+
}
|
|
316
|
+
// Itera su ogni certificato remoto per verificare se esiste già nel sistema
|
|
317
|
+
// Conta i certificati effettivamente elaborati con successo
|
|
318
|
+
let successfullyProcessedCount = 0;
|
|
319
|
+
try {
|
|
320
|
+
await Promise.all(remoteCertificates.map(async (remoteCertificate) => {
|
|
321
|
+
// Validazione: il certificato deve avere un CID valido
|
|
322
|
+
if (remoteCertificate.cid === undefined) {
|
|
323
|
+
warnings.push({ rowIndex, id1: inputDcmt.TID, id2: inputDcmt.DID, resultType: ResultTypes.WARNING, description: 'Certificato remoto con informazioni incomplete (cid mancante). Impossibile importare questo certificato.' });
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
// Costruisce la query per verificare se esiste già un documento certificato
|
|
327
|
+
const certificateSearchQuery = buildCertificateSearchQuery(dtdDetail?.id, emailDescriptor.id, cidDescriptor.id, email, remoteCertificate.cid);
|
|
328
|
+
// Esegue la ricerca
|
|
329
|
+
const searchEngine = SDK_Globals.tmSession?.NewSearchEngine();
|
|
330
|
+
if (!searchEngine)
|
|
331
|
+
throw new Error("Search Engine not available");
|
|
332
|
+
const existingCertificateResult = await searchEngine.SearchByIDAsync(certificateSearchQuery);
|
|
333
|
+
if (existingCertificateResult === undefined) {
|
|
334
|
+
warnings.push({ rowIndex, id1: inputDcmt.TID, id2: inputDcmt.DID, resultType: ResultTypes.WARNING, description: 'Errore durante la verifica dei certificati esistenti. Impossibile importare questo certificato.' });
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
const dcmtsFound = existingCertificateResult.dcmtsFound ?? 0;
|
|
338
|
+
if (dcmtsFound === 0) {
|
|
339
|
+
// Crea nuovo certificato
|
|
340
|
+
await createNewCertificateDocument(dtdDetail, remoteCertificate, email, abortSignal);
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
// Aggiorna certificati esistenti
|
|
344
|
+
await updateExistingCertificates(existingCertificateResult.dtdResult?.rows ?? [], dtdDetail, remoteCertificate, email);
|
|
345
|
+
}
|
|
346
|
+
// Incrementa il conteggio solo se l'elaborazione è andata a buon fine
|
|
347
|
+
successfullyProcessedCount++;
|
|
348
|
+
}));
|
|
349
|
+
// Determina l'esito in base ai certificati effettivamente elaborati
|
|
350
|
+
if (successfullyProcessedCount === 0) {
|
|
351
|
+
// Nessun certificato elaborato con successo (tutti senza CID o con errori)
|
|
352
|
+
await updateMasterDocument(inputDcmt, dtdMaster, ProcessingResult.ERROR, 0, 'Errore durante l\'importazione dei certificati: nessun certificato valido trovato');
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
// Almeno un certificato elaborato con successo
|
|
356
|
+
await updateMasterDocument(inputDcmt, dtdMaster, ProcessingResult.SUCCESS, successfullyProcessedCount);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
catch (error) {
|
|
360
|
+
// Caso 3: errore durante l'importazione
|
|
361
|
+
const errorMessage = error instanceof Error ? error.message : 'Errore durante l\'importazione dei certificati';
|
|
362
|
+
await updateMasterDocument(inputDcmt, dtdMaster, ProcessingResult.ERROR, 0, errorMessage);
|
|
363
|
+
warnings.push({ rowIndex, id1: inputDcmt.TID, id2: inputDcmt.DID, resultType: ResultTypes.WARNING, description: errorMessage });
|
|
364
|
+
}
|
|
365
|
+
return warnings.length > 0 ? warnings : undefined;
|
|
366
|
+
};
|
|
367
|
+
export const archiveUserRegistryDocument = async (abortSignal, params) => {
|
|
368
|
+
try {
|
|
369
|
+
const allDtds = await DcmtTypeListCacheService.GetAllWithoutMetadataAsync();
|
|
370
|
+
const dtdMasterWithoutMetadata = allDtds.find(d => d.name?.toLowerCase() === S4T_USER_REGISTRY_MASTER);
|
|
371
|
+
const dtdMaster = dtdMasterWithoutMetadata ? await DcmtTypeListCacheService.GetAsync(dtdMasterWithoutMetadata.id) : undefined;
|
|
372
|
+
if (!dtdMaster) {
|
|
373
|
+
throw new Error(`DTD Master "${S4T_USER_REGISTRY_MASTER}" non trovato`);
|
|
374
|
+
}
|
|
375
|
+
const ae = new ArchiveEngineByID(SDK_Globals.tmSession);
|
|
376
|
+
ae.TID = dtdMaster.id;
|
|
377
|
+
ae.Metadata_ClearAll();
|
|
378
|
+
// Aggiunge i metadati dall'oggetto params
|
|
379
|
+
const metadata = dtdMaster.metadata ?? [];
|
|
380
|
+
const emailDescriptor = metadata.find(md => md.name?.toLowerCase() === 'email');
|
|
381
|
+
if (emailDescriptor)
|
|
382
|
+
ae.Metadata_AddString(emailDescriptor.id, params.email);
|
|
383
|
+
const fiscalCodeDescriptor = metadata.find(md => md.name?.toLowerCase() === 'fiscalcode');
|
|
384
|
+
if (fiscalCodeDescriptor)
|
|
385
|
+
ae.Metadata_AddString(fiscalCodeDescriptor.id, params.fiscalCode);
|
|
386
|
+
const phoneNumberDescriptor = metadata.find(md => md.name?.toLowerCase() === 'phonenumber');
|
|
387
|
+
if (phoneNumberDescriptor)
|
|
388
|
+
ae.Metadata_AddString(phoneNumberDescriptor.id, params.phoneNumber);
|
|
389
|
+
const nameDescriptor = metadata.find(md => md.name?.toLowerCase() === 'name');
|
|
390
|
+
if (nameDescriptor)
|
|
391
|
+
ae.Metadata_AddString(nameDescriptor.id, params.name);
|
|
392
|
+
const surnameDescriptor = metadata.find(md => md.name?.toLowerCase() === 'surname');
|
|
393
|
+
if (surnameDescriptor)
|
|
394
|
+
ae.Metadata_AddString(surnameDescriptor.id, params.surname);
|
|
395
|
+
const typeDescriptor = metadata.find(md => md.name?.toLowerCase() === 'certificatemethod');
|
|
396
|
+
if (typeDescriptor)
|
|
397
|
+
ae.Metadata_AddString(typeDescriptor.id, params.type);
|
|
398
|
+
await ae.ArchiveAsync(abortSignal);
|
|
399
|
+
}
|
|
400
|
+
catch (error) {
|
|
401
|
+
throw error;
|
|
402
|
+
}
|
|
403
|
+
};
|
package/lib/helper/index.d.ts
CHANGED
package/lib/helper/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RetrieveFileOptions, DcmtOpers, FileDescriptor, GeneralRetrieveFormats, InvoiceRetrieveFormats, OrderRetrieveFormats, FileFormats } from '@topconsultnpm/sdk-ts';
|
|
2
2
|
import { DcmtInfo, DcmtOperationTypes, DownloadModes, DownloadTypes } from '../ts';
|
|
3
|
+
import { IntesiCertificateData } from '../helper/certificateImportHelper';
|
|
3
4
|
export interface RetrieveFormatOptions {
|
|
4
5
|
retrieveReason?: DcmtOpers;
|
|
5
6
|
cvtFormat?: FileFormats;
|
|
@@ -44,7 +45,7 @@ export interface UseDcmtOperationsReturn {
|
|
|
44
45
|
clearDcmtsFileCache: () => void;
|
|
45
46
|
removeDcmtsFileCache: (key: string) => void;
|
|
46
47
|
isDcmtFileInCache: (key: string) => boolean;
|
|
47
|
-
runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>;
|
|
48
|
+
runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>, fetchRemoteCertificates?: (email: string) => Promise<IntesiCertificateData[]>) => Promise<void>;
|
|
48
49
|
FileSourceDialog: () => JSX.Element;
|
|
49
50
|
}
|
|
50
51
|
export declare const useDcmtOperations: () => UseDcmtOperationsReturn;
|
|
@@ -5,6 +5,7 @@ import { ShowAlert, TMResultManager, FormulaHelper, TMExceptionBoxManager, TMSpi
|
|
|
5
5
|
import { Globalization, getExceptionMessage, dialogConfirmOperation, extensionHandler, downloadBase64File, SDKUI_Globals, dcmtsFileCacheDownload, CACHE_SIZE_LIMIT, clearDcmtsFileCache, dcmtsFileCachePreview, isDcmtFileInCache, removeDcmtsFileCache, SDKUI_Localizator, ZipManager } from '../helper';
|
|
6
6
|
import { DcmtOperationTypes, DownloadTypes, FileExtensionHandler } from '../ts';
|
|
7
7
|
import { useFileDialog, useFileSourceDialog } from './useInputDialog';
|
|
8
|
+
import { importCertificatesAsync } from '../helper/certificateImportHelper';
|
|
8
9
|
import { isXMLFileExt } from '../helper/dcmtsHelper';
|
|
9
10
|
import { ShowConfirm } from '../components/base/TMConfirm';
|
|
10
11
|
import { generateTargetFileName } from '../components/features/documents/copyAndMergeDcmtsShared';
|
|
@@ -635,7 +636,7 @@ export const useDcmtOperations = () => {
|
|
|
635
636
|
}
|
|
636
637
|
}
|
|
637
638
|
};
|
|
638
|
-
const runOperationAsync = async (inputDcmts, dcmtOperationType, actionAfterOperationAsync) => {
|
|
639
|
+
const runOperationAsync = async (inputDcmts, dcmtOperationType, actionAfterOperationAsync, fetchRemoteCertificates) => {
|
|
639
640
|
if (inputDcmts === undefined)
|
|
640
641
|
return;
|
|
641
642
|
if (inputDcmts.length <= 0)
|
|
@@ -780,6 +781,13 @@ export const useDcmtOperations = () => {
|
|
|
780
781
|
}
|
|
781
782
|
break;
|
|
782
783
|
}
|
|
784
|
+
case DcmtOperationTypes.ImportCertificates: {
|
|
785
|
+
const importWarnings = await importCertificatesAsync(inputDcmts[i], i, fetchRemoteCertificates, abortController.signal);
|
|
786
|
+
if (importWarnings) {
|
|
787
|
+
result.push(...importWarnings);
|
|
788
|
+
}
|
|
789
|
+
break;
|
|
790
|
+
}
|
|
783
791
|
}
|
|
784
792
|
result.push({ rowIndex: i, id1: inputDcmts[i].TID, id2: inputDcmts[i].DID, resultType: ResultTypes.SUCCESS });
|
|
785
793
|
}
|
|
@@ -6,6 +6,7 @@ import { DcmtInfo, MetadataValueDescriptorEx, SearchResultContext, TaskContext }
|
|
|
6
6
|
import { UseCheckInOutOperationsReturn } from "./useCheckInOutOperations";
|
|
7
7
|
import { UseDcmtOperationsReturn } from "./useDcmtOperations";
|
|
8
8
|
import { UseRelatedDocumentsReturn } from "./useRelatedDocuments";
|
|
9
|
+
import { IntesiCertificateData } from '../helper';
|
|
9
10
|
export interface DocumentDataProps {
|
|
10
11
|
dtd: DcmtTypeDescriptor | undefined;
|
|
11
12
|
selectedItems: Array<any>;
|
|
@@ -14,6 +15,7 @@ export interface DocumentDataProps {
|
|
|
14
15
|
currentMetadataValues: Array<MetadataValueDescriptorEx>;
|
|
15
16
|
allUsers?: Array<UserDescriptor>;
|
|
16
17
|
searchResult?: SearchResultDescriptor;
|
|
18
|
+
fetchRemoteCertificates?: (email: string) => Promise<IntesiCertificateData[]>;
|
|
17
19
|
datagridUtility?: {
|
|
18
20
|
visibleItems?: any[];
|
|
19
21
|
onRefreshSearchAsyncDatagrid?: () => Promise<void>;
|
|
@@ -21,7 +21,7 @@ import { useDcmtOperations } from "./useDcmtOperations";
|
|
|
21
21
|
import useFloatingBarPinnedItems from "./useFloatingBarPinnedItems";
|
|
22
22
|
import { useInputAttachmentsDialog, useInputCvtFormatDialog } from "./useInputDialog";
|
|
23
23
|
import { useRelatedDocuments } from "./useRelatedDocuments";
|
|
24
|
-
import { convertSearchResultDescriptorToFileItems, dcmtsFileCachePreview, getDcmtCicoStatus, getMoreInfoTasksForDocument, IconActivity, IconArchiveDetail, IconArchiveDoc, IconArchiveMaster, IconBatchUpdate, IconCheck, IconCheckFile, IconCheckIn, IconCircleInfo, IconCloseCircle, IconConvertFilePdf, IconCopy, IconCustom, IconDelete, IconDetailDcmts, IconDotsVerticalCircleOutline, IconDownload, IconEdit, IconExportTo, IconFileDots, IconHide, IconInfo, IconMenuCAArchive, IconMoveToFolder, IconPair, IconPin, IconPlatform, IconPreview, IconRelation, IconSearch, IconShare, IconSharedDcmt, IconShow, IconSignaturePencil, IconStar, IconSubstFile, IconUndo, IconUnpair, IconUserGroupOutline, isConvertibleToPdfExt, isPdfEditorAvailable, SDKUI_Globals, SDKUI_Localizator, searchResultToMetadataValues, TMImageLibrary } from '../helper';
|
|
24
|
+
import { convertSearchResultDescriptorToFileItems, dcmtsFileCachePreview, getDcmtCicoStatus, getMoreInfoTasksForDocument, IconActivity, IconArchiveDetail, IconArchiveDoc, IconArchiveMaster, IconBatchUpdate, IconCheck, IconCheckFile, IconCheckIn, IconCircleInfo, IconCloseCircle, IconConvertFilePdf, IconCopy, IconCustom, IconDelete, IconDetailDcmts, IconDotsVerticalCircleOutline, IconDownload, IconEdit, IconExportTo, IconFileDots, IconHide, IconImport, IconInfo, IconMenuCAArchive, IconMoveToFolder, IconPair, IconPin, IconPlatform, IconPreview, IconRelation, IconSearch, IconShare, IconSharedDcmt, IconShow, IconSignaturePencil, IconStar, IconSubstFile, IconUndo, IconUnpair, IconUserGroupOutline, isConvertibleToPdfExt, isPdfEditorAvailable, S4T_USER_REGISTRY_MASTER, SDKUI_Globals, SDKUI_Localizator, searchResultToMetadataValues, TMImageLibrary } from '../helper';
|
|
25
25
|
import { isXMLFileExt } from "../helper/dcmtsHelper";
|
|
26
26
|
import TMCopyToFolderForm from "../components/features/documents/TMCopyToFolderForm";
|
|
27
27
|
import TMMergeToPdfForm from "../components/features/documents/TMMergeToPdfForm";
|
|
@@ -52,7 +52,7 @@ export const getAllFieldSelectedDcmtsOrFocused = (selectedItems, focusedItem, fi
|
|
|
52
52
|
};
|
|
53
53
|
export const useDocumentOperations = (props) => {
|
|
54
54
|
const { context, documentData, exportData, uiConfig, tasks, callbacks, } = props;
|
|
55
|
-
const { dtd, selectedItems, focusedItem, searchResult, currentSearchResults, currentMetadataValues, allUsers = [], datagridUtility, dcmtUtility, } = documentData;
|
|
55
|
+
const { dtd, selectedItems, focusedItem, searchResult, currentSearchResults, currentMetadataValues, allUsers = [], datagridUtility, dcmtUtility, fetchRemoteCertificates, } = documentData;
|
|
56
56
|
/** State for managing the document(s) to process */
|
|
57
57
|
const [selectedDcmtInfos, setSelectedDcmtInfos] = useState([]);
|
|
58
58
|
const [selectedItemsFull, setSelectedItemsFull] = useState([]);
|
|
@@ -618,6 +618,25 @@ export const useDocumentOperations = (props) => {
|
|
|
618
618
|
disabled: isDisabledForMultiRow(),
|
|
619
619
|
onClick: async () => { await runOperationAsync(selectedDcmtInfos, DcmtOperationTypes.VerifySign); }
|
|
620
620
|
},
|
|
621
|
+
{
|
|
622
|
+
id: 'sign-sync',
|
|
623
|
+
icon: _jsx(IconImport, {}),
|
|
624
|
+
name: SDKUI_Localizator.ImportCertificates,
|
|
625
|
+
operationType: 'multiRow',
|
|
626
|
+
// Visibile solo per tipo documento 'S4T_certificate_registry' con metadato 'email' e se la callback fetchRemoteCertificates è definita
|
|
627
|
+
visible: !!(dtd?.name?.toLowerCase() === S4T_USER_REGISTRY_MASTER
|
|
628
|
+
&& dtd?.metadata?.some(md => md.name?.toLowerCase() === 'email')
|
|
629
|
+
&& fetchRemoteCertificates !== undefined),
|
|
630
|
+
disabled: isDisabledForMultiRow(),
|
|
631
|
+
beginGroup: true,
|
|
632
|
+
onClick: async () => {
|
|
633
|
+
await runOperationAsync(selectedDcmtInfos, DcmtOperationTypes.ImportCertificates, async () => {
|
|
634
|
+
await onRefreshSearchAsyncDatagrid?.();
|
|
635
|
+
await updateCurrentDcmt?.();
|
|
636
|
+
}, // refresh
|
|
637
|
+
fetchRemoteCertificates);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
621
640
|
]
|
|
622
641
|
};
|
|
623
642
|
};
|
|
@@ -1326,6 +1345,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1326
1345
|
onTaskCreateRequest,
|
|
1327
1346
|
datagridUtility,
|
|
1328
1347
|
dcmtUtility,
|
|
1348
|
+
fetchRemoteCertificates
|
|
1329
1349
|
};
|
|
1330
1350
|
const masterDetailMasterCommonProps = {
|
|
1331
1351
|
deviceType,
|
|
@@ -1353,6 +1373,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1353
1373
|
onTaskCreateRequest,
|
|
1354
1374
|
datagridUtility,
|
|
1355
1375
|
dcmtUtility,
|
|
1376
|
+
fetchRemoteCertificates
|
|
1356
1377
|
};
|
|
1357
1378
|
const renderDcmtOperations = (_jsxs(_Fragment, { children: [(showExportForm && searchResult && dataColumns && dataSource && selectedRowKeys) && (_jsx(TMDataGridExportForm, { dataColumns: dataColumns, dataSource: dataSource, selectedRowKeys: selectedRowKeys, onCloseExportForm: () => setShowExportForm(false), searchResult: searchResult })), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: ((isOpenDcmtForm && focusedItem?.TID !== undefined && focusedItem?.DID !== undefined) &&
|
|
1358
1379
|
_jsx(TMDcmtForm, { isModal: openDcmtFormAsModal || (dcmtFormLayoutMode === LayoutModes.Ark && focusedItem?.DID !== undefined), titleModal: dtd?.name ?? '', TID: focusedItem.TID, DID: focusedItem.DID, allowButtonsRefs: true, showTodoDcmtForm: showTodoDcmtForm, layoutMode: dcmtFormLayoutMode, count: visibleItems?.length, itemIndex: visibleItems ? visibleItems.findIndex(o => o.rowIndex === focusedItem?.rowIndex) + 1 : undefined, canNext: canNavigateHandler ? canNavigateHandler('next') : false, canPrev: canNavigateHandler ? canNavigateHandler('prev') : false, onNext: () => onNavigateHandler && onNavigateHandler('next'), onPrev: () => onNavigateHandler && onNavigateHandler('prev'), onClose: () => { (false); onDcmtFormOpenChange(false, LayoutModes.Update); }, onWFOperationCompleted: onWFOperationCompleted, onTaskCreateRequest: onTaskCreateRequest, onSavedAsyncCallback: onSavedAsyncCallback, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openFileUploaderPdfEditor: openFileUploaderPdfEditor, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.TID, focusedItem?.DID), showDcmtFormSidebar: showDcmtFormSidebar, datagridUtility: {
|
|
@@ -1361,7 +1382,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1361
1382
|
refreshFocusedDataRowAsync,
|
|
1362
1383
|
onRefreshBlogDatagrid,
|
|
1363
1384
|
onRefreshPreviewDatagrid
|
|
1364
|
-
} })) }), (showHistory && dtd && selectedDcmtInfos.length > 0) && _jsx(TMViewHistoryDcmt, { fromDTD: dtd, deviceType: deviceType, inputDcmt: selectedDcmtInfos[0], onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (commentFormState.show && selectedDcmtInfos.length > 0) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: selectedDcmtInfos[0].TID, did: selectedDcmtInfos[0].DID } }, onClose: hideCommentFormCallback, refreshCallback: onRefreshBlog, participants: [], showAttachmentsSection: true, allArchivedDocumentsFileItems: convertSearchResultDescriptorToFileItems(currentSearchResults ?? []), isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment, selectedAttachmentDid: [Number(selectedDcmtInfos[0].DID)] }), (showCheckoutInformationForm && dtd && selectedDcmtInfos.length > 0) &&
|
|
1385
|
+
}, fetchRemoteCertificates: fetchRemoteCertificates })) }), (showHistory && dtd && selectedDcmtInfos.length > 0) && _jsx(TMViewHistoryDcmt, { fromDTD: dtd, deviceType: deviceType, inputDcmt: selectedDcmtInfos[0], onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (commentFormState.show && selectedDcmtInfos.length > 0) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: selectedDcmtInfos[0].TID, did: selectedDcmtInfos[0].DID } }, onClose: hideCommentFormCallback, refreshCallback: onRefreshBlog, participants: [], showAttachmentsSection: true, allArchivedDocumentsFileItems: convertSearchResultDescriptorToFileItems(currentSearchResults ?? []), isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment, selectedAttachmentDid: [Number(selectedDcmtInfos[0].DID)] }), (showCheckoutInformationForm && dtd && selectedDcmtInfos.length > 0) &&
|
|
1365
1386
|
_jsx(TMDcmtCheckoutInfoForm, { dtdName: dtd.name ?? SDKUI_Localizator.SearchResult, selectedDcmtOrFocused: selectedDcmtInfos[0], onClose: hideCheckoutInformationFormCallback }), isOpenDetailsModal && _jsx(TMModal, { width: "95%", height: "95%", onClose: () => setIsOpenDetailsModal(false), title: SDKUI_Localizator.Relations, children: _jsx(TMMasterDetailDcmts, { ...masterDetailDetailsCommonProps, onBack: () => setIsOpenDetailsModal(false) }) }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDetails, children: isOpenDetails && _jsx(TMMasterDetailDcmts, { ...masterDetailDetailsCommonProps, onBack: () => setIsOpenDetails(false) }) }), isOpenMasterModal && _jsx(TMModal, { width: "95%", height: "95%", onClose: () => setIsOpenMasterModal(false), title: SDKUI_Localizator.Relations, children: _jsx(TMMasterDetailDcmts, { ...masterDetailMasterCommonProps, onBack: () => setIsOpenMasterModal(false) }) }), _jsxs(StyledMultiViewPanel, { "$isVisible": isOpenMaster, children: [isOpenMaster && _jsx(TMMasterDetailDcmts, { ...masterDetailMasterCommonProps, onBack: () => setIsOpenMaster(false) }), secondaryMasterDcmts.length > 0 && secondaryMasterDcmts.map((dcmt, index) => {
|
|
1366
1387
|
return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { ...masterDetailMasterCommonProps, inputDcmts: [dcmt], allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID) }) }, `${index}-${dcmt.DID}`));
|
|
1367
1388
|
})] }), isOpenArchiveRelationForm && _jsx(TMDcmtForm, { isModal: true, titleModal: SDKUI_Localizator.Archive + ' - ' + (archiveType === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster), TID: archiveRelatedDcmtFormTID, layoutMode: LayoutModes.Ark, inputMids: archiveRelatedDcmtFormMids, showBackButton: false, allowButtonsRefs: false, onClose: () => {
|
|
@@ -1408,7 +1429,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1408
1429
|
TMSpinner.hide();
|
|
1409
1430
|
}
|
|
1410
1431
|
}, onClose: () => setShowManyToManyChooser(false), manageUseLocalizedName: false }), showPairDcmtsModal &&
|
|
1411
|
-
_jsx(TMModal, { title: (isPairingManyToMany ? "Abbina" : "Disabbina") + " documenti", onClose: () => setShowPairDcmtsModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearchResult, { searchResults: pairedSearchResults, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsyncDatagrid: onRefreshSearchAsyncDatagrid, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, passToArchiveCallback: passToArchiveCallback, showTodoDcmtForm: showTodoDcmtForm, allowFloatingBar: false, floatingActionConfig: pairFloatingActionConfig, showBackButton: false, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter }) }), showPairSearchModal &&
|
|
1432
|
+
_jsx(TMModal, { title: (isPairingManyToMany ? "Abbina" : "Disabbina") + " documenti", onClose: () => setShowPairDcmtsModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearchResult, { searchResults: pairedSearchResults, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsyncDatagrid: onRefreshSearchAsyncDatagrid, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, passToArchiveCallback: passToArchiveCallback, showTodoDcmtForm: showTodoDcmtForm, allowFloatingBar: false, floatingActionConfig: pairFloatingActionConfig, showBackButton: false, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, fetchRemoteCertificates: fetchRemoteCertificates }) }), showPairSearchModal &&
|
|
1412
1433
|
_jsx(TMModal, { title: "Ricerca documenti", onClose: () => setShowPairSearchModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearch, { onlyShowSearchQueryPanel: true, inputTID: pairSearchModalTargetTID, inputMids: pairSearchModalInputMids, floatingActionConfig: pairSearchModalFloatingActionConfig, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), isOpenSharedArchive && _jsx(TMModal, { title: SDKUI_Localizator.SharedArchiving, onClose: () => {
|
|
1413
1434
|
setIsOpenSharedArchive(false);
|
|
1414
1435
|
}, width: isMobile ? '90%' : '60%', height: isMobile ? '90%' : '80%', children: _jsx(TMArchive, { inputDID: selectedDcmtInfos?.[0].DID, inputTID: selectedDcmtInfos?.[0].TID, inputMids: currentMetadataValues.filter(md => md.mid && md.mid > 100).map(md => ({ mid: md.mid, value: md.value ?? '' })), isSharedArchive: true, inputFile: sharedDcmtFile, onSavedAsyncCallback: async (tid, did) => {
|
|
@@ -1417,7 +1438,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1417
1438
|
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), sharedDcmtSearchResults.length > 0 &&
|
|
1418
1439
|
_jsx(TMModal, { title: "Documenti condivisi", onClose: () => {
|
|
1419
1440
|
setSharedDcmtSearchResults([]);
|
|
1420
|
-
}, width: isMobile ? '90%' : '60%', height: isMobile ? '90%' : '80%', children: _jsx(TMSearchResult, { searchResults: sharedDcmtSearchResults, allowFloatingBar: false, showSelector: true, disableAccordionIfSingleCategory: true, showBackButton: isMobile, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: `${SDKUI_Localizator.BatchUpdate} (${selectedDcmtInfos.length} documenti selezionati)`, inputDcmts: selectedDcmtInfos, TID: selectedDcmtInfos.length > 0 ? selectedDcmtInfos[0]?.TID : undefined, DID: selectedDcmtInfos.length > 0 ? selectedDcmtInfos[0]?.DID : undefined, onBack: () => updateBatchUpdateForm(false), onSavedCallbackAsync: async () => {
|
|
1441
|
+
}, width: isMobile ? '90%' : '60%', height: isMobile ? '90%' : '80%', children: _jsx(TMSearchResult, { searchResults: sharedDcmtSearchResults, allowFloatingBar: false, showSelector: true, disableAccordionIfSingleCategory: true, showBackButton: isMobile, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, fetchRemoteCertificates: fetchRemoteCertificates }) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: `${SDKUI_Localizator.BatchUpdate} (${selectedDcmtInfos.length} documenti selezionati)`, inputDcmts: selectedDcmtInfos, TID: selectedDcmtInfos.length > 0 ? selectedDcmtInfos[0]?.TID : undefined, DID: selectedDcmtInfos.length > 0 ? selectedDcmtInfos[0]?.DID : undefined, onBack: () => updateBatchUpdateForm(false), onSavedCallbackAsync: async () => {
|
|
1421
1442
|
updateBatchUpdateForm(false);
|
|
1422
1443
|
setIsModifiedBatchUpdate(false);
|
|
1423
1444
|
await onRefreshDataRowsAsync?.();
|
|
@@ -3,7 +3,7 @@ export declare class PlatformObjectService {
|
|
|
3
3
|
static readonly retrieveAllAsync: (objClass: ObjectClasses, refreshCache?: boolean) => Promise<import("@topconsultnpm/sdk-ts").RelationDescriptor[] | import("@topconsultnpm/sdk-ts").AreaDescriptor[] | import("@topconsultnpm/sdk-ts").NotificationDescriptor[] | import("@topconsultnpm/sdk-ts").TaskDescriptor[] | import("@topconsultnpm/sdk-ts").WorkingGroupDescriptor[] | undefined>;
|
|
4
4
|
static readonly retrieveAsync: (objClass: ObjectClasses, id: number) => Promise<import("@topconsultnpm/sdk-ts").RelationDescriptor | import("@topconsultnpm/sdk-ts").AreaDescriptor | import("@topconsultnpm/sdk-ts").BasketTypeDescriptor | import("@topconsultnpm/sdk-ts").NotificationDescriptor | import("@topconsultnpm/sdk-ts").TaskDescriptor | import("@topconsultnpm/sdk-ts").WorkingGroupDescriptor | undefined>;
|
|
5
5
|
private static readonly retrieveAllAdminJobsAsync;
|
|
6
|
-
static readonly retrieveAllAdminAsync: (objClass: ObjectClasses, jobType?: JobTypes) => Promise<import("@topconsultnpm/sdk-ts").UserDescriptor[] | import("@topconsultnpm/sdk-ts").RelationDescriptor[] | import("@topconsultnpm/sdk-ts").GroupDescriptor[] |
|
|
6
|
+
static readonly retrieveAllAdminAsync: (objClass: ObjectClasses, jobType?: JobTypes) => Promise<import("@topconsultnpm/sdk-ts").UserDescriptor[] | DcmtTypeDescriptor[] | import("@topconsultnpm/sdk-ts").RelationDescriptor[] | import("@topconsultnpm/sdk-ts").GroupDescriptor[] | import("@topconsultnpm/sdk-ts").AreaDescriptor[] | import("@topconsultnpm/sdk-ts").FEDistillerJobDescriptor[] | import("@topconsultnpm/sdk-ts").DataListDescriptor[] | import("@topconsultnpm/sdk-ts").DiskDescriptor[] | import("@topconsultnpm/sdk-ts").LDAPDescriptor[] | import("@topconsultnpm/sdk-ts").NumeratorDescriptor[] | ProcessDescriptor[] | import("@topconsultnpm/sdk-ts").SAPLoginDescriptor[] | import("@topconsultnpm/sdk-ts").SignCertDescriptor[] | import("@topconsultnpm/sdk-ts").SignServerDescriptor[] | import("@topconsultnpm/sdk-ts").TreeDescriptor[] | import("@topconsultnpm/sdk-ts").TSADescriptor[] | import("@topconsultnpm/sdk-ts").WFDescriptor[] | undefined>;
|
|
7
7
|
private static readonly loadCacheForJobAsync;
|
|
8
8
|
private static readonly retrieveAdminJobAsync;
|
|
9
9
|
static readonly retrieveAdminAsync: (objClass: ObjectClasses, jobType: JobTypes, id: number) => Promise<import("@topconsultnpm/sdk-ts").UserDescriptor | import("@topconsultnpm/sdk-ts").WFDescriptor | DcmtTypeDescriptor | import("@topconsultnpm/sdk-ts").DataListDescriptor | import("@topconsultnpm/sdk-ts").RelationDescriptor | import("@topconsultnpm/sdk-ts").GroupDescriptor | import("@topconsultnpm/sdk-ts").SavedQueryDescriptor | import("@topconsultnpm/sdk-ts").AreaDescriptor | import("@topconsultnpm/sdk-ts").BasketTypeDescriptor | import("@topconsultnpm/sdk-ts").TaskDescriptor | import("@topconsultnpm/sdk-ts").WorkingGroupDescriptor | import("@topconsultnpm/sdk-ts").BarcodeArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").BatchUpdaterJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoDoganaleJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoDoganalePlusJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoDoganaleDistillerJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoFiscaleQueryJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoFiscaleSenderJobDescriptor | import("@topconsultnpm/sdk-ts").CheckSequenceJobDescriptor | import("@topconsultnpm/sdk-ts").COSCheckerJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtConverterJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtCreatorJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtDeleterJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtNoteJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtPrinterJobDescriptor | import("@topconsultnpm/sdk-ts").FEAttacherJobDescriptor | import("@topconsultnpm/sdk-ts").FECreatorTxtJobDescriptor | import("@topconsultnpm/sdk-ts").FEDetacherJobDescriptor | import("@topconsultnpm/sdk-ts").FEDistillerJobDescriptor | import("@topconsultnpm/sdk-ts").FESenderWsJobDescriptor | import("@topconsultnpm/sdk-ts").FESplitterJobDescriptor | import("@topconsultnpm/sdk-ts").FEValidatorJobDescriptor | import("@topconsultnpm/sdk-ts").FileArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").FileCheckerJobDescriptor | import("@topconsultnpm/sdk-ts").FileExecJobDescriptor | import("@topconsultnpm/sdk-ts").FileExportJobDescriptor | import("@topconsultnpm/sdk-ts").FileMoverJobDescriptor | import("@topconsultnpm/sdk-ts").LexJobDescriptor | import("@topconsultnpm/sdk-ts").LinkerJobDescriptor | import("@topconsultnpm/sdk-ts").MailArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").MailQueryJobDescriptor | import("@topconsultnpm/sdk-ts").MailSenderJobDescriptor | import("@topconsultnpm/sdk-ts").MigrationJobDescriptor | import("@topconsultnpm/sdk-ts").OcrSixJobDescriptor | import("@topconsultnpm/sdk-ts").PdDCreatorJobDescriptor | import("@topconsultnpm/sdk-ts").PDFArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").PdVArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").PdVQueryJobDescriptor | import("@topconsultnpm/sdk-ts").PdVSenderJobDescriptor | import("@topconsultnpm/sdk-ts").PeppolQueryJobDescriptor | import("@topconsultnpm/sdk-ts").PeppolSenderJobDescriptor | import("@topconsultnpm/sdk-ts").PostelQueryJobDescriptor | import("@topconsultnpm/sdk-ts").PostelSenderJobDescriptor | import("@topconsultnpm/sdk-ts").ReplicatorJobDescriptor | import("@topconsultnpm/sdk-ts").SAPAlignerJobDescriptor | import("@topconsultnpm/sdk-ts").SAPBarcodeJobDescriptor | import("@topconsultnpm/sdk-ts").SAPDataReaderJobDescriptor | import("@topconsultnpm/sdk-ts").SAPDataWriterJobDescriptor | import("@topconsultnpm/sdk-ts").SignerJobDescriptor | import("@topconsultnpm/sdk-ts").SpoolArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").UpdaterJobDescriptor | import("@topconsultnpm/sdk-ts").DiskDescriptor | import("@topconsultnpm/sdk-ts").LDAPDescriptor | import("@topconsultnpm/sdk-ts").NumeratorDescriptor | ProcessDescriptor | import("@topconsultnpm/sdk-ts").SAPLoginDescriptor | import("@topconsultnpm/sdk-ts").SignCertDescriptor | import("@topconsultnpm/sdk-ts").SignServerDescriptor | import("@topconsultnpm/sdk-ts").TreeDescriptor | import("@topconsultnpm/sdk-ts").TSADescriptor | undefined>;
|
package/lib/ts/types.d.ts
CHANGED
package/lib/ts/types.js
CHANGED
|
@@ -40,6 +40,7 @@ export var DcmtOperationTypes;
|
|
|
40
40
|
DcmtOperationTypes[DcmtOperationTypes["BatchUpdate"] = 14] = "BatchUpdate";
|
|
41
41
|
DcmtOperationTypes[DcmtOperationTypes["RemoveFromWorkgroup"] = 15] = "RemoveFromWorkgroup";
|
|
42
42
|
DcmtOperationTypes[DcmtOperationTypes["CopyCompliant"] = 16] = "CopyCompliant";
|
|
43
|
+
DcmtOperationTypes[DcmtOperationTypes["ImportCertificates"] = 17] = "ImportCertificates";
|
|
43
44
|
})(DcmtOperationTypes || (DcmtOperationTypes = {}));
|
|
44
45
|
export var DownloadTypes;
|
|
45
46
|
(function (DownloadTypes) {
|