@topconsultnpm/sdkui-react 6.20.0-dev1.6 → 6.20.0-dev1.60
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.d.ts +4 -0
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +416 -0
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +13 -0
- package/lib/components/NewComponents/ContextMenu/hooks.js +61 -0
- package/lib/components/NewComponents/ContextMenu/index.d.ts +5 -0
- package/lib/components/NewComponents/ContextMenu/index.js +3 -0
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +31 -0
- package/lib/components/NewComponents/ContextMenu/styles.js +336 -0
- package/lib/components/NewComponents/ContextMenu/types.d.ts +39 -0
- package/lib/components/NewComponents/ContextMenu/types.js +1 -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.d.ts +4 -0
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +745 -0
- package/lib/components/NewComponents/FloatingMenuBar/index.d.ts +2 -0
- package/lib/components/NewComponents/FloatingMenuBar/index.js +2 -0
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +51 -0
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +385 -0
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +29 -0
- package/lib/components/NewComponents/FloatingMenuBar/types.js +1 -0
- 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/choosers/TMMetadataChooser.js +8 -1
- 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 +40 -69
- package/lib/components/features/documents/TMMasterDetailDcmts.js +37 -52
- 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 +30 -5
- package/lib/components/features/search/TMSearchQueryPanel.js +13 -12
- package/lib/components/features/search/TMSearchResult.js +57 -216
- 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 +32 -2
- package/lib/components/features/workflow/TMWorkflowPopup.js +112 -14
- package/lib/components/features/workflow/diagram/WFDiagram.js +2 -2
- 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/index.d.ts +2 -0
- package/lib/components/index.js +2 -0
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
- package/lib/components/viewers/TMDataListItemViewer.js +12 -11
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +17 -0
- package/lib/helper/SDKUI_Globals.js +9 -0
- package/lib/helper/SDKUI_Localizator.d.ts +9 -1
- package/lib/helper/SDKUI_Localizator.js +87 -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 +368 -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.js +29 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
- package/lib/hooks/useCheckInOutOperations.js +223 -0
- package/lib/hooks/useWorkflowApprove.d.ts +4 -0
- package/lib/hooks/useWorkflowApprove.js +14 -1
- package/lib/ts/types.d.ts +56 -1
- package/package.json +5 -2
- 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 `
|
|
@@ -111,11 +109,11 @@ export const WorkFlowApproveRejectPopUp = ({ TID = 0, DID = 0, deviceType = Devi
|
|
|
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 }) => {
|
|
119
117
|
const [commentValue, setCommentValue] = useState('');
|
|
120
118
|
const [selectedUserID, setSelectedUserID] = useState([]);
|
|
121
119
|
const [participants, setParticipants] = useState([]);
|
|
@@ -153,11 +151,11 @@ export const WorkFlowReAssignPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
153
151
|
if (!tidToUse)
|
|
154
152
|
return;
|
|
155
153
|
// Recupera info workflow
|
|
156
|
-
const
|
|
154
|
+
const workflowInfo = wf ?? await WorkflowCacheService.GetWFInfoAsync(tidToUse);
|
|
157
155
|
// Recupera tutti gli utenti
|
|
158
156
|
const allUsers = await UserListCacheService.GetAllAsync();
|
|
159
157
|
// Filtra utenti partecipanti
|
|
160
|
-
const participantIds =
|
|
158
|
+
const participantIds = workflowInfo?.participants?.map(p => p.userID);
|
|
161
159
|
const participantUsers = allUsers.filter(u => participantIds?.includes(u.id) && u.id !== SDK_Globals.tmSession?.SessionDescr?.userID);
|
|
162
160
|
if (isMounted)
|
|
163
161
|
setParticipants(participantUsers);
|
|
@@ -171,10 +169,110 @@ export const WorkFlowReAssignPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
171
169
|
};
|
|
172
170
|
fetchData();
|
|
173
171
|
return () => { isMounted = false; };
|
|
174
|
-
}, [tidToUse]);
|
|
172
|
+
}, [tidToUse, wf]);
|
|
175
173
|
return (_jsx(TMModal, { onClose: onClose, width: '600px', height: '270px', isModal: true, title: SDKUI_Localizator.Reassign + (selectedItems.length > 0 ? ' (' + selectedItems.length + ' workitem)' : ''), children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx(TMUserChooser, { dataSource: participants, values: selectedUserID, onValueChanged: (IDs) => {
|
|
176
174
|
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 }) })] }) }));
|
|
175
|
+
} }), _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 }) })] }) }));
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Modal per forzare l'approvazione di un work item
|
|
179
|
+
*/
|
|
180
|
+
export const WorkflowForceApproveModal = ({ detail, onClose, onCompleted }) => {
|
|
181
|
+
const [commentValue, setCommentValue] = useState('');
|
|
182
|
+
const disable = commentValue.length === 0;
|
|
183
|
+
const forceApproveAsync = async () => {
|
|
184
|
+
try {
|
|
185
|
+
TMSpinner.show({ description: 'Forza approvazione in corso...' });
|
|
186
|
+
await SDK_Globals.tmSession?.NewWorkflowEngine().WFCtrl_ForceWIAsync(detail.tid, detail.did, WFEvents.AfterBtnApprove01, commentValue);
|
|
187
|
+
ShowAlert({
|
|
188
|
+
mode: 'success',
|
|
189
|
+
position: 'TOP_RIGHT',
|
|
190
|
+
title: 'Forza completamento',
|
|
191
|
+
message: 'Work item approvato con successo',
|
|
192
|
+
duration: 3000
|
|
193
|
+
});
|
|
194
|
+
await onCompleted?.();
|
|
195
|
+
}
|
|
196
|
+
catch (e) {
|
|
197
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
198
|
+
}
|
|
199
|
+
finally {
|
|
200
|
+
onClose?.();
|
|
201
|
+
TMSpinner.hide();
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
const userName = detail.toUser?.name ?? detail.to;
|
|
205
|
+
const title = `Forza completamento - ${userName}`;
|
|
206
|
+
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 }) })] }) }));
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Modal per forzare il rifiuto di un work item
|
|
210
|
+
*/
|
|
211
|
+
export const WorkflowForceRejectModal = ({ detail, onClose, onCompleted }) => {
|
|
212
|
+
const [commentValue, setCommentValue] = useState('');
|
|
213
|
+
const disable = commentValue.length === 0;
|
|
214
|
+
const forceRejectAsync = async () => {
|
|
215
|
+
try {
|
|
216
|
+
TMSpinner.show({ description: 'Forza rifiuto in corso...' });
|
|
217
|
+
await SDK_Globals.tmSession?.NewWorkflowEngine().WFCtrl_ForceWIAsync(detail.tid, detail.did, WFEvents.AfterBtnReject01, commentValue);
|
|
218
|
+
ShowAlert({
|
|
219
|
+
mode: 'success',
|
|
220
|
+
position: 'TOP_RIGHT',
|
|
221
|
+
title: 'Forza rifiuto',
|
|
222
|
+
message: 'Work item rifiutato con successo',
|
|
223
|
+
duration: 3000
|
|
224
|
+
});
|
|
225
|
+
await onCompleted?.();
|
|
226
|
+
}
|
|
227
|
+
catch (e) {
|
|
228
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
229
|
+
}
|
|
230
|
+
finally {
|
|
231
|
+
onClose?.();
|
|
232
|
+
TMSpinner.hide();
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
const userName = detail.toUser?.name ?? detail.to;
|
|
236
|
+
const title = `Forza rifiuto - ${userName}`;
|
|
237
|
+
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 }) })] }) }));
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* Modal per terminare le istanze workflow selezionate
|
|
241
|
+
*/
|
|
242
|
+
export const WorkflowEndInstanceModal = ({ selectedInstances, onClose, onCompleted }) => {
|
|
243
|
+
const [commentValue, setCommentValue] = useState('');
|
|
244
|
+
const disable = commentValue.length === 0;
|
|
245
|
+
const endInstancesAsync = async () => {
|
|
246
|
+
try {
|
|
247
|
+
TMSpinner.show({ description: 'Terminazione istanze in corso...' });
|
|
248
|
+
const workflowEngine = SDK_Globals.tmSession?.NewWorkflowEngine();
|
|
249
|
+
if (!workflowEngine)
|
|
250
|
+
throw new Error("Workflow engine non disponibile");
|
|
251
|
+
for (const instance of selectedInstances) {
|
|
252
|
+
if (instance.wfid && instance.did) {
|
|
253
|
+
await workflowEngine.WFCtrl_EndInstanceAsync(instance.wfid, instance.tid ?? 0, instance.did, commentValue);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
ShowAlert({
|
|
257
|
+
mode: 'success',
|
|
258
|
+
position: 'TOP_RIGHT',
|
|
259
|
+
title: 'Terminazione istanze',
|
|
260
|
+
message: `${selectedInstances.length} ${selectedInstances.length === 1 ? 'istanza terminata' : 'istanze terminate'} con successo`,
|
|
261
|
+
duration: 3000
|
|
262
|
+
});
|
|
263
|
+
await onCompleted?.();
|
|
264
|
+
}
|
|
265
|
+
catch (e) {
|
|
266
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
267
|
+
}
|
|
268
|
+
finally {
|
|
269
|
+
onClose?.();
|
|
270
|
+
TMSpinner.hide();
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
const itemCount = selectedInstances.length > 0 ? `(${selectedInstances.length} ${selectedInstances.length === 1 ? 'istanza' : 'istanze'})` : '';
|
|
274
|
+
const title = `Termina istanza ${itemCount}`;
|
|
275
|
+
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
276
|
};
|
|
179
277
|
export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceType.DESKTOP, onClose, onCompleted }) => {
|
|
180
278
|
const [users, setUsers] = useState([]);
|
|
@@ -1656,10 +1656,10 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
1656
1656
|
}
|
|
1657
1657
|
}, [wfDiagram]);
|
|
1658
1658
|
const handleCanvasDoubleClick = useCallback((event) => {
|
|
1659
|
-
if (isReadOnly) {
|
|
1659
|
+
if (isReadOnly && allowEdit) {
|
|
1660
1660
|
toggleReadOnlyMode();
|
|
1661
1661
|
}
|
|
1662
|
-
}, [isReadOnly, toggleReadOnlyMode]);
|
|
1662
|
+
}, [isReadOnly, allowEdit, toggleReadOnlyMode]);
|
|
1663
1663
|
const handleFullScreenKeyDown = useCallback((event) => {
|
|
1664
1664
|
if (event.key === 'Escape') {
|
|
1665
1665
|
// Blocca sempre la propagazione per evitare che TMSaveForm riceva l'evento
|
|
@@ -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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
-
import { DossierEngine, LayoutModes, ResultTypes, SDK_Globals, TaskDescriptor, WorkingGroupEngine } from "@topconsultnpm/sdk-ts";
|
|
4
|
-
import { ContextMenu } from "
|
|
3
|
+
import { DossierEngine, LayoutModes, ObjectClasses, ResultTypes, SDK_Globals, TaskDescriptor, WorkingGroupEngine } from "@topconsultnpm/sdk-ts";
|
|
4
|
+
import { ContextMenu as TMContextMenu } from "../NewComponents/ContextMenu";
|
|
5
5
|
import { SDKUI_Localizator, Globalization, getExceptionMessage, TMConditionalWrapper, calcResponsiveSizes } from "../../helper";
|
|
6
6
|
import TMToppyMessage from "../../helper/TMToppyMessage";
|
|
7
7
|
import { useDcmtOperations } from "../../hooks/useDcmtOperations";
|
|
@@ -68,7 +68,8 @@ const TMBlogsPost = (props) => {
|
|
|
68
68
|
const [showTaskForm, setShowTaskForm] = useState(false);
|
|
69
69
|
// State to manage show selected file
|
|
70
70
|
const [dcmtForm, setDcmtForm] = useState({ show: false, dcmt: undefined });
|
|
71
|
-
const [
|
|
71
|
+
const [menuVisible, setMenuVisible] = useState(false);
|
|
72
|
+
const [menuPosition, setMenuPosition] = useState({ x: 0, y: 0 });
|
|
72
73
|
const [menuItems, setMenuItems] = useState([]);
|
|
73
74
|
const [localShowWaitPanel, setLocalShowWaitPanel] = useState(false);
|
|
74
75
|
const [localWaitPanelTitle, setLocalWaitPanelTitle] = useState('');
|
|
@@ -500,8 +501,8 @@ const TMBlogsPost = (props) => {
|
|
|
500
501
|
const classId = targetItem ? targetItem.classID : undefined;
|
|
501
502
|
if (contextMenuParams.isDownloadAttachmentEnabled && focusedAttachment !== undefined) {
|
|
502
503
|
menuItems.push({
|
|
503
|
-
icon: "download",
|
|
504
|
-
|
|
504
|
+
icon: _jsx("span", { className: "dx-icon-download" }),
|
|
505
|
+
name: 'Download',
|
|
505
506
|
onClick: async () => {
|
|
506
507
|
await downloadDcmtsAsync([
|
|
507
508
|
{ TID: focusedAttachment.TID, DID: focusedAttachment.DID, fileName: focusedAttachment.fileName }
|
|
@@ -511,26 +512,26 @@ const TMBlogsPost = (props) => {
|
|
|
511
512
|
}
|
|
512
513
|
if (contextMenuParams.isViewEditMetadata && focusedAttachment !== undefined) {
|
|
513
514
|
menuItems.push({
|
|
514
|
-
icon:
|
|
515
|
-
|
|
515
|
+
icon: _jsx("span", { className: "dx-icon-eyeopen" }),
|
|
516
|
+
name: SDKUI_Localizator.OpenForm,
|
|
516
517
|
onClick: () => openDcmtForm(focusedAttachment),
|
|
517
518
|
});
|
|
518
519
|
}
|
|
519
520
|
if (contextMenuParams.isCommentEnabled && showCommentFormCallback !== undefined) {
|
|
520
521
|
menuItems.push({
|
|
521
|
-
icon:
|
|
522
|
-
|
|
522
|
+
icon: _jsx("span", { className: "dx-icon-chat" }),
|
|
523
|
+
name: SDKUI_Localizator.Comment,
|
|
523
524
|
disabled: isGroupArchived ? true : false,
|
|
524
525
|
onClick: () => {
|
|
525
526
|
showCommentFormCallback(focusedAttachment);
|
|
526
527
|
},
|
|
527
|
-
beginGroup:
|
|
528
|
+
beginGroup: menuItems.length > 0
|
|
528
529
|
});
|
|
529
530
|
}
|
|
530
531
|
if (targetItem && contextMenuParams.isDeleteEnabled) {
|
|
531
532
|
menuItems.push({
|
|
532
|
-
icon: "trash",
|
|
533
|
-
|
|
533
|
+
icon: _jsx("span", { className: "dx-icon-trash" }),
|
|
534
|
+
name: SDKUI_Localizator.Delete,
|
|
534
535
|
visible: contextMenuParams.isDeleteEnabled,
|
|
535
536
|
onClick: () => deleteOrUndeleteCommentCallback(targetItem, true),
|
|
536
537
|
disabled: isNotOwner || isDeleted || isGroupArchived,
|
|
@@ -538,24 +539,24 @@ const TMBlogsPost = (props) => {
|
|
|
538
539
|
}
|
|
539
540
|
if (targetItem && contextMenuParams.isRestoreEnabled) {
|
|
540
541
|
menuItems.push({
|
|
541
|
-
icon: "undo",
|
|
542
|
-
|
|
542
|
+
icon: _jsx("span", { className: "dx-icon-undo" }),
|
|
543
|
+
name: SDKUI_Localizator.Restore,
|
|
543
544
|
onClick: () => deleteOrUndeleteCommentCallback(targetItem, false),
|
|
544
545
|
disabled: isNotOwner || (targetItem && (targetItem.isDel === undefined || targetItem.isDel === 0)),
|
|
545
546
|
});
|
|
546
547
|
}
|
|
547
548
|
if (targetItem && contextMenuParams.isCopyToClipboardEnabled) {
|
|
548
549
|
menuItems.push({
|
|
549
|
-
|
|
550
|
-
icon:
|
|
550
|
+
name: SDKUI_Localizator.CopyToClipboard,
|
|
551
|
+
icon: _jsx("span", { className: "dx-icon-copy" }),
|
|
551
552
|
disabled: false,
|
|
552
553
|
onClick: () => { copyInClipboard(targetItem); }
|
|
553
554
|
});
|
|
554
555
|
}
|
|
555
556
|
if (contextMenuParams.isCreateContextualTask) {
|
|
556
557
|
menuItems.push({
|
|
557
|
-
|
|
558
|
-
icon:
|
|
558
|
+
name: SDKUI_Localizator.CreateContextualTask,
|
|
559
|
+
icon: _jsx("span", { className: "dx-icon-plus" }),
|
|
559
560
|
onClick: () => openTaskFormCallback(targetItem),
|
|
560
561
|
disabled: isGroupArchived ? true : false,
|
|
561
562
|
beginGroup: true
|
|
@@ -563,15 +564,15 @@ const TMBlogsPost = (props) => {
|
|
|
563
564
|
}
|
|
564
565
|
if (targetItem && Boolean(classId && (classId === 'WG' || classId === 'DS'))) {
|
|
565
566
|
menuItems.push({
|
|
566
|
-
icon: "eyeclose",
|
|
567
|
-
|
|
567
|
+
icon: _jsx("span", { className: "dx-icon-eyeclose" }),
|
|
568
|
+
name: SDKUI_Localizator.Unfollow,
|
|
568
569
|
onClick: () => (targetItem && classId) && unFollowCallback(targetItem, classId),
|
|
569
570
|
});
|
|
570
571
|
}
|
|
571
572
|
if (contextMenuParams.isShowHideFilterEnabled) {
|
|
572
573
|
menuItems.push({
|
|
573
|
-
icon: isHeaderHidden ?
|
|
574
|
-
|
|
574
|
+
icon: _jsx("span", { className: isHeaderHidden ? "dx-icon-eyeopen" : "dx-icon-eyeclose" }),
|
|
575
|
+
name: isHeaderHidden ? SDKUI_Localizator.ShowFilters : SDKUI_Localizator.HideFilters,
|
|
575
576
|
onClick: toggleHeaderClick,
|
|
576
577
|
disabled: false,
|
|
577
578
|
beginGroup: true
|
|
@@ -579,23 +580,24 @@ const TMBlogsPost = (props) => {
|
|
|
579
580
|
}
|
|
580
581
|
if (contextMenuParams.isShowHideIDEnaled) {
|
|
581
582
|
menuItems.push({
|
|
582
|
-
icon: localShowId ?
|
|
583
|
+
icon: _jsx("span", { className: localShowId ? "dx-icon-eyeclose" : "dx-icon-eyeopen" }),
|
|
583
584
|
onClick: () => setLocalShowId(prevShowId => !prevShowId),
|
|
584
|
-
|
|
585
|
+
name: localShowId ? SDKUI_Localizator.ID_Hide : SDKUI_Localizator.ID_Show,
|
|
585
586
|
disabled: false,
|
|
586
587
|
});
|
|
587
588
|
}
|
|
588
589
|
if (contextMenuParams.isRefreshEnabled && refreshCallback !== undefined) {
|
|
589
590
|
menuItems.push({
|
|
590
|
-
icon: "refresh",
|
|
591
|
-
|
|
591
|
+
icon: _jsx("span", { className: "dx-icon-refresh" }),
|
|
592
|
+
name: SDKUI_Localizator.Refresh,
|
|
592
593
|
onClick: refresh,
|
|
593
594
|
disabled: false,
|
|
594
595
|
});
|
|
595
596
|
}
|
|
596
597
|
if (menuItems.length > 0) {
|
|
597
|
-
|
|
598
|
+
setMenuPosition({ x: event.clientX, y: event.clientY });
|
|
598
599
|
setMenuItems(menuItems);
|
|
600
|
+
setMenuVisible(true);
|
|
599
601
|
}
|
|
600
602
|
};
|
|
601
603
|
const handlePostsToShowChange = (value) => {
|
|
@@ -606,12 +608,31 @@ const TMBlogsPost = (props) => {
|
|
|
606
608
|
setSearchText(value);
|
|
607
609
|
};
|
|
608
610
|
const closeContextMenu = useCallback(() => {
|
|
609
|
-
|
|
611
|
+
setMenuVisible(false);
|
|
610
612
|
}, []);
|
|
613
|
+
const handleNavigateToReference = (ref) => {
|
|
614
|
+
switch (ref.objClass) {
|
|
615
|
+
case ObjectClasses.Dossier:
|
|
616
|
+
if (ref.objID)
|
|
617
|
+
handleNavigateToDossiers?.(ref.objID);
|
|
618
|
+
else
|
|
619
|
+
console.log("Dossier reference missing objID");
|
|
620
|
+
break;
|
|
621
|
+
case ObjectClasses.WorkingGroup:
|
|
622
|
+
if (ref.objID)
|
|
623
|
+
handleNavigateToWGs?.(ref.objID);
|
|
624
|
+
else
|
|
625
|
+
console.log("Working Group reference missing objID");
|
|
626
|
+
break;
|
|
627
|
+
// Handle other object types as needed
|
|
628
|
+
default:
|
|
629
|
+
console.warn(`Unhandled object type: ${ref.objClass}`);
|
|
630
|
+
}
|
|
631
|
+
};
|
|
611
632
|
return _jsx("div", { ref: containerRef, style: { height: height, width: width }, children: _jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: localShowWaitPanel, showWaitPanelPrimary: localShowPrimary, waitPanelTitle: localWaitPanelTitle, waitPanelTextPrimary: localWaitPanelTextPrimary, waitPanelValuePrimary: localWaitPanelValuePrimary, waitPanelMaxValuePrimary: localWaitPanelMaxValuePrimary, isCancelable: true, abortController: localAbortController, children: [_jsx(TMBlogHeader, { isVisible: currentHeader !== undefined && !isHeaderHidden, layoutMode: layoutMode, height: layoutMode === 'extended' ? "40px" : "70px", width: "100%", allPosts: posts, postsToShow: postsToShow, onPostsToShowChange: handlePostsToShowChange, categoryIdDataSource: categoryIdDataSource, appliedCategoryIdFilters: appliedCategoryIdFilters, setAppliedCategoryIdFilters: setAppliedCategoryIdFilters, searchText: searchText, onSearchChange: handleSearchChange }), _jsxs("div", { style: {
|
|
612
633
|
width: "100%",
|
|
613
634
|
height: currentHeader !== undefined && !isHeaderHidden ? `calc(100% - ${layoutMode === 'extended' ? "40px" : "70px"})` : "100%",
|
|
614
|
-
}, children: [blogPosts.length === 0 && _jsx(TMToppyMessage, { message: searchText.length > 0 ? SDKUI_Localizator.NoMessagesFound : SDKUI_Localizator.NoMessages }), blogPosts.length > 0 && _jsxs("div", { tabIndex: 0, onKeyDown: handleKeyDown, onContextMenu: onContextMenu, style: {
|
|
635
|
+
}, children: [blogPosts.length === 0 && _jsx(TMToppyMessage, { message: searchText.length > 0 ? SDKUI_Localizator.NoMessagesFound : SDKUI_Localizator.NoMessages }), blogPosts.length > 0 && _jsxs("div", { id: `${id}-blogs-container`, tabIndex: 0, onKeyDown: handleKeyDown, onContextMenu: onContextMenu, style: {
|
|
615
636
|
height: '100%',
|
|
616
637
|
width: '100%',
|
|
617
638
|
outline: "none",
|
|
@@ -659,7 +680,11 @@ const TMBlogsPost = (props) => {
|
|
|
659
680
|
boxShadow: isFocused ? "0 4px 12px rgba(19, 85, 150, 0.6)" : "none",
|
|
660
681
|
cursor: 'pointer',
|
|
661
682
|
}, children: [_jsx(BlogPostTitle, { displayMode: displayMode, layoutMode: layoutMode, blogPost: blogPost, isSelected: isSelected, isOwnComment: isOwnComment, searchText: searchText, isSys: isSys, isHomeBlogPost: isHomeBlogPost, showId: localShowId, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), isNew && _jsx(NewBadge, { layoutMode: layoutMode }), _jsx("div", { style: { fontSize: '1rem', color: "#000", marginTop: "10px", overflow: "hidden" }, children: _jsx(TMHtmlContentDisplay, { markup: blogPost.description ?? '-', searchText: searchText, isSelected: isSelected }) }), showExtendedAttachments && blogPost.attachments && blogPost.attachments.length > 0 && (_jsx(TMBlogAttachments, { attachments: blogPost.attachments, layoutMode: layoutMode, isSelected: isSelected, searchText: searchText, dcmtTypeDescriptors: dcmtTypeDescriptors, treeFs: treeFs, draftLatestInfoMap: draftLatestInfoMap, archivedDocumentMap: archivedDocumentMap, handleAttachmentFocus: handleFocusedAttachment, openDcmtForm: openDcmtForm }))] }, `${id}-blogpost-${blogPost.id}`) })] }, "blog-post-wrapper-" + id + "-" + blogPost.id);
|
|
662
|
-
}), _jsx("div", { ref: bottomRef }),
|
|
683
|
+
}), _jsx("div", { ref: bottomRef }), _jsx(TMContextMenu, { items: menuItems, target: `#${id}-blogs-container`, externalControl: {
|
|
684
|
+
visible: menuVisible,
|
|
685
|
+
position: menuPosition,
|
|
686
|
+
onClose: closeContextMenu,
|
|
687
|
+
} })] }), (showTaskForm && handleNavigateToWGs && handleNavigateToDossiers && getAllTasks && deleteTaskByIdsCallback && addTaskCallback && editTaskCallback) && _jsx("div", { style: { height: "100%", width: "100%" }, children: _jsx(TMTaskForm, { id: -1, title: SDKUI_Localizator.ContextualTask, isModal: true, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '670px', '80%', '95%'), formMode: FormModes.Create, visualizedTasks: [], currentTask: currentTask, setCurrentTask: () => { }, selectedRowKeys: [], handleFocusedRowKeyChange: () => { }, onStatusChanged: () => { }, onSaved: onSavedTaskFormCallback, onClose: () => closeTaskFormCallback(), onCancel: () => closeTaskFormCallback(), usersList: participants, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, isContextualCreate: true, taskContext: taskContext, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback }) }), (dcmtForm.dcmt && dcmtForm.dcmt.TID && dcmtForm.dcmt.DID) && _jsx(TMDcmtForm, { TID: Number(dcmtForm.dcmt.TID), DID: Number(dcmtForm.dcmt.DID), layoutMode: LayoutModes.Update, onClose: closeDcmtForm, isClosable: true, titleModal: SDKUI_Localizator.Attachment + ": " + dcmtForm.dcmt.fileName, isModal: true, widthModal: "95%", heightModal: "95%", allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onReferenceClick: handleNavigateToReference }), (showFloatingCommentButton && showCommentFormCallback && !(context?.engine === 'WorkingGroupEngine' && context?.object?.customData1 === 1)) && _jsx("button", { style: {
|
|
663
688
|
position: 'absolute',
|
|
664
689
|
bottom: '18px',
|
|
665
690
|
right: '20px',
|
|
@@ -112,5 +112,7 @@ export * from "./features/workflow/diagram/WFDiagram";
|
|
|
112
112
|
export * from "./features/workflow/diagram/workflowHelpers";
|
|
113
113
|
export * from "./features/workflow/diagram/xmlParser";
|
|
114
114
|
export * from "./features/workflow/diagram/interfaces";
|
|
115
|
+
export * from "./features/workflow/diagram/DiagramItemSvgContent";
|
|
116
|
+
export * from "./features/workflow/TMWorkflowPopup";
|
|
115
117
|
export { default as TMWizard } from './wizard/TMWizard';
|
|
116
118
|
export * from './wizard/TMWizard';
|
package/lib/components/index.js
CHANGED
|
@@ -133,6 +133,8 @@ export * from "./features/workflow/diagram/WFDiagram";
|
|
|
133
133
|
export * from "./features/workflow/diagram/workflowHelpers";
|
|
134
134
|
export * from "./features/workflow/diagram/xmlParser";
|
|
135
135
|
export * from "./features/workflow/diagram/interfaces";
|
|
136
|
+
export * from "./features/workflow/diagram/DiagramItemSvgContent";
|
|
137
|
+
export * from "./features/workflow/TMWorkflowPopup";
|
|
136
138
|
// wizard
|
|
137
139
|
export { default as TMWizard } from './wizard/TMWizard';
|
|
138
140
|
export * from './wizard/TMWizard';
|
|
@@ -4,7 +4,8 @@ interface ITMDataListItemViewerProps {
|
|
|
4
4
|
dataListId?: number;
|
|
5
5
|
value?: string | Date | number;
|
|
6
6
|
viewMode?: DataListViewModes;
|
|
7
|
+
showTooltip?: boolean;
|
|
7
8
|
}
|
|
8
|
-
declare const TMDataListItemViewer: ({ dataListId, value, viewMode }: ITMDataListItemViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const TMDataListItemViewer: ({ dataListId, value, viewMode, showTooltip }: ITMDataListItemViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export default TMDataListItemViewer;
|
|
10
11
|
export declare const cellRenderDataListItem: (data: DataGridTypes.ColumnCellTemplateData, dataListId?: number, viewMode?: DataListViewModes) => import("react/jsx-runtime").JSX.Element;
|