@topconsultnpm/sdkui-react 6.20.0-dev2.49 → 6.20.0-dev2.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/features/tasks/TMTaskForm.js +4 -9
- package/lib/components/features/tasks/TMTaskFormUtils.d.ts +3 -15
- package/lib/components/features/tasks/TMTaskFormUtils.js +165 -59
- package/lib/components/pages/TMPage.js +4 -0
- package/lib/helper/Enum_Localizator.js +5 -0
- package/lib/helper/SDKUI_Localizator.d.ts +2 -0
- package/lib/helper/SDKUI_Localizator.js +20 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect,
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { ObjectClasses, TaskDescriptor, PdGs, UserListCacheService, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { gotoPDGExtendedLabel, taskValidatorAsync } from './TMTasksUtils';
|
|
5
5
|
import ScrollView from 'devextreme-react/scroll-view';
|
|
@@ -12,8 +12,7 @@ import { TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
|
12
12
|
import TMSpinner from '../../base/TMSpinner';
|
|
13
13
|
import TMSaveForm from '../../forms/TMSaveForm';
|
|
14
14
|
import TMDcmtForm from '../documents/TMDcmtForm';
|
|
15
|
-
import {
|
|
16
|
-
import { getCurrentUserTaskRole, RenderDescriptionField, RenderEndDateField, RenderNameField, RenderPriorityField, RenderRemindDateField, RenderStartDateField, RenderTaskFormStateField, TaskAssigneeField, TaskFormAssignmentNoticeBadge, TaskFormContextualAttachments, TaskFormResponseComment, TaskPdgOriginNavigator, TMChangeStateForm } from './TMTaskFormUtils';
|
|
15
|
+
import { getCurrentUserTaskRole, RenderDescriptionField, RenderEndDateField, RenderNameField, RenderPriorityField, RenderRemindDateField, RenderStartDateField, RenderTaskFormStateField, TaskAssigneeField, TaskFormAssignmentNoticeBadge, TaskFormContextualAttachments, TMChangeStateForm } from './TMTaskFormUtils';
|
|
17
16
|
const TMTaskForm = (props) => {
|
|
18
17
|
// Custom hook to manage workflow approval data
|
|
19
18
|
const { refreshWorkflowApprove } = useWorkflowApprove();
|
|
@@ -61,10 +60,6 @@ const TMTaskForm = (props) => {
|
|
|
61
60
|
};
|
|
62
61
|
const { formData, setFormData, formDataOrig, validationItems, exception, saveDataAsync } = useSaveForm(formMode, id, sfo, validator, onSaved, onStatusChanged, customizeFormData);
|
|
63
62
|
const containerRef = useRef(null);
|
|
64
|
-
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
|
|
65
|
-
const deviceType = useDeviceType();
|
|
66
|
-
// This avoids unnecessary re-renders by only recalculating when deviceType changes.
|
|
67
|
-
let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
|
|
68
63
|
const [showDcmtForm, setShowDcmtForm] = useState(false);
|
|
69
64
|
const [showChangeStateForm, setShowChangeStateForm] = useState(false);
|
|
70
65
|
const [users, setUsers] = useState([]); // State to store the users
|
|
@@ -270,7 +265,7 @@ const TMTaskForm = (props) => {
|
|
|
270
265
|
console.warn(`Unhandled object type: ${ref.objClass}`);
|
|
271
266
|
}
|
|
272
267
|
};
|
|
273
|
-
return (_jsx("div", { style: { width: "100%", height: "100%", overflow: "auto" }, ref: containerRef, children: _jsxs(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: formData && (formMode === FormModes.Create || formMode === FormModes.None) ? "calc(100% - 70px)" : "calc(100% - 35px)", children: _jsx("div", { style: { marginRight: "5px" }, children: _jsxs(TMLayoutContainer, { direction: 'vertical', gap: 2, children: [(formMode === FormModes.Create || formMode === FormModes.None) && _jsxs("div", { style: { width: '100%', height: '100%' }, children: [_jsx(RenderNameField, { fieldsReadOnly: fieldsReadOnly, setFormData: setFormData, formData: formData, formDataOrig: formDataOrig, validationItems: validationItems }), _jsx(RenderDescriptionField, { fieldsReadOnly: fieldsReadOnly, setFormData: setFormData, formData: formData, formDataOrig: formDataOrig, validationItems: validationItems }), _jsx(TaskAssigneeField, { formMode: formMode, formData: formData, formDataOrig: formDataOrig, taskContext: taskContext, validationItems: validationItems, fieldsReadOnly: fieldsReadOnly, usersList: usersList, onValueChanged: (newValue) => {
|
|
268
|
+
return (_jsx("div", { style: { width: "100%", height: "100%", overflow: "auto" }, ref: containerRef, children: _jsxs(TMSaveForm, { width: width, height: height, id: id, title: title, isModal: isModal, formMode: formMode, onSaveAsync: saveDataAsync, onClose: onCloseCallback, showUndoButton: formMode === FormModes.Update, 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: formData && (formMode === FormModes.Create || formMode === FormModes.None) ? "calc(100% - 70px)" : "calc(100% - 35px)", children: _jsx("div", { style: { marginRight: "5px" }, children: _jsxs(TMLayoutContainer, { direction: 'vertical', gap: 2, children: [(formMode === FormModes.Create || formMode === FormModes.None) && _jsxs("div", { style: { width: '100%', height: '100%' }, children: [_jsx(RenderNameField, { fieldsReadOnly: fieldsReadOnly, setFormData: setFormData, formData: formData, formDataOrig: formDataOrig, validationItems: validationItems }), _jsx(RenderDescriptionField, { fieldsReadOnly: fieldsReadOnly, setFormData: setFormData, formData: formData, formDataOrig: formDataOrig, validationItems: validationItems }), _jsx(TaskAssigneeField, { formMode: formMode, formData: formData, formDataOrig: formDataOrig, taskContext: taskContext, validationItems: validationItems, fieldsReadOnly: fieldsReadOnly, usersList: usersList, onValueChanged: (newValue) => {
|
|
274
269
|
if (newValue === undefined)
|
|
275
270
|
return;
|
|
276
271
|
setFormData({ ...formData ?? {}, toID: newValue[0] });
|
|
@@ -278,7 +273,7 @@ const TMTaskForm = (props) => {
|
|
|
278
273
|
if (newValue === undefined)
|
|
279
274
|
return;
|
|
280
275
|
setFormData({ ...formData ?? {}, toID: newValue[0] });
|
|
281
|
-
} }), _jsx(RenderStartDateField, { fieldsReadOnly: fieldsReadOnly, formData: formData, formDataOrig: formDataOrig, validationItems: validationItems, setFormData: setFormData, onContentReady: handleStartTimeContentReady }), _jsx(RenderEndDateField, { fieldsReadOnly: fieldsReadOnly, formData: formData, formDataOrig: formDataOrig, validationItems: validationItems, setFormData: setFormData, onContentReady: handleEndTimeContentReady }), _jsx(RenderPriorityField, { formData: formData, formDataOrig: formDataOrig, fieldsReadOnly: fieldsReadOnly, onPriorityValueChange: onPriorityValueChange }), _jsx(RenderRemindDateField, { fieldsReadOnly: fieldsReadOnly, formData: formData, formDataOrig: formDataOrig, validationItems: validationItems, setFormData: setFormData }), _jsx(RenderTaskFormStateField, { formData: formData, formDataOrig: formDataOrig,
|
|
276
|
+
} }), _jsx(RenderStartDateField, { fieldsReadOnly: fieldsReadOnly, formData: formData, formDataOrig: formDataOrig, validationItems: validationItems, setFormData: setFormData, onContentReady: handleStartTimeContentReady }), _jsx(RenderEndDateField, { fieldsReadOnly: fieldsReadOnly, formData: formData, formDataOrig: formDataOrig, validationItems: validationItems, setFormData: setFormData, onContentReady: handleEndTimeContentReady }), _jsx(RenderPriorityField, { formData: formData, formDataOrig: formDataOrig, fieldsReadOnly: fieldsReadOnly, onPriorityValueChange: onPriorityValueChange }), _jsx(RenderRemindDateField, { fieldsReadOnly: fieldsReadOnly, formData: formData, formDataOrig: formDataOrig, validationItems: validationItems, setFormData: setFormData }), _jsx(RenderTaskFormStateField, { formData: formData, formDataOrig: formDataOrig, formMode: formMode, gotoPDGExtendedLabelClickCallback: gotoPDGExtendedLabelClickCallback, handleShowChangeStateForm: handleShowChangeStateForm, onSavedCallback: onSaved })] })] }) }) }), formData && (_jsx("div", { style: {
|
|
282
277
|
position: 'absolute',
|
|
283
278
|
bottom: 0,
|
|
284
279
|
left: 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { PdGs, Task_States, TaskDescriptor, UserDescriptor, ValidationItem } from "@topconsultnpm/sdk-ts";
|
|
3
3
|
import { FormModes, TaskContext } from "../../../ts";
|
|
4
4
|
import { IFieldsEditability } from "./TMTasksUtils";
|
|
@@ -18,13 +18,6 @@ interface TaskFormContextualAttachmentsProps {
|
|
|
18
18
|
taskContext: TaskContext | undefined;
|
|
19
19
|
}
|
|
20
20
|
export declare const TaskFormContextualAttachments: ({ taskContext }: TaskFormContextualAttachmentsProps) => JSX.Element | null;
|
|
21
|
-
interface TaskPdgOriginNavigatorProps {
|
|
22
|
-
formMode: FormModes;
|
|
23
|
-
formData: TaskDescriptor | undefined;
|
|
24
|
-
isMobile: boolean;
|
|
25
|
-
gotoPDGExtendedLabelClickCallback: () => void;
|
|
26
|
-
}
|
|
27
|
-
export declare const TaskPdgOriginNavigator: (props: TaskPdgOriginNavigatorProps) => false | "" | import("react/jsx-runtime").JSX.Element | undefined;
|
|
28
21
|
interface TaskFormAssignedToProps {
|
|
29
22
|
formMode: FormModes;
|
|
30
23
|
formData: TaskDescriptor | undefined;
|
|
@@ -36,13 +29,6 @@ interface TaskFormAssignedToProps {
|
|
|
36
29
|
onValueChanged: (newValue: Array<number> | undefined) => void;
|
|
37
30
|
}
|
|
38
31
|
export declare const TaskAssigneeField: (props: TaskFormAssignedToProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
-
interface TaskFormResponseCommentProps {
|
|
40
|
-
originalResponse?: string;
|
|
41
|
-
currentResponse?: string;
|
|
42
|
-
readonly?: boolean;
|
|
43
|
-
onAnswerChange?: (e: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
44
|
-
}
|
|
45
|
-
export declare const TaskFormResponseComment: (props: TaskFormResponseCommentProps) => import("react/jsx-runtime").JSX.Element;
|
|
46
32
|
interface RenderFieldBaseProps {
|
|
47
33
|
fieldsReadOnly: IFieldsEditability;
|
|
48
34
|
formDataOrig?: TaskDescriptor;
|
|
@@ -67,6 +53,8 @@ export declare const RenderRemindDateField: ({ validationItems, setFormData, for
|
|
|
67
53
|
interface RenderTaskFormStateFieldProps {
|
|
68
54
|
formDataOrig: TaskDescriptor | undefined;
|
|
69
55
|
formData: TaskDescriptor | undefined;
|
|
56
|
+
formMode: FormModes;
|
|
57
|
+
gotoPDGExtendedLabelClickCallback: () => void;
|
|
70
58
|
handleShowChangeStateForm: (value: boolean) => void;
|
|
71
59
|
onSavedCallback?: (task: TaskDescriptor) => void;
|
|
72
60
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import React, { useEffect, useMemo } from "react";
|
|
2
|
+
import React, { useEffect, useMemo, useState } from "react";
|
|
3
3
|
import { PdGs, Priorities, SDK_Globals, Task_States } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { FormModes } from "../../../ts";
|
|
5
5
|
import { calcResponsiveSizes, DateDisplayTypes, getPdgsIconMap, IconSave, SDKUI_Localizator } from "../../../helper";
|
|
@@ -12,11 +12,12 @@ import { TMColors } from "../../../utils/theme";
|
|
|
12
12
|
import TMTextArea from "../../editors/TMTextArea";
|
|
13
13
|
import TMDropDown from "../../editors/TMDropDown";
|
|
14
14
|
import TMDateBox from "../../editors/TMDateBox";
|
|
15
|
-
import { useDeviceType } from "../../base/TMDeviceProvider";
|
|
15
|
+
import { DeviceType, useDeviceType } from "../../base/TMDeviceProvider";
|
|
16
16
|
import TMModal from "../../base/TMModal";
|
|
17
17
|
import TMButton from "../../base/TMButton";
|
|
18
18
|
import { ButtonNames, TMExceptionBoxManager, TMMessageBoxManager } from "../../base/TMPopUp";
|
|
19
19
|
import TMSpinner from "../../base/TMSpinner";
|
|
20
|
+
import { taskStateIconMap } from "./TMTasksUtilsView";
|
|
20
21
|
export const getCurrentUserTaskRole = (task) => {
|
|
21
22
|
if (!task)
|
|
22
23
|
return "personal";
|
|
@@ -93,7 +94,7 @@ export const TaskFormContextualAttachments = ({ taskContext }) => {
|
|
|
93
94
|
const hasAnyAttachment = hasWorkingGroup || hasDossier || hasDocument || hasWorkItem;
|
|
94
95
|
return (_jsx("div", { style: { width: '100%', marginTop: 15, marginLeft: 5 }, children: !hasAnyAttachment ? (_jsxs("span", { children: [SDKUI_Localizator.Attachment, ": ", _jsx("span", { style: { color: '#6c757d', fontStyle: 'italic' }, children: 'Nessun allegato' })] })) : (_jsxs(_Fragment, { children: [_jsx(RenderAttachmentBlock, { condition: hasWorkingGroup, pdg: PdGs.WG, label: SDKUI_Localizator.WorkGroup + ' "' + getOriginLabel(PdGs.WG, taskContext?.workingGroup?.name) + '"' }), _jsx(RenderAttachmentBlock, { condition: hasDossier, pdg: PdGs.CF, label: SDKUI_Localizator.Dossier + ' "' + getOriginLabel(PdGs.CF, taskContext?.dossier?.name) + '"' }), _jsx(RenderAttachmentBlock, { condition: hasDocument, pdg: PdGs.DT, label: SDKUI_Localizator.Document + ' "' + getOriginLabel(PdGs.DT, taskContext?.document?.name) + '"' }), _jsx(RenderAttachmentBlock, { condition: hasWorkItem, pdg: PdGs.DT, label: SDKUI_Localizator.Document + ' "' + getOriginLabel(PdGs.DT, taskContext?.workItem?.name) + '"' })] })) }));
|
|
95
96
|
};
|
|
96
|
-
|
|
97
|
+
const TaskPdgOriginNavigator = (props) => {
|
|
97
98
|
const { formMode, formData, isMobile, gotoPDGExtendedLabelClickCallback } = props;
|
|
98
99
|
return formMode === FormModes.Update && formData?.pdG && formData?.iD1Name && (_jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 16, padding: '8px 0' }, children: _jsx("div", { style: { width: "100%", display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: _jsxs("div", { onClick: () => formData.pdG !== PdGs.None ? gotoPDGExtendedLabelClickCallback() : null, style: {
|
|
99
100
|
backgroundColor: "#C2388B",
|
|
@@ -173,17 +174,16 @@ export const TaskAssigneeField = (props) => {
|
|
|
173
174
|
}
|
|
174
175
|
return (_jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: content }));
|
|
175
176
|
};
|
|
176
|
-
const
|
|
177
|
+
const FloatingLabelFieldCard = styled.div `
|
|
177
178
|
position: relative;
|
|
178
179
|
width: 100%;
|
|
179
180
|
background: #ffffff;
|
|
180
181
|
border: 1px solid ${props => props.$isModifiedWhen ? '#E29000' : '#e6e6e6'};
|
|
181
182
|
border-radius: 10px;
|
|
182
183
|
padding: 12px 15px;
|
|
183
|
-
margin-top: 12px;
|
|
184
184
|
box-shadow: 0 2px 6px rgba(0,0,0,0.05);
|
|
185
185
|
`;
|
|
186
|
-
const
|
|
186
|
+
const FloatingFieldLabel = styled.label `
|
|
187
187
|
position: absolute;
|
|
188
188
|
top: -9px;
|
|
189
189
|
left: 9px;
|
|
@@ -195,18 +195,72 @@ const ReadOnlyFieldLabel = styled.label `
|
|
|
195
195
|
align-items: center;
|
|
196
196
|
gap: 6px;
|
|
197
197
|
`;
|
|
198
|
-
|
|
198
|
+
// Nuovo Styled component semplice per StatusFieldValue
|
|
199
|
+
const StatusFieldLabel = styled.div `
|
|
200
|
+
display: flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
gap: 8px; // spazio tra label e valore
|
|
203
|
+
font-size: 1rem;
|
|
204
|
+
color: #000; // nero semplice
|
|
205
|
+
font-weight: 400;
|
|
206
|
+
`;
|
|
207
|
+
const StatusValue = styled.span `
|
|
208
|
+
display: inline-flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
gap: 6px;
|
|
211
|
+
font-size: 1rem;
|
|
212
|
+
font-weight: 500;
|
|
213
|
+
padding: 4px 10px;
|
|
214
|
+
border-radius: 999px;
|
|
215
|
+
border: 2px solid transparent;
|
|
216
|
+
background: ${props => props.$isModifiedWhen
|
|
217
|
+
? "#FFF4E0"
|
|
218
|
+
: `linear-gradient(#F6F7F9, #F6F7F9) padding-box,
|
|
219
|
+
linear-gradient(270deg, #46B5A2 16%, #3BAABC 34%, #3BAABC 34%, #3681AD 54%, #3368A5 72%, #2F549D 88%, #304F99 100%) border-box`};
|
|
220
|
+
${props => props.$isModifiedWhen && `border-color: #FFD79A;`}
|
|
221
|
+
color: ${props => props.$isModifiedWhen ? "#B46900" : "#3A3A3A"};
|
|
222
|
+
transition: all 0.2s ease;
|
|
223
|
+
`;
|
|
224
|
+
const ResponseReadOnlyContainer = styled.div `width: 100%;`;
|
|
225
|
+
const ResponseReadOnlyLabel = styled.div `
|
|
226
|
+
font-size: 1rem;
|
|
227
|
+
color: #000;
|
|
228
|
+
margin-bottom: 6px;
|
|
229
|
+
`;
|
|
230
|
+
const ResponseReadOnlyValue = styled.div `
|
|
231
|
+
border: 1px solid #dee2e6;
|
|
232
|
+
border-radius: 8px;
|
|
233
|
+
padding: 12px 14px;
|
|
199
234
|
font-size: 0.95rem;
|
|
200
|
-
color:
|
|
235
|
+
color: #495057;
|
|
236
|
+
line-height: 1.5;
|
|
201
237
|
white-space: pre-wrap;
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
238
|
+
word-wrap: break-word;
|
|
239
|
+
background: ${props => props.$isModifiedWhen
|
|
240
|
+
? "#FFF4E0"
|
|
241
|
+
: `linear-gradient(#F6F7F9, #F6F7F9) padding-box,
|
|
242
|
+
linear-gradient(270deg, #46B5A2 16%, #3BAABC 34%, #3BAABC 34%, #3681AD 54%, #3368A5 72%, #2F549D 88%, #304F99 100%) border-box`};
|
|
243
|
+
${props => props.$isModifiedWhen && `border-color: #FFD79A;`}
|
|
244
|
+
/* Limite a 3 righe con scrollbar */
|
|
245
|
+
max-height: calc(1.5em * 3 + 24px); /* 3 righe + padding */
|
|
246
|
+
overflow-y: auto;
|
|
247
|
+
|
|
248
|
+
/* Scrollbar stilizzata */
|
|
249
|
+
&::-webkit-scrollbar {
|
|
250
|
+
width: 6px;
|
|
251
|
+
}
|
|
252
|
+
&::-webkit-scrollbar-track {
|
|
253
|
+
background: #f1f1f1;
|
|
254
|
+
border-radius: 3px;
|
|
255
|
+
}
|
|
256
|
+
&::-webkit-scrollbar-thumb {
|
|
257
|
+
background: linear-gradient(180deg, #46B5A2, #3681AD);
|
|
258
|
+
border-radius: 3px;
|
|
259
|
+
}
|
|
260
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
261
|
+
background: linear-gradient(180deg, #3a9a89, #2d6d94);
|
|
262
|
+
}
|
|
263
|
+
|
|
210
264
|
/* Permette selezione testo */
|
|
211
265
|
user-select: text;
|
|
212
266
|
`;
|
|
@@ -249,9 +303,50 @@ const ResponseCommentCharacterCounter = styled.div `
|
|
|
249
303
|
color: #6c757d;
|
|
250
304
|
margin-top: 4px;
|
|
251
305
|
`;
|
|
252
|
-
|
|
306
|
+
const TaskFormResponseComment = (props) => {
|
|
253
307
|
const { originalResponse = "", currentResponse = "", onAnswerChange, readonly = false } = props;
|
|
254
|
-
|
|
308
|
+
const [showFullscreen, setShowFullscreen] = useState(false);
|
|
309
|
+
const deviceType = useDeviceType();
|
|
310
|
+
return (_jsx("div", { style: { width: '100%', marginTop: !readonly ? 10 : 0 }, children: readonly ?
|
|
311
|
+
_jsxs(_Fragment, { children: [_jsxs("div", { style: {
|
|
312
|
+
width: '100%',
|
|
313
|
+
backgroundColor: '#fff',
|
|
314
|
+
border: '1px solid #ccc',
|
|
315
|
+
borderRadius: 8,
|
|
316
|
+
padding: 8,
|
|
317
|
+
boxSizing: 'border-box',
|
|
318
|
+
height: '5.4rem',
|
|
319
|
+
overflowY: 'auto',
|
|
320
|
+
position: 'relative',
|
|
321
|
+
}, children: [_jsx("i", { className: "dx-icon-fullscreen", onClick: () => setShowFullscreen(true), style: {
|
|
322
|
+
position: 'absolute',
|
|
323
|
+
top: 6,
|
|
324
|
+
right: 6,
|
|
325
|
+
fontSize: '1.1rem',
|
|
326
|
+
color: '#6c757d',
|
|
327
|
+
cursor: 'pointer',
|
|
328
|
+
transition: 'color 0.2s',
|
|
329
|
+
}, onMouseEnter: e => e.currentTarget.style.color = '#333', onMouseLeave: e => e.currentTarget.style.color = '#6c757d' }), _jsx("div", { style: {
|
|
330
|
+
fontSize: '1rem',
|
|
331
|
+
color: '#000',
|
|
332
|
+
whiteSpace: 'pre-wrap',
|
|
333
|
+
lineHeight: '1.6rem',
|
|
334
|
+
paddingRight: 20,
|
|
335
|
+
}, children: currentResponse && currentResponse.length > 0
|
|
336
|
+
? currentResponse
|
|
337
|
+
: _jsx("span", { style: { color: '#6c757d', fontStyle: 'italic' }, children: SDKUI_Localizator.NoAnswerProvided }) })] }), showFullscreen && (_jsx(TMModal, { title: SDKUI_Localizator.Answer, width: calcResponsiveSizes(deviceType, '600px', '600px', '95%'), height: calcResponsiveSizes(deviceType, '400px', '400px', '80%'), isModal: true, resizable: true, onClose: () => setShowFullscreen(false), children: _jsx("div", { style: {
|
|
338
|
+
padding: 16,
|
|
339
|
+
fontSize: '1rem',
|
|
340
|
+
color: '#000',
|
|
341
|
+
whiteSpace: 'pre-wrap',
|
|
342
|
+
lineHeight: '1.6rem',
|
|
343
|
+
overflowY: 'auto',
|
|
344
|
+
height: '100%',
|
|
345
|
+
boxSizing: 'border-box',
|
|
346
|
+
}, children: currentResponse && currentResponse.length > 0
|
|
347
|
+
? currentResponse
|
|
348
|
+
: _jsx("span", { style: { color: '#6c757d', fontStyle: 'italic' }, children: SDKUI_Localizator.NoAnswerProvided }) }) }))] })
|
|
349
|
+
: (_jsxs(ResponseCommentWrapper, { children: [_jsx(ResponseCommentTextArea, { id: "responseId", name: "response", "$isValid": true, value: currentResponse ?? '', onChange: onAnswerChange ? onAnswerChange : undefined, "$isModifiedWhen": currentResponse !== originalResponse }), _jsx(ResponseCommentLabel, { htmlFor: "responseId", "$isModifiedWhen": currentResponse !== originalResponse, children: SDKUI_Localizator.Answer }), _jsx(ResponseCommentCharacterCounter, { children: `${500 - (currentResponse ?? '').length} ${SDKUI_Localizator.CharactersRemaining}` })] })) }));
|
|
255
350
|
};
|
|
256
351
|
// Stile comune per i container dei campi
|
|
257
352
|
const fieldContainerStyle = { width: '100%' };
|
|
@@ -263,14 +358,18 @@ export const RenderStartDateField = ({ validationItems, setFormData, formData, f
|
|
|
263
358
|
export const RenderEndDateField = ({ validationItems, setFormData, formData, formDataOrig, fieldsReadOnly, onContentReady }) => (_jsx("div", { style: fieldContainerWithMarginStyle, children: !fieldsReadOnly.startDate ? (_jsx(TMDateBox, { id: "end-date", resetTimeToZeroOnKeyPress: false, label: SDKUI_Localizator.ExpirationDate, 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: onContentReady, onValueChange: (value) => setFormData({ ...formData ?? {}, endTime: value }), showClearButton: true, readOnly: fieldsReadOnly.endDate })) : (_jsx(TMTextBox, { label: SDKUI_Localizator.ExpirationDate, value: formData?.endTime ? formatDate(formData?.endTime) : '', readOnly: true })) }));
|
|
264
359
|
export const RenderRemindDateField = ({ validationItems, setFormData, formData, formDataOrig, fieldsReadOnly }) => (_jsx("div", { style: fieldContainerWithMarginStyle, 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 }) }));
|
|
265
360
|
export const RenderTaskFormStateField = (props) => {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
361
|
+
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
|
|
362
|
+
const deviceType = useDeviceType();
|
|
363
|
+
// This avoids unnecessary re-renders by only recalculating when deviceType changes.
|
|
364
|
+
let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
|
|
365
|
+
const { formDataOrig, formData, formMode, gotoPDGExtendedLabelClickCallback, handleShowChangeStateForm, onSavedCallback } = props;
|
|
270
366
|
const taskRole = getCurrentUserTaskRole(formDataOrig);
|
|
271
367
|
// Condizione per mostrare il pulsante
|
|
272
|
-
const showCloseButton = taskRole === 'sender' && formDataOrig
|
|
273
|
-
const showModifyButton = !(taskRole === 'sender' && formDataOrig
|
|
368
|
+
const showCloseButton = taskRole === 'sender' && formDataOrig?.state === Task_States.Completed;
|
|
369
|
+
const showModifyButton = !(taskRole === 'sender' && formDataOrig?.state === Task_States.Completed);
|
|
370
|
+
console.log(taskRole);
|
|
371
|
+
console.log("showCloseButton", showCloseButton);
|
|
372
|
+
console.log("showModifyButton", showModifyButton);
|
|
274
373
|
const closeTaskCallback = () => {
|
|
275
374
|
if (!formData || !formData.id)
|
|
276
375
|
return;
|
|
@@ -300,41 +399,48 @@ export const RenderTaskFormStateField = (props) => {
|
|
|
300
399
|
}
|
|
301
400
|
});
|
|
302
401
|
};
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
402
|
+
// Non renderizzare nulla finché i dati non sono pronti
|
|
403
|
+
if (!formDataOrig)
|
|
404
|
+
return null;
|
|
405
|
+
return (_jsx("div", { style: { width: '100%', marginTop: 15 }, children: _jsxs(FloatingLabelFieldCard, { "$isModifiedWhen": formDataOrig?.state !== formData?.state, style: { display: 'flex', flexDirection: 'column', gap: 10 }, children: [_jsx(FloatingFieldLabel, { "$isModifiedWhen": formDataOrig?.state !== formData?.state, children: SDKUI_Localizator.StatusAndAnswer }), _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', width: '100%' }, children: [_jsx(StatusFieldLabel, { children: _jsxs(StatusValue, { "$isModifiedWhen": formDataOrig?.state !== formData?.state, children: [_jsx("span", { style: { display: 'flex', alignItems: 'center' }, children: taskStateIconMap(20).get(formData?.state ?? Task_States.None) }), getStatusLocalizatorValue(formData?.state ?? Task_States.None)] }) }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [showModifyButton && (_jsxs("div", { onClick: () => handleShowChangeStateForm(true), style: {
|
|
406
|
+
backgroundColor: "#d17800",
|
|
407
|
+
color: "#fff",
|
|
408
|
+
padding: "10px 16px",
|
|
409
|
+
borderRadius: "20px",
|
|
410
|
+
display: "inline-flex",
|
|
411
|
+
alignItems: "center",
|
|
412
|
+
justifyContent: "center",
|
|
413
|
+
gap: "8px",
|
|
414
|
+
cursor: "pointer",
|
|
415
|
+
fontWeight: 600,
|
|
416
|
+
width: "120px",
|
|
417
|
+
transition: 'background-color 0.3s, transform 0.2s',
|
|
418
|
+
}, onMouseEnter: e => {
|
|
419
|
+
e.currentTarget.style.backgroundColor = "#a66300";
|
|
420
|
+
e.currentTarget.style.transform = 'scale(1.05)';
|
|
421
|
+
}, onMouseLeave: e => {
|
|
422
|
+
e.currentTarget.style.backgroundColor = "#d17800";
|
|
423
|
+
e.currentTarget.style.transform = 'scale(1)';
|
|
424
|
+
}, children: [_jsx("span", { style: { fontWeight: 500 }, children: SDKUI_Localizator.Update }), _jsx("i", { className: "dx-icon-edit", style: { fontSize: '20px' } })] })), showCloseButton && (_jsxs("div", { onClick: closeTaskCallback, style: {
|
|
425
|
+
backgroundColor: "#d17800",
|
|
426
|
+
color: "#fff",
|
|
427
|
+
padding: "10px 16px",
|
|
428
|
+
borderRadius: "20px",
|
|
429
|
+
display: "inline-flex",
|
|
430
|
+
alignItems: "center",
|
|
431
|
+
justifyContent: "center",
|
|
432
|
+
gap: "8px",
|
|
433
|
+
cursor: "pointer",
|
|
434
|
+
fontWeight: 600,
|
|
435
|
+
width: "150px",
|
|
436
|
+
transition: 'background-color 0.3s, transform 0.2s',
|
|
437
|
+
}, onMouseEnter: e => {
|
|
438
|
+
e.currentTarget.style.backgroundColor = "#a66300";
|
|
439
|
+
e.currentTarget.style.transform = 'scale(1.05)';
|
|
440
|
+
}, onMouseLeave: e => {
|
|
441
|
+
e.currentTarget.style.backgroundColor = "#d17800";
|
|
442
|
+
e.currentTarget.style.transform = 'scale(1)';
|
|
443
|
+
}, children: [_jsx("span", { style: { fontWeight: 500 }, children: SDKUI_Localizator.CloseTask }), _jsx("i", { className: "dx-icon-lock", style: { fontSize: '20px' } })] }))] })] }), _jsx(TaskFormResponseComment, { originalResponse: formDataOrig?.response, currentResponse: formData?.response, readonly: true }), _jsx("div", { style: { display: 'flex', justifyContent: 'center', width: '100%' }, children: _jsx(TaskPdgOriginNavigator, { formMode: formMode, formData: formDataOrig, isMobile: isMobile, gotoPDGExtendedLabelClickCallback: gotoPDGExtendedLabelClickCallback }) })] }) }));
|
|
338
444
|
};
|
|
339
445
|
export const TMChangeStateForm = (props) => {
|
|
340
446
|
const { formData, formDataOrig, handleShowChangeStateForm, setFormData } = props;
|
|
@@ -41,6 +41,8 @@ const TMPage = ({ id, objClass = ObjectClasses.None, listDisabled = false, lastR
|
|
|
41
41
|
let itemsCount = gridInstance?.instance().getDataSource().items().length;
|
|
42
42
|
if (itemsCount && itemsCount > 0) {
|
|
43
43
|
gridInstance?.instance().selectRows(selectedItems?.map((item) => item.id) ?? [], false);
|
|
44
|
+
if (selectedItems && selectedItems.length > 0 && (selectedItems?.[0]).id)
|
|
45
|
+
gridInstance?.instance()?.navigateToRow((selectedItems?.[0]).id);
|
|
44
46
|
}
|
|
45
47
|
}, [selectedItems]);
|
|
46
48
|
useEffect(() => {
|
|
@@ -52,6 +54,8 @@ const TMPage = ({ id, objClass = ObjectClasses.None, listDisabled = false, lastR
|
|
|
52
54
|
useEffect(() => {
|
|
53
55
|
if (lastRefreshTime) {
|
|
54
56
|
loadDataAsync(id);
|
|
57
|
+
if (id)
|
|
58
|
+
gridInstance?.instance()?.navigateToRow(id);
|
|
55
59
|
}
|
|
56
60
|
}, [lastRefreshTime]);
|
|
57
61
|
useEffect(() => {
|
|
@@ -101,6 +101,11 @@ export function LocalizeJobTypes(value) {
|
|
|
101
101
|
case CultureIDs.It_IT: return value?.toString();
|
|
102
102
|
default: return "CustomsDrawerPlus";
|
|
103
103
|
}
|
|
104
|
+
case JobTypes.CassettoDoganaleDistiller:
|
|
105
|
+
switch (cultureID) {
|
|
106
|
+
case CultureIDs.It_IT: return value?.toString();
|
|
107
|
+
default: return "CustomsDrawerDistiller";
|
|
108
|
+
}
|
|
104
109
|
default: return value?.toString() ?? '';
|
|
105
110
|
}
|
|
106
111
|
}
|
|
@@ -37,6 +37,7 @@ export declare class SDKUI_Localizator {
|
|
|
37
37
|
static get Anomalies(): "Anomalien" | "Anomalies" | "Anomalías" | "Anomalias" | "Anomalie";
|
|
38
38
|
static get Answer(): "Antwort" | "Answer" | "Respuesta" | "Réponse" | "Resposta" | "Risposta";
|
|
39
39
|
static get AnswerTooltip(): "Die Antwort kann nur bearbeitet werden, wenn der Aktivitätsstatus \"Abgeschlossen\", \"Ausstehend\" oder \"Verschoben\" ist." | "The answer can be edited only if the activity status is \"Completed\", \"Pending\", or \"Deferred\"." | "La respuesta solo se puede editar si el estado de la actividad es \"Completada\", \"Pendiente\" o \"Pospuesta\"." | "La réponse peut être modifiée uniquement si l'état de l’activité est \"Terminée\", \"En attente\" ou \"Reportée\"." | "A resposta só pode ser editada se o estado da atividade for \"Concluída\", \"Pendente\" ou \"Adiada\"." | "La risposta può essere modificata solo se lo stato dell’attività è \"Completata\", \"In attesa\" o \"Rinviata\".";
|
|
40
|
+
static get NoAnswerProvided(): "Keine Antwort" | "No answer" | "Sin respuesta" | "Aucune réponse" | "Nenhuma resposta" | "Nessuna risposta";
|
|
40
41
|
static get Application(): "Anwendung" | "Application" | "Aplicación" | "Aplicação" | "Applicazione";
|
|
41
42
|
static get Applied(): string;
|
|
42
43
|
static get Apply(): "Anwenden" | "Apply" | "Aplicar" | "Applique" | "Applica";
|
|
@@ -634,6 +635,7 @@ export declare class SDKUI_Localizator {
|
|
|
634
635
|
static get StartDateMustBeBeforeEndDate(): "Das Startdatum muss vor dem Enddatum liegen" | "The start date must be before the end date" | "La fecha de inicio debe ser anterior a la fecha de finalización" | "La date de début doit être antérieure à la date de fin" | "A data de início deve ser anterior à data de término" | "La data di inizio deve essere precedente alla data di fine";
|
|
635
636
|
static get Statistics(): "Statistiken" | "Statistics" | "Estadística" | "Statistiques" | "Estatísticas" | "Statistiche";
|
|
636
637
|
static get Status(): "Status" | "Estado" | "Statut" | "Stato";
|
|
638
|
+
static get StatusAndAnswer(): "Status und Antwort" | "Status and answer" | "Estado y respuesta" | "Statut et réponse" | "Estado e resposta" | "Stato e risposta";
|
|
637
639
|
static get Subject(): "Betreff" | "Subject" | "Asunto" | "Objet" | "Assunto" | "Oggetto";
|
|
638
640
|
static get Summary(): "Zusammenfassung" | "Summary" | "Resumen" | "Résumé" | "Resumo" | "Riepilogo";
|
|
639
641
|
static get SwitchUser(): "Benutzer wechseln" | "Switch user" | "Cambiar usuario" | "Changer d'utilisateur" | "Mudar de usuário" | "Cambia utente";
|
|
@@ -324,6 +324,16 @@ export class SDKUI_Localizator {
|
|
|
324
324
|
return "La risposta può essere modificata solo se lo stato dell’attività è \"Completata\", \"In attesa\" o \"Rinviata\".";
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
+
static get NoAnswerProvided() {
|
|
328
|
+
switch (this._cultureID) {
|
|
329
|
+
case CultureIDs.De_DE: return "Keine Antwort";
|
|
330
|
+
case CultureIDs.En_US: return "No answer";
|
|
331
|
+
case CultureIDs.Es_ES: return "Sin respuesta";
|
|
332
|
+
case CultureIDs.Fr_FR: return "Aucune réponse";
|
|
333
|
+
case CultureIDs.Pt_PT: return "Nenhuma resposta";
|
|
334
|
+
default: return "Nessuna risposta";
|
|
335
|
+
}
|
|
336
|
+
}
|
|
327
337
|
static get Application() {
|
|
328
338
|
switch (this._cultureID) {
|
|
329
339
|
case CultureIDs.De_DE: return "Anwendung";
|
|
@@ -6312,6 +6322,16 @@ export class SDKUI_Localizator {
|
|
|
6312
6322
|
default: return "Stato";
|
|
6313
6323
|
}
|
|
6314
6324
|
}
|
|
6325
|
+
static get StatusAndAnswer() {
|
|
6326
|
+
switch (this._cultureID) {
|
|
6327
|
+
case CultureIDs.De_DE: return "Status und Antwort";
|
|
6328
|
+
case CultureIDs.En_US: return "Status and answer";
|
|
6329
|
+
case CultureIDs.Es_ES: return "Estado y respuesta";
|
|
6330
|
+
case CultureIDs.Fr_FR: return "Statut et réponse";
|
|
6331
|
+
case CultureIDs.Pt_PT: return "Estado e resposta";
|
|
6332
|
+
default: return "Stato e risposta";
|
|
6333
|
+
}
|
|
6334
|
+
}
|
|
6315
6335
|
static get Subject() {
|
|
6316
6336
|
switch (this._cultureID) {
|
|
6317
6337
|
case CultureIDs.De_DE: return "Betreff";
|