@topconsultnpm/sdkui-react 6.20.0-dev1.7 → 6.20.0-dev1.70
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 +258 -17
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +2 -0
- package/lib/components/NewComponents/ContextMenu/hooks.js +17 -4
- package/lib/components/NewComponents/ContextMenu/index.d.ts +3 -0
- package/lib/components/NewComponents/ContextMenu/index.js +2 -0
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +5 -1
- package/lib/components/NewComponents/ContextMenu/styles.js +59 -31
- package/lib/components/NewComponents/ContextMenu/types.d.ts +13 -0
- package/lib/components/NewComponents/ContextMenu/useLongPress.d.ts +21 -0
- package/lib/components/NewComponents/ContextMenu/useLongPress.js +112 -0
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +517 -100
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +19 -5
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +206 -54
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +1 -2
- package/lib/components/base/TMAccordionNew.js +35 -14
- package/lib/components/base/TMCustomButton.js +61 -17
- package/lib/components/base/TMDataGrid.d.ts +7 -4
- package/lib/components/base/TMDataGrid.js +142 -11
- package/lib/components/base/TMDropDownMenu.js +19 -18
- package/lib/components/base/TMPanel.js +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.js +8 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMUserChooser.d.ts +0 -5
- package/lib/components/choosers/TMUserChooser.js +25 -45
- package/lib/components/editors/TMMetadataValues.js +23 -5
- package/lib/components/editors/TMTextBox.js +6 -3
- package/lib/components/features/documents/TMDcmtForm.d.ts +13 -1
- package/lib/components/features/documents/TMDcmtForm.js +386 -194
- package/lib/components/features/documents/TMDcmtPreview.js +41 -105
- package/lib/components/features/documents/TMMasterDetailDcmts.js +37 -52
- package/lib/components/features/documents/TMRelationViewer.d.ts +1 -1
- package/lib/components/features/documents/TMRelationViewer.js +2 -2
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
- package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +5 -10
- package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
- package/lib/components/features/search/TMSearch.js +41 -9
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +19 -18
- package/lib/components/features/search/TMSearchResult.js +118 -242
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
- package/lib/components/features/search/TMSearchResultsMenuItems.js +205 -169
- package/lib/components/features/search/TMSignSettingsForm.js +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
- package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
- package/lib/components/features/search/TMViewHistoryDcmt.js +1 -1
- package/lib/components/features/tasks/TMTaskForm.js +20 -1
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
- package/lib/components/features/tasks/TMTasksUtils.js +62 -52
- package/lib/components/features/tasks/TMTasksView.js +6 -6
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
- package/lib/components/features/workflow/TMWorkflowPopup.js +134 -24
- package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +1 -0
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +2 -3
- package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
- package/lib/components/features/workflow/diagram/WFDiagram.d.ts +2 -0
- package/lib/components/features/workflow/diagram/WFDiagram.js +21 -4
- package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
- package/lib/components/forms/Login/LoginValidatorService.js +7 -2
- package/lib/components/forms/Login/TMLoginForm.js +34 -6
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +55 -30
- package/lib/components/grids/TMRecentsManager.js +20 -10
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.js +4 -0
- package/lib/components/settings/SettingsAppearance.js +92 -29
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
- package/lib/components/viewers/TMDataListItemViewer.js +35 -71
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +8 -0
- package/lib/components/viewers/TMDataUserIdItemViewer.js +39 -0
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +19 -0
- package/lib/helper/SDKUI_Globals.js +11 -0
- package/lib/helper/SDKUI_Localizator.d.ts +15 -1
- package/lib/helper/SDKUI_Localizator.js +147 -1
- package/lib/helper/TMIcons.d.ts +2 -0
- package/lib/helper/TMIcons.js +6 -0
- package/lib/helper/TMPdfViewer.d.ts +8 -0
- package/lib/helper/TMPdfViewer.js +373 -0
- package/lib/helper/checkinCheckoutManager.d.ts +32 -2
- package/lib/helper/checkinCheckoutManager.js +115 -38
- package/lib/helper/devextremeCustomMessages.d.ts +30 -0
- package/lib/helper/devextremeCustomMessages.js +30 -0
- package/lib/helper/helpers.d.ts +2 -1
- package/lib/helper/helpers.js +14 -3
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/helper/queryHelper.d.ts +1 -1
- package/lib/helper/queryHelper.js +33 -3
- package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
- package/lib/hooks/useCheckInOutOperations.js +223 -0
- package/lib/hooks/useDataListItem.d.ts +12 -0
- package/lib/hooks/useDataListItem.js +131 -0
- package/lib/hooks/useDataUserIdItem.d.ts +10 -0
- package/lib/hooks/useDataUserIdItem.js +96 -0
- package/lib/hooks/useSettingsFeedback.d.ts +11 -0
- package/lib/hooks/useSettingsFeedback.js +38 -0
- package/lib/hooks/useWorkflowApprove.d.ts +4 -0
- package/lib/hooks/useWorkflowApprove.js +14 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/ts/types.d.ts +58 -1
- package/lib/utils/theme.d.ts +1 -1
- package/lib/utils/theme.js +1 -1
- package/package.json +5 -2
- package/lib/components/NewComponents/Notification/Notification.d.ts +0 -4
- package/lib/components/NewComponents/Notification/Notification.js +0 -60
- package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +0 -8
- package/lib/components/NewComponents/Notification/NotificationContainer.js +0 -33
- package/lib/components/NewComponents/Notification/index.d.ts +0 -2
- package/lib/components/NewComponents/Notification/index.js +0 -2
- package/lib/components/NewComponents/Notification/styles.d.ts +0 -21
- package/lib/components/NewComponents/Notification/styles.js +0 -180
- package/lib/components/NewComponents/Notification/types.d.ts +0 -18
- package/lib/components/NewComponents/Notification/types.js +0 -1
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import { Priorities, ResultTypes, SDK_Globals, SDK_Localizator, TaskEngine, UserListCacheService, ValidationItem, WorkflowCacheService } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { Priorities, ResultTypes, SDK_Globals, SDK_Localizator, TaskEngine, UserListCacheService, ValidationItem, WFEvents, WorkflowCacheService } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from "styled-components";
|
|
5
|
-
import { SDKUI_Localizator, IconApply, IconCloseOutline, IconUser, IconInfo, DateDisplayTypes, TASK_MORE_INFO_PREFIX_NAME, IconSignaturePencil, isSign4TopEnabled } from "../../../helper";
|
|
5
|
+
import { SDKUI_Localizator, IconApply, IconCloseOutline, IconUser, IconInfo, DateDisplayTypes, TASK_MORE_INFO_PREFIX_NAME, IconSignaturePencil, isSign4TopEnabled, IconCheck, IconCloseCircle, IconStop } from "../../../helper";
|
|
6
6
|
import { TMColors } from "../../../utils/theme";
|
|
7
7
|
import TMButton from "../../base/TMButton";
|
|
8
8
|
import { DeviceType } from "../../base/TMDeviceProvider";
|
|
@@ -21,17 +21,15 @@ const StyledWorkFlowOperationButtonsContainer = styled.div `
|
|
|
21
21
|
gap: 10px;
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
`;
|
|
24
|
-
const StyledTextArea = styled.textarea
|
|
25
|
-
maxLength: 200
|
|
26
|
-
}) `
|
|
24
|
+
const StyledTextArea = styled.textarea `
|
|
27
25
|
width: 100%;
|
|
28
26
|
height: 100%;
|
|
29
|
-
border: 1px solid ${props => props.$isValid ? '#b4b4b4' : TMColors.error};
|
|
27
|
+
border: 1px solid ${(props) => (props.$isValid ? '#b4b4b4' : TMColors.error)};
|
|
30
28
|
border-radius: 10px;
|
|
31
29
|
padding: 10px;
|
|
32
|
-
&:focus{
|
|
30
|
+
&:focus {
|
|
33
31
|
outline: none;
|
|
34
|
-
border-bottom: 4px solid ${props => props.$isValid ? TMColors.primaryColor : TMColors.error};
|
|
32
|
+
border-bottom: 4px solid ${(props) => (props.$isValid ? TMColors.primaryColor : TMColors.error)};
|
|
35
33
|
}
|
|
36
34
|
`;
|
|
37
35
|
const CharacterCounter = styled.div `
|
|
@@ -97,6 +95,7 @@ export const WorkFlowApproveRejectPopUp = ({ TID = 0, DID = 0, deviceType = Devi
|
|
|
97
95
|
for (const { TID, DID } of items) {
|
|
98
96
|
await workflowEngine.WorkItem_CompleteOrRejectAsync(TID, DID, commentValue, isReject);
|
|
99
97
|
}
|
|
98
|
+
ShowAlert({ mode: 'success', position: 'TOP_RIGHT', title: isReject === 0 ? SDKUI_Localizator.WorkitemApprove : SDKUI_Localizator.WorkitemReject, message: SDKUI_Localizator.OperationSuccess, duration: 3000 });
|
|
100
99
|
}
|
|
101
100
|
catch (e) {
|
|
102
101
|
TMExceptionBoxManager.show({ exception: e });
|
|
@@ -105,33 +104,42 @@ export const WorkFlowApproveRejectPopUp = ({ TID = 0, DID = 0, deviceType = Devi
|
|
|
105
104
|
onCompleted?.();
|
|
106
105
|
onClose?.();
|
|
107
106
|
TMSpinner.hide();
|
|
108
|
-
ShowAlert({ mode: 'success', position: 'TOP_RIGHT', title: isReject === 0 ? SDKUI_Localizator.WorkitemApprove : SDKUI_Localizator.WorkitemReject, message: SDKUI_Localizator.OperationSuccess, duration: 3000 });
|
|
109
107
|
}
|
|
110
108
|
};
|
|
111
109
|
const workflowAction = isReject === 0 ? SDKUI_Localizator.Approve : SDKUI_Localizator.Reject;
|
|
112
110
|
const itemCount = selectedItems.length > 0 ? `(${selectedItems.length} workitem)` : '';
|
|
113
111
|
const title = `${workflowAction} ${itemCount}`;
|
|
114
|
-
return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsxs("p", { style: { color: (isReject === 1 && disable) ? TMColors.error : 'black' }, children: [SDKUI_Localizator.CommentText, " ", isReject === 1 && disable && _jsx("span", { children: ` (${SDKUI_Localizator.RequiredField})` }), " "] }), _jsx(StyledTextArea, { "$isValid": isReject === 0 ? true : !disable, value: commentValue, onChange: (e) => setCommentValue(e.target.value) }), _jsx(CharacterCounter, { children: `${200 - commentValue.length} ${SDKUI_Localizator.CharactersRemaining}` })] }), _jsx(StyledModalFooter, { children: isReject === 0
|
|
112
|
+
return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsxs("p", { style: { color: (isReject === 1 && disable) ? TMColors.error : 'black' }, children: [SDKUI_Localizator.CommentText, " ", isReject === 1 && disable && _jsx("span", { children: ` (${SDKUI_Localizator.RequiredField})` }), " "] }), _jsx(StyledTextArea, { maxLength: 200, "$isValid": isReject === 0 ? true : !disable, value: commentValue, onChange: (e) => setCommentValue(e.target.value) }), _jsx(CharacterCounter, { children: `${200 - commentValue.length} ${SDKUI_Localizator.CharactersRemaining}` })] }), _jsx(StyledModalFooter, { children: isReject === 0
|
|
115
113
|
? _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconApply, {}), caption: SDKUI_Localizator.Approve, disabled: false, onClick: () => completeOrRejectAsync(isReject), advancedColor: TMColors.success })
|
|
116
114
|
: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: disable, onClick: () => { !disable && completeOrRejectAsync(isReject); }, advancedColor: TMColors.error }) })] }) }));
|
|
117
115
|
};
|
|
118
|
-
export const WorkFlowReAssignPopUp = ({ DID = 0, TID = 0, deviceType = DeviceType.DESKTOP, onClose, selectedItems = [], onCompleted }) => {
|
|
116
|
+
export const WorkFlowReAssignPopUp = ({ DID = 0, TID = 0, deviceType = DeviceType.DESKTOP, onClose, selectedItems = [], onCompleted, wf, workItemDetail }) => {
|
|
119
117
|
const [commentValue, setCommentValue] = useState('');
|
|
120
118
|
const [selectedUserID, setSelectedUserID] = useState([]);
|
|
121
119
|
const [participants, setParticipants] = useState([]);
|
|
122
120
|
const disable = commentValue.length === 0 || !selectedUserID;
|
|
121
|
+
// Determina se siamo nel contesto CtrlWorkflow (quando abbiamo workItemDetail)
|
|
122
|
+
const isCtrlWorkflowContext = !!workItemDetail;
|
|
123
123
|
const reAssignWorkFlowAsync = async () => {
|
|
124
124
|
try {
|
|
125
125
|
TMSpinner.show();
|
|
126
126
|
const workflowEngine = SDK_Globals.tmSession?.NewWorkflowEngine();
|
|
127
127
|
if (!workflowEngine)
|
|
128
128
|
throw new Error("Workflow engine is not available");
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
if (isCtrlWorkflowContext && workItemDetail) {
|
|
130
|
+
// Contesto CtrlWorkflow: usa WFCtrl_ReassignWIAsync
|
|
131
|
+
await workflowEngine.WFCtrl_ReassignWIAsync(workItemDetail.wfid, workItemDetail.did, selectedUserID?.[0], commentValue);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
// Contesto WorkItem: usa WorkItem_ReassignAsync
|
|
135
|
+
const items = selectedItems.length > 0
|
|
136
|
+
? selectedItems.map(({ TID, DID }) => ({ TID, DID }))
|
|
137
|
+
: [{ TID, DID }];
|
|
138
|
+
for (const { TID, DID } of items) {
|
|
139
|
+
await workflowEngine.WorkItem_ReassignAsync(TID, DID, selectedUserID?.[0], commentValue);
|
|
140
|
+
}
|
|
134
141
|
}
|
|
142
|
+
ShowAlert({ mode: 'success', position: 'TOP_RIGHT', title: SDKUI_Localizator.WorkitemReassign, message: SDKUI_Localizator.OperationSuccess, duration: 3000 });
|
|
135
143
|
}
|
|
136
144
|
catch (e) {
|
|
137
145
|
TMExceptionBoxManager.show({ exception: e });
|
|
@@ -140,11 +148,10 @@ export const WorkFlowReAssignPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
140
148
|
onCompleted?.();
|
|
141
149
|
onClose?.();
|
|
142
150
|
TMSpinner.hide();
|
|
143
|
-
ShowAlert({ mode: 'success', position: 'TOP_RIGHT', title: SDKUI_Localizator.WorkitemReassign, message: SDKUI_Localizator.OperationSuccess, duration: 3000 });
|
|
144
151
|
}
|
|
145
152
|
};
|
|
146
153
|
// Determina il TID da usare
|
|
147
|
-
const tidToUse = selectedItems?.[0]?.TID ?? TID;
|
|
154
|
+
const tidToUse = workItemDetail?.tid ?? selectedItems?.[0]?.TID ?? TID;
|
|
148
155
|
useEffect(() => {
|
|
149
156
|
let isMounted = true;
|
|
150
157
|
const fetchData = async () => {
|
|
@@ -153,11 +160,11 @@ export const WorkFlowReAssignPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
153
160
|
if (!tidToUse)
|
|
154
161
|
return;
|
|
155
162
|
// Recupera info workflow
|
|
156
|
-
const
|
|
163
|
+
const workflowInfo = wf ?? await WorkflowCacheService.GetWFInfoAsync(tidToUse);
|
|
157
164
|
// Recupera tutti gli utenti
|
|
158
165
|
const allUsers = await UserListCacheService.GetAllAsync();
|
|
159
166
|
// Filtra utenti partecipanti
|
|
160
|
-
const participantIds =
|
|
167
|
+
const participantIds = workflowInfo?.participants?.map(p => p.userID);
|
|
161
168
|
const participantUsers = allUsers.filter(u => participantIds?.includes(u.id) && u.id !== SDK_Globals.tmSession?.SessionDescr?.userID);
|
|
162
169
|
if (isMounted)
|
|
163
170
|
setParticipants(participantUsers);
|
|
@@ -171,10 +178,113 @@ export const WorkFlowReAssignPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
171
178
|
};
|
|
172
179
|
fetchData();
|
|
173
180
|
return () => { isMounted = false; };
|
|
174
|
-
}, [tidToUse]);
|
|
175
|
-
|
|
181
|
+
}, [tidToUse, wf, workItemDetail]);
|
|
182
|
+
// Determina il conteggio degli item da mostrare nel titolo
|
|
183
|
+
const itemCount = workItemDetail ? 1 : selectedItems.length;
|
|
184
|
+
const titleSuffix = itemCount > 0 ? ` (${itemCount} workitem)` : '';
|
|
185
|
+
return (_jsx(TMModal, { onClose: onClose, width: '600px', height: '270px', isModal: true, title: SDKUI_Localizator.Reassign + titleSuffix, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx(TMUserChooser, { dataSource: participants, values: selectedUserID, onValueChanged: (IDs) => {
|
|
176
186
|
setSelectedUserID(IDs ?? []);
|
|
177
|
-
} }), _jsxs("p", { style: { color: commentValue.length === 0 ? TMColors.error : 'black' }, children: [SDKUI_Localizator.CommentText, " ", commentValue.length === 0 && _jsx("span", { children: ` (${SDKUI_Localizator.RequiredField})` }), " "] }), _jsx(StyledTextArea, { "$isValid": commentValue.length !== 0, value: commentValue, onChange: (e) => setCommentValue(e.target.value) }), _jsx(CharacterCounter, { children: `${200 - commentValue.length} ${SDKUI_Localizator.CharactersRemaining}` })] }), _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 }) })] }) }));
|
|
187
|
+
} }), _jsxs("p", { style: { color: commentValue.length === 0 ? TMColors.error : 'black' }, children: [SDKUI_Localizator.CommentText, " ", commentValue.length === 0 && _jsx("span", { children: ` (${SDKUI_Localizator.RequiredField})` }), " "] }), _jsx(StyledTextArea, { maxLength: 200, "$isValid": commentValue.length !== 0, value: commentValue, onChange: (e) => setCommentValue(e.target.value) }), _jsx(CharacterCounter, { children: `${200 - commentValue.length} ${SDKUI_Localizator.CharactersRemaining}` })] }), _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 }) })] }) }));
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* Modal per forzare l'approvazione di un work item
|
|
191
|
+
*/
|
|
192
|
+
export const WorkflowForceApproveModal = ({ detail, onClose, onCompleted }) => {
|
|
193
|
+
const [commentValue, setCommentValue] = useState('');
|
|
194
|
+
const disable = commentValue.length === 0;
|
|
195
|
+
const forceApproveAsync = async () => {
|
|
196
|
+
try {
|
|
197
|
+
TMSpinner.show({ description: 'Forza approvazione in corso...' });
|
|
198
|
+
await SDK_Globals.tmSession?.NewWorkflowEngine().WFCtrl_ForceWIAsync(detail.wfid, detail.did, WFEvents.AfterBtnApprove01, commentValue);
|
|
199
|
+
ShowAlert({
|
|
200
|
+
mode: 'success',
|
|
201
|
+
position: 'TOP_RIGHT',
|
|
202
|
+
title: 'Forza completamento',
|
|
203
|
+
message: 'Work item approvato con successo',
|
|
204
|
+
duration: 3000
|
|
205
|
+
});
|
|
206
|
+
await onCompleted?.();
|
|
207
|
+
}
|
|
208
|
+
catch (e) {
|
|
209
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
210
|
+
}
|
|
211
|
+
finally {
|
|
212
|
+
onClose?.();
|
|
213
|
+
TMSpinner.hide();
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
const userName = detail.toUser?.name ?? detail.to;
|
|
217
|
+
const title = `Forza completamento - ${userName}`;
|
|
218
|
+
return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx("div", { style: { fontWeight: 600, marginBottom: '8px' }, children: "Motivazione (obbligatorio):" }), _jsx(StyledTextArea, { "$isValid": !disable, value: commentValue, onChange: (e) => setCommentValue(e.target.value), placeholder: "Inserisci il motivo della forzatura...", maxLength: 200 }), _jsxs(CharacterCounter, { children: [commentValue.length, "/200"] })] }), _jsx(StyledModalFooter, { children: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconCheck, {}), caption: "Forza approvazione", width: '180px', disabled: disable, onClick: () => !disable && forceApproveAsync(), advancedColor: TMColors.success }) })] }) }));
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Modal per forzare il rifiuto di un work item
|
|
222
|
+
*/
|
|
223
|
+
export const WorkflowForceRejectModal = ({ detail, onClose, onCompleted }) => {
|
|
224
|
+
const [commentValue, setCommentValue] = useState('');
|
|
225
|
+
const disable = commentValue.length === 0;
|
|
226
|
+
const forceRejectAsync = async () => {
|
|
227
|
+
try {
|
|
228
|
+
TMSpinner.show({ description: 'Forza rifiuto in corso...' });
|
|
229
|
+
await SDK_Globals.tmSession?.NewWorkflowEngine().WFCtrl_ForceWIAsync(detail.wfid, detail.did, WFEvents.AfterBtnReject01, commentValue);
|
|
230
|
+
ShowAlert({
|
|
231
|
+
mode: 'success',
|
|
232
|
+
position: 'TOP_RIGHT',
|
|
233
|
+
title: 'Forza rifiuto',
|
|
234
|
+
message: 'Work item rifiutato con successo',
|
|
235
|
+
duration: 3000
|
|
236
|
+
});
|
|
237
|
+
await onCompleted?.();
|
|
238
|
+
}
|
|
239
|
+
catch (e) {
|
|
240
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
241
|
+
}
|
|
242
|
+
finally {
|
|
243
|
+
onClose?.();
|
|
244
|
+
TMSpinner.hide();
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
const userName = detail.toUser?.name ?? detail.to;
|
|
248
|
+
const title = `Forza rifiuto - ${userName}`;
|
|
249
|
+
return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx("div", { style: { fontWeight: 600, marginBottom: '8px' }, children: "Motivazione (obbligatorio):" }), _jsx(StyledTextArea, { "$isValid": !disable, value: commentValue, onChange: (e) => setCommentValue(e.target.value), placeholder: "Inserisci il motivo del rifiuto...", maxLength: 200 }), _jsxs(CharacterCounter, { children: [commentValue.length, "/200"] })] }), _jsx(StyledModalFooter, { children: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconCloseCircle, {}), caption: "Forza rifiuto", width: '150px', disabled: disable, onClick: () => !disable && forceRejectAsync(), advancedColor: TMColors.error }) })] }) }));
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Modal per terminare le istanze workflow selezionate
|
|
253
|
+
*/
|
|
254
|
+
export const WorkflowEndInstanceModal = ({ selectedInstances, onClose, onCompleted }) => {
|
|
255
|
+
const [commentValue, setCommentValue] = useState('');
|
|
256
|
+
const disable = commentValue.length === 0;
|
|
257
|
+
const endInstancesAsync = async () => {
|
|
258
|
+
try {
|
|
259
|
+
TMSpinner.show({ description: 'Terminazione istanze in corso...' });
|
|
260
|
+
const workflowEngine = SDK_Globals.tmSession?.NewWorkflowEngine();
|
|
261
|
+
if (!workflowEngine)
|
|
262
|
+
throw new Error("Workflow engine non disponibile");
|
|
263
|
+
for (const instance of selectedInstances) {
|
|
264
|
+
if (instance.wfid && instance.did) {
|
|
265
|
+
await workflowEngine.WFCtrl_EndInstanceAsync(instance.wfid, instance.tid ?? 0, instance.did, commentValue);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
ShowAlert({
|
|
269
|
+
mode: 'success',
|
|
270
|
+
position: 'TOP_RIGHT',
|
|
271
|
+
title: 'Terminazione istanze',
|
|
272
|
+
message: `${selectedInstances.length} ${selectedInstances.length === 1 ? 'istanza terminata' : 'istanze terminate'} con successo`,
|
|
273
|
+
duration: 3000
|
|
274
|
+
});
|
|
275
|
+
await onCompleted?.();
|
|
276
|
+
}
|
|
277
|
+
catch (e) {
|
|
278
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
279
|
+
}
|
|
280
|
+
finally {
|
|
281
|
+
onClose?.();
|
|
282
|
+
TMSpinner.hide();
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
const itemCount = selectedInstances.length > 0 ? `(${selectedInstances.length} ${selectedInstances.length === 1 ? 'istanza' : 'istanze'})` : '';
|
|
286
|
+
const title = `Termina istanza ${itemCount}`;
|
|
287
|
+
return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx("div", { style: { fontWeight: 600, marginBottom: '8px' }, children: "Motivazione (obbligatorio):" }), _jsx(StyledTextArea, { "$isValid": !disable, value: commentValue, onChange: (e) => setCommentValue(e.target.value), placeholder: "Inserisci il motivo della terminazione...", maxLength: 200 }), _jsxs(CharacterCounter, { children: [commentValue.length, "/200"] })] }), _jsx(StyledModalFooter, { children: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconStop, {}), caption: "Termina istanza", width: '150px', disabled: disable, onClick: () => !disable && endInstancesAsync(), advancedColor: TMColors.error }) })] }) }));
|
|
178
288
|
};
|
|
179
289
|
export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceType.DESKTOP, onClose, onCompleted }) => {
|
|
180
290
|
const [users, setUsers] = useState([]);
|
|
@@ -210,6 +320,7 @@ export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
210
320
|
name: `${TASK_MORE_INFO_PREFIX_NAME}${nameInput}`
|
|
211
321
|
};
|
|
212
322
|
await SDK_Globals.tmSession?.NewWorkflowEngine().WorkItem_MoreInfoAsync(TID, DID, taskWithPrefix);
|
|
323
|
+
ShowAlert({ mode: 'success', position: 'TOP_RIGHT', title: SDKUI_Localizator.MoreInformation, message: SDKUI_Localizator.MoreInfoSent, duration: 3000 });
|
|
213
324
|
}
|
|
214
325
|
catch (e) {
|
|
215
326
|
TMExceptionBoxManager.show({ exception: e });
|
|
@@ -218,7 +329,6 @@ export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
218
329
|
onCompleted?.();
|
|
219
330
|
onClose?.();
|
|
220
331
|
TMSpinner.hide();
|
|
221
|
-
ShowAlert({ mode: 'success', position: 'TOP_RIGHT', title: SDKUI_Localizator.MoreInformation, message: SDKUI_Localizator.MoreInfoSent, duration: 3000 });
|
|
222
332
|
}
|
|
223
333
|
};
|
|
224
334
|
useEffect(() => {
|
|
@@ -13,6 +13,7 @@ interface DiagramItemComponentProps {
|
|
|
13
13
|
onConnectorMouseUp: (itemId: string, connectorName: string) => void;
|
|
14
14
|
onDimensionsChange: (itemId: string, width: number, height: number) => void;
|
|
15
15
|
onDoubleClick?: (id: string) => void;
|
|
16
|
+
backgroundColor?: string;
|
|
16
17
|
}
|
|
17
18
|
declare const _default: React.NamedExoticComponent<DiagramItemComponentProps>;
|
|
18
19
|
export default _default;
|
|
@@ -42,7 +42,6 @@ const StyledDiagramItem = styled.g `
|
|
|
42
42
|
filter: ${props => (props.$isSelected || props.$isDragging || props.$isHovered ? 'drop-shadow(2px 4px 6px rgba(0,0,0,0.4))' : 'none')};
|
|
43
43
|
|
|
44
44
|
& .item-main-shape {
|
|
45
|
-
fill: transparent;
|
|
46
45
|
stroke: ${props => {
|
|
47
46
|
if (props.$isDragging)
|
|
48
47
|
return '#ffc107';
|
|
@@ -82,7 +81,7 @@ const ConnectorHitArea = styled.circle `
|
|
|
82
81
|
opacity: 0;
|
|
83
82
|
pointer-events: all;
|
|
84
83
|
`;
|
|
85
|
-
const DiagramItemComponent = ({ wf, item, isSelected, isCurrent, readOnly, onClick, onDrag, onDragEnd, onConnectorMouseDown, onConnectorMouseUp, onDimensionsChange, onDoubleClick, }) => {
|
|
84
|
+
const DiagramItemComponent = ({ wf, item, isSelected, isCurrent, readOnly, onClick, onDrag, onDragEnd, onConnectorMouseDown, onConnectorMouseUp, onDimensionsChange, onDoubleClick, backgroundColor, }) => {
|
|
86
85
|
const diagramItemRef = useRef(null);
|
|
87
86
|
const textRef = useRef(null);
|
|
88
87
|
const [isDragging, setIsDragging] = useState(false);
|
|
@@ -257,7 +256,7 @@ const DiagramItemComponent = ({ wf, item, isSelected, isCurrent, readOnly, onCli
|
|
|
257
256
|
isTruncated = textLines[textLines.length - 1].endsWith('...');
|
|
258
257
|
}
|
|
259
258
|
}
|
|
260
|
-
return (_jsxs(_Fragment, { children: [isTruncated && _jsx("title", { children: item.ItemName }), _jsx("rect", { x: "0", y: "0", width: calculatedWidth, height: calculatedHeight, className: "item-main-shape" }), _jsx("g", { transform: `translate(${svgX}, ${svgY})`, children: _jsx(DiagramItemSvgContent, { itemType: item.Type, width: iconRenderWidth, height: iconRenderHeight, statusData: statusData }) }), textLines.length > 0 && (_jsx("text", { ref: textRef, x: calculatedWidth / 2, dominantBaseline: "central", className: "item-text", children: textLines.map((line, index) => (_jsx("tspan", { x: calculatedWidth / 2, dy: index === 0 ? PADDING_TOP + SVG_ICON_SIZE + SPACING_SVG_TEXT : FONT_SIZE + 1, children: line }, index))) })), connectors] }));
|
|
259
|
+
return (_jsxs(_Fragment, { children: [isTruncated && _jsx("title", { children: item.ItemName }), backgroundColor && (_jsx("rect", { x: "-5", y: "-5", width: calculatedWidth + 10, height: calculatedHeight + 10, rx: "12", ry: "12", fill: backgroundColor, opacity: "0.4", style: { filter: 'blur(3px)' } })), _jsx("rect", { x: "0", y: "0", width: calculatedWidth, height: calculatedHeight, className: "item-main-shape", fill: "transparent" }), _jsx("g", { transform: `translate(${svgX}, ${svgY})`, children: _jsx(DiagramItemSvgContent, { itemType: item.Type, width: iconRenderWidth, height: iconRenderHeight, statusData: statusData }) }), textLines.length > 0 && (_jsx("text", { ref: textRef, x: calculatedWidth / 2, dominantBaseline: "central", className: "item-text", children: textLines.map((line, index) => (_jsx("tspan", { x: calculatedWidth / 2, dy: index === 0 ? PADDING_TOP + SVG_ICON_SIZE + SPACING_SVG_TEXT : FONT_SIZE + 1, children: line }, index))) })), connectors] }));
|
|
261
260
|
};
|
|
262
261
|
return (_jsx(StyledDiagramItem, { ref: diagramItemRef, transform: `translate(${currentPosition.x}, ${currentPosition.y})`, "$isSelected": isSelected, "$itemType": item.Type, "$isDragging": isDragging, "$isHovered": isHovered, "$isReadOnly": readOnly, onMouseDown: handleMouseDown, onClick: handleItemClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onDoubleClick: handleDoubleClick, children: _jsx(AnimatingGroup, { "$isCurrent": isCurrent, children: renderContent() }) }));
|
|
263
262
|
};
|
|
@@ -3,7 +3,7 @@ import { useCallback, useEffect, useState } from 'react';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import TMButton from '../../../base/TMButton';
|
|
5
5
|
import { IconAdd, IconDelete, SDKUI_Localizator } from '../../../../helper';
|
|
6
|
-
import { TMUserChooserForm
|
|
6
|
+
import { TMUserChooserForm } from '../../../choosers/TMUserChooser';
|
|
7
7
|
import { TMGroupChooserForm, TMGroupIdViewer } from '../../../choosers/TMGroupChooser';
|
|
8
8
|
import { TMMidViewer } from '../../../viewers/TMMidViewer';
|
|
9
9
|
import { SDK_Globals, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
@@ -13,6 +13,7 @@ import { TMMessageBoxManager, ButtonNames } from '../../../base/TMPopUp';
|
|
|
13
13
|
import TMModal from '../../../base/TMModal';
|
|
14
14
|
import { TMMetadataChooserForm } from '../../../choosers/TMMetadataChooser';
|
|
15
15
|
import TMQueryEditor from '../../../query/TMQueryEditor';
|
|
16
|
+
import TMDataUserIdItemViewer from '../../../viewers/TMDataUserIdItemViewer';
|
|
16
17
|
export var WorkItemActorTypes;
|
|
17
18
|
(function (WorkItemActorTypes) {
|
|
18
19
|
WorkItemActorTypes[WorkItemActorTypes["None"] = 0] = "None";
|
|
@@ -168,7 +169,7 @@ const RecipientList = ({ recipients, title, tid, qd, onAdd, onRemove, onQDChange
|
|
|
168
169
|
const actorId = parseInt(recipient.ActorID, 10);
|
|
169
170
|
switch (recipient.ActorType) {
|
|
170
171
|
case WorkItemActorTypes.UID:
|
|
171
|
-
return _jsx(
|
|
172
|
+
return _jsx(TMDataUserIdItemViewer, { userId: actorId, showIcon: true });
|
|
172
173
|
case WorkItemActorTypes.GID:
|
|
173
174
|
return _jsx(TMGroupIdViewer, { groupID: actorId, showIcon: true });
|
|
174
175
|
case WorkItemActorTypes.MID:
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { IWorkItemData } from '../../../../ts/types';
|
|
2
3
|
interface IWFDiagramProps {
|
|
3
4
|
xmlDiagramString: string;
|
|
4
5
|
currentSetID?: string;
|
|
5
6
|
allowEdit?: boolean;
|
|
6
7
|
onDiagramChange?: (newXmlDiagram: string) => void;
|
|
8
|
+
workitems?: IWorkItemData[];
|
|
7
9
|
}
|
|
8
10
|
declare const WFDiagram: React.FC<IWFDiagramProps>;
|
|
9
11
|
export default WFDiagram;
|
|
@@ -317,7 +317,7 @@ const DiagramMessage = styled.div `
|
|
|
317
317
|
color: #555;
|
|
318
318
|
text-align: center;
|
|
319
319
|
`;
|
|
320
|
-
const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagramChange }) => {
|
|
320
|
+
const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagramChange, workitems }) => {
|
|
321
321
|
const [isReadOnly, setIsReadOnly] = useState(true);
|
|
322
322
|
const [isFullScreen, setIsFullScreen] = useState(false);
|
|
323
323
|
const [zoomLevel, setZoomLevel] = useState(1);
|
|
@@ -338,6 +338,23 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
338
338
|
const [tempConnectionEnd, setTempConnectionEnd] = useState(null);
|
|
339
339
|
const [mouseDownPos, setMouseDownPos] = useState(null);
|
|
340
340
|
const [isDraggingExistingConnectionEndpoint, setIsDraggingExistingConnectionEndpoint] = useState(false);
|
|
341
|
+
// Helper function per ottenere il colore di sfondo basato sullo stato del workitem
|
|
342
|
+
const getWorkItemBackgroundColor = useCallback((setID) => {
|
|
343
|
+
if (!workitems || workitems.length === 0)
|
|
344
|
+
return undefined;
|
|
345
|
+
const workitem = workitems.find(wi => wi.setID === setID);
|
|
346
|
+
if (!workitem || !workitem.setStatus || workitem.setStatus.value === undefined)
|
|
347
|
+
return undefined;
|
|
348
|
+
const statusValue = typeof workitem.setStatus.value === 'number'
|
|
349
|
+
? workitem.setStatus.value
|
|
350
|
+
: parseInt(String(workitem.setStatus.value), 10);
|
|
351
|
+
switch (statusValue) {
|
|
352
|
+
case 0: return '#FFFACD'; // Giallo pastello (lemon chiffon) (nuovo)
|
|
353
|
+
case 1: return '#C8E6C9'; // Verde pastello (completato)
|
|
354
|
+
case -1: return '#FFCDD2'; // Rosso pastello (rifiutato)
|
|
355
|
+
default: return '#e0e0e0'; // Grigio di default
|
|
356
|
+
}
|
|
357
|
+
}, [workitems]);
|
|
341
358
|
const [draggingConnectionId, setDraggingConnectionId] = useState(null);
|
|
342
359
|
const [draggingEndpointType, setDraggingEndpointType] = useState(null);
|
|
343
360
|
const [draggingConnectionFixedPoint, setDraggingConnectionFixedPoint] = useState(null);
|
|
@@ -1656,10 +1673,10 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
1656
1673
|
}
|
|
1657
1674
|
}, [wfDiagram]);
|
|
1658
1675
|
const handleCanvasDoubleClick = useCallback((event) => {
|
|
1659
|
-
if (isReadOnly) {
|
|
1676
|
+
if (isReadOnly && allowEdit) {
|
|
1660
1677
|
toggleReadOnlyMode();
|
|
1661
1678
|
}
|
|
1662
|
-
}, [isReadOnly, toggleReadOnlyMode]);
|
|
1679
|
+
}, [isReadOnly, allowEdit, toggleReadOnlyMode]);
|
|
1663
1680
|
const handleFullScreenKeyDown = useCallback((event) => {
|
|
1664
1681
|
if (event.key === 'Escape') {
|
|
1665
1682
|
// Blocca sempre la propagazione per evitare che TMSaveForm riceva l'evento
|
|
@@ -1680,7 +1697,7 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
1680
1697
|
}, [isFullScreen]);
|
|
1681
1698
|
const diagramContent = (_jsxs(CanvasContainer, { onDoubleClick: handleCanvasDoubleClick, children: [_jsx("input", { ref: fileInputRef, type: "file", accept: ".xml" // Filtra per file XML
|
|
1682
1699
|
, onChange: handleFileChange, style: { display: 'none' } }), _jsxs(ToolbarContainer, { "$isCollapsed": isToolbarCollapsed, "$isFloating": isToolbarFloating, "$isToolboxVisible": isToolboxVisible, "$isReadOnly": isReadOnly, children: [allowEdit && _jsx(ButtonGroup, { "$isFloating": isToolbarFloating, children: _jsxs("button", { onClick: toggleReadOnlyMode, title: isReadOnly ? SDKUI_Localizator.Design : SDKUI_Localizator.ReadOnly, children: [isReadOnly ? _jsx(IconPencil, {}) : _jsx(IconLock, {}), !isToolbarCollapsed && _jsx("span", { children: isReadOnly ? SDKUI_Localizator.Design : SDKUI_Localizator.ReadOnly })] }) }), allowEdit && _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [!isReadOnly && _jsxs("button", { onClick: handleToggleToolboxVisibility, title: SDKUI_Localizator.ShowToolbox, children: [_jsx(IconFlowChart, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ShowToolboxToggle })] }), _jsxs("button", { onClick: toggleFullScreenMode, title: SDKUI_Localizator.ShowFullScreen, children: [isFullScreen ? _jsx(IconWindowMinimize, {}) : _jsx(IconWindowMaximize, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ShowFullScreen })] })] }), _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [_jsxs("button", { onClick: handleZoomIn, title: SDKUI_Localizator.ZoomIn, children: [_jsx(IconZoomIn, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ZoomIn })] }), _jsxs("button", { onClick: handleZoomOut, title: SDKUI_Localizator.ZoomOut, children: [_jsx(IconZoomOut, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ZoomOut })] }), _jsx(ZoomLevelText, { "$isFloating": isToolbarFloating, "$isCollapsed": isToolbarCollapsed, children: formattedZoomLevel })] }), !isReadOnly && _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [_jsxs("button", { onClick: handleUndo, disabled: historyIndex === 0, title: SDKUI_Localizator.Undo, children: [_jsx(IconUndo, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Undo })] }), _jsxs("button", { onClick: handleRedo, disabled: historyIndex === wfDiagramHistory.length - 1, title: SDKUI_Localizator.Redo, children: [_jsx(IconUndo, { style: { transform: 'scaleX(-1)' } }), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Redo })] }), _jsxs("button", { onClick: handleRestore, title: SDKUI_Localizator.Restore, children: [_jsx(IconRestore, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Restore })] }), _jsxs("button", { onClick: handleNew, title: SDKUI_Localizator.DiagramNew, disabled: isReadOnly, children: [_jsx(IconNew, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.DiagramNew })] }), _jsxs("button", { onClick: handleExportDiagram, disabled: isReadOnly || !wfDiagram, title: SDKUI_Localizator.Export, children: [_jsx(IconExport, {}), _jsx("span", { children: SDKUI_Localizator.Export })] }), _jsxs("button", { onClick: handleImportDiagramClick, disabled: isReadOnly, title: SDKUI_Localizator.Import, children: [_jsx(IconImport, {}), _jsx("span", { children: SDKUI_Localizator.Import })] })] }), !isReadOnly && _jsx(ButtonGroup, { "$isFloating": isToolbarFloating, children: _jsxs("button", { onClick: handleAutoAdjust, title: SDKUI_Localizator.AutoAdjust, children: [_jsx(IconAdjust, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.AutoAdjust })] }) }), !isReadOnly && _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [_jsxs("button", { onClick: handleCopy, disabled: selectedItems.size === 0, title: SDKUI_Localizator.Copy, children: [_jsx(IconCopy, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Copy })] }), _jsxs("button", { onClick: handleCut, disabled: selectedItems.size === 0, title: SDKUI_Localizator.Cut, children: [_jsx(IconCut, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Cut })] }), _jsxs("button", { onClick: handlePaste, disabled: copiedItems.length === 0 && copiedConnections.length === 0, title: SDKUI_Localizator.Paste, children: [_jsx(IconPaste, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Paste })] })] }), allowEdit && _jsxs("button", { onClick: handleToggleToolbarMode, title: isToolbarFloating ? SDKUI_Localizator.ToolbarDock : SDKUI_Localizator.ToolbarFloat, children: [isToolbarFloating ? _jsx(IconPin, {}) : _jsx(IconUnpin, {}), !isToolbarCollapsed && !isToolbarFloating && _jsx("span", { children: SDKUI_Localizator.ToggleMode })] }), !isToolbarFloating && _jsx(ToolbarToggle, { onClick: () => setIsToolbarCollapsed(!isToolbarCollapsed), title: isToolbarCollapsed ? SDKUI_Localizator.ToolbarExpand : SDKUI_Localizator.ToolbarCollapse, children: isToolbarCollapsed ? _jsx(IconChevronRight, {}) : _jsx(IconCloseOutline, {}) })] }), !isReadOnly && (_jsx(ToolboxContainer, { "$isVisible": isToolboxVisible, children: isToolboxVisible && availableItemTypes.map(type => (_jsxs(ToolboxItem, { draggable: true, onDragStart: (e) => handleToolboxDragStart(e, type), onDragEnd: handleToolboxDragEnd, children: [_jsx(ToolboxIconWrapper, { children: _jsx(DiagramItemSvgContent, { itemType: type, width: 38, height: 38, isToolboxPreview: true }) }), _jsx("span", { children: LocalizeDiagramItemType(type) })] }, type))) })), _jsx(SvgScrollContainer, { children: isLoading ?
|
|
1683
|
-
(_jsxs(StyledLoadingContainer, { children: [_jsx(StyledSpinner, {}), _jsx("span", { children: `${'Caricamento diagramma'}...` })] })) : wfDiagram ? (_jsx(StyledSvg, { ref: svgRef, tabIndex: 0, onKeyDownCapture: handleKeyDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseDown: handleMouseDown, onDrop: handleDropOnCanvas, onDragOver: handleDragOver, width: svgWidth, height: svgHeight, children: _jsxs(ScalableGroup, { "$scale": zoomLevel, "$translateX": translateX, "$translateY": translateY, children: [wfDiagram?.DiagramItems.map(item => (_jsx(DiagramItemComponent, { wf: wfDiagram?.Info, readOnly: isReadOnly, item: item, isSelected: selectedItems.has(item.ID), isCurrent: item.ID === currentSetID, onClick: handleDiagramItemClick, onDrag: handleDrag, onDragEnd: handleDragEnd, onConnectorMouseDown: handleConnectorMouseDown, onConnectorMouseUp: handleConnectorMouseUp, onDimensionsChange: handleItemDimensionsChange, onDoubleClick: handleDoubleClickItem }, item.ID))), calculatedConnections.map(connection => {
|
|
1700
|
+
(_jsxs(StyledLoadingContainer, { children: [_jsx(StyledSpinner, {}), _jsx("span", { children: `${'Caricamento diagramma'}...` })] })) : wfDiagram ? (_jsx(StyledSvg, { ref: svgRef, tabIndex: 0, onKeyDownCapture: handleKeyDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseDown: handleMouseDown, onDrop: handleDropOnCanvas, onDragOver: handleDragOver, width: svgWidth, height: svgHeight, children: _jsxs(ScalableGroup, { "$scale": zoomLevel, "$translateX": translateX, "$translateY": translateY, children: [wfDiagram?.DiagramItems.map(item => (_jsx(DiagramItemComponent, { wf: wfDiagram?.Info, readOnly: isReadOnly, item: item, isSelected: selectedItems.has(item.ID), isCurrent: item.ID === currentSetID, onClick: handleDiagramItemClick, onDrag: handleDrag, onDragEnd: handleDragEnd, onConnectorMouseDown: handleConnectorMouseDown, onConnectorMouseUp: handleConnectorMouseUp, onDimensionsChange: handleItemDimensionsChange, onDoubleClick: handleDoubleClickItem, backgroundColor: getWorkItemBackgroundColor(item.ID) }, item.ID))), calculatedConnections.map(connection => {
|
|
1684
1701
|
const sourceItem = wfDiagram?.DiagramItems.find(item => item.ID === connection.Source.ParentDiagramItem.ID);
|
|
1685
1702
|
const sinkItem = wfDiagram?.DiagramItems.find(item => item.ID === connection.Sink.ParentDiagramItem.ID);
|
|
1686
1703
|
if (!sourceItem || !sinkItem)
|
|
@@ -3,6 +3,8 @@ import { TMEndpointsType } from './TMLoginForm';
|
|
|
3
3
|
export interface LoginData {
|
|
4
4
|
endpoint: TMEndpointsType;
|
|
5
5
|
dcmtArchive: ArchiveDescriptor;
|
|
6
|
+
manualArchiveID?: string;
|
|
7
|
+
hasArchives?: boolean;
|
|
6
8
|
authenticationMode: AuthenticationModes;
|
|
7
9
|
username?: string;
|
|
8
10
|
password?: string;
|
|
@@ -27,8 +27,13 @@ export class LoginValidator {
|
|
|
27
27
|
if (!data.endpoint?.Description?.trim()) {
|
|
28
28
|
addError("endpoint", SDKUI_Localizator.RequiredField);
|
|
29
29
|
}
|
|
30
|
-
if (
|
|
31
|
-
|
|
30
|
+
if (data.hasArchives) {
|
|
31
|
+
if (!data.dcmtArchive?.description?.trim()) {
|
|
32
|
+
addError("dcmtArchive", SDKUI_Localizator.RequiredField);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else if (!data.manualArchiveID?.trim()) {
|
|
36
|
+
addError("manualArchiveID", SDKUI_Localizator.RequiredField);
|
|
32
37
|
}
|
|
33
38
|
if (!data.authenticationMode || data.authenticationMode === AuthenticationModes.None) {
|
|
34
39
|
addError("authenticationMode", SDKUI_Localizator.RequiredField);
|
|
@@ -8,6 +8,7 @@ import frMessages from "devextreme/localization/messages/fr.json";
|
|
|
8
8
|
import itMessages from "devextreme/localization/messages/it.json";
|
|
9
9
|
import ptMessages from "devextreme/localization/messages/pt.json";
|
|
10
10
|
import { locale as dxlocale, loadMessages } from "devextreme/localization";
|
|
11
|
+
import { devextremeCustomMessages } from "../../../helper/devextremeCustomMessages";
|
|
11
12
|
import styled from "styled-components";
|
|
12
13
|
import Menu from "./Menu";
|
|
13
14
|
import TextBox from "./TextBox";
|
|
@@ -81,6 +82,7 @@ export const useCultureID = ({ cultureID = CultureIDs.It_IT }) => {
|
|
|
81
82
|
loadMessages(frMessages);
|
|
82
83
|
loadMessages(itMessages);
|
|
83
84
|
loadMessages(ptMessages);
|
|
85
|
+
loadMessages(devextremeCustomMessages); // Fix traduzioni mancanti in DevExtreme
|
|
84
86
|
}, []);
|
|
85
87
|
return (currentCultureID);
|
|
86
88
|
};
|
|
@@ -111,6 +113,7 @@ const TMLoginForm = (props) => {
|
|
|
111
113
|
const [showCultureIDs, setShowCultureIDs] = useState(false);
|
|
112
114
|
const [dcmtArchives, setDcmtArchives] = useState([]);
|
|
113
115
|
const [dcmtArchive, setDcmtArchive] = useState();
|
|
116
|
+
const [manualArchiveID, setManualArchiveID] = useState('');
|
|
114
117
|
const [authMode, setAuthMode] = useState(AuthenticationModes.TopMedia);
|
|
115
118
|
const [username, setUsername] = useState('SysAdmin');
|
|
116
119
|
const [password, setPassword] = useState('');
|
|
@@ -131,6 +134,8 @@ const TMLoginForm = (props) => {
|
|
|
131
134
|
authenticationMode: authMode,
|
|
132
135
|
cultureID: props.cultureID ?? CultureIDs.It_IT,
|
|
133
136
|
dcmtArchive: dcmtArchive,
|
|
137
|
+
manualArchiveID: manualArchiveID,
|
|
138
|
+
hasArchives: dcmtArchives.length > 0,
|
|
134
139
|
endpoint: endpoint,
|
|
135
140
|
authDomain: authDomain,
|
|
136
141
|
authDomainOnBehalfOf: authDomain,
|
|
@@ -142,7 +147,7 @@ const TMLoginForm = (props) => {
|
|
|
142
147
|
username: username,
|
|
143
148
|
usernameOnBehalfOf: usernameOnBehalf
|
|
144
149
|
};
|
|
145
|
-
}, [authMode, props.cultureID, dcmtArchive, endpoint, authDomain, otpCode, password, passwordOnBehalf, saveLoginName, saveLoginEnable, username, usernameOnBehalf]);
|
|
150
|
+
}, [authMode, props.cultureID, dcmtArchive, manualArchiveID, dcmtArchives.length, endpoint, authDomain, otpCode, password, passwordOnBehalf, saveLoginName, saveLoginEnable, username, usernameOnBehalf]);
|
|
146
151
|
const inputRefs = useMemo(() => {
|
|
147
152
|
switch (authMode) {
|
|
148
153
|
case AuthenticationModes.TopMedia:
|
|
@@ -302,7 +307,7 @@ const TMLoginForm = (props) => {
|
|
|
302
307
|
}, []);
|
|
303
308
|
const disableContinueBtn = useMemo(() => {
|
|
304
309
|
switch (loginStep) {
|
|
305
|
-
case 1: return fieldValidations('endpoint').length > 0 || fieldValidations('dcmtArchive').length > 0;
|
|
310
|
+
case 1: return fieldValidations('endpoint').length > 0 || fieldValidations('dcmtArchive').length > 0 || fieldValidations('manualArchiveID').length > 0;
|
|
306
311
|
case 2: return fieldValidations('authenticationMode').length > 0 || fieldValidations('username').length > 0 || fieldValidations('password').length > 0;
|
|
307
312
|
default: return false;
|
|
308
313
|
}
|
|
@@ -321,8 +326,13 @@ const TMLoginForm = (props) => {
|
|
|
321
326
|
return tmSession;
|
|
322
327
|
}, [endpoint, username, dcmtArchive]);
|
|
323
328
|
const nextStepHandler = async () => {
|
|
324
|
-
if (!endpoint || !dcmtArchive)
|
|
329
|
+
if (!endpoint || (!dcmtArchive && !manualArchiveID))
|
|
325
330
|
return;
|
|
331
|
+
if (loginStep === 1 && !dcmtArchive && manualArchiveID) {
|
|
332
|
+
const isValid = await validateManualArchiveAsync();
|
|
333
|
+
if (!isValid)
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
326
336
|
if (loginStep === 1) {
|
|
327
337
|
setLoginStep(2);
|
|
328
338
|
}
|
|
@@ -349,6 +359,23 @@ const TMLoginForm = (props) => {
|
|
|
349
359
|
return;
|
|
350
360
|
setLoginStep(prev => prev - 1);
|
|
351
361
|
}, [loginStep]);
|
|
362
|
+
const validateManualArchiveAsync = async () => {
|
|
363
|
+
if (!tmSession || !manualArchiveID)
|
|
364
|
+
return false;
|
|
365
|
+
try {
|
|
366
|
+
TMSpinner.show({ description: '' });
|
|
367
|
+
const archiveEngine = tmSession.NewArchiveEngine();
|
|
368
|
+
await archiveEngine.RetrieveAsync(manualArchiveID);
|
|
369
|
+
return true;
|
|
370
|
+
}
|
|
371
|
+
catch (e) {
|
|
372
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
373
|
+
return false;
|
|
374
|
+
}
|
|
375
|
+
finally {
|
|
376
|
+
TMSpinner.hide();
|
|
377
|
+
}
|
|
378
|
+
};
|
|
352
379
|
const getArchivesAsync = async () => {
|
|
353
380
|
if (!tmSession)
|
|
354
381
|
return;
|
|
@@ -392,7 +419,7 @@ const TMLoginForm = (props) => {
|
|
|
392
419
|
const sdInput = {
|
|
393
420
|
authenticationMode: authMode,
|
|
394
421
|
appModuleID: props.appModule,
|
|
395
|
-
archiveID: dcmtArchive?.id,
|
|
422
|
+
archiveID: dcmtArchive?.id ?? (dcmtArchives.length === 0 && manualArchiveID ? manualArchiveID : undefined),
|
|
396
423
|
description: dcmtArchive?.description,
|
|
397
424
|
userName: username,
|
|
398
425
|
password: password,
|
|
@@ -594,7 +621,7 @@ const TMLoginForm = (props) => {
|
|
|
594
621
|
}
|
|
595
622
|
}, [SDK_Globals.appModule]);
|
|
596
623
|
return (_jsxs(StyledWrapper, { children: [!isMobile && _jsxs(StyledVersionContainer, { children: [_jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.primary }, children: "\u25CF" }), SDK_Globals.appModule] }), _jsxs("p", { children: ["v.", SDK_Globals.appVersion] })] }), _jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.tertiary }, children: "\u25CF" }), "SDKUI"] }), _jsxs("p", { children: ["v.", SDK_Globals.sdkuiVersion] })] }), _jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.error }, children: "\u25CF" }), "SDK"] }), _jsxs("p", { children: ["v.", SDK_Globals.sdkVersion] })] })] }), _jsxs(StyledLoginContainer, { "$isMobile": isMobile, children: [_jsxs(StyledLeftSection, { "$isMobile": isMobile, "$isConnector": props.isConnector ?? false, children: [isMobile && _jsxs(StyledTopBar, { children: [_jsx(StyledTitle, { children: SDKUI_Localizator.WelcomeTo.replaceParams('') + ' ' + welcomeAppNameHeader + ' ' + 'v.' + SDK_Globals.appVersion }), _jsx(StyledMobileVersionIcon, { onClick: showVersionPopup, children: _jsx(IconInfo, { fontSize: 20, color: TMColors.primary }) })] }), _jsx(StyledOverlay, { "$isMobile": isMobile, children: _jsx(StyledCustomLogo, { style: { backgroundImage: `url(${showDefaultLogo ? 'logo-default.svg' : 'logo-custom.svg'})` } }) }), (windowHeight === WindowHeight.LARGE || !isMobile) && _jsxs(StyledPoweredByContainer, { "$isMobile": isMobile, children: [" ", showDefaultLogo ? 'Powered by TopConsult' : _jsx("img", { src: "/logo-default.svg", alt: "Logo", width: isMobile ? 50 : 100 }), " "] })] }), _jsxs(StyledRightSection, { "$isMobile": isMobile, children: [((((getDeviceType() === 'desktop' || isDesktop || isTablet) && windowHeight !== WindowHeight.SMALL)) && !isMobile) && _jsxs(StyledLogoContainer, { "$isMobile": isMobile, children: [_jsx(StyledWelcomeText, { children: SDKUI_Localizator.WelcomeTo.replaceParams('') }), _jsx(StyledLogo, { children: _jsx("img", { src: six, alt: "six", height: 50 }) }), _jsx(StyledWelcomeText, { children: welcomeAppName })] }), _jsxs(StyledToolbarContainer, { children: [_jsx(StyledLanguageChooser, { onClick: () => setShowCultureIDs(true), children: _jsx(TMTooltip, { content: SDKUI_Localizator.CultureID, children: _jsx("img", { src: getCultureIDImg(), alt: "Lang", width: 25, height: 25 }) }) }), loginStep !== 3 && _jsx(TMButton, { btnStyle: "icon", onClick: () => setShowRapidAccess(true), icon: _jsx(IconFastAccess, { fontSize: 20 }), caption: LOGINLocalizator.QuickAccess }), showPasswordOperations && _jsx(TMButton, { disabled: disablePasswordOperations, btnStyle: "icon", onClick: () => setShowChangePassword(true), icon: _jsx(IconPasswordOutline, { fontSize: 19 }), caption: SDKUI_Localizator.ChangePassword })] }), _jsxs(StyledFormContainer, { "$isMobile": isMobile, "$windowHeight": windowHeight, children: [loginStep === 1 &&
|
|
597
|
-
_jsxs(StyledStepContainer, { "$deviceType": deviceType, children: [_jsx(Chooser, { isDropDown: isDesktop, dataSource: props.endpoints, value: 'Description', columns: accessPointChooserColumns, additionalIcons: accessPointAdditionalIcons, icon: _jsx(IconAccessPoint, {}), label: SDKUI_Localizator.Endpoint, onSelectionChanged: (ep) => { setEndpoint(ep); setDcmtArchive(undefined); }, validationItems: fieldValidations('endpoint'), selectedRow: endpoint ?? undefined }), _jsx(Chooser, { isDropDown: isDesktop, dataSource: dcmtArchives, value: 'description', columns: dcmtArchiveChooserColumns, icon: _jsx(IconArchiveDoc, {}), label: SDKUI_Localizator.ArchiveID, onSelectionChanged: (arch) => setDcmtArchive(arch), validationItems: fieldValidations('dcmtArchive'), disabled: !endpoint, selectedRow: dcmtArchive ?? undefined })] }), loginStep === 2 &&
|
|
624
|
+
_jsxs(StyledStepContainer, { "$deviceType": deviceType, children: [_jsx(Chooser, { isDropDown: isDesktop, dataSource: props.endpoints, value: 'Description', columns: accessPointChooserColumns, additionalIcons: accessPointAdditionalIcons, icon: _jsx(IconAccessPoint, {}), label: SDKUI_Localizator.Endpoint, onSelectionChanged: (ep) => { setEndpoint(ep); setDcmtArchive(undefined); }, validationItems: fieldValidations('endpoint'), selectedRow: endpoint ?? undefined }), dcmtArchives.length > 0 ? (_jsx(Chooser, { isDropDown: isDesktop, dataSource: dcmtArchives, value: 'description', columns: dcmtArchiveChooserColumns, icon: _jsx(IconArchiveDoc, {}), label: SDKUI_Localizator.ArchiveID, onSelectionChanged: (arch) => setDcmtArchive(arch), validationItems: fieldValidations('dcmtArchive'), disabled: !endpoint, selectedRow: dcmtArchive ?? undefined })) : (_jsx(TextBox, { type: "text", icon: _jsx(IconArchiveDoc, {}), label: SDKUI_Localizator.ArchiveID, value: manualArchiveID, onValueChanged: (value) => setManualArchiveID(value), validationItems: fieldValidations('manualArchiveID'), disabled: !endpoint, placeHolder: 'Inserisci archivio' }))] }), loginStep === 2 &&
|
|
598
625
|
_jsxs(_Fragment, { children: [_jsxs(StyledSummaryContainer, { style: {
|
|
599
626
|
display: 'flex',
|
|
600
627
|
justifyContent: 'center',
|
|
@@ -604,7 +631,7 @@ const TMLoginForm = (props) => {
|
|
|
604
631
|
marginBottom: windowHeight === WindowHeight.SMALL ? '30px' : '25px',
|
|
605
632
|
width: '100%',
|
|
606
633
|
minHeight: '15px'
|
|
607
|
-
}, children: [_jsxs(StyledDescription, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.Endpoint, children: _jsx(IconAccessPoint, { color: TMColors.primary, fontSize: 16 }) }), _jsx(TMTooltip, { content: endpoint?.Description ?? '', children: _jsx("p", { children: endpoint?.Description && endpoint.Description.length > 20 ? endpoint.Description.substring(0, 20) + '...' : endpoint?.Description }) })] }), _jsxs(StyledDescription, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.ArchiveID, children: _jsx(IconArchiveDoc, { color: TMColors.primary, fontSize: 16 }) }), _jsx(TMTooltip, { content: dcmtArchive
|
|
634
|
+
}, children: [_jsxs(StyledDescription, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.Endpoint, children: _jsx(IconAccessPoint, { color: TMColors.primary, fontSize: 16 }) }), _jsx(TMTooltip, { content: endpoint?.Description ?? '', children: _jsx("p", { children: endpoint?.Description && endpoint.Description.length > 20 ? endpoint.Description.substring(0, 20) + '...' : endpoint?.Description }) })] }), _jsxs(StyledDescription, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.ArchiveID, children: _jsx(IconArchiveDoc, { color: TMColors.primary, fontSize: 16 }) }), _jsx(TMTooltip, { content: dcmtArchive ? (dcmtArchive.description ?? '') : manualArchiveID, children: _jsx(StyledArchiveText, { children: dcmtArchive ? (dcmtArchive.description ?? '') : manualArchiveID }) })] })] }), _jsxs(StyledStepContainer, { "$windowHeight": windowHeight, "$deviceType": deviceType, children: [_jsx(SelectBox, { value: authMode, options: authModeOptions, onValueChanged: (value) => setAuthMode(value), validationItems: fieldValidations('authenticationMode'), icon: _jsx(IconLogin, {}), label: SDKUI_Localizator.AuthMode }), _jsxs(StyledCredentialWrapper, { children: [authMode === AuthenticationModes.WindowsThroughTopMedia && _jsx(TextBox, { ref: authDomainRef, value: authDomain, onValueChanged: (e) => setAuthDomain(e), validationItems: fieldValidations('authDomain'), type: "text", icon: _jsx(IconWeb, {}), label: SDKUI_Localizator.Domain }), authMode !== AuthenticationModes.MSAzure && _jsx(CeredentialContainer, { isMobile: isMobile, ref: usernameRef, secondaryRef: passwordRef, usernameValidator: fieldValidations('username'), passwordValidator: fieldValidations('password'), authMode: authMode, username: username, password: password, onUsernameChanged: (un) => setUsername(un), onPasswordChanged: (ps) => setPassword(ps) }), authMode === AuthenticationModes.TopMediaOnBehalfOf &&
|
|
608
635
|
_jsxs(StyledCredentialWrapper, { children: [_jsx(TextBox, { value: authDomain, ref: authDomainRef, onValueChanged: (e) => setAuthDomain(e), validationItems: fieldValidations('authDomain'), type: "text", icon: _jsx(IconWeb, {}), label: SDKUI_Localizator.Domain }), _jsx(CeredentialContainer, { isMobile: isMobile, ref: usernameOnBehalfOfRef, secondaryRef: passwordOnBehalfOfRRef, usernameValidator: fieldValidations('usernameOnBehalfOf'), passwordValidator: fieldValidations('passwordOnBehalfOf'), authMode: AuthenticationModes.TopMediaOnBehalfOf, username: usernameOnBehalf, password: passwordOnBehalf, onUsernameChanged: (un) => setUsernameOnBehalf(un), onPasswordChanged: (ps) => setPasswordOnBehalf(ps) })] })] }), authMode !== AuthenticationModes.TopMediaWithMFA &&
|
|
609
636
|
_jsx(RapidAccessContainer, { isSaveEnable: saveLoginEnable, name: saveLoginName, nameValidationItems: fieldValidations('rapidAccessName'), onEnableSaveChange: () => setSaveLoginEnable(!saveLoginEnable), onNameChange: (name) => setSaveLoginName(name) })] })] }), loginStep === 3 &&
|
|
610
637
|
_jsxs(StyledStepThreeContainer, { "$isMobile": isMobile, children: [_jsx(OTPReader, { isMobile: isMobile, digits: otpCode, onChange: handleDigitChange, onFullChange: handleFullChange, text: _jsxs("div", { children: [" ", LOGINLocalizator.EnterOtpInstructions, " "] }), header: '', additionalButtons: [
|
|
@@ -703,6 +730,7 @@ const StyledLogo = styled.div ` display: flex; gap: 5px; align-items: center; `;
|
|
|
703
730
|
const StyledFormContainer = styled.div ` display: flex; flex-direction: column; padding: ${props => getPadding(props.$windowHeight, props.$isMobile)} ; align-items: center; justify-content: center; gap: 10px; width: 100%; height: fit-content; max-height: calc(100% - 100px); margin-top : ${props => !props.$isMobile && props.$windowHeight === WindowHeight.MEDIUM ? '70px' : '0'} ; `;
|
|
704
731
|
const StyledButtonContainer = styled.div ` display: flex; align-items: center; justify-content: center; padding: ${props => props.$windowHeight !== WindowHeight.SMALL ? '10px' : '0'}; width: 100%; margin-top: ${props => props.$windowHeight !== WindowHeight.SMALL ? '10px' : '0'}; `;
|
|
705
732
|
const StyledDescription = styled.div ` display: flex; align-items: center; gap: 2px; `;
|
|
733
|
+
const StyledArchiveText = styled.p ` max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; `;
|
|
706
734
|
const StyledRapidLoginSave = styled.div ` display: flex; flex-direction: column; width: 100%; gap: 2px; `;
|
|
707
735
|
const StyledForgetPassword = styled.div ` position: absolute; bottom: ${props => props.$isMobile ? '15px' : '25px'}; left: 50%; transform: translateX(-50%); font-size: 0.8rem; `;
|
|
708
736
|
const StyledBackButton = styled.div ` position: absolute; top: 20px; left: 20px; `;
|
|
@@ -88,7 +88,7 @@ const TMChooserForm = ({ children, title, allowMultipleSelection = false, allowA
|
|
|
88
88
|
}, [manageUseLocalizedName, summaryItems]);
|
|
89
89
|
return (_jsx(TMModal, { title: renderTitle(), width: width ?? '550px', height: height ?? '600px', toolbar: _jsx(ToolbarButtons, {}), onClose: onClose, children: children ??
|
|
90
90
|
filteredItems.length > 0
|
|
91
|
-
? _jsx(TMDataGrid, { dataSource: filteredItems, keyExpr: keyName, dataColumns: dataColumns, focusedRowKey: focusedRowKey, selectedRowKeys: selectedRowKeys,
|
|
91
|
+
? _jsx(TMDataGrid, { dataSource: filteredItems, keyExpr: keyName, dataColumns: dataColumns, focusedRowKey: focusedRowKey, selectedRowKeys: selectedRowKeys, searchPanelFocusTrigger: 1, headerFilter: { visible: true }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single', showCheckBoxesMode: 'always', selectAllMode: 'allPages' }, grouping: allowGrouping ? { autoExpandAll: false, expandMode: 'rowClick' } : undefined, summary: customSummary, showFilterPanel: showFilterPanel, onFocusedRowChanged: handleFocusedRowChange, onSelectionChanged: handleSelectionChanged, onRowDblClick: handleRowDoubleClick })
|
|
92
92
|
: _jsx(TMLayoutContainer, { gap: 30, alignItems: 'center', justifyContent: 'center', children: _jsx(TMLayoutItem, { children: _jsx("p", { style: { height: "100%", color: TMColors.primaryColor, fontSize: "1.5rem", display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: SDKUI_Localizator.NoDataToDisplay }) }) }) }));
|
|
93
93
|
};
|
|
94
94
|
export default TMChooserForm;
|