@topconsultnpm/sdkui-react-beta 6.14.107 → 6.14.108
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.
|
@@ -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,23 @@ 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={() =>
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
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),
|
|
377
|
+
// onMoreInfo={() => {
|
|
378
|
+
// const vid = focusedItem ? focusedItem?.TID : selectedItems[0]?.TID;
|
|
379
|
+
// const did = focusedItem ? focusedItem?.DID : selectedItems[0]?.DID;
|
|
380
|
+
// openTaskFormHandler((task) => {
|
|
381
|
+
// SDK_Globals.tmSession?.NewWorkflowEngine().WorkItem_MoreInfoAsync(vid, did, task?.id ?? 0)
|
|
382
|
+
// .catch(err => TMExceptionBoxManager.show({ exception: err }));
|
|
383
|
+
// });
|
|
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 })] }), [
|
|
386
386
|
searchResults,
|
|
387
387
|
selectedSearchResult,
|
|
388
388
|
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";
|
|
@@ -129,21 +129,46 @@ export const WorkFlowReAssignPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
129
129
|
setSelectedUserID(IDs ?? []);
|
|
130
130
|
} }), _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) })] }) }));
|
|
131
131
|
};
|
|
132
|
-
export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceType.DESKTOP, onClose,
|
|
133
|
-
const [
|
|
132
|
+
export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceType.DESKTOP, onClose, onCompleted }) => {
|
|
133
|
+
const [users, setUsers] = useState([]);
|
|
134
134
|
const [task, setTask] = useState();
|
|
135
135
|
const [taskOrig, setTaskOrig] = useState();
|
|
136
|
-
const
|
|
137
|
-
const
|
|
136
|
+
const [validationItems, setValidationItems] = useState([]);
|
|
137
|
+
const disable = validationItems.filter(o => o.ResultType === ResultTypes.ERROR).length > 0;
|
|
138
|
+
const validatorMoreInfoAsync = async (taskDescriptor) => {
|
|
139
|
+
let vil = [];
|
|
140
|
+
// Validate task name
|
|
141
|
+
if (!taskDescriptor.name || taskDescriptor.name === "")
|
|
142
|
+
vil.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.Name, `${SDK_Localizator.RequiredField}`));
|
|
143
|
+
// Validate name length (max 100)
|
|
144
|
+
if (taskDescriptor.name && taskDescriptor.name.length > 100) {
|
|
145
|
+
vil.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.Name, `${"Valore troppo lungo"}`));
|
|
146
|
+
}
|
|
147
|
+
// Validate description length (max 200)
|
|
148
|
+
if (taskDescriptor.description && taskDescriptor.description.length > 200) {
|
|
149
|
+
vil.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.Description, `${"Valore troppo lungo"}`));
|
|
150
|
+
}
|
|
151
|
+
// Validate toID
|
|
152
|
+
if (!taskDescriptor.toID || taskDescriptor.toID <= 0)
|
|
153
|
+
vil.push(new ValidationItem(ResultTypes.ERROR, "Assegnato a", `${SDK_Localizator.RequiredField}`));
|
|
154
|
+
// // Validate that startTime is less than or equal to endTime
|
|
155
|
+
// if (taskDescriptor.startTime && taskDescriptor.endTime) {
|
|
156
|
+
// if (taskDescriptor.startTime > taskDescriptor.endTime) {
|
|
157
|
+
// vil.push(new ValidationItem(ResultTypes.ERROR, SURFER_Localizator.ErrorStartEndDate, `${SURFER_Localizator.StartDateMustBeBeforeEndDate}`));
|
|
158
|
+
// }
|
|
159
|
+
// }
|
|
160
|
+
// // Validate that reminderTime is less than endTime
|
|
161
|
+
// if (taskDescriptor.remTime && taskDescriptor.endTime) {
|
|
162
|
+
// if (taskDescriptor.remTime >= taskDescriptor.endTime) {
|
|
163
|
+
// vil.push(new ValidationItem(ResultTypes.ERROR, SURFER_Localizator.ErrorEndRemDate, `${SURFER_Localizator.ReminderDateMustBeBeforeEndDate}`));
|
|
164
|
+
// }
|
|
165
|
+
// }
|
|
166
|
+
return vil;
|
|
167
|
+
};
|
|
138
168
|
const requestMoreInfoAsync = async () => {
|
|
139
169
|
try {
|
|
140
170
|
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
|
-
}
|
|
171
|
+
await SDK_Globals.tmSession?.NewWorkflowEngine().WorkItem_MoreInfoAsync(TID, DID, task);
|
|
147
172
|
}
|
|
148
173
|
catch (e) {
|
|
149
174
|
TMExceptionBoxManager.show({ exception: e });
|
|
@@ -155,19 +180,21 @@ export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
155
180
|
}
|
|
156
181
|
};
|
|
157
182
|
// Determina il TID da usare
|
|
158
|
-
const tidToUse = selectedItems?.[0]?.TID ?? TID;
|
|
159
183
|
useEffect(() => {
|
|
160
|
-
let isMounted = true;
|
|
161
184
|
const fetchData = async () => {
|
|
162
185
|
TMSpinner.show({ description: SDKUI_Localizator.LoadingParticipants });
|
|
163
186
|
try {
|
|
164
|
-
|
|
165
|
-
|
|
187
|
+
console.log('TID', TID);
|
|
188
|
+
let newTask = TaskEngine.NewTaskDescriptor();
|
|
189
|
+
newTask.toID = 0;
|
|
190
|
+
setTask(newTask);
|
|
191
|
+
setTaskOrig(structuredClone(newTask));
|
|
192
|
+
validatorMoreInfoAsync(newTask);
|
|
166
193
|
// Recupera tutti gli utenti (tranne me)
|
|
167
194
|
const allUsers = await UserListCacheService.GetAllAsync();
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
195
|
+
const filteredUsers = allUsers.filter(u => u.id !== SDK_Globals.tmSession?.SessionDescr?.userID);
|
|
196
|
+
console.log('filteredUsers', filteredUsers);
|
|
197
|
+
setUsers(filteredUsers);
|
|
171
198
|
}
|
|
172
199
|
catch (e) {
|
|
173
200
|
TMExceptionBoxManager.show({ exception: e });
|
|
@@ -176,9 +203,15 @@ export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
176
203
|
TMSpinner.hide();
|
|
177
204
|
}
|
|
178
205
|
};
|
|
206
|
+
if (!TID)
|
|
207
|
+
return;
|
|
179
208
|
fetchData();
|
|
180
|
-
|
|
181
|
-
|
|
209
|
+
}, [TID]);
|
|
210
|
+
useEffect(() => {
|
|
211
|
+
if (!task)
|
|
212
|
+
return;
|
|
213
|
+
validatorMoreInfoAsync(task).then((vil) => setValidationItems(vil));
|
|
214
|
+
}, [task]);
|
|
182
215
|
const getPriorityLocalizatorValues = () => {
|
|
183
216
|
// Filtered enum for Low and High values
|
|
184
217
|
const filteredPriorities = { Low: Priorities.Low, High: Priorities.High };
|
|
@@ -191,11 +224,11 @@ export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
191
224
|
}
|
|
192
225
|
});
|
|
193
226
|
};
|
|
194
|
-
return (_jsx(TMModal, { toolbar: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconUser, { fontSize: 16 }), caption:
|
|
227
|
+
return (_jsx(TMModal, { toolbar: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconUser, { fontSize: 16 }), caption: "Richiedi", width: '180px', disabled: disable, onClick: () => !disable && requestMoreInfoAsync(), advancedColor: TMColors.tertiary }), onClose: onClose, width: deviceType === DeviceType.MOBILE ? '95%' : '60%', height: '60%', isModal: true, title: SDKUI_Localizator.MoreInformation, children: _jsxs("div", { style: { width: '100%', height: '100%', padding: '10px', display: 'flex', flexDirection: 'column', gap: 5 }, children: [_jsx(TMUserChooser, { label: "Richiedi a", dataSource: users, values: task?.toID ? [task.toID] : [], validationItems: validationItems?.filter(o => o.PropertyName === "Assegnato a"), onValueChanged: (IDs) => {
|
|
195
228
|
if (IDs === undefined)
|
|
196
229
|
return;
|
|
197
230
|
setTask({ ...task ?? {}, toID: IDs?.[0] });
|
|
198
|
-
} }), _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 }); } }), _jsx(TMTextArea, { label: SDKUI_Localizator.Description, value: task?.description ?? '', maxLength: 200, isModifiedWhen: task?.description !== task?.description, onValueChanged: (e) => { setTask({ ...task ?? {}, description: e.target.value }); },
|
|
231
|
+
} }), _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 ?? '', maxLength: 200, isModifiedWhen: task?.description !== task?.description, onValueChanged: (e) => { setTask({ ...task ?? {}, description: e.target.value }); },
|
|
199
232
|
// validationItems={validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.Description)}
|
|
200
233
|
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 })] }) }));
|
|
201
234
|
};
|
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.108",
|
|
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",
|