@topconsultnpm/sdkui-react 6.20.0-dev1.12 → 6.20.0-dev1.121
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/assets/Toppy-help-center.png +0 -0
- package/lib/assets/headergradient.svg +87 -0
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +322 -30
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +8 -1
- package/lib/components/NewComponents/ContextMenu/hooks.js +80 -8
- 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 +9 -1
- package/lib/components/NewComponents/ContextMenu/styles.js +159 -37
- package/lib/components/NewComponents/ContextMenu/types.d.ts +22 -3
- 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 +610 -127
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +25 -5
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +215 -59
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +12 -3
- package/lib/components/base/TMAccordionNew.js +35 -14
- package/lib/components/base/TMButton.js +6 -0
- package/lib/components/base/TMClosableList.js +4 -0
- package/lib/components/base/TMCustomButton.js +61 -17
- package/lib/components/base/TMDataGrid.d.ts +7 -4
- package/lib/components/base/TMDataGrid.js +153 -11
- package/lib/components/base/TMDropDownMenu.js +21 -18
- package/lib/components/base/TMFileManager.d.ts +4 -3
- package/lib/components/base/TMFileManager.js +32 -24
- package/lib/components/base/TMFileManagerDataGridView.d.ts +3 -2
- package/lib/components/base/TMFileManagerDataGridView.js +1 -11
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +7 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +5 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +17 -4
- package/lib/components/base/TMFileManagerThumbnailsView.js +18 -6
- package/lib/components/base/TMFileManagerUtils.d.ts +0 -12
- package/lib/components/base/TMListView.js +33 -15
- package/lib/components/base/TMPanel.d.ts +1 -1
- package/lib/components/base/TMPanel.js +3 -1
- package/lib/components/base/TMPopUp.js +6 -0
- package/lib/components/base/TMToolbarCard.js +2 -0
- package/lib/components/base/TMTreeView.d.ts +2 -1
- package/lib/components/base/TMTreeView.js +33 -26
- package/lib/components/choosers/TMDataListItemChooser.d.ts +2 -0
- package/lib/components/choosers/TMDataListItemChooser.js +8 -2
- package/lib/components/choosers/TMDcmtTypeChooser.d.ts +1 -0
- package/lib/components/choosers/TMDcmtTypeChooser.js +11 -3
- package/lib/components/choosers/TMDistinctValues.js +2 -2
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +2 -0
- package/lib/components/choosers/TMDynDataListItemChooser.js +8 -2
- package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.d.ts +2 -0
- package/lib/components/choosers/TMMetadataChooser.js +19 -4
- package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMUserChooser.d.ts +2 -5
- package/lib/components/choosers/TMUserChooser.js +33 -47
- package/lib/components/editors/TMCheckBox.js +2 -0
- package/lib/components/editors/TMDateBox.js +18 -9
- package/lib/components/editors/TMEditorStyled.js +7 -0
- package/lib/components/editors/TMLocalizedTextBox.d.ts +3 -1
- package/lib/components/editors/TMLocalizedTextBox.js +16 -14
- package/lib/components/editors/TMMetadataEditor.d.ts +1 -0
- package/lib/components/editors/TMMetadataEditor.js +4 -4
- package/lib/components/editors/TMMetadataTextBox.d.ts +9 -0
- package/lib/components/editors/TMMetadataTextBox.js +92 -0
- package/lib/components/editors/TMMetadataValues.d.ts +1 -0
- package/lib/components/editors/TMMetadataValues.js +25 -7
- package/lib/components/editors/TMRadioButton.js +2 -0
- package/lib/components/editors/TMTextArea.js +18 -30
- package/lib/components/editors/TMTextBox.d.ts +1 -1
- package/lib/components/editors/TMTextBox.js +29 -4
- package/lib/components/editors/TMTextExpression.js +6 -91
- package/lib/components/features/archive/TMArchive.js +2 -2
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +15 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +462 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.d.ts +11 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.js +126 -0
- package/lib/components/features/documents/TMDcmtBlog.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.d.ts +14 -2
- package/lib/components/features/documents/TMDcmtForm.js +459 -208
- package/lib/components/features/documents/TMDcmtPreview.js +42 -155
- package/lib/components/features/documents/TMDcmtTasks.js +9 -9
- package/lib/components/features/documents/TMMasterDetailDcmts.js +38 -53
- 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} +2 -2
- package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
- package/lib/components/features/search/TMSearch.d.ts +3 -0
- package/lib/components/features/search/TMSearch.js +50 -11
- package/lib/components/features/search/TMSearchQueryEditor.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryEditor.js +10 -10
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +40 -25
- package/lib/components/features/search/TMSearchResult.d.ts +3 -0
- package/lib/components/features/search/TMSearchResult.js +210 -250
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
- package/lib/components/features/search/TMSearchResultsMenuItems.js +227 -171
- 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 +2 -2
- package/lib/components/features/tasks/TMTaskForm.js +75 -25
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +3 -1
- package/lib/components/features/tasks/TMTasksAgenda.js +48 -9
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +2 -0
- package/lib/components/features/tasks/TMTasksCalendar.js +19 -7
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
- package/lib/components/features/tasks/TMTasksUtils.js +57 -37
- package/lib/components/features/tasks/TMTasksView.js +28 -19
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
- package/lib/components/features/workflow/TMWorkflowPopup.js +139 -34
- package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +2 -0
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +14 -7
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
- package/lib/components/features/workflow/diagram/WFDiagram.d.ts +4 -0
- package/lib/components/features/workflow/diagram/WFDiagram.js +164 -13
- 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 +35 -7
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +56 -31
- package/lib/components/grids/TMRecentsManager.js +20 -10
- package/lib/components/grids/TMValidationItemsList.js +6 -0
- package/lib/components/index.d.ts +6 -3
- package/lib/components/index.js +6 -3
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +13 -5
- package/lib/components/query/TMQueryEditor.d.ts +3 -1
- package/lib/components/query/TMQueryEditor.js +102 -100
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/settings/SettingsAppearance.js +99 -30
- package/lib/components/sidebar/TMHeader.js +11 -7
- package/lib/components/sidebar/TMSidebar.d.ts +0 -1
- package/lib/components/sidebar/TMSidebar.js +16 -44
- package/lib/components/sidebar/TMSidebarItem.js +36 -17
- 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 +22 -0
- package/lib/helper/SDKUI_Globals.js +10 -1
- package/lib/helper/SDKUI_Localizator.d.ts +20 -1
- package/lib/helper/SDKUI_Localizator.js +197 -1
- package/lib/helper/TMCommandsContextMenu.d.ts +4 -2
- package/lib/helper/TMCommandsContextMenu.js +15 -4
- package/lib/helper/TMIcons.d.ts +4 -0
- package/lib/helper/TMIcons.js +13 -3
- package/lib/helper/TMPdfViewer.d.ts +8 -0
- package/lib/helper/TMPdfViewer.js +373 -0
- package/lib/helper/TMToppyMessage.js +4 -0
- package/lib/helper/checkinCheckoutManager.d.ts +31 -1
- package/lib/helper/checkinCheckoutManager.js +112 -30
- package/lib/helper/devextremeCustomMessages.d.ts +30 -0
- package/lib/helper/devextremeCustomMessages.js +30 -0
- package/lib/helper/helpers.d.ts +30 -2
- package/lib/helper/helpers.js +131 -3
- package/lib/helper/index.d.ts +2 -0
- package/lib/helper/index.js +2 -0
- package/lib/helper/queryHelper.d.ts +1 -1
- package/lib/helper/queryHelper.js +33 -3
- package/lib/helper/workItemsHelper.d.ts +6 -0
- package/lib/helper/workItemsHelper.js +230 -0
- 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 +132 -0
- package/lib/hooks/useDataUserIdItem.d.ts +10 -0
- package/lib/hooks/useDataUserIdItem.js +96 -0
- package/lib/hooks/useFloatingBarPinnedItems.d.ts +11 -0
- package/lib/hooks/useFloatingBarPinnedItems.js +54 -0
- package/lib/hooks/useMetadataExpression.d.ts +19 -0
- package/lib/hooks/useMetadataExpression.js +99 -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 +3 -2
- package/lib/services/platform_services.d.ts +3 -3
- package/lib/ts/types.d.ts +61 -1
- package/lib/utils/theme.d.ts +1 -1
- package/lib/utils/theme.js +1 -1
- package/package.json +7 -4
- 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/base/TMContextMenu.d.ts +0 -25
- package/lib/components/base/TMContextMenu.js +0 -109
- package/lib/components/base/TMContextMenuOLD.d.ts +0 -26
- package/lib/components/base/TMContextMenuOLD.js +0 -56
- package/lib/components/base/TMFloatingToolbar.d.ts +0 -9
- package/lib/components/base/TMFloatingToolbar.js +0 -101
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +0 -30
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +0 -482
- package/lib/components/features/assistant/ToppySpeechBubble.d.ts +0 -9
- package/lib/components/features/assistant/ToppySpeechBubble.js +0 -117
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
|
@@ -333,7 +333,7 @@ const TMSignSettingsForm = (props) => {
|
|
|
333
333
|
fontWeight: 'bold',
|
|
334
334
|
color: isModified ? MODIFIED_COLOR : '#777',
|
|
335
335
|
transition: 'opacity 0.2s ease'
|
|
336
|
-
}, onMouseEnter: (e) => { e.currentTarget.style.opacity = '0.9'; }, onMouseLeave: (e) => { e.currentTarget.style.opacity = '0.5'; }, children: "
|
|
336
|
+
}, onMouseEnter: (e) => { e.currentTarget.style.opacity = '0.9'; }, onMouseLeave: (e) => { e.currentTarget.style.opacity = '0.5'; }, children: _jsx("i", { className: "dx-icon-close" }) })] }));
|
|
337
337
|
};
|
|
338
338
|
const renderMultiSignerTag = (tagData) => {
|
|
339
339
|
const handleRemoveTag = () => {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DcmtInfo } from "../../../ts";
|
|
2
|
+
interface TMSignatureInfoContentProps {
|
|
3
|
+
inputDcmt: DcmtInfo;
|
|
4
|
+
}
|
|
5
|
+
declare const TMSignatureInfoContent: (props: TMSignatureInfoContentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
export default TMSignatureInfoContent;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { SDK_Globals } from "@topconsultnpm/sdk-ts";
|
|
4
|
+
import { IconCopy, getExceptionMessage } from "../../../helper";
|
|
5
|
+
import TMSpinner from "../../base/TMSpinner";
|
|
6
|
+
const TMSignatureInfoContent = (props) => {
|
|
7
|
+
const { inputDcmt } = props;
|
|
8
|
+
const [selectedHash, setSelectedHash] = useState('sha256');
|
|
9
|
+
const [signerInfo, setSignerInfo] = useState(undefined);
|
|
10
|
+
const [error, setError] = useState(undefined);
|
|
11
|
+
const [copiedHash, setCopiedHash] = useState(false);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const fetchSignerInfo = async () => {
|
|
14
|
+
TMSpinner.show();
|
|
15
|
+
try {
|
|
16
|
+
const ue = SDK_Globals.tmSession?.NewUpdateEngineByID();
|
|
17
|
+
if (!ue) {
|
|
18
|
+
setError("Sessione non disponibile");
|
|
19
|
+
TMSpinner.hide();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
ue.TID = inputDcmt.TID;
|
|
23
|
+
ue.DID = inputDcmt.DID;
|
|
24
|
+
const signerInfoDescriptor = await ue.GetSignersAsync();
|
|
25
|
+
if (!signerInfoDescriptor) {
|
|
26
|
+
setError("Informazioni di firma non disponibili");
|
|
27
|
+
TMSpinner.hide();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
setSignerInfo(signerInfoDescriptor);
|
|
31
|
+
setError(undefined);
|
|
32
|
+
TMSpinner.hide();
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
setError(getExceptionMessage(err));
|
|
36
|
+
TMSpinner.hide();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
fetchSignerInfo();
|
|
40
|
+
}, [inputDcmt]);
|
|
41
|
+
const hashButtonStyle = (isActive) => ({
|
|
42
|
+
padding: '8px 16px',
|
|
43
|
+
margin: '0 2px',
|
|
44
|
+
border: isActive ? '2px solid #0078d4' : '1px solid #ccc',
|
|
45
|
+
borderRadius: '6px',
|
|
46
|
+
background: isActive ? '#e6f2ff' : '#fff',
|
|
47
|
+
color: isActive ? '#0078d4' : '#333',
|
|
48
|
+
cursor: 'pointer',
|
|
49
|
+
fontSize: '13px',
|
|
50
|
+
fontWeight: isActive ? '600' : '400',
|
|
51
|
+
transition: 'all 0.2s ease',
|
|
52
|
+
outline: 'none',
|
|
53
|
+
userSelect: 'none',
|
|
54
|
+
whiteSpace: 'nowrap'
|
|
55
|
+
});
|
|
56
|
+
const getHashValue = () => {
|
|
57
|
+
switch (selectedHash) {
|
|
58
|
+
case 'sha256': return signerInfo?.shA256;
|
|
59
|
+
case 'sha1': return signerInfo?.shA1;
|
|
60
|
+
case 'sha256base64': return signerInfo?.shA256Base64;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const getHashLabel = () => {
|
|
64
|
+
switch (selectedHash) {
|
|
65
|
+
case 'sha256': return 'SHA-256';
|
|
66
|
+
case 'sha1': return 'SHA-1';
|
|
67
|
+
case 'sha256base64': return 'SHA-256 (Base64)';
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const copyToClipboard = async () => {
|
|
71
|
+
const value = getHashValue();
|
|
72
|
+
if (value) {
|
|
73
|
+
try {
|
|
74
|
+
await navigator.clipboard.writeText(value);
|
|
75
|
+
setCopiedHash(true);
|
|
76
|
+
setTimeout(() => setCopiedHash(false), 2000);
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
console.error('Failed to copy:', err);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
if (error) {
|
|
84
|
+
return (_jsx("div", { style: {
|
|
85
|
+
padding: '20px',
|
|
86
|
+
textAlign: 'center',
|
|
87
|
+
color: '#d32f2f',
|
|
88
|
+
background: '#ffebee',
|
|
89
|
+
borderRadius: '8px'
|
|
90
|
+
}, children: error }));
|
|
91
|
+
}
|
|
92
|
+
if (!signerInfo) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
return (_jsxs("div", { style: { lineHeight: "1.5em", overflowY: "auto", maxHeight: "500px", paddingRight: "8px", boxSizing: "border-box", userSelect: 'text' }, children: [signerInfo.signers && signerInfo.signers.length > 0 ? (_jsxs("div", { children: [_jsxs("h4", { style: { margin: '0 0 12px 0', color: '#0078d4', fontSize: '16px' }, children: ["Firme digitali (", signerInfo.signers.length, ")"] }), signerInfo.signers.map((signer, idx) => (_jsxs("div", { style: {
|
|
96
|
+
border: "1px solid #d0d0d0",
|
|
97
|
+
borderRadius: "8px",
|
|
98
|
+
padding: "16px",
|
|
99
|
+
marginBottom: "12px",
|
|
100
|
+
background: "linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%)",
|
|
101
|
+
boxShadow: "0 2px 4px rgba(0,0,0,0.08)",
|
|
102
|
+
userSelect: 'text',
|
|
103
|
+
}, children: [_jsxs("h3", { style: { margin: "0 0 12px", color: "#0078d4", fontSize: '15px', fontWeight: '600' }, children: ["Firma ", signer.levelAndIndex] }), _jsxs("div", { style: {
|
|
104
|
+
display: 'grid',
|
|
105
|
+
gap: '10px',
|
|
106
|
+
fontSize: '13px'
|
|
107
|
+
}, children: [_jsxs("div", { children: [_jsx("strong", { style: { color: '#555' }, children: "Intestatario:" }), _jsx("div", { style: { marginTop: '4px', color: '#333' }, children: signer.info1 ?? '-' })] }), _jsxs("div", { children: [_jsx("strong", { style: { color: '#555' }, children: "Riferimento temporale:" }), _jsx("div", { style: { marginTop: '4px', color: '#333' }, children: signer.info2 ?? '-' })] }), _jsxs("div", { children: [_jsx("strong", { style: { color: '#555' }, children: "Dettagli:" }), _jsx("div", { style: { marginTop: '4px', color: '#333' }, children: signer.info3 ?? '-' })] })] })] }, idx)))] })) : (_jsx("div", { style: {
|
|
108
|
+
padding: '20px',
|
|
109
|
+
textAlign: 'center',
|
|
110
|
+
color: '#666',
|
|
111
|
+
background: '#f5f5f5',
|
|
112
|
+
borderRadius: '8px'
|
|
113
|
+
}, children: "Nessuna firma trovata" })), signerInfo.shA256 && (_jsxs("div", { style: {
|
|
114
|
+
marginBottom: '12px',
|
|
115
|
+
padding: '16px',
|
|
116
|
+
background: '#f5f5f5',
|
|
117
|
+
borderRadius: '8px',
|
|
118
|
+
border: '1px solid #e0e0e0'
|
|
119
|
+
}, children: [_jsxs("div", { style: { marginBottom: '12px', display: 'flex', gap: '4px', flexWrap: 'wrap' }, children: [signerInfo.shA256 && (_jsx("button", { onClick: () => setSelectedHash('sha256'), style: hashButtonStyle(selectedHash === 'sha256'), children: "SHA-256" })), signerInfo.shA1 && (_jsx("button", { onClick: () => setSelectedHash('sha1'), style: hashButtonStyle(selectedHash === 'sha1'), children: "SHA-1" })), signerInfo.shA256Base64 && (_jsx("button", { onClick: () => setSelectedHash('sha256base64'), style: hashButtonStyle(selectedHash === 'sha256base64'), children: "Base64" }))] }), _jsxs("div", { style: {
|
|
120
|
+
background: '#fff',
|
|
121
|
+
padding: '12px',
|
|
122
|
+
borderRadius: '6px',
|
|
123
|
+
wordBreak: 'break-all',
|
|
124
|
+
fontSize: '12px',
|
|
125
|
+
border: '1px solid #d0d0d0',
|
|
126
|
+
userSelect: 'text',
|
|
127
|
+
}, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: '6px' }, children: [_jsxs("strong", { style: { color: '#0078d4', fontSize: '14px' }, children: [getHashLabel(), ":"] }), _jsxs("button", { onClick: copyToClipboard, style: {
|
|
128
|
+
background: copiedHash ? '#d4edda' : 'transparent',
|
|
129
|
+
border: 'none',
|
|
130
|
+
cursor: 'pointer',
|
|
131
|
+
padding: '4px 8px',
|
|
132
|
+
borderRadius: '4px',
|
|
133
|
+
display: 'flex',
|
|
134
|
+
alignItems: 'center',
|
|
135
|
+
gap: '4px',
|
|
136
|
+
transition: 'all 0.2s ease',
|
|
137
|
+
color: copiedHash ? '#155724' : '#666'
|
|
138
|
+
}, title: "Copia", children: [_jsx(IconCopy, { width: 16, height: 16 }), copiedHash && _jsx("span", { style: { fontSize: '11px' }, children: "Copiato" })] })] }), _jsx("div", { style: { color: '#333' }, children: getHashValue() })] })] }))] }));
|
|
139
|
+
};
|
|
140
|
+
export default TMSignatureInfoContent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
3
|
import { DownloadTypes, FormModes } from "../../../ts/types";
|
|
4
|
-
import { associateColumnsToRows, calcResponsiveSizes, formatBytes, getExceptionMessage, Globalization, SDKUI_Localizator } from "../../../helper";
|
|
4
|
+
import { associateColumnsToRows, calcResponsiveSizes, formatBytes, getExceptionMessage, getMoreInfoTasksForDocument, Globalization, SDKUI_Localizator } from "../../../helper";
|
|
5
5
|
import TMModal from "../../base/TMModal";
|
|
6
6
|
import { DeleteEngine, ResultTypes, SDK_Globals, UpdateEngineByID, UserListCacheService } from "@topconsultnpm/sdk-ts";
|
|
7
7
|
import TMSpinner from "../../base/TMSpinner";
|
|
@@ -280,6 +280,6 @@ const TMViewHistoryDcmt = (props) => {
|
|
|
280
280
|
]);
|
|
281
281
|
}, [showId]);
|
|
282
282
|
return _jsx(TMModal, { title: `${SDKUI_Localizator.SearchResult} \u2014 ${SDKUI_Localizator.History + ": " + (fromDTD.nameLoc ?? SDKUI_Localizator.Document) + " (DID:" + inputDcmt.DID})`, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '80%', '80%', '95%'), onClose: onClose, 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: showLocalWaitPanel, showWaitPanelPrimary: showLocalPrimary, waitPanelTitle: waitLocalPanelTitle, waitPanelTextPrimary: waitLocalPanelTextPrimary, waitPanelValuePrimary: waitLocalPanelValuePrimary, waitPanelMaxValuePrimary: waitLocalPanelMaxValuePrimary, isCancelable: true, abortController: abortLocalController, children: [_jsx(TMDataGrid, { dataSource: dcmtHistory, dataColumns: dataColumns, focusedRowKey: focusedRowKey, selection: selection, onContextMenuPreparing: onContextMenuPreparing, onFocusedRowChanged: onFocusedRowChanged, onCellDblClick: onCellDblClick, noDataText: SDKUI_Localizator.NoDataToDisplay, showSearchPanel: showSearch }), (showDcmtForm && selectedDcmt !== undefined) &&
|
|
283
|
-
_jsx(TMDcmtForm, { TID: Number(selectedDcmt.TID), DID: Number(selectedDcmt.DID), formMode: FormModes.ReadOnly, isModal: true, widthModal: "95%", heightModal: "95%", titleModal: fromDTD.name ?? SDKUI_Localizator.SearchResult, allowNavigation: dcmtHistory.length > 0, itemIndex: selectedIndex + 1, count: dcmtHistory.length, onClose: () => { setShowDcmtForm(false); }, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback })] }) }) });
|
|
283
|
+
_jsx(TMDcmtForm, { TID: Number(selectedDcmt.TID), DID: Number(selectedDcmt.DID), formMode: FormModes.ReadOnly, isModal: true, widthModal: "95%", heightModal: "95%", titleModal: fromDTD.name ?? SDKUI_Localizator.SearchResult, allowNavigation: dcmtHistory.length > 0, itemIndex: selectedIndex + 1, count: dcmtHistory.length, onClose: () => { setShowDcmtForm(false); }, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks ?? [], Number(selectedDcmt.TID), Number(selectedDcmt.DID)) })] }) }) });
|
|
284
284
|
};
|
|
285
285
|
export default TMViewHistoryDcmt;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { ObjectClasses, TaskDescriptor, Priorities, PdGs, SDK_Globals, UserListCacheService, SDK_Localizator, Task_States } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { areDifferentIDs, formatDate, getOriginLabel, getPriorityLocalizatorValue, getPriorityLocalizatorValues, getStatusLocalizatorValues, gotoPDGExtendedLabel, taskValidatorAsync } from './TMTasksUtils';
|
|
5
5
|
import ScrollView from 'devextreme-react/scroll-view';
|
|
@@ -21,6 +21,7 @@ import TMDcmtForm from '../documents/TMDcmtForm';
|
|
|
21
21
|
import styled from 'styled-components';
|
|
22
22
|
import { TMColors } from '../../../utils/theme';
|
|
23
23
|
import { renderContextBlock } from './TMTasksUtilsView';
|
|
24
|
+
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
|
24
25
|
const ResponseCommentWrapper = styled.div `
|
|
25
26
|
position: relative;
|
|
26
27
|
width: 100%;
|
|
@@ -105,6 +106,10 @@ const TMTaskForm = (props) => {
|
|
|
105
106
|
};
|
|
106
107
|
const { formData, setFormData, formDataOrig, validationItems, exception, saveDataAsync } = useSaveForm(formMode, id, sfo, validator, onSaved, onStatusChanged, customizeFormData);
|
|
107
108
|
const containerRef = useRef(null);
|
|
109
|
+
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
|
|
110
|
+
const deviceType = useDeviceType();
|
|
111
|
+
// This avoids unnecessary re-renders by only recalculating when deviceType changes.
|
|
112
|
+
let isMobileDevice = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
|
|
108
113
|
const [isMobile, setIsMobile] = useState(false);
|
|
109
114
|
const [showDcmtForm, setShowDcmtForm] = useState(false);
|
|
110
115
|
const mobileBreakpoint = 768;
|
|
@@ -325,6 +330,25 @@ const TMTaskForm = (props) => {
|
|
|
325
330
|
await editTaskCallback(task);
|
|
326
331
|
onClose?.();
|
|
327
332
|
};
|
|
333
|
+
const handleNavigateToReference = (ref) => {
|
|
334
|
+
switch (ref.objClass) {
|
|
335
|
+
case ObjectClasses.Dossier:
|
|
336
|
+
if (ref.objID)
|
|
337
|
+
handleNavigateToDossiers(ref.objID);
|
|
338
|
+
else
|
|
339
|
+
console.log("Dossier reference missing objID");
|
|
340
|
+
break;
|
|
341
|
+
case ObjectClasses.WorkingGroup:
|
|
342
|
+
if (ref.objID)
|
|
343
|
+
handleNavigateToWGs(ref.objID);
|
|
344
|
+
else
|
|
345
|
+
console.log("Working Group reference missing objID");
|
|
346
|
+
break;
|
|
347
|
+
// Handle other object types as needed
|
|
348
|
+
default:
|
|
349
|
+
console.warn(`Unhandled object type: ${ref.objClass}`);
|
|
350
|
+
}
|
|
351
|
+
};
|
|
328
352
|
return (_jsx("div", { style: { width: "100%", height: "100%", overflow: "auto" }, ref: containerRef, children: _jsx(TMSaveForm, { width: width, height: height, id: id, title: title, isModal: isModal, formMode: formMode, onSaveAsync: saveDataAsync, onClose: onCloseCallback, onUndo: onUndoCallback, exception: exception, isModified: calcIsModified(formData, formDataOrig), validationItems: validationItems, showBackButton: showBackButton, hasNavigation: (hasNavigation && formMode !== FormModes.Create), canNext: canNext(), onNext: onNextCallback, canPrev: canPrev(), onPrev: onPrevCallback, showToolbar: !(showDcmtForm && formData?.iD1 && formData?.iD2), children: _jsxs(_Fragment, { children: [_jsx(ScrollView, { direction: "vertical", useNative: true, height: "calc(100% - 35px)", children: _jsx("div", { style: { marginRight: "5px" }, children: _jsxs(TMLayoutContainer, { direction: 'vertical', gap: 2, children: [(formMode === FormModes.Update && areDifferentIDs(formDataOrig?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID)) && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsxs("div", { style: { width: '100%', display: 'flex', alignItems: 'center', color: "#E29000" }, children: [_jsx("i", { className: "dx-icon-info", style: { fontSize: 20 } }), "\u00A0", _jsx("span", { children: SDKUI_Localizator.TaskAssignedMessage.replaceParams(formDataOrig?.fromName ?? '') })] }) }), taskContext?.workItem === undefined && (!areDifferentIDs(formData?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID)
|
|
329
353
|
&& !areDifferentIDs(formData?.toID, SDK_Globals.tmSession?.SessionDescr?.userID))
|
|
330
354
|
&& _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsxs("div", { style: { width: '100%', display: 'flex', alignItems: 'center', color: "#2559A5" }, children: [_jsx("i", { className: "dx-icon-info", style: { fontSize: 20 } }), "\u00A0", _jsx("span", { children: SDKUI_Localizator.PersonalTaskAssignmentMessage })] }) }), (!areDifferentIDs(formData?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID)
|
|
@@ -355,29 +379,55 @@ const TMTaskForm = (props) => {
|
|
|
355
379
|
width: '100%',
|
|
356
380
|
gap: 16,
|
|
357
381
|
padding: '8px 0'
|
|
358
|
-
}, children: children })), children: _jsx("div", { style: {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
382
|
+
}, children: children })), children: _jsx("div", { style: {
|
|
383
|
+
width: "100%",
|
|
384
|
+
display: 'flex',
|
|
385
|
+
alignItems: 'center',
|
|
386
|
+
justifyContent: 'center',
|
|
387
|
+
marginTop: 12
|
|
388
|
+
}, children: _jsxs("div", { onClick: () => formData.pdG !== PdGs.None ? gotoPDGExtendedLabelClickCallback() : null, style: {
|
|
389
|
+
backgroundColor: "#C2388B",
|
|
390
|
+
color: "#fff",
|
|
391
|
+
padding: "10px 16px",
|
|
392
|
+
borderRadius: "20px",
|
|
393
|
+
display: "flex",
|
|
394
|
+
alignItems: "center",
|
|
395
|
+
justifyContent: "space-between",
|
|
396
|
+
cursor: "pointer",
|
|
397
|
+
fontWeight: 500,
|
|
398
|
+
transition: "background-color 0.3s",
|
|
399
|
+
minWidth: "180px",
|
|
400
|
+
maxWidth: "100%",
|
|
401
|
+
flexWrap: "wrap",
|
|
402
|
+
gap: "8px",
|
|
403
|
+
}, onMouseEnter: e => {
|
|
404
|
+
if (formData.pdG !== PdGs.None)
|
|
405
|
+
e.currentTarget.style.backgroundColor = "#A12D78";
|
|
406
|
+
}, onMouseLeave: e => {
|
|
407
|
+
if (formData.pdG !== PdGs.None)
|
|
408
|
+
e.currentTarget.style.backgroundColor = "#C2388B";
|
|
409
|
+
}, children: [_jsxs("span", { style: {
|
|
410
|
+
flex: 1,
|
|
411
|
+
textAlign: "center",
|
|
412
|
+
gap: "6px",
|
|
413
|
+
display: "flex",
|
|
414
|
+
justifyContent: "center",
|
|
415
|
+
alignItems: "center",
|
|
416
|
+
}, children: [formData.pdG === PdGs.WG && _jsx("span", { children: SDKUI_Localizator.GoToWorkgroup }), formData.pdG === PdGs.CF && _jsx("span", { children: SDKUI_Localizator.GoToDossier }), formData.pdG === PdGs.DT && _jsx("span", { children: SDKUI_Localizator.GoToDocument }), (() => {
|
|
417
|
+
const originLabel = getOriginLabel(formData.pdG, formData.iD1Name);
|
|
418
|
+
if (!originLabel)
|
|
419
|
+
return null;
|
|
420
|
+
const maxLength = isMobileDevice ? 10 : 30;
|
|
421
|
+
const displayText = originLabel.length > maxLength
|
|
422
|
+
? originLabel.slice(0, maxLength) + "..."
|
|
423
|
+
: originLabel;
|
|
424
|
+
return _jsxs("span", { children: ["\u201C", displayText, "\u201D"] });
|
|
425
|
+
})()] }), _jsx(TMTooltip, { content: _jsxs("div", { style: { textAlign: "left" }, children: [formData.pdG && (_jsxs(_Fragment, { children: [_jsxs("div", { style: {
|
|
426
|
+
display: "flex",
|
|
427
|
+
alignItems: "center",
|
|
428
|
+
gap: "6px",
|
|
429
|
+
fontWeight: 600,
|
|
430
|
+
}, children: [_jsx("span", { style: { display: "flex", alignItems: "center" }, children: getPdgsIconMap().get(formData.pdG) }), _jsx("span", { children: formData.pdG === PdGs.WG ? SDKUI_Localizator.WorkGroup : formData.pdG === PdGs.CF ? SDKUI_Localizator.Dossier : formData.pdG === PdGs.DT ? SDKUI_Localizator.Document : "" })] }), _jsx("hr", { style: { margin: "4px 0 8px 0" } })] })), formData.iD1 != null && formData.iD1 !== 0 && (_jsxs("div", { children: [_jsx("b", { children: "ID1" }), ": ", formData.iD1.toString()] })), formData.iD1Name && (_jsxs("div", { children: [_jsx("b", { children: "ID1NAME" }), ": ", formData.iD1Name.toString()] })), formData.iD2 != null && formData.iD2 !== 0 && (_jsxs("div", { children: [_jsx("b", { children: "ID2" }), ": ", formData.iD2.toString()] }))] }), children: _jsx("i", { className: "dx-icon-info", style: { fontSize: "1.3rem", flexShrink: 0 } }) })] }) }) })), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%' }, children: _jsx(TMTextBox, { label: SDKUI_Localizator.Name, value: formData?.name ?? '', readOnly: fieldsReadOnly.name, autoFocus: true, maxLength: 100, isModifiedWhen: formData?.name !== formDataOrig?.name, onValueChanged: (e) => { setFormData({ ...formData ?? {}, name: e.target.value }); }, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.Name) }) }) }), _jsx("div", { style: { width: '100%' }, children: _jsx(TMTextArea, { label: SDKUI_Localizator.Description, value: formData?.description ?? '', maxLength: 200, readOnly: fieldsReadOnly.description, isModifiedWhen: formData?.description !== formDataOrig?.description, onValueChanged: (e) => { setFormData({ ...formData ?? {}, description: e.target.value }); }, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.Description), resize: false }) }), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: (formMode === FormModes.Create || !areDifferentIDs(formDataOrig?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID)) ?
|
|
381
431
|
_jsx("div", { id: "assignedToAnotherUserField", style: { width: isMobile ? '100%' : '50%' }, children: _jsx(TMUserChooser, { dataSource: usersList ?? undefined, allowShowAllUsers: !!taskContext?.dossier, allowMultipleSelection: false, label: SDKUI_Localizator.AssignedTo_Female, readOnly: fieldsReadOnly.assignedTO, values: formData?.toID ? [formData?.toID] : [], isModifiedWhen: formData?.toID !== formDataOrig?.toID, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.AssignedTo_Female), onValueChanged: (newValue) => {
|
|
382
432
|
if (newValue === undefined)
|
|
383
433
|
return;
|
|
@@ -387,6 +437,6 @@ const TMTaskForm = (props) => {
|
|
|
387
437
|
: _jsx(TMTextBox, { label: SDKUI_Localizator.Priority, value: getPriorityLocalizatorValue(formData?.priority ?? Priorities.Low), readOnly: true }) })] }) }), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsxs(_Fragment, { children: [_jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: !fieldsReadOnly.startDate ? _jsx(TMDateBox, { id: "start-date", resetTimeToZeroOnKeyPress: false, label: SDKUI_Localizator.StartDate, dateDisplayType: DateDisplayTypes.DateTime, value: formData?.startTime, isModifiedWhen: formData?.startTime !== formDataOrig?.startTime, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.ErrorStartEndDate), onContentReady: handleStartTimeContentReady, onValueChange: (value) => { setFormData({ ...formData ?? {}, startTime: value }); }, showClearButton: true }) : _jsx(TMTextBox, { label: SDKUI_Localizator.StartDate, value: formData?.startTime ? formatDate(formData?.startTime) : '', readOnly: true }) }), _jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: !fieldsReadOnly.startDate ? _jsx(TMDateBox, { id: "end-date", resetTimeToZeroOnKeyPress: false, label: SDKUI_Localizator.Expiration, dateDisplayType: DateDisplayTypes.DateTime, value: formData?.endTime, isModifiedWhen: formData?.endTime !== formDataOrig?.endTime, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.ErrorStartEndDate || o.PropertyName === SDKUI_Localizator.ErrorEndRemDate), onContentReady: handleEndTimeContentReady, onValueChange: (value) => { setFormData({ ...formData ?? {}, endTime: value }); }, showClearButton: true, readOnly: fieldsReadOnly.endDate }) : _jsx(TMTextBox, { label: SDKUI_Localizator.Expiration, value: formData?.endTime ? formatDate(formData?.endTime) : '', readOnly: true }) })] }) }), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 3 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: _jsx(TMDateBox, { id: "alert-time", resetTimeToZeroOnKeyPress: false, label: SDKUI_Localizator.Reminder, dateDisplayType: DateDisplayTypes.DateTime, value: formData?.remTime ?? undefined, isModifiedWhen: formData?.remTime !== formDataOrig?.remTime, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.ErrorEndRemDate), onValueChange: (value) => { setFormData({ ...formData ?? {}, remTime: value }); }, showClearButton: true, readOnly: fieldsReadOnly.remTime }) }) }), (formData?.state && [Task_States.Completed, Task_States.Waiting, Task_States.Deferred].includes(formData?.state) ||
|
|
388
438
|
(formData?.response ?? "") !== "") && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 3 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: _jsxs(ResponseCommentWrapper, { children: [_jsx(ResponseCommentTextArea, { id: "responseId", name: "response", "$isValid": true, value: formData?.response ?? '', onChange: onAnswerChange, "$isModifiedWhen": formData?.response !== formDataOrig?.response, disabled: (formData?.response ?? "") !== "" &&
|
|
389
439
|
(formData?.state && ![Task_States.Completed, Task_States.Waiting, Task_States.Deferred].includes(formData?.state)) }), _jsxs(ResponseCommentLabel, { htmlFor: "responseId", children: [SDKUI_Localizator.Answer, _jsxs(TMTooltip, { content: SDKUI_Localizator.AnswerTooltip, children: [" ", _jsx("i", { className: 'dx-icon-info' }), " "] })] }), _jsx(ResponseCommentCharacterCounter, { children: `${500 - (formData?.response ?? '').length} ${SDKUI_Localizator.CharactersRemaining}` })] }) }) })] }) }) }), (showDcmtForm && formData?.iD1 && formData?.iD2) &&
|
|
390
|
-
_jsx(TMDcmtForm, { titleModal: formData.iD1Name ?? '-', isModal: true, TID: formData.iD1, DID: formData.iD2, allowButtonsRefs: true,
|
|
440
|
+
_jsx(TMDcmtForm, { titleModal: formData.iD1Name ?? '-', isModal: true, TID: formData.iD1, DID: formData.iD2, allowButtonsRefs: true, moreInfoTasks: [formData], onWFOperationCompleted: refreshWorkflowApprove, onTaskCompleted: onTaskCompleted, onClose: () => { setShowDcmtForm(false); }, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onReferenceClick: handleNavigateToReference })] }) }) }));
|
|
391
441
|
};
|
|
392
442
|
export default TMTaskForm;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { TaskDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
3
|
import { FormModes } from "../../../ts";
|
|
4
|
+
import { TMContextMenuItemProps } from "../../NewComponents/ContextMenu";
|
|
4
5
|
interface TMTasksAgendaProps {
|
|
5
6
|
id: string;
|
|
6
7
|
showId: boolean;
|
|
@@ -12,6 +13,7 @@ interface TMTasksAgendaProps {
|
|
|
12
13
|
setCurrentAgendaDate: React.Dispatch<React.SetStateAction<Date>>;
|
|
13
14
|
openTaskForm: (formMode: FormModes, task?: TaskDescriptor) => void;
|
|
14
15
|
handleFocusedRowChange: (row: TaskDescriptor | undefined) => void;
|
|
16
|
+
menuItems: TMContextMenuItemProps[];
|
|
15
17
|
}
|
|
16
|
-
declare const TMTasksAgenda:
|
|
18
|
+
declare const TMTasksAgenda: (props: TMTasksAgendaProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export default TMTasksAgenda;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as _jsxs,
|
|
2
|
-
import React, { useCallback, useEffect, useState } from "react";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import ArrayStore from "devextreme/data/array_store";
|
|
4
4
|
import Scheduler from "devextreme-react/scheduler";
|
|
5
5
|
import { calculateNumberOfDays, highlightTaskText, priorityLegend, renderTaskIcons } from "./TMTasksUtilsView";
|
|
@@ -11,14 +11,31 @@ import { FormModes } from "../../../ts";
|
|
|
11
11
|
import { SDKUI_Localizator } from "../../../helper";
|
|
12
12
|
import TMCustomSearchBar from "../../../helper/TMCustomSearchBar";
|
|
13
13
|
import TMTooltip from "../../base/TMTooltip";
|
|
14
|
-
|
|
14
|
+
import TMContextMenu from "../../NewComponents/ContextMenu/TMContextMenu";
|
|
15
|
+
const MemoizedScheduler = React.memo(({ dataSource, currentAgendaDate, appointmentRender, onAppointmentDblClick, onCurrentDateChange, onAppointmentContextMenu, onAppointmentClick }) => {
|
|
15
16
|
const views = ['agenda'];
|
|
16
|
-
|
|
17
|
+
return (_jsx(Scheduler, { id: "tasks-agenda", defaultCurrentView: "agenda", dataSource: dataSource, width: "100%", height: "100%", editing: false, views: views, currentDate: currentAgendaDate, appointmentRender: appointmentRender, onAppointmentDblClick: onAppointmentDblClick, onCurrentDateChange: onCurrentDateChange, onAppointmentContextMenu: onAppointmentContextMenu, onAppointmentClick: onAppointmentClick }));
|
|
18
|
+
});
|
|
19
|
+
const TMTasksAgenda = (props) => {
|
|
20
|
+
const { id, showId, showSearch, visualizedTasks, fromCell, toCell, currentAgendaDate, setCurrentAgendaDate, openTaskForm, handleFocusedRowChange, menuItems } = props;
|
|
17
21
|
const [schedulerData, setSchedulerData] = useState([]);
|
|
18
22
|
const [loading, setLoading] = useState(false);
|
|
19
23
|
const [searchText, setSearchText] = useState('');
|
|
24
|
+
const [contextMenuVisible, setContextMenuVisible] = useState(false);
|
|
25
|
+
const [contextMenuPosition, setContextMenuPosition] = useState({ x: 0, y: 0 });
|
|
26
|
+
const prevTasksRef = useRef({ length: 0 });
|
|
20
27
|
useEffect(() => {
|
|
21
|
-
|
|
28
|
+
const currentSignature = {
|
|
29
|
+
length: visualizedTasks.length,
|
|
30
|
+
firstId: visualizedTasks[0]?.id,
|
|
31
|
+
lastId: visualizedTasks[visualizedTasks.length - 1]?.id
|
|
32
|
+
};
|
|
33
|
+
if (prevTasksRef.current.length !== currentSignature.length ||
|
|
34
|
+
prevTasksRef.current.firstId !== currentSignature.firstId ||
|
|
35
|
+
prevTasksRef.current.lastId !== currentSignature.lastId) {
|
|
36
|
+
prevTasksRef.current = currentSignature;
|
|
37
|
+
setSchedulerData(convertToSchedulerAppointments(visualizedTasks));
|
|
38
|
+
}
|
|
22
39
|
}, [visualizedTasks]);
|
|
23
40
|
useEffect(() => {
|
|
24
41
|
let timeoutId;
|
|
@@ -74,13 +91,16 @@ const TMTasksAgenda = React.memo((props) => {
|
|
|
74
91
|
if (e === undefined || e.event === undefined || e.appointmentData.id === undefined)
|
|
75
92
|
return;
|
|
76
93
|
e.event.preventDefault();
|
|
94
|
+
e.event.stopPropagation();
|
|
77
95
|
const { id } = e.appointmentData;
|
|
78
|
-
// Update the state with the new set of selected appointments
|
|
79
96
|
const task = visualizedTasks.find(task => task.id === id);
|
|
80
97
|
if (task) {
|
|
81
98
|
handleFocusedRowChange(task);
|
|
82
99
|
}
|
|
83
|
-
|
|
100
|
+
const event = e.event;
|
|
101
|
+
setContextMenuPosition({ x: event.clientX, y: event.clientY });
|
|
102
|
+
setContextMenuVisible(true);
|
|
103
|
+
}, [visualizedTasks, handleFocusedRowChange]);
|
|
84
104
|
const onCurrentDateChange = useCallback((value) => {
|
|
85
105
|
// Exit early if it's not a valid Date
|
|
86
106
|
if (!(value instanceof Date) || isNaN(value.getTime())) {
|
|
@@ -101,7 +121,26 @@ const TMTasksAgenda = React.memo((props) => {
|
|
|
101
121
|
openTaskForm(FormModes.Update, task);
|
|
102
122
|
}
|
|
103
123
|
}, [visualizedTasks]);
|
|
124
|
+
const handleWrapperContextMenu = useCallback((e) => {
|
|
125
|
+
handleFocusedRowChange(undefined);
|
|
126
|
+
setContextMenuPosition({ x: e.clientX, y: e.clientY });
|
|
127
|
+
setContextMenuVisible(true);
|
|
128
|
+
}, [handleFocusedRowChange]);
|
|
129
|
+
const handleCloseContextMenu = useCallback(() => {
|
|
130
|
+
setContextMenuVisible(false);
|
|
131
|
+
}, []);
|
|
132
|
+
const dataSourceRef = useRef(new ArrayStore({ key: `tasks-agenda-data`, data: schedulerData }));
|
|
133
|
+
const dataLengthRef = useRef(0);
|
|
134
|
+
if (dataLengthRef.current !== schedulerData.length) {
|
|
135
|
+
dataLengthRef.current = schedulerData.length;
|
|
136
|
+
dataSourceRef.current = new ArrayStore({ key: `tasks-agenda-data`, data: schedulerData });
|
|
137
|
+
}
|
|
138
|
+
const memoizedDataSource = useMemo(() => dataSourceRef.current, [schedulerData.length]);
|
|
104
139
|
return _jsxs("div", { style: { height: "100%", width: "100%" }, children: [_jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', width: '100%', height: "48px" }, children: [_jsx("div", { style: { width: showSearch ? "160px" : "0", marginLeft: '10px' }, children: showSearch && (_jsx(TMCustomSearchBar, { initialValue: searchText, onSearchChange: (value) => setSearchText(value) })) }), _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', cursor: "default" }, children: _jsxs(TMTooltip, { content: priorityLegend(), children: [" ", SDKUI_Localizator.PriorityLegend] }) })] }), _jsx("div", { style: { height: "calc(100% - 48px)", width: "100%" }, children: loading ? _jsx("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", width: "100%" }, children: _jsx(LoadIndicator, {}) })
|
|
105
|
-
:
|
|
106
|
-
|
|
140
|
+
: _jsxs(_Fragment, { children: [_jsx(TMContextMenu, { items: menuItems, externalControl: {
|
|
141
|
+
visible: contextMenuVisible,
|
|
142
|
+
position: contextMenuPosition,
|
|
143
|
+
onClose: handleCloseContextMenu
|
|
144
|
+
} }), _jsx("div", { id: `tasks-agenda-wrapper-${id}`, style: { width: "100%", height: "100%" }, onContextMenu: handleWrapperContextMenu, children: _jsx(MemoizedScheduler, { dataSource: memoizedDataSource, currentAgendaDate: currentAgendaDate, appointmentRender: appointmentRender, onAppointmentDblClick: handleAppointmentDblClick, onCurrentDateChange: onCurrentDateChange, onAppointmentContextMenu: onAppointmentContextMenu, onAppointmentClick: handleAppointmentClick }) })] }) })] });
|
|
145
|
+
};
|
|
107
146
|
export default TMTasksAgenda;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TaskDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
3
|
import { FormModes } from '../../../ts';
|
|
4
|
+
import { TMContextMenuItemProps } from '../../NewComponents/ContextMenu/types';
|
|
4
5
|
interface TMTasksCalendarProps {
|
|
5
6
|
id: string;
|
|
6
7
|
visualizedTasks: Array<TaskDescriptor>;
|
|
@@ -16,6 +17,7 @@ interface TMTasksCalendarProps {
|
|
|
16
17
|
setCalendarEndDate: React.Dispatch<React.SetStateAction<Date | undefined>>;
|
|
17
18
|
focusedRowKey: number | undefined;
|
|
18
19
|
handleFocusedRowChange: (row: TaskDescriptor | undefined) => void;
|
|
20
|
+
menuItems: TMContextMenuItemProps[];
|
|
19
21
|
}
|
|
20
22
|
declare const TMTasksCalendar: (props: TMTasksCalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
export default TMTasksCalendar;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import ArrayStore from 'devextreme/data/array_store';
|
|
3
3
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { Priorities, Task_States } from "@topconsultnpm/sdk-ts";
|
|
@@ -10,13 +10,15 @@ import { FormModes } from '../../../ts';
|
|
|
10
10
|
import { SDKUI_Localizator } from '../../../helper';
|
|
11
11
|
import TMTooltip from '../../base/TMTooltip';
|
|
12
12
|
import TMCustomSearchBar from '../../../helper/TMCustomSearchBar';
|
|
13
|
+
import TMContextMenu from '../../NewComponents/ContextMenu/TMContextMenu';
|
|
13
14
|
const views = ['month'];
|
|
14
|
-
let clickTimeout = null;
|
|
15
|
+
let clickTimeout = null;
|
|
15
16
|
let clickCount = 0; // Click counter
|
|
16
17
|
let lastClickedCell = null;
|
|
17
18
|
const TMTasksCalendar = (props) => {
|
|
18
|
-
const { id, visualizedTasks, showId, showSearch, fromCell, toCell, openTaskForm, onDeleteCallback, currentCalendarDate, setCurrentCalendarDate, focusedRowKey, handleFocusedRowChange, setCalendarStartDate, setCalendarEndDate } = props;
|
|
19
|
+
const { id, visualizedTasks, showId, showSearch, fromCell, toCell, openTaskForm, onDeleteCallback, currentCalendarDate, setCurrentCalendarDate, focusedRowKey, handleFocusedRowChange, setCalendarStartDate, setCalendarEndDate, menuItems } = props;
|
|
19
20
|
const [isMobile, setIsMobile] = useState(false);
|
|
21
|
+
const [contextMenuControl, setContextMenuControl] = useState({ visible: false, position: { x: 0, y: 0 } });
|
|
20
22
|
const mobileBreakpoint = 768;
|
|
21
23
|
const [schedulerData, setSchedulerData] = useState([]);
|
|
22
24
|
const [isRange, setIsRange] = useState(false);
|
|
@@ -228,13 +230,23 @@ const TMTasksCalendar = (props) => {
|
|
|
228
230
|
}
|
|
229
231
|
}
|
|
230
232
|
};
|
|
231
|
-
const onWrapperContextMenu = useCallback(() => {
|
|
232
|
-
handleFocusedRowChange(undefined);
|
|
233
|
-
}, []);
|
|
234
233
|
const onWrapperClick = useCallback(() => {
|
|
235
234
|
handleFocusedRowChange(undefined);
|
|
236
235
|
}, []);
|
|
236
|
+
const handleWrapperContextMenu = useCallback((e) => {
|
|
237
|
+
setContextMenuControl({
|
|
238
|
+
visible: true,
|
|
239
|
+
position: { x: e.clientX, y: e.clientY }
|
|
240
|
+
});
|
|
241
|
+
}, []);
|
|
242
|
+
const handleCloseContextMenu = useCallback(() => {
|
|
243
|
+
setContextMenuControl(prev => ({ ...prev, visible: false }));
|
|
244
|
+
}, []);
|
|
237
245
|
return (_jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', width: '100%', height: "48px", padding: 5 }, children: [_jsx("div", { style: { width: showSearch ? "160px" : "0", marginLeft: '10px' }, children: showSearch && (_jsx(TMCustomSearchBar, { initialValue: searchText, onSearchChange: (value) => setSearchText(value) })) }), _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', cursor: "default" }, children: _jsx(TMTooltip, { content: priorityLegend(), children: SDKUI_Localizator.PriorityLegend }) })] }), _jsx("div", { style: { height: "calc(100% - 48px)", width: "100%" }, children: loading ? _jsx("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", width: "100%" }, children: _jsx(LoadIndicator, {}) })
|
|
238
|
-
:
|
|
246
|
+
: _jsxs(_Fragment, { children: [_jsx(TMContextMenu, { items: menuItems, externalControl: {
|
|
247
|
+
visible: contextMenuControl.visible,
|
|
248
|
+
position: contextMenuControl.position,
|
|
249
|
+
onClose: handleCloseContextMenu
|
|
250
|
+
} }), _jsx("div", { id: `tasks-calendar-wrapper-${id}`, style: { width: "100%", height: "100%" }, onContextMenu: handleWrapperContextMenu, onClick: onWrapperClick, children: _jsx(Scheduler, { ref: schedulerRef, id: "tasks-calendar", dataSource: new ArrayStore({ key: 'tasks-calendar-data', data: schedulerData }), views: views, defaultCurrentView: "month", adaptivityEnabled: isMobile, editing: false, width: "100%", height: "100%", currentDate: currentCalendarDate, appointmentComponent: appointmentComponent, onAppointmentFormOpening: handleAppointmentFormOpening, appointmentTooltipComponent: appointmentTooltipComponent, onAppointmentDblClick: handleAppointmentDblClick, onCurrentDateChange: onCurrentCalendarDateChange, onAppointmentContextMenu: onAppointmentContextMenu, onCellContextMenu: onCellContextMenu, onCellClick: handleCellClick, onAppointmentClick: handleAppointmentClick, onContentReady: handleContentReady, onOptionChanged: onOptionChanged, children: _jsx(Resource, { dataSource: prioritiesResourceData, fieldExpr: "priority", label: "Priority" }) }) })] }) })] }));
|
|
239
251
|
};
|
|
240
252
|
export default TMTasksCalendar;
|
|
@@ -2,7 +2,7 @@ import { Appointment } from 'devextreme/ui/scheduler';
|
|
|
2
2
|
import { ContextMenuTypes } from 'devextreme-react/context-menu';
|
|
3
3
|
import { TaskDescriptor, Task_States, PdGs, Priorities, ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { FormModes, TaskContext } from '../../../ts';
|
|
5
|
-
import {
|
|
5
|
+
import { TMContextMenuItemProps } from '../../NewComponents/ContextMenu';
|
|
6
6
|
export declare const TEXT_SELECTED_COLOR = "#ff5e1a";
|
|
7
7
|
export declare const BG_COLOR_INACTIVE_WIDGET = "#fff";
|
|
8
8
|
export declare const BG_COLOR_ACTIVE_WIDGET = "#fff0b7";
|
|
@@ -100,7 +100,7 @@ export declare const gotoPDGExtendedLabel: (gotoVisible: boolean, pdg: PdGs, iD1
|
|
|
100
100
|
export declare const convertToSchedulerAppointments: (tasks: Array<TaskDescriptor>) => Array<Appointment>;
|
|
101
101
|
export declare const formatDate: (date: Date) => string;
|
|
102
102
|
export declare const areDifferentIDs: (fromID: number | undefined, userID: number | undefined) => boolean;
|
|
103
|
-
export declare const createTasksMenuItems: (taskDescriptor: TaskDescriptor | undefined, showId: boolean, setShowId: React.Dispatch<React.SetStateAction<boolean>>, showSearch: boolean, setShowSearch: React.Dispatch<React.SetStateAction<boolean>>, openTaskForm: (formMode: FormModes, task?: TaskDescriptor, isContextual?: boolean) => void, openEditTaskForm: (rowId: number | undefined) => void, openDuplicateTaskForm: (rowId: number | undefined) => void, onDeleteCallback: (rowIds: Array<number>) => void, markAsStatus: (rowIds: Array<number>, status: Task_States) => void, getAllTasks: () => Promise<void>, fromWG: boolean, showContextualWG: boolean, setShowContextualWG: React.Dispatch<React.SetStateAction<boolean>>, fromDossier: boolean, showContextualDossier: boolean, setShowContextualDossier: React.Dispatch<React.SetStateAction<boolean>>, fromDocument: boolean, showContextualDocument: boolean, setShowContextualDocument: React.Dispatch<React.SetStateAction<boolean>>, showGoToToday: boolean, handleGoToToday?: () => void, fromDatagrid?: boolean) => Array<
|
|
103
|
+
export declare const createTasksMenuItems: (taskDescriptor: TaskDescriptor | undefined, showId: boolean, setShowId: React.Dispatch<React.SetStateAction<boolean>>, showSearch: boolean, setShowSearch: React.Dispatch<React.SetStateAction<boolean>>, openTaskForm: (formMode: FormModes, task?: TaskDescriptor, isContextual?: boolean) => void, openEditTaskForm: (rowId: number | undefined) => void, openDuplicateTaskForm: (rowId: number | undefined) => void, onDeleteCallback: (rowIds: Array<number>) => void, markAsStatus: (rowIds: Array<number>, status: Task_States) => void, getAllTasks: () => Promise<void>, fromWG: boolean, showContextualWG: boolean, setShowContextualWG: React.Dispatch<React.SetStateAction<boolean>>, fromDossier: boolean, showContextualDossier: boolean, setShowContextualDossier: React.Dispatch<React.SetStateAction<boolean>>, fromDocument: boolean, showContextualDocument: boolean, setShowContextualDocument: React.Dispatch<React.SetStateAction<boolean>>, showGoToToday: boolean, handleGoToToday?: () => void, fromDatagrid?: boolean) => Array<TMContextMenuItemProps>;
|
|
104
104
|
export declare const checkIfNew: (fromId: number | undefined, isNew: number | undefined) => boolean;
|
|
105
105
|
export declare const getNewTaskCount: (tasks: Array<TaskDescriptor>) => number;
|
|
106
106
|
export declare const isTaskAssignedToAnotherUser: (task: TaskDescriptor) => boolean;
|