@topconsultnpm/sdkui-react-beta 6.14.109 → 6.14.110
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/features/assistant/ToppyHelpCenter.js +2 -2
- package/lib/components/features/documents/TMDcmtForm.js +4 -9
- package/lib/components/features/search/TMSearchResult.js +3 -12
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +1 -2
- package/lib/components/features/workflow/TMWorkflowPopup.js +87 -35
- package/package.json +2 -2
|
@@ -42,7 +42,7 @@ const wiggle = keyframes `
|
|
|
42
42
|
// Styled Components
|
|
43
43
|
const ToppyContainer = styled.div `
|
|
44
44
|
position: ${({ $fixed }) => ($fixed ? 'fixed' : 'absolute')};
|
|
45
|
-
bottom: ${({ $isCollapsed, $isMobile }) => $isMobile ? '
|
|
45
|
+
bottom: ${({ $isCollapsed, $isMobile }) => $isMobile ? '60px' : $isCollapsed ? '5px' : '-20px'};
|
|
46
46
|
right: ${({ $isCollapsed }) => ($isCollapsed ? '5px' : '10px')};
|
|
47
47
|
display: flex;
|
|
48
48
|
flex-direction: column-reverse;
|
|
@@ -78,7 +78,7 @@ const ToppyContent = styled.div `
|
|
|
78
78
|
rgba(27, 20, 100, 0.65) 100%
|
|
79
79
|
);
|
|
80
80
|
color: white;
|
|
81
|
-
padding: 10px;
|
|
81
|
+
padding: ${props => props.$isMobile ? '18px' : '10px'};
|
|
82
82
|
border-radius: 10px;
|
|
83
83
|
border: 1px solid #FFFFFF;
|
|
84
84
|
opacity: ${props => (props.$isCollapsed ? 0 : 1)};
|
|
@@ -3,7 +3,7 @@ import { useEffect, useMemo, useState } from 'react';
|
|
|
3
3
|
import TMDcmtPreview from './TMDcmtPreview';
|
|
4
4
|
import { AccessLevels, ArchiveConstraints, ArchiveEngineByID, DcmtTypeListCacheService, LayoutModes, MetadataDataTypes, ResultTypes, SDK_Globals, SDK_Localizator, SystemMIDsAsNumber, TemplateTIDs, TID_DID, UpdateEngineByID, ValidationItem } from '@topconsultnpm/sdk-ts-beta';
|
|
5
5
|
import { ContextMenu } from 'devextreme-react';
|
|
6
|
-
import { WorkFlowApproveRejectPopUp, WorkFlowOperationButtons, WorkFlowReAssignPopUp } from '../workflow/TMWorkflowPopup';
|
|
6
|
+
import { WorkFlowApproveRejectPopUp, WorkFlowMoreInfoPopUp, WorkFlowOperationButtons, WorkFlowReAssignPopUp } from '../workflow/TMWorkflowPopup';
|
|
7
7
|
import { DownloadTypes, FormModes } from '../../../ts';
|
|
8
8
|
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
|
9
9
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
@@ -55,6 +55,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
55
55
|
const [showApprovePopup, setShowApprovePopup] = useState(false);
|
|
56
56
|
const [showRejectPopup, setShowRejectPopup] = useState(false);
|
|
57
57
|
const [showReAssignPopup, setShowReAssignPopup] = useState(false);
|
|
58
|
+
const [showMoreInfoPopup, setShowMoreInfoPopup] = useState(false);
|
|
58
59
|
const [isOpenDetails, setIsOpenDetails] = useState(false);
|
|
59
60
|
const [isOpenMaster, setIsOpenMaster] = useState(false);
|
|
60
61
|
const [secondaryMasterDcmts, setSecondaryMasterDcmts] = useState([]);
|
|
@@ -638,14 +639,8 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
638
639
|
isEditable: true,
|
|
639
640
|
value: FormulaHelper.addFormulaTag(newFormula.expression)
|
|
640
641
|
}));
|
|
641
|
-
} }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowReAssignPopup(false) }), (isModal && onClose) && _jsx("div", { id: "TMDcmtFormShowConfirmForClose-" + id })] }), showToppyForApprove && (_jsx(ToppyHelpCenter, { deviceType: deviceType, usePortal: false, content: workItems.length === 1 ?
|
|
642
|
-
_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: () => ShowAlert({ message: 'TODO', mode: 'info', title: SDKUI_Localizator.SignatureAndApprove, duration: 3000 }), onReject: () =>
|
|
643
|
-
const did = Number(DID);
|
|
644
|
-
openTaskFormHandler((task) => {
|
|
645
|
-
SDK_Globals.tmSession?.NewWorkflowEngine().WorkItem_MoreInfoAsync(approvalVID, did, task?.id ?? 0)
|
|
646
|
-
.catch(err => TMExceptionBoxManager.show({ exception: err }));
|
|
647
|
-
});
|
|
648
|
-
} }) })
|
|
642
|
+
} }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowMoreInfoPopup(false) }), (isModal && onClose) && _jsx("div", { id: "TMDcmtFormShowConfirmForClose-" + id })] }), showToppyForApprove && (_jsx(ToppyHelpCenter, { deviceType: deviceType, usePortal: false, content: workItems.length === 1 ?
|
|
643
|
+
_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: () => ShowAlert({ message: 'TODO', mode: 'info', title: SDKUI_Localizator.SignatureAndApprove, duration: 3000 }), onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true) }) })
|
|
649
644
|
:
|
|
650
645
|
_jsxs("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: [`Devi approvare ${workItems.length} workitem(s) per questo documento.`, `Vai alla sezione di approvazione.`] }) })), isOpenDetails &&
|
|
651
646
|
_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, isForMaster: false, inputDcmts: getSelectionDcmtInfo(), allowNavigation: allowNavigation, canNext: canNext, canPrev: canPrev, onNext: onNext, onPrev: onPrev, onBack: () => setIsOpenDetails(false) }) }), isOpenMaster &&
|
|
@@ -14,7 +14,7 @@ import TMButton from '../../base/TMButton';
|
|
|
14
14
|
import TMDataGrid, { TMDataGridPageSize } from '../../base/TMDataGrid';
|
|
15
15
|
import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
|
16
16
|
import { TMSplitterLayout, TMLayoutItem } from '../../base/TMLayout';
|
|
17
|
-
import { TMMessageBoxManager, ButtonNames
|
|
17
|
+
import { TMMessageBoxManager, ButtonNames } from '../../base/TMPopUp';
|
|
18
18
|
import TMTooltip from '../../base/TMTooltip';
|
|
19
19
|
import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
|
20
20
|
import { TMUserIdViewer } from '../../choosers/TMUserChooser';
|
|
@@ -366,23 +366,14 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
366
366
|
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
367
367
|
:
|
|
368
368
|
_jsx(_Fragment, {}), _jsxs(TMLayoutItem, { children: [_jsx(TMSearchResultGrid, { inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], lastUpdateSearchTime: lastUpdateSearchTime, onDblClick: () => openFormHandler(LayoutModes.Update), onContextMenuPreparing: onContextMenuPreparing, onSelectionChanged: (items) => { setSelectedItems(items); }, onVisibleItemChanged: setVisibleItems, onFocusedItemChanged: setFocusedItem, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync(inputDcmts, downloadType, downloadMode, onFileOpened, confirmAttachments) }), allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE &&
|
|
369
|
-
_jsxs(TMFloatingToolbar, { backgroundColor: TMColors.primaryColor, initialLeft: '10px', initialTop: 'calc(100% - 75px)', children: [fromDTD?.perm?.canRetrieveFile === AccessLevels.Yes && _jsx(TMButton, { btnStyle: 'icon', caption: "Download file", disabled: fromDTD?.perm?.canRetrieveFile !== AccessLevels.Yes || !focusedItem?.DID, icon: _jsx(IconDownload, { color: 'white' }), onClick: () => { downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download"); } }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasDetailRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true) }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasMasterRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white', transform: 'scale(-1, 1)' }), caption: SDKUI_Localizator.DcmtsMaster, onClick: () => setIsOpenMaster(true) }), _jsx(IconMenuVertical, { id: `commands-floating-${id}`, color: 'white', cursor: 'pointer' }), _jsx(CommandsContextMenu, { target: `#commands-floating-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, showCopyMoveFormCallback) })] })] }), "m"] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, {
|
|
369
|
+
_jsxs(TMFloatingToolbar, { backgroundColor: TMColors.primaryColor, initialLeft: '10px', initialTop: 'calc(100% - 75px)', children: [fromDTD?.perm?.canRetrieveFile === AccessLevels.Yes && _jsx(TMButton, { btnStyle: 'icon', caption: "Download file", disabled: fromDTD?.perm?.canRetrieveFile !== AccessLevels.Yes || !focusedItem?.DID, icon: _jsx(IconDownload, { color: 'white' }), onClick: () => { downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download"); } }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasDetailRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true) }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasMasterRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white', transform: 'scale(-1, 1)' }), caption: SDKUI_Localizator.DcmtsMaster, onClick: () => setIsOpenMaster(true) }), _jsx(IconMenuVertical, { id: `commands-floating-${id}`, color: 'white', cursor: 'pointer' }), _jsx(CommandsContextMenu, { target: `#commands-floating-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, showCopyMoveFormCallback) })] })] }), "m"] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { TID: focusedItem?.TID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: onWFOperationCompleted, onClose: () => setShowMoreInfoPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: SDKUI_Localizator.BatchUpdate, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
|
|
370
370
|
setIsOpenBatchUpdate(false);
|
|
371
371
|
}, onSavedCallbackAsync: async () => {
|
|
372
372
|
setIsOpenBatchUpdate(false);
|
|
373
373
|
setIsModifiedBatchUpdate(false);
|
|
374
374
|
await refreshSelectionDataRowsAsync();
|
|
375
375
|
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), showToppyForApprove && !showApprovePopup && !showRejectPopup && !showReAssignPopup && !showMoreInfoPopup &&
|
|
376
|
-
_jsx(ToppyHelpCenter, { deviceType: deviceType, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: () => ShowAlert({ message: 'TODO', mode: 'info', title: SDKUI_Localizator.SignatureAndApprove, duration: 3000 }), onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true),
|
|
377
|
-
// onMoreInfo={() => setShowMoreInfoPopup(true)}
|
|
378
|
-
onMoreInfo: () => {
|
|
379
|
-
const vid = focusedItem ? focusedItem?.TID : selectedItems[0]?.TID;
|
|
380
|
-
const did = focusedItem ? focusedItem?.DID : selectedItems[0]?.DID;
|
|
381
|
-
openTaskFormHandler((task) => {
|
|
382
|
-
SDK_Globals.tmSession?.NewWorkflowEngine().WorkItem_MoreInfoAsync(vid, did, task?.id ?? 0)
|
|
383
|
-
.catch(err => TMExceptionBoxManager.show({ exception: err }));
|
|
384
|
-
});
|
|
385
|
-
}, approveDisable: disable, signApproveDisable: disable, rejectDisable: disable, reassignDisable: disable, infoDisable: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length !== 1 }) }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), (copyMoveDraftForm.show && copyMoveDraftForm.mode && getSelectedDcmtsOrFocused(selectedItems, focusedItem)) && _jsx(TMWGsCopyMoveForm, { context: { engine: 'SearchEngine', object: fromDTD, selectedDrafts: getSelectedDcmtsOrFocused(selectedItems, focusedItem) }, mode: copyMoveDraftForm.mode, onClose: () => { setCopyMoveDraftForm({ show: false, mode: undefined }); }, focusedWorkingGroupId: focusedWorkingGroupId, fetchTreeFileSystemForWorkingGroup: fetchTreeFileSystemForWorkingGroup, fetchArchivedDocumentsForWorkingGroup: fetchArchivedDocumentsForWorkingGroup })] }), [
|
|
376
|
+
_jsx(ToppyHelpCenter, { deviceType: deviceType, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: () => ShowAlert({ message: 'TODO', mode: 'info', title: SDKUI_Localizator.SignatureAndApprove, duration: 3000 }), onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), approveDisable: disable, signApproveDisable: disable, rejectDisable: disable, reassignDisable: disable, infoDisable: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length !== 1 }) }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), (copyMoveDraftForm.show && copyMoveDraftForm.mode && getSelectedDcmtsOrFocused(selectedItems, focusedItem)) && _jsx(TMWGsCopyMoveForm, { context: { engine: 'SearchEngine', object: fromDTD, selectedDrafts: getSelectedDcmtsOrFocused(selectedItems, focusedItem) }, mode: copyMoveDraftForm.mode, onClose: () => { setCopyMoveDraftForm({ show: false, mode: undefined }); }, focusedWorkingGroupId: focusedWorkingGroupId, fetchTreeFileSystemForWorkingGroup: fetchTreeFileSystemForWorkingGroup, fetchArchivedDocumentsForWorkingGroup: fetchArchivedDocumentsForWorkingGroup })] }), [
|
|
386
377
|
searchResults,
|
|
387
378
|
selectedSearchResult,
|
|
388
379
|
lastUpdateSearchTime,
|
|
@@ -30,12 +30,11 @@ export declare const WorkFlowReAssignPopUp: ({ DID, TID, deviceType, onClose, se
|
|
|
30
30
|
selectedItems?: any[];
|
|
31
31
|
onCompleted?: () => Promise<void>;
|
|
32
32
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
export declare const WorkFlowMoreInfoPopUp: ({ DID, TID, deviceType, onClose,
|
|
33
|
+
export declare const WorkFlowMoreInfoPopUp: ({ DID, TID, deviceType, onClose, onCompleted }: {
|
|
34
34
|
TID?: number;
|
|
35
35
|
DID?: number;
|
|
36
36
|
deviceType?: DeviceType;
|
|
37
37
|
onClose?: () => void;
|
|
38
|
-
selectedItems?: any[];
|
|
39
38
|
onCompleted?: () => Promise<void>;
|
|
40
39
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
41
40
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import { Priorities, SDK_Globals, UserListCacheService, WorkflowCacheService } from '@topconsultnpm/sdk-ts-beta';
|
|
3
|
+
import { Priorities, ResultTypes, SDK_Globals, SDK_Localizator, TaskEngine, UserListCacheService, ValidationItem, WorkflowCacheService } from '@topconsultnpm/sdk-ts-beta';
|
|
4
4
|
import styled from "styled-components";
|
|
5
5
|
import { SDKUI_Localizator, IconApply, IconCloseOutline, IconUser, IconInfo, IconSignature, DateDisplayTypes } from "../../../helper";
|
|
6
6
|
import { TMColors } from "../../../utils/theme";
|
|
@@ -18,7 +18,7 @@ const StyledWorkFlowOperationButtonsContainer = styled.div `
|
|
|
18
18
|
display: flex;
|
|
19
19
|
align-items: center;
|
|
20
20
|
gap: 10px;
|
|
21
|
-
flex-direction:
|
|
21
|
+
flex-direction: column;
|
|
22
22
|
`;
|
|
23
23
|
const StyledTextArea = styled.textarea `
|
|
24
24
|
width: 100%;
|
|
@@ -31,6 +31,26 @@ const StyledTextArea = styled.textarea `
|
|
|
31
31
|
border-bottom: 4px solid ${props => props.$isValid ? TMColors.primaryColor : TMColors.error};
|
|
32
32
|
}
|
|
33
33
|
`;
|
|
34
|
+
const StyledModalFooter = styled.div `
|
|
35
|
+
position: absolute;
|
|
36
|
+
left: 0;
|
|
37
|
+
right: 0;
|
|
38
|
+
bottom: 0;
|
|
39
|
+
padding: 16px 0 12px 0;
|
|
40
|
+
display: flex;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
background: transparent;
|
|
43
|
+
z-index: 2;
|
|
44
|
+
`;
|
|
45
|
+
const StyledModalContentContainer = styled.div `
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
padding: 10px;
|
|
49
|
+
padding-bottom: 60px;
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
gap: 5px;
|
|
53
|
+
`;
|
|
34
54
|
export const WorkFlowOperationButtons = ({ deviceType = DeviceType.DESKTOP, approveDisable = false, signApproveDisable = false, reassignDisable = false, rejectDisable = false, infoDisable = false, onApprove, onSignApprove, onReAssign, onReject, onMoreInfo }) => {
|
|
35
55
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
36
56
|
return (_jsxs(StyledWorkFlowOperationButtonsContainer, { "$isMobile": isMobile, children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconApply, {}), caption: SDKUI_Localizator.Approve, disabled: approveDisable, onClick: () => !approveDisable && onApprove?.(), advancedColor: TMColors.success, color: 'success' }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconSignature, {}), caption: SDKUI_Localizator.SignatureAndApprove, width: '160px', disabled: approveDisable, onClick: () => !signApproveDisable && onSignApprove?.(), advancedColor: TMColors.success, color: 'success' }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: rejectDisable, onClick: () => !rejectDisable && onReject?.(), advancedColor: TMColors.error, color: 'error' }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconUser, { fontSize: 16 }), caption: SDKUI_Localizator.Reassign, disabled: reassignDisable, onClick: () => !reassignDisable && onReAssign?.(), advancedColor: TMColors.tertiary, color: 'tertiary' }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: '180px', disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), advancedColor: TMColors.info, color: 'info' })] }));
|
|
@@ -64,9 +84,9 @@ export const WorkFlowApproveRejectPopUp = ({ TID = 0, DID = 0, deviceType = Devi
|
|
|
64
84
|
const workflowAction = isReject === 0 ? 'Approva' : 'Rifiuta';
|
|
65
85
|
const itemCount = selectedItems.length > 0 ? `(${count()})` : '';
|
|
66
86
|
const title = `${workflowAction} workflow ${itemCount}`;
|
|
67
|
-
return (
|
|
68
|
-
|
|
69
|
-
|
|
87
|
+
return (_jsxs(TMModal, { title: title, onClose: onClose, width: deviceType === DeviceType.MOBILE ? '95%' : '60%', height: '60%', isModal: true, children: [_jsxs(StyledModalContentContainer, { children: [_jsxs("p", { style: { color: (isReject === 1 && disable) ? TMColors.error : 'black' }, children: ["Commento ", isReject === 1 && disable && _jsx("span", { children: ' (Campo obbligatorio)' }), " "] }), _jsx(StyledTextArea, { "$isValid": isReject === 0 ? true : !disable, value: commentValue, onChange: (e) => setCommentValue(e.target.value) })] }), _jsx(StyledModalFooter, { children: isReject === 0
|
|
88
|
+
? _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconApply, {}), caption: 'Approva', disabled: false, onClick: () => completeOrRejectAsync(isReject), advancedColor: TMColors.success })
|
|
89
|
+
: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconCloseOutline, {}), caption: 'Rifiuta', disabled: disable, onClick: () => { !disable && completeOrRejectAsync(isReject); }, advancedColor: TMColors.error }) })] }));
|
|
70
90
|
};
|
|
71
91
|
export const WorkFlowReAssignPopUp = ({ DID = 0, TID = 0, deviceType = DeviceType.DESKTOP, onClose, selectedItems = [], onCompleted }) => {
|
|
72
92
|
const [commentValue, setCommentValue] = useState('');
|
|
@@ -125,25 +145,50 @@ export const WorkFlowReAssignPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
125
145
|
fetchData();
|
|
126
146
|
return () => { isMounted = false; };
|
|
127
147
|
}, [tidToUse]);
|
|
128
|
-
return (
|
|
129
|
-
|
|
130
|
-
|
|
148
|
+
return (_jsxs(TMModal, { onClose: onClose, width: deviceType === DeviceType.MOBILE ? '95%' : '60%', height: '60%', isModal: true, title: 'Riassegna workitem ' + (selectedItems.length > 0 ? '(' + count() + ')' : ''), children: [_jsxs(StyledModalContentContainer, { children: [_jsx(TMUserChooser, { dataSource: participants, values: selectedUserID, onValueChanged: (IDs) => {
|
|
149
|
+
setSelectedUserID(IDs ?? []);
|
|
150
|
+
} }), _jsxs("p", { style: { color: commentValue.length === 0 ? TMColors.error : 'black' }, children: ["Commento ", commentValue.length === 0 && _jsx("span", { children: ' (Campo obbligatorio)' }), " "] }), _jsx(StyledTextArea, { "$isValid": commentValue.length !== 0, value: commentValue, onChange: (e) => setCommentValue(e.target.value) })] }), _jsx(StyledModalFooter, { children: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconUser, { fontSize: 16 }), caption: SDKUI_Localizator.Reassign, disabled: disable, onClick: () => !disable && reAssignWorkFlowAsync(), advancedColor: TMColors.tertiary }) })] }));
|
|
131
151
|
};
|
|
132
|
-
export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceType.DESKTOP, onClose,
|
|
133
|
-
const [
|
|
152
|
+
export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceType.DESKTOP, onClose, onCompleted }) => {
|
|
153
|
+
const [users, setUsers] = useState([]);
|
|
134
154
|
const [task, setTask] = useState();
|
|
135
155
|
const [taskOrig, setTaskOrig] = useState();
|
|
136
|
-
const
|
|
137
|
-
const
|
|
156
|
+
const [validationItems, setValidationItems] = useState([]);
|
|
157
|
+
const disable = validationItems.filter(o => o.ResultType === ResultTypes.ERROR).length > 0;
|
|
158
|
+
const validatorMoreInfoAsync = async (taskDescriptor) => {
|
|
159
|
+
let vil = [];
|
|
160
|
+
// Validate task name
|
|
161
|
+
if (!taskDescriptor.name || taskDescriptor.name === "")
|
|
162
|
+
vil.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.Name, `${SDK_Localizator.RequiredField}`));
|
|
163
|
+
// Validate name length (max 100)
|
|
164
|
+
if (taskDescriptor.name && taskDescriptor.name.length > 100) {
|
|
165
|
+
vil.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.Name, `${"Valore troppo lungo"}`));
|
|
166
|
+
}
|
|
167
|
+
// Validate description length (max 200)
|
|
168
|
+
if (taskDescriptor.description && taskDescriptor.description.length > 200) {
|
|
169
|
+
vil.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.Description, `${"Valore troppo lungo"}`));
|
|
170
|
+
}
|
|
171
|
+
// Validate toID
|
|
172
|
+
if (!taskDescriptor.toID || taskDescriptor.toID <= 0)
|
|
173
|
+
vil.push(new ValidationItem(ResultTypes.ERROR, "Assegnato a", `${SDK_Localizator.RequiredField}`));
|
|
174
|
+
// // Validate that startTime is less than or equal to endTime
|
|
175
|
+
// if (taskDescriptor.startTime && taskDescriptor.endTime) {
|
|
176
|
+
// if (taskDescriptor.startTime > taskDescriptor.endTime) {
|
|
177
|
+
// vil.push(new ValidationItem(ResultTypes.ERROR, SURFER_Localizator.ErrorStartEndDate, `${SURFER_Localizator.StartDateMustBeBeforeEndDate}`));
|
|
178
|
+
// }
|
|
179
|
+
// }
|
|
180
|
+
// // Validate that reminderTime is less than endTime
|
|
181
|
+
// if (taskDescriptor.remTime && taskDescriptor.endTime) {
|
|
182
|
+
// if (taskDescriptor.remTime >= taskDescriptor.endTime) {
|
|
183
|
+
// vil.push(new ValidationItem(ResultTypes.ERROR, SURFER_Localizator.ErrorEndRemDate, `${SURFER_Localizator.ReminderDateMustBeBeforeEndDate}`));
|
|
184
|
+
// }
|
|
185
|
+
// }
|
|
186
|
+
return vil;
|
|
187
|
+
};
|
|
138
188
|
const requestMoreInfoAsync = async () => {
|
|
139
189
|
try {
|
|
140
190
|
TMSpinner.show();
|
|
141
|
-
|
|
142
|
-
? selectedItems.map(({ TID, DID }) => ({ TID, DID }))
|
|
143
|
-
: [{ TID, DID }];
|
|
144
|
-
for (const { TID, DID } of items) {
|
|
145
|
-
await SDK_Globals.tmSession?.NewWorkflowEngine().WorkItem_MoreInfoAsync(TID, DID, 0);
|
|
146
|
-
}
|
|
191
|
+
await SDK_Globals.tmSession?.NewWorkflowEngine().WorkItem_MoreInfoAsync(TID, DID, task);
|
|
147
192
|
}
|
|
148
193
|
catch (e) {
|
|
149
194
|
TMExceptionBoxManager.show({ exception: e });
|
|
@@ -154,20 +199,21 @@ export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
154
199
|
TMSpinner.hide();
|
|
155
200
|
}
|
|
156
201
|
};
|
|
157
|
-
// Determina il TID da usare
|
|
158
|
-
const tidToUse = selectedItems?.[0]?.TID ?? TID;
|
|
159
202
|
useEffect(() => {
|
|
160
|
-
let isMounted = true;
|
|
161
203
|
const fetchData = async () => {
|
|
162
204
|
TMSpinner.show({ description: SDKUI_Localizator.LoadingParticipants });
|
|
163
205
|
try {
|
|
164
|
-
|
|
165
|
-
|
|
206
|
+
console.log('TID', TID);
|
|
207
|
+
let newTask = TaskEngine.NewTaskDescriptor();
|
|
208
|
+
newTask.toID = 0;
|
|
209
|
+
setTask(newTask);
|
|
210
|
+
setTaskOrig(structuredClone(newTask));
|
|
211
|
+
validatorMoreInfoAsync(newTask);
|
|
166
212
|
// Recupera tutti gli utenti (tranne me)
|
|
167
213
|
const allUsers = await UserListCacheService.GetAllAsync();
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
214
|
+
const filteredUsers = allUsers.filter(u => u.id !== SDK_Globals.tmSession?.SessionDescr?.userID);
|
|
215
|
+
console.log('filteredUsers', filteredUsers);
|
|
216
|
+
setUsers(filteredUsers);
|
|
171
217
|
}
|
|
172
218
|
catch (e) {
|
|
173
219
|
TMExceptionBoxManager.show({ exception: e });
|
|
@@ -176,9 +222,15 @@ export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
176
222
|
TMSpinner.hide();
|
|
177
223
|
}
|
|
178
224
|
};
|
|
225
|
+
if (!TID)
|
|
226
|
+
return;
|
|
179
227
|
fetchData();
|
|
180
|
-
|
|
181
|
-
|
|
228
|
+
}, [TID]);
|
|
229
|
+
useEffect(() => {
|
|
230
|
+
if (!task)
|
|
231
|
+
return;
|
|
232
|
+
validatorMoreInfoAsync(task).then((vil) => setValidationItems(vil));
|
|
233
|
+
}, [task]);
|
|
182
234
|
const getPriorityLocalizatorValues = () => {
|
|
183
235
|
// Filtered enum for Low and High values
|
|
184
236
|
const filteredPriorities = { Low: Priorities.Low, High: Priorities.High };
|
|
@@ -191,11 +243,11 @@ export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
191
243
|
}
|
|
192
244
|
});
|
|
193
245
|
};
|
|
194
|
-
return (
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
246
|
+
return (_jsxs(TMModal, { title: SDKUI_Localizator.MoreInformation, onClose: onClose, width: deviceType === DeviceType.MOBILE ? '95%' : '60%', height: '60%', isModal: true, children: [_jsxs(StyledModalContentContainer, { children: [_jsx(TMUserChooser, { label: "Richiedi a", dataSource: users, values: task?.toID ? [task.toID] : [], validationItems: validationItems?.filter(o => o.PropertyName === "Assegnato a"), onValueChanged: (IDs) => {
|
|
247
|
+
if (IDs === undefined)
|
|
248
|
+
return;
|
|
249
|
+
setTask({ ...task ?? {}, toID: IDs?.[0] });
|
|
250
|
+
} }), _jsx(TMTextBox, { label: SDKUI_Localizator.Name, value: task?.name ?? '', isModifiedWhen: task?.description !== taskOrig?.description, autoFocus: true, maxLength: 100, onValueChanged: (e) => { setTask({ ...task ?? {}, name: e.target.value }); }, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.Name) }), _jsx(TMTextArea, { label: SDKUI_Localizator.Description, value: task?.description ?? '', rows: 2, maxLength: 200, isModifiedWhen: task?.description !== task?.description, onValueChanged: (e) => { setTask({ ...task ?? {}, description: e.target.value }); },
|
|
251
|
+
// validationItems={validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.Description)}
|
|
252
|
+
resize: false }), _jsx(TMDropDown, { label: "Priorità", value: task?.priority, dataSource: getPriorityLocalizatorValues(), isModifiedWhen: task?.priority !== taskOrig?.priority, onValueChanged: (e) => setTask({ ...task ?? {}, priority: e?.target?.value }) }), _jsx(TMDateBox, { id: "end-date", resetTimeToZeroOnKeyPress: false, padding: "10px 0px", label: "Entro il", dateDisplayType: DateDisplayTypes.DateTime, value: task?.endTime, isModifiedWhen: task?.endTime !== taskOrig?.endTime, onValueChange: (value) => { setTask({ ...task ?? {}, endTime: value }); }, showClearButton: true })] }), _jsx(StyledModalFooter, { children: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconUser, { fontSize: 16 }), caption: "Richiedi", disabled: disable, onClick: () => !disable && requestMoreInfoAsync(), advancedColor: TMColors.tertiary }) })] }));
|
|
201
253
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topconsultnpm/sdkui-react-beta",
|
|
3
|
-
"version": "6.14.
|
|
3
|
+
"version": "6.14.110",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"lib"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@topconsultnpm/sdk-ts-beta": "6.14.
|
|
45
|
+
"@topconsultnpm/sdk-ts-beta": "6.14.19",
|
|
46
46
|
"buffer": "^6.0.3",
|
|
47
47
|
"devextreme": "24.2.6",
|
|
48
48
|
"devextreme-react": "24.2.6",
|