@topconsultnpm/sdkui-react 6.20.0-dev2.9 → 6.20.0-dev3.1

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.
Files changed (84) hide show
  1. package/lib/components/NewComponents/ContextMenu/styles.d.ts +3 -1
  2. package/lib/components/NewComponents/ContextMenu/styles.js +7 -5
  3. package/lib/components/base/Styled.d.ts +4 -1
  4. package/lib/components/base/Styled.js +11 -3
  5. package/lib/components/base/TMTreeView.d.ts +3 -1
  6. package/lib/components/base/TMTreeView.js +64 -21
  7. package/lib/components/choosers/TMDataListItemEditor.d.ts +11 -0
  8. package/lib/components/choosers/TMDataListItemEditor.js +130 -0
  9. package/lib/components/choosers/TMDataListItemFields.d.ts +11 -0
  10. package/lib/components/choosers/TMDataListItemFields.js +61 -0
  11. package/lib/components/choosers/TMDataListItemPicker.d.ts +1 -0
  12. package/lib/components/choosers/TMDataListItemPicker.js +178 -18
  13. package/lib/components/choosers/TMImageIDChooser.d.ts +16 -0
  14. package/lib/components/choosers/TMImageIDChooser.js +53 -0
  15. package/lib/components/choosers/TMMetadataChooser.js +1 -1
  16. package/lib/components/editors/TMDateBox.js +1 -1
  17. package/lib/components/editors/TMHtmlEditor.js +1 -1
  18. package/lib/components/editors/TMLocalizedTextBox.d.ts +1 -0
  19. package/lib/components/editors/TMLocalizedTextBox.js +3 -3
  20. package/lib/components/editors/TMTextBox.js +9 -10
  21. package/lib/components/features/archive/TMArchive.d.ts +2 -1
  22. package/lib/components/features/archive/TMArchive.js +31 -44
  23. package/lib/components/features/blog/TMBlogCommentForm.d.ts +3 -0
  24. package/lib/components/features/blog/TMBlogCommentForm.js +42 -36
  25. package/lib/components/features/documents/TMDcmtForm.d.ts +3 -1
  26. package/lib/components/features/documents/TMDcmtForm.js +197 -53
  27. package/lib/components/features/documents/TMDcmtTasks.d.ts +3 -1
  28. package/lib/components/features/documents/TMDcmtTasks.js +2 -2
  29. package/lib/components/features/documents/TMFileUploader.d.ts +4 -0
  30. package/lib/components/features/documents/TMFileUploader.js +23 -6
  31. package/lib/components/features/documents/TMMasterDetailDcmts.js +68 -84
  32. package/lib/components/features/documents/TMRelationViewer.d.ts +7 -1
  33. package/lib/components/features/documents/TMRelationViewer.js +395 -78
  34. package/lib/components/features/search/TMSearchResult.d.ts +2 -0
  35. package/lib/components/features/search/TMSearchResult.js +82 -79
  36. package/lib/components/features/search/TMSearchResultsMenuItems.js +2 -2
  37. package/lib/components/features/tasks/TMTaskForm.d.ts +1 -0
  38. package/lib/components/features/tasks/TMTaskForm.js +61 -193
  39. package/lib/components/features/tasks/TMTaskFormUtils.d.ts +80 -0
  40. package/lib/components/features/tasks/TMTaskFormUtils.js +559 -0
  41. package/lib/components/features/tasks/TMTasksUtils.d.ts +3 -1
  42. package/lib/components/features/tasks/TMTasksUtils.js +46 -16
  43. package/lib/components/features/tasks/TMTasksUtilsView.d.ts +0 -7
  44. package/lib/components/features/tasks/TMTasksUtilsView.js +7 -14
  45. package/lib/components/features/tasks/TMTasksView.js +5 -3
  46. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +20 -3
  47. package/lib/components/features/workflow/TMWorkflowPopup.js +14 -92
  48. package/lib/components/features/workflow/diagram/ConnectionComponent.d.ts +1 -0
  49. package/lib/components/features/workflow/diagram/ConnectionComponent.js +6 -2
  50. package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
  51. package/lib/components/features/workflow/diagram/WFDiagram.js +75 -5
  52. package/lib/components/forms/Login/TMLoginForm.js +1 -1
  53. package/lib/components/forms/TMSaveForm.js +61 -13
  54. package/lib/components/grids/TMBlogsPost.js +8 -8
  55. package/lib/components/grids/TMBlogsPostUtils.js +2 -2
  56. package/lib/components/index.d.ts +2 -0
  57. package/lib/components/index.js +2 -0
  58. package/lib/components/pages/TMPage.js +4 -0
  59. package/lib/components/query/TMQueryEditor.d.ts +1 -0
  60. package/lib/components/query/TMQueryEditor.js +2 -2
  61. package/lib/helper/Enum_Localizator.js +5 -0
  62. package/lib/helper/GlobalStyles.js +3 -0
  63. package/lib/helper/SDKUI_Globals.d.ts +8 -0
  64. package/lib/helper/SDKUI_Globals.js +12 -0
  65. package/lib/helper/SDKUI_Localizator.d.ts +19 -3
  66. package/lib/helper/SDKUI_Localizator.js +182 -22
  67. package/lib/helper/TMIcons.d.ts +2 -1
  68. package/lib/helper/TMIcons.js +4 -1
  69. package/lib/helper/TMUtils.d.ts +5 -0
  70. package/lib/helper/TMUtils.js +10 -5
  71. package/lib/helper/helpers.d.ts +6 -2
  72. package/lib/helper/helpers.js +24 -8
  73. package/lib/helper/index.d.ts +1 -0
  74. package/lib/helper/index.js +1 -0
  75. package/lib/helper/queryHelper.js +1 -1
  76. package/lib/hooks/useBetaFeatures.d.ts +1 -0
  77. package/lib/hooks/useBetaFeatures.js +41 -0
  78. package/lib/hooks/useDcmtOperations.js +14 -2
  79. package/lib/hooks/useRelatedDocuments.js +34 -11
  80. package/lib/index.d.ts +1 -0
  81. package/lib/index.js +1 -0
  82. package/lib/services/platform_services.d.ts +1 -1
  83. package/lib/services/platform_services.js +4 -0
  84. package/package.json +2 -2
@@ -134,6 +134,8 @@ export const getStatusLocalizatorValues = () => {
134
134
  switch (status) {
135
135
  case Task_States.Completed:
136
136
  return ({ value: status, display: SDKUI_Localizator.Completed });
137
+ case Task_States.Closed:
138
+ return ({ value: status, display: SDKUI_Localizator.Closed });
137
139
  case Task_States.Deferred:
138
140
  return ({ value: status, display: SDKUI_Localizator.Postponed });
139
141
  case Task_States.InProgress:
@@ -151,6 +153,8 @@ export const getStatusLocalizatorValue = (status) => {
151
153
  switch (status) {
152
154
  case Task_States.Completed:
153
155
  return SDKUI_Localizator.Completed;
156
+ case Task_States.Closed:
157
+ return SDKUI_Localizator.Closed;
154
158
  case Task_States.Deferred:
155
159
  return SDKUI_Localizator.Postponed;
156
160
  case Task_States.InProgress:
@@ -179,7 +183,8 @@ export const getTaskNotPersonalAssignedToMe = (tasks) => {
179
183
  .filter((task) => task.fromID !== undefined &&
180
184
  task.fromID !== userID &&
181
185
  task.toID === userID &&
182
- task.state !== Task_States.Completed)
186
+ task.state !== Task_States.Completed &&
187
+ task.state !== Task_States.Closed)
183
188
  .sort((a, b) => {
184
189
  if (!a.endTime && !b.endTime)
185
190
  return 0;
@@ -196,7 +201,8 @@ export const getTaskPersonalAssignedToMe = (tasks) => {
196
201
  .filter((task) => task.fromID !== undefined &&
197
202
  task.fromID === userID &&
198
203
  task.toID === userID &&
199
- task.state !== Task_States.Completed)
204
+ task.state !== Task_States.Completed &&
205
+ task.state !== Task_States.Closed)
200
206
  .sort((a, b) => {
201
207
  if (!a.endTime && !b.endTime)
202
208
  return 0;
@@ -216,7 +222,8 @@ export const getTaskNotCompletedAssignedByMe = (tasks) => {
216
222
  return tasks
217
223
  .filter((task) => task.toID !== undefined &&
218
224
  task.toID !== userID &&
219
- task.state !== Task_States.Completed).sort((a, b) => {
225
+ task.state !== Task_States.Completed &&
226
+ task.state !== Task_States.Closed).sort((a, b) => {
220
227
  if (!a.endTime && !b.endTime)
221
228
  return 0;
222
229
  if (!a.endTime)
@@ -226,6 +233,24 @@ export const getTaskNotCompletedAssignedByMe = (tasks) => {
226
233
  return a.endTime.getTime() - b.endTime.getTime();
227
234
  });
228
235
  };
236
+ export const getTaskCompletedAssignedByMe = (tasks) => {
237
+ const userID = SDK_Globals.tmSession?.SessionDescr?.userID;
238
+ return tasks
239
+ .filter((task) => task.toID !== undefined &&
240
+ task.toID !== userID &&
241
+ task.state === Task_States.Completed)
242
+ .sort((a, b) => {
243
+ // Task senza lastUpdateTime li mettiamo alla fine
244
+ if (!a.lastUpdateTime && !b.lastUpdateTime)
245
+ return 0;
246
+ if (!a.lastUpdateTime)
247
+ return 1; // a va dopo
248
+ if (!b.lastUpdateTime)
249
+ return -1; // b va dopo
250
+ // Ordine decrescente: più recente prima
251
+ return b.lastUpdateTime.getTime() - a.lastUpdateTime.getTime();
252
+ });
253
+ };
229
254
  export const getHeaderStatusFilterConfig = () => ({
230
255
  enabled: true,
231
256
  dataSource: getStatusLocalizatorValues().map(item => ({
@@ -297,7 +322,10 @@ newTasks // Array of new tasks to merge
297
322
  return Array.from(taskMap.values());
298
323
  };
299
324
  export const getOriginLabel = (pdg, ID1Name) => {
300
- let label = ID1Name ?? SDKUI_Localizator.NoSource;
325
+ if (!pdg) {
326
+ return SDKUI_Localizator.NoSource;
327
+ }
328
+ let label = ID1Name ?? '';
301
329
  try {
302
330
  if (typeof label === 'string' && label.length > 0) {
303
331
  // Rimuove: (TID: 123), (DID: 456), TID: 123, DID: 456
@@ -307,12 +335,11 @@ export const getOriginLabel = (pdg, ID1Name) => {
307
335
  }
308
336
  }
309
337
  catch {
310
- label = ID1Name ?? SDKUI_Localizator.NoSource;
338
+ // Se fallisce, mantieni label così com'è ('' se undefined)
311
339
  }
312
- // Se pdg esiste ritorna la label (anche se vuota), altrimenti ritorna sempre NoSource
313
- return pdg ? label : SDKUI_Localizator.NoSource;
340
+ return label;
314
341
  };
315
- export const taskValidatorAsync = async (taskDescriptor) => {
342
+ export const taskValidatorAsync = async (taskDescriptor, requestMoreInfo = false) => {
316
343
  let vil = [];
317
344
  // Validate task name
318
345
  if (!taskDescriptor.name || taskDescriptor.name === "")
@@ -331,13 +358,12 @@ export const taskValidatorAsync = async (taskDescriptor) => {
331
358
  // Validate that startTime is less than or equal to endTime
332
359
  if (taskDescriptor.startTime && taskDescriptor.endTime) {
333
360
  if (taskDescriptor.startTime > taskDescriptor.endTime) {
334
- vil.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.ErrorStartEndDate, `${SDKUI_Localizator.StartDateMustBeBeforeEndDate}`));
335
- }
336
- }
337
- // Validate that reminderTime is less than endTime
338
- if (taskDescriptor.remTime && taskDescriptor.endTime) {
339
- if (taskDescriptor.remTime >= taskDescriptor.endTime) {
340
- vil.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.ErrorEndRemDate, `${SDKUI_Localizator.ReminderDateMustBeBeforeEndDate}`));
361
+ if (requestMoreInfo) {
362
+ vil.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.ErrorStartEndDate, `${SDKUI_Localizator.ExpirationDateMustBeAfterCurrentDateTime}`));
363
+ }
364
+ else {
365
+ vil.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.ErrorStartEndDate, `${SDKUI_Localizator.StartDateMustBeBeforeEndDate}`));
366
+ }
341
367
  }
342
368
  }
343
369
  return vil;
@@ -404,6 +430,7 @@ export const formatDate = (date) => {
404
430
  // Return the formatted date string
405
431
  return `${day}/${month}/${year} ${hours}:${minutes}:${seconds}`;
406
432
  };
433
+ // Funzione per confrontare due ID e verificare se sono diversi
407
434
  export const areDifferentIDs = (fromID, userID) => {
408
435
  if (fromID && userID) {
409
436
  return fromID !== userID;
@@ -464,6 +491,7 @@ export const createTasksMenuItems = (taskDescriptor, showId, setShowId, showSear
464
491
  { icon: _jsx("span", { className: "dx-icon-product" }), name: SDKUI_Localizator.NewFemale, operationType: 'multiRow', onClick: (rowIds) => markAsStatus(getRowIdsAsArray(rowIds), Task_States.NotStarted) },
465
492
  { icon: _jsx("span", { className: "dx-icon-refresh" }), name: SDKUI_Localizator.InProgress, operationType: 'multiRow', onClick: (rowIds) => markAsStatus(getRowIdsAsArray(rowIds), Task_States.InProgress) },
466
493
  { icon: _jsx("span", { className: "dx-icon-check" }), name: SDKUI_Localizator.Completed, operationType: 'multiRow', onClick: (rowIds) => markAsStatus(getRowIdsAsArray(rowIds), Task_States.Completed) },
494
+ { icon: _jsx("span", { className: "dx-icon-imgarlock" }), name: SDKUI_Localizator.Closed, operationType: 'multiRow', onClick: (rowIds) => markAsStatus(getRowIdsAsArray(rowIds), Task_States.Closed) },
467
495
  { icon: _jsx("span", { className: "dx-icon-taskstop" }), name: SDKUI_Localizator.Pending, operationType: 'multiRow', onClick: (rowIds) => markAsStatus(getRowIdsAsArray(rowIds), Task_States.Waiting) },
468
496
  { icon: _jsx("span", { className: "dx-icon-clock" }), name: SDKUI_Localizator.Postponed, operationType: 'multiRow', onClick: (rowIds) => markAsStatus(getRowIdsAsArray(rowIds), Task_States.Deferred) }
469
497
  ]
@@ -616,6 +644,7 @@ export var FilterCategoryId;
616
644
  FilterCategoryId[FilterCategoryId["New"] = 1.2] = "New";
617
645
  FilterCategoryId[FilterCategoryId["InProgress"] = 1.3] = "InProgress";
618
646
  FilterCategoryId[FilterCategoryId["Completed"] = 1.4] = "Completed";
647
+ FilterCategoryId[FilterCategoryId["Closed"] = 1.45] = "Closed";
619
648
  FilterCategoryId[FilterCategoryId["Pending"] = 1.5] = "Pending";
620
649
  FilterCategoryId[FilterCategoryId["Postponed"] = 1.6] = "Postponed";
621
650
  FilterCategoryId[FilterCategoryId["Low"] = 2.1] = "Low";
@@ -627,10 +656,11 @@ export const filterTreeTask = (tasks, filtersApplied) => {
627
656
  [FilterCategoryId.AllStates]: (task) => !task.state || (Object.values(Task_States).includes(task.state)),
628
657
  [FilterCategoryId.AllPriorities]: (task) => !task.priority || (Object.values(Priorities).includes(task.priority)),
629
658
  [FilterCategoryId.NewAssignedActivities]: (task) => checkIfNew(task.fromID, task.isNew),
630
- [FilterCategoryId.Expiring]: (task) => task.state !== Task_States.Completed && task.endTime && taskIsExpiringSoon(task.endTime, task.remTime),
659
+ [FilterCategoryId.Expiring]: (task) => task.state !== Task_States.Completed && task.state !== Task_States.Closed && task.endTime && taskIsExpiringSoon(task.endTime, task.remTime),
631
660
  [FilterCategoryId.New]: (task) => task.state === undefined || task.state === Task_States.NotStarted,
632
661
  [FilterCategoryId.InProgress]: (task) => task.state === Task_States.InProgress,
633
662
  [FilterCategoryId.Completed]: (task) => task.state === Task_States.Completed,
663
+ [FilterCategoryId.Closed]: (task) => task.state === Task_States.Closed,
634
664
  [FilterCategoryId.Pending]: (task) => task.state === Task_States.Waiting,
635
665
  [FilterCategoryId.Postponed]: (task) => task.state === Task_States.Deferred,
636
666
  // Low = Low + Normal: Merged 'Low' and 'Normal' filters for backwards compatibility
@@ -29,11 +29,4 @@ export declare const treeFilterDataSource: (allTasks: Array<TaskDescriptor>) =>
29
29
  expanded?: boolean;
30
30
  tooltipContent?: ReactNode;
31
31
  }>;
32
- type RenderContextBlockParams = {
33
- condition: boolean;
34
- pdg: PdGs;
35
- label: string | undefined;
36
- isMobile: boolean;
37
- };
38
- export declare const renderContextBlock: ({ condition, pdg, label, isMobile }: RenderContextBlockParams) => JSX.Element | null;
39
32
  export {};
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { useState } from "react";
3
3
  import { PdGs, Priorities, SDK_Globals, Task_States } from '@topconsultnpm/sdk-ts';
4
4
  import { Extended_Task_States, FilterCategoryId, filterTreeTask, gotoPDGExtendedLabel, prioritiesResourceData, taskIsExpiringSoon } from "./TMTasksUtils";
5
- import { getPdgsIconMap, SDKUI_Localizator, TMConditionalWrapper } from "../../../helper";
5
+ import { getPdgsIconMap, SDKUI_Localizator } from "../../../helper";
6
6
  import { FormModes } from "../../../ts";
7
7
  import TMTooltip from "../../base/TMTooltip";
8
8
  const taskStateIconClassMap = () => {
@@ -11,6 +11,7 @@ const taskStateIconClassMap = () => {
11
11
  [Task_States.NotStarted, "dx-icon-product"],
12
12
  [Task_States.InProgress, "dx-icon-refresh"],
13
13
  [Task_States.Completed, "dx-icon-check"],
14
+ [Task_States.Closed, "dx-icon-imgarlock"],
14
15
  [Task_States.Waiting, "dx-icon-taskstop"],
15
16
  [Task_States.Deferred, "dx-icon-clock"],
16
17
  ]);
@@ -21,6 +22,7 @@ export const taskStateIconMap = (fontSize = 20) => {
21
22
  [Task_States.NotStarted, _jsx("i", { style: { fontSize }, className: taskStateIconClassMap().get(Task_States.NotStarted) }, "Task_States-NotStarted")],
22
23
  [Task_States.InProgress, _jsx("i", { style: { fontSize }, className: taskStateIconClassMap().get(Task_States.InProgress) }, "Task_States-InProgress")],
23
24
  [Task_States.Completed, _jsx("i", { style: { fontSize }, className: taskStateIconClassMap().get(Task_States.Completed) }, "Task_States-Completed")],
25
+ [Task_States.Closed, _jsx("i", { style: { fontSize }, className: taskStateIconClassMap().get(Task_States.Closed) }, "Task_States-Closed")],
24
26
  [Task_States.Waiting, _jsx("i", { style: { fontSize }, className: taskStateIconClassMap().get(Task_States.Waiting) }, "Task_States-Waiting")],
25
27
  [Task_States.Deferred, _jsx("i", { style: { fontSize }, className: taskStateIconClassMap().get(Task_States.Deferred) }, "Task_States-Deferred")]
26
28
  ]);
@@ -35,8 +37,8 @@ export const calculateNumberOfDays = (startTime, endTime) => {
35
37
  };
36
38
  export const renderTaskIcons = (taskData) => {
37
39
  const { stateLabel, stateTooltipLabel, pdg, ID1Name, endTime, remTime, isNew, numberOfDays } = taskData;
38
- return (_jsxs("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [_jsx(TMTooltip, { content: stateTooltipLabel, children: _jsx("div", { className: "task-icon", children: taskStateIconMap().get(stateLabel) }) }), (stateLabel !== Task_States.Completed && endTime && taskIsExpiringSoon(endTime, remTime)) &&
39
- _jsx(TMTooltip, { content: SDKUI_Localizator.Expiring, children: _jsx("i", { className: "dx-icon-warning task-icon" }) }), _jsx(TMTooltip, { content: gotoPDGExtendedLabel(false, pdg ?? PdGs.None, ID1Name), children: _jsx("div", { className: "task-icon", style: {
40
+ return (_jsxs("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [_jsx(TMTooltip, { content: stateTooltipLabel, children: _jsx("div", { className: "task-icon", children: taskStateIconMap().get(stateLabel) }) }), (stateLabel !== Task_States.Completed && stateLabel !== Task_States.Closed && endTime && taskIsExpiringSoon(endTime, remTime)) &&
41
+ _jsx(TMTooltip, { content: SDKUI_Localizator.Expiring, children: _jsx("i", { className: "dx-icon-warning task-icon", style: { fontSize: 20 } }) }), _jsx(TMTooltip, { content: gotoPDGExtendedLabel(false, pdg ?? PdGs.None, ID1Name), children: _jsx("div", { className: "task-icon", style: {
40
42
  marginLeft: pdg === PdGs.CF || pdg === PdGs.WG ? "-4px" : undefined,
41
43
  marginRight: pdg === PdGs.CF || pdg === PdGs.WG ? "-4px" : undefined,
42
44
  }, children: getPdgsIconMap().get(pdg) }) }), numberOfDays > 1 &&
@@ -106,6 +108,7 @@ export const treeFilterDataSource = (allTasks) => {
106
108
  const newNotStartedLength = filterTreeTask(allTasks, [FilterCategoryId.New]).length ?? 0;
107
109
  const inProgressLength = filterTreeTask(allTasks, [FilterCategoryId.InProgress]).length ?? 0;
108
110
  const completedLength = filterTreeTask(allTasks, [FilterCategoryId.Completed]).length ?? 0;
111
+ const closedLength = filterTreeTask(allTasks, [FilterCategoryId.Closed]).length ?? 0;
109
112
  const pendingLength = filterTreeTask(allTasks, [FilterCategoryId.Pending]).length ?? 0;
110
113
  const postponedLength = filterTreeTask(allTasks, [FilterCategoryId.Postponed]).length ?? 0;
111
114
  const lowLength = filterTreeTask(allTasks, [FilterCategoryId.Low]).length ?? 0;
@@ -120,6 +123,7 @@ export const treeFilterDataSource = (allTasks) => {
120
123
  { id: FilterCategoryId.New, label: SDKUI_Localizator.NewFemale + " (" + newNotStartedLength + ")", value: Task_States.NotStarted, categoryId: FilterCategoryId.AllStates },
121
124
  { id: FilterCategoryId.InProgress, label: SDKUI_Localizator.InProgress + " (" + inProgressLength + ")", value: Task_States.InProgress, categoryId: FilterCategoryId.AllStates },
122
125
  { id: FilterCategoryId.Completed, label: SDKUI_Localizator.Completed + " (" + completedLength + ")", value: Task_States.Completed, categoryId: FilterCategoryId.AllStates },
126
+ { id: FilterCategoryId.Closed, label: SDKUI_Localizator.Closed + " (" + closedLength + ")", value: Task_States.Closed, categoryId: FilterCategoryId.AllStates },
123
127
  { id: FilterCategoryId.Pending, label: SDKUI_Localizator.Pending + " (" + pendingLength + ")", value: Task_States.Waiting, categoryId: FilterCategoryId.AllStates },
124
128
  { id: FilterCategoryId.Postponed, label: SDKUI_Localizator.Postponed + " (" + postponedLength + ")", value: Task_States.Deferred, categoryId: FilterCategoryId.AllStates },
125
129
  // Low = Low + Normal for backwards compatibility with version 5
@@ -127,14 +131,3 @@ export const treeFilterDataSource = (allTasks) => {
127
131
  { id: FilterCategoryId.High, label: SDKUI_Localizator.High + " (" + highLength + ")", value: Priorities.High, categoryId: FilterCategoryId.AllPriorities },
128
132
  ];
129
133
  };
130
- export const renderContextBlock = ({ condition, pdg, label, isMobile }) => {
131
- if (!condition || !label)
132
- return null;
133
- return (_jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: (children) => (_jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children })), children: _jsx("div", { style: {
134
- width: isMobile ? '100%' : '50%',
135
- display: 'flex',
136
- alignItems: 'center',
137
- color: "#2559A5",
138
- marginTop: 10
139
- }, children: _jsxs(TMTooltip, { content: label, children: [_jsx("span", { children: getPdgsIconMap().get(pdg) }), "\u00A0", _jsx("span", { children: label })] }) }) }));
140
- };
@@ -5,7 +5,7 @@ import { TabPanel, Item } from 'devextreme-react/tab-panel';
5
5
  import { Priorities, ResultTypes, SDK_Globals, Task_States } from "@topconsultnpm/sdk-ts";
6
6
  import { calculateNumberOfDays, renderTaskIcons } from "./TMTasksUtilsView";
7
7
  import { getPriorityLocalizatorValue } from "../tasks/TMTasksUtils";
8
- import { calcResponsiveSizes, getExceptionMessage, SDKUI_Localizator, StyledTabItem, TMCountBadge } from "../../../helper";
8
+ import { getExceptionMessage, SDKUI_Localizator, StyledTabItem, taskModalSizes, TMCountBadge } from "../../../helper";
9
9
  import { useDeviceType } from "../../base/TMDeviceProvider";
10
10
  import { FormModes } from "../../../ts";
11
11
  import TMDataGrid from "../../base/TMDataGrid";
@@ -195,6 +195,7 @@ const TMTasksView = (props) => {
195
195
  }
196
196
  await deleteTaskByIdsCallback(deletedTaskIds);
197
197
  handleSelectionChange([]);
198
+ handleFocusedRowChange(undefined);
198
199
  setWaitPanelTextPrimary('');
199
200
  setWaitPanelMaxValuePrimary(0);
200
201
  setWaitPanelValuePrimary(0);
@@ -254,6 +255,7 @@ const TMTasksView = (props) => {
254
255
  }
255
256
  await getAllTasks().then(() => {
256
257
  handleSelectionChange([]);
258
+ handleFocusedRowChange(undefined);
257
259
  setWaitPanelTextPrimary('');
258
260
  setWaitPanelMaxValuePrimary(0);
259
261
  setWaitPanelValuePrimary(0);
@@ -460,7 +462,7 @@ const TMTasksView = (props) => {
460
462
  },
461
463
  {
462
464
  dataField: "name",
463
- caption: SDKUI_Localizator.Name,
465
+ caption: SDKUI_Localizator.Subject,
464
466
  dataType: 'string',
465
467
  cellRender: cellDefaultRender,
466
468
  headerCellRender: (e) => _jsx(RenderCustomHeader, { data: e }),
@@ -545,7 +547,7 @@ const TMTasksView = (props) => {
545
547
  _jsxs(_Fragment, { children: [activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, false, true), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, false, true), activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, false, true)] }) : '' }), _jsx(Item, { title: SDKUI_Localizator.AllFemale, icon: "fields", tabRender: (params) => {
546
548
  return _jsxs(StyledTabItem, { "$isSelected": activeTabIndex === AssignedTab.All, children: [_jsxs(TMTooltip, { content: SDKUI_Localizator.AllFemale, children: [_jsx("i", { className: `dx-icon-${params.icon}` }), "\u00A0", params.title, " ", (allTasksFilteredCount > 0) ? `(${allTasksFilteredCount})` : ''] }), newTaskCount > 0 && (_jsx(TMTooltip, { content: SDKUI_Localizator.NewAssignedActivitiesNumber + ": " + newTaskCount, children: _jsx(TMCountBadge, { children: newTaskCount }) }))] });
547
549
  }, render: () => activeTabIndex === AssignedTab.All ?
548
- _jsxs(_Fragment, { children: [activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, true, true), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, true, true), activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, true, true)] }) : '' })] }) }), showTaskForm && _jsx(TMTaskForm, { id: currentTask?.id ?? -1, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), title: isContextualCreate ? SDKUI_Localizator.ContextualTask : SDKUI_Localizator.Widget_Activities, isModal: true, formMode: formMode ?? FormModes.Create, visualizedTasks: visualizedTasks, currentTask: currentTask, setCurrentTask: setCurrentTask, isContextualCreate: isContextualCreate, selectedRowKeys: selectedRowKeys, handleFocusedRowKeyChange: handleFocusedRowChange, taskContext: taskContext, usersList: usersList, onStatusChanged: () => { }, onClose: closeTaskFormCallback, onCancel: closeTaskFormCallback, showBackButton: false, onSaved: onSavedCallback, startDate: calendarStartDate, endDate: calendarEndDate, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGsWrapper, handleNavigateToDossiers: handleNavigateToDossiersWrapper }), _jsx("button", { style: {
550
+ _jsxs(_Fragment, { children: [activeComponent === TaskView.CALENDAR_TASK && getFromOrToCalendarElement(visualizedTasks, true, true), activeComponent === TaskView.AGENDA_TASK && getFromOrToAgendaElement(visualizedTasks, true, true), activeComponent === TaskView.LIST_TASK && getFromOrToDatagridElement(visualizedTasks, true, true)] }) : '' })] }) }), showTaskForm && _jsx(TMTaskForm, { id: currentTask?.id ?? -1, width: taskModalSizes(deviceType, formMode ?? FormModes.Create).width, height: taskModalSizes(deviceType, formMode ?? FormModes.Create).height, title: isContextualCreate ? SDKUI_Localizator.ContextualTask : SDKUI_Localizator.Widget_Activities, isModal: true, formMode: formMode ?? FormModes.Create, visualizedTasks: visualizedTasks, currentTask: currentTask, setCurrentTask: setCurrentTask, isContextualCreate: isContextualCreate, selectedRowKeys: selectedRowKeys, handleFocusedRowKeyChange: handleFocusedRowChange, taskContext: taskContext, usersList: usersList, onStatusChanged: () => { }, onClose: closeTaskFormCallback, onCancel: closeTaskFormCallback, showBackButton: false, onSaved: onSavedCallback, startDate: calendarStartDate, endDate: calendarEndDate, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGsWrapper, handleNavigateToDossiers: handleNavigateToDossiersWrapper }), _jsx("button", { style: {
549
551
  position: 'absolute',
550
552
  bottom: hasFilters ? '90px' : '18px',
551
553
  right: '20px',
@@ -1,4 +1,4 @@
1
- import { DcmtTypeDescriptor, WFDescriptor } from '@topconsultnpm/sdk-ts';
1
+ import { DcmtTypeDescriptor, HomeBlogPost, TaskDescriptor, WFDescriptor } from '@topconsultnpm/sdk-ts';
2
2
  import { DeviceType } from "../../base/TMDeviceProvider";
3
3
  import { WorkItemDetail } from "../../../ts";
4
4
  interface IWorkflowOperationButtonsProps {
@@ -14,6 +14,13 @@ interface IWorkflowOperationButtonsProps {
14
14
  onReject?: () => void;
15
15
  onReAssign?: () => void;
16
16
  onMoreInfo?: () => void;
17
+ allTasks?: Array<TaskDescriptor>;
18
+ getAllTasks?: () => Promise<void>;
19
+ deleteTaskByIdsCallback?: (deletedTaskIds: Array<number>) => Promise<void>;
20
+ addTaskCallback?: (task: TaskDescriptor) => Promise<void>;
21
+ editTaskCallback?: (task: TaskDescriptor) => Promise<void>;
22
+ handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
23
+ handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
17
24
  }
18
25
  export declare const WorkFlowOperationButtons: (props: IWorkflowOperationButtonsProps) => import("react/jsx-runtime").JSX.Element;
19
26
  export declare const WorkFlowApproveRejectPopUp: ({ TID, DID, deviceType, isReject, selectedItems, onClose, onCompleted }: {
@@ -63,11 +70,21 @@ export declare const WorkflowEndInstanceModal: ({ selectedInstances, onClose, on
63
70
  onClose?: () => void;
64
71
  onCompleted?: () => Promise<void>;
65
72
  }) => import("react/jsx-runtime").JSX.Element;
66
- export declare const WorkFlowMoreInfoPopUp: ({ DID, TID, deviceType, onClose, onCompleted }: {
73
+ interface IWorkFlowMoreInfoPopUpProps {
74
+ fromDTD?: DcmtTypeDescriptor;
67
75
  TID?: number;
68
76
  DID?: number;
69
77
  deviceType?: DeviceType;
70
78
  onClose?: () => void;
71
79
  onCompleted?: () => Promise<void>;
72
- }) => import("react/jsx-runtime").JSX.Element;
80
+ allTasks?: Array<TaskDescriptor>;
81
+ getAllTasks?: () => Promise<void>;
82
+ deleteTaskByIdsCallback?: (deletedTaskIds: Array<number>) => Promise<void>;
83
+ addTaskCallback?: (task: TaskDescriptor) => Promise<void>;
84
+ editTaskCallback?: (task: TaskDescriptor) => Promise<void>;
85
+ handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
86
+ handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
87
+ triggerBlogRefresh?: () => Promise<void>;
88
+ }
89
+ export declare const WorkFlowMoreInfoPopUp: (props: IWorkFlowMoreInfoPopUpProps) => import("react/jsx-runtime").JSX.Element | undefined;
73
90
  export {};
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useState } from "react";
3
- import { Priorities, ResultTypes, SDK_Globals, SDK_Localizator, TaskEngine, UserListCacheService, ValidationItem, WFEvents, WorkflowCacheService } from '@topconsultnpm/sdk-ts';
3
+ import { SDK_Globals, UserListCacheService, WFEvents, WorkflowCacheService } from '@topconsultnpm/sdk-ts';
4
4
  import styled from "styled-components";
5
- import { SDKUI_Localizator, IconApply, IconCloseOutline, IconUser, IconInfo, DateDisplayTypes, TASK_MORE_INFO_PREFIX_NAME, IconSignaturePencil, isSign4TopEnabled, IconCheck, IconCloseCircle, IconStop } from "../../../helper";
5
+ import { SDKUI_Localizator, IconApply, IconCloseOutline, IconUser, IconInfo, IconSignaturePencil, isSign4TopEnabled, IconCheck, IconCloseCircle, IconStop, taskModalSizes } from "../../../helper";
6
6
  import { TMColors } from "../../../utils/theme";
7
7
  import TMButton from "../../base/TMButton";
8
8
  import { DeviceType } from "../../base/TMDeviceProvider";
@@ -10,11 +10,9 @@ import TMModal from "../../base/TMModal";
10
10
  import { TMExceptionBoxManager } from "../../base/TMPopUp";
11
11
  import TMSpinner from "../../base/TMSpinner";
12
12
  import TMUserChooser from "../../choosers/TMUserChooser";
13
- import TMTextBox from "../../editors/TMTextBox";
14
- import TMTextArea from "../../editors/TMTextArea";
15
- import TMDropDown from "../../editors/TMDropDown";
16
- import TMDateBox from "../../editors/TMDateBox";
17
13
  import ShowAlert from "../../base/TMAlert";
14
+ import { FormModes } from "../../../ts";
15
+ import TMTaskForm from "../tasks/TMTaskForm";
18
16
  const StyledWorkFlowOperationButtonsContainer = styled.div `
19
17
  display: flex;
20
18
  align-items: center;
@@ -64,7 +62,7 @@ const StyledHorizontalContainer = styled.div `
64
62
  /* align-items: flex-end; */
65
63
  `;
66
64
  export const WorkFlowOperationButtons = (props) => {
67
- const { dtd = undefined, deviceType = DeviceType.DESKTOP, approveDisable = false, signApproveDisable = false, rejectDisable = false, reassignDisable = false, infoDisable = false, onApprove, onSignApprove, onReject, onReAssign, onMoreInfo } = props;
65
+ const { dtd = undefined, deviceType = DeviceType.DESKTOP, approveDisable = false, signApproveDisable = false, rejectDisable = false, reassignDisable = false, infoDisable = false, onApprove, onSignApprove, onReject, onReAssign, onMoreInfo, } = props;
68
66
  const isMobile = deviceType === DeviceType.MOBILE;
69
67
  // Calcola direttamente se è un workflow di firma per evitare flickering durante il render
70
68
  const isSignWorkflow = useMemo(() => {
@@ -282,68 +280,20 @@ export const WorkflowEndInstanceModal = ({ selectedInstances, onClose, onComplet
282
280
  : `${SDKUI_Localizator.WorkflowEndInstance} (${selectedInstances.length} istanze)`;
283
281
  return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx("div", { style: { fontWeight: 600, marginBottom: '8px' }, children: "Motivazione (obbligatorio):" }), _jsx(StyledTextArea, { "$isValid": !disable, value: commentValue, onChange: (e) => setCommentValue(e.target.value), placeholder: "Inserisci il motivo della terminazione...", maxLength: 200 }), _jsxs(CharacterCounter, { children: [commentValue.length, "/200"] })] }), _jsx(StyledModalFooter, { children: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconStop, {}), caption: SDKUI_Localizator.WorkflowEndInstance, width: '150px', disabled: disable, onClick: () => !disable && endInstancesAsync(), advancedColor: TMColors.error }) })] }) }));
284
282
  };
285
- export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceType.DESKTOP, onClose, onCompleted }) => {
283
+ export const WorkFlowMoreInfoPopUp = (props) => {
284
+ const { fromDTD, DID = 0, TID = 0, deviceType = DeviceType.DESKTOP, onClose, onCompleted, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, triggerBlogRefresh } = props;
285
+ const taskContext = useMemo(() => ({ document: { tid: TID, did: DID, name: `${fromDTD?.name ?? '-'} (DID: ${DID})` } }), [TID, DID, fromDTD?.id]);
286
286
  const [users, setUsers] = useState([]);
287
- const [task, setTask] = useState();
288
- const [taskOrig, setTaskOrig] = useState();
289
- const [validationItems, setValidationItems] = useState([]);
290
- const [nameInput, setNameInput] = useState(''); // State to hold the input value for the name
291
- const disable = validationItems.filter(o => o.ResultType === ResultTypes.ERROR).length > 0;
292
- const validatorMoreInfoAsync = async (taskDescriptor) => {
293
- let vil = [];
294
- // Validate task name
295
- if (!nameInput || nameInput === "")
296
- vil.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.Name, `${SDK_Localizator.RequiredField}`));
297
- // Validate name length (max 100)
298
- if (taskDescriptor.name && taskDescriptor.name.length > 100) {
299
- vil.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.Name, SDKUI_Localizator.ValueTooLong));
300
- }
301
- // Validate description length (max 200)
302
- if (taskDescriptor.description && taskDescriptor.description.length > 200) {
303
- vil.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.Description, SDKUI_Localizator.ValueTooLong));
304
- }
305
- // Validate toID
306
- if (!taskDescriptor.toID || taskDescriptor.toID <= 0)
307
- vil.push(new ValidationItem(ResultTypes.ERROR, SDKUI_Localizator.AssignedTo_Female, `${SDK_Localizator.RequiredField}`));
308
- return vil;
309
- };
310
- const requestMoreInfoAsync = async () => {
311
- try {
312
- TMSpinner.show();
313
- // Ensure the task name includes the prefix before sending
314
- const taskWithPrefix = {
315
- ...task,
316
- name: `${TASK_MORE_INFO_PREFIX_NAME}${nameInput}`
317
- };
318
- await SDK_Globals.tmSession?.NewWorkflowEngine().WorkItem_MoreInfoAsync(TID, DID, taskWithPrefix);
319
- ShowAlert({ mode: 'success', position: 'TOP_RIGHT', title: SDKUI_Localizator.MoreInformation, message: SDKUI_Localizator.MoreInfoSent, duration: 3000 });
320
- }
321
- catch (e) {
322
- TMExceptionBoxManager.show({ exception: e });
323
- }
324
- finally {
325
- onCompleted?.();
326
- onClose?.();
327
- TMSpinner.hide();
328
- }
287
+ const onSaved = async (newTask) => {
288
+ await getAllTasks?.();
289
+ await triggerBlogRefresh?.();
290
+ await onCompleted?.();
291
+ onClose?.();
329
292
  };
330
293
  useEffect(() => {
331
294
  const fetchData = async () => {
332
295
  TMSpinner.show({ description: SDKUI_Localizator.LoadingParticipants });
333
296
  try {
334
- let newTask = TaskEngine.NewTaskDescriptor();
335
- newTask.toID = 0;
336
- // Initialize nameInput from task.name if it exists and remove the prefix
337
- const initialName = newTask.name?.startsWith(TASK_MORE_INFO_PREFIX_NAME)
338
- ? newTask.name.substring(TASK_MORE_INFO_PREFIX_NAME.length)
339
- : newTask.name || '';
340
- setNameInput(initialName);
341
- // Set task name with prefix for internal state consistency if needed by validation,
342
- // or ensure validation handles it correctly. For now, we'll keep nameInput for the TMTextBox.
343
- newTask.name = `${TASK_MORE_INFO_PREFIX_NAME}${initialName}`;
344
- setTask(newTask);
345
- setTaskOrig(structuredClone(newTask));
346
- validatorMoreInfoAsync(newTask);
347
297
  // Recupera tutti gli utenti (tranne me)
348
298
  const allUsers = await UserListCacheService.GetAllAsync();
349
299
  const filteredUsers = allUsers.filter(u => u.id !== SDK_Globals.tmSession?.SessionDescr?.userID);
@@ -360,33 +310,5 @@ export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
360
310
  return;
361
311
  fetchData();
362
312
  }, [TID]);
363
- useEffect(() => {
364
- if (!task)
365
- return;
366
- validatorMoreInfoAsync(task).then((vil) => setValidationItems(vil));
367
- }, [task]);
368
- const getPriorityLocalizatorValues = () => {
369
- // Filtered enum for Low and High values
370
- const filteredPriorities = { Low: Priorities.Low, High: Priorities.High };
371
- return Object.values(filteredPriorities).map(priority => {
372
- switch (priority) {
373
- case Priorities.High:
374
- return ({ value: priority, display: SDKUI_Localizator.High });
375
- default:
376
- return ({ value: priority, display: SDKUI_Localizator.Low });
377
- }
378
- });
379
- };
380
- return (_jsx(TMModal, { title: SDKUI_Localizator.MoreInformation, onClose: onClose, width: deviceType === DeviceType.MOBILE ? '95%' : '640px', height: deviceType === DeviceType.MOBILE ? '60%' : '440px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx(TMUserChooser, { width: "250px", label: SDKUI_Localizator.RequestTo, dataSource: users, values: task?.toID ? [task.toID] : [], validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.AssignedTo_Female), onValueChanged: (IDs) => {
381
- if (IDs === undefined)
382
- return;
383
- setTask({ ...task ?? {}, toID: IDs?.[0] });
384
- } }), _jsx(TMTextBox, { label: SDKUI_Localizator.Subject, value: nameInput, isModifiedWhen: nameInput !== (taskOrig?.name?.startsWith(TASK_MORE_INFO_PREFIX_NAME) ? taskOrig.name.substring(TASK_MORE_INFO_PREFIX_NAME.length) : taskOrig?.name || ''), autoFocus: true, maxLength: 100 - TASK_MORE_INFO_PREFIX_NAME.length, onValueChanged: (e) => {
385
- const newValue = e.target.value;
386
- setNameInput(newValue);
387
- // Update task.name with the prefix
388
- setTask({ ...task ?? {}, name: `${TASK_MORE_INFO_PREFIX_NAME}${newValue}` });
389
- }, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.Name) }), _jsx("p", { style: { fontStyle: 'italic', fontSize: '0.9rem' }, children: `${TASK_MORE_INFO_PREFIX_NAME}${nameInput}` }), _jsx(TMTextArea, { label: SDKUI_Localizator.Description, value: task?.description ?? '', rows: 2, maxLength: 200, isModifiedWhen: task?.description !== task?.description, onValueChanged: (e) => { setTask({ ...task ?? {}, description: e.target.value }); },
390
- // validationItems={validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.Description)}
391
- resize: false }), _jsxs(StyledHorizontalContainer, { children: [_jsx(TMDropDown, { label: SDKUI_Localizator.Priority, width: "250px", value: task?.priority, dataSource: getPriorityLocalizatorValues(), isModifiedWhen: task?.priority !== taskOrig?.priority, onValueChanged: (e) => setTask({ ...task ?? {}, priority: e?.target?.value }) }), _jsx(TMDateBox, { width: "250px", resetTimeToZeroOnKeyPress: false, padding: "10px 0px", label: SDKUI_Localizator.ByDate, dateDisplayType: DateDisplayTypes.DateTime, value: task?.endTime, isModifiedWhen: task?.endTime !== taskOrig?.endTime, onValueChange: (value) => { setTask({ ...task ?? {}, endTime: value }); }, showClearButton: true })] })] }), _jsx(StyledModalFooter, { children: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconUser, { fontSize: 16 }), caption: SDKUI_Localizator.Request, disabled: disable, onClick: () => !disable && requestMoreInfoAsync(), advancedColor: TMColors.tertiary }) })] }) }));
313
+ return (getAllTasks && deleteTaskByIdsCallback && addTaskCallback && editTaskCallback && handleNavigateToWGs && handleNavigateToDossiers && (_jsx(TMTaskForm, { taskContext: taskContext, id: -1, showBackButton: false, width: taskModalSizes(deviceType, FormModes.Create).width, height: taskModalSizes(deviceType, FormModes.Create).height, title: SDKUI_Localizator.MoreInformation, isModal: true, formMode: FormModes.Create, requestMoreInfo: true, isContextualCreate: true, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, visualizedTasks: [], currentTask: null, selectedRowKeys: [], onClose: onClose, usersList: users, onSaved: onSaved })));
392
314
  };
@@ -9,6 +9,7 @@ interface ConnectionComponentProps {
9
9
  onClick: (id: string, event: React.MouseEvent) => void;
10
10
  onDoubleClick: (id: string) => void;
11
11
  onConnectionEndpointMouseDown?: (connectionId: string, endpointType: 'source' | 'sink', mouseEvent: React.MouseEvent) => void;
12
+ onContextMenu?: (id: string, event: React.MouseEvent) => void;
12
13
  }
13
14
  declare const _default: React.NamedExoticComponent<ConnectionComponentProps>;
14
15
  export default _default;
@@ -37,7 +37,7 @@ const StyledSquareConnector = styled.rect `
37
37
  stroke-width: 1;
38
38
  pointer-events: all;
39
39
  `;
40
- const ConnectionComponent = ({ connection, isSelected, sourcePoint, sinkPoint, isTemporary, onClick, onDoubleClick, onConnectionEndpointMouseDown }) => {
40
+ const ConnectionComponent = ({ connection, isSelected, sourcePoint, sinkPoint, isTemporary, onClick, onDoubleClick, onConnectionEndpointMouseDown, onContextMenu }) => {
41
41
  const connectionColor = getConnectionColor(connection.OutputStatus);
42
42
  // Funzione per renderizzare la forma della freccia
43
43
  const renderArrow = useCallback((arrowType, angle) => {
@@ -82,7 +82,11 @@ const ConnectionComponent = ({ connection, isSelected, sourcePoint, sinkPoint, i
82
82
  event.stopPropagation();
83
83
  onDoubleClick?.(connection.ID);
84
84
  }, [onDoubleClick, connection.ID]);
85
- return (_jsxs("g", { children: [_jsx(StyledPathHitArea, { d: connection.PathGeometry, onClick: (e) => onClick(connection.ID, e), onDoubleClick: handleDoubleClick }), _jsx(StyledPath, { d: connection.PathGeometry, "$isSelected": isSelected, "$isTemporary": isTemporary, "$outputStatus": connection.OutputStatus, onClick: (e) => onClick(connection.ID, e), onDoubleClick: handleDoubleClick }), connection.SinkArrowSymbol !== ArrowSymbol.None && (_jsxs("g", { transform: calculateArrowTransform(true), children: [renderArrow(connection.SinkArrowSymbol, 0), " "] })), connection.SourceArrowSymbol !== ArrowSymbol.None && (_jsx("g", { transform: calculateArrowTransform(false) + ' rotate(180)', children: renderArrow(connection.SourceArrowSymbol, 0) })), isSelected && (_jsxs(_Fragment, { children: [_jsx(StyledSquareConnector, { "$color": connectionColor, x: sourcePoint.x - 5, y: sourcePoint.y - 5, width: 10, height: 10 }), _jsx(StyledSquareConnector, { "$color": connectionColor, x: sinkPoint.x - 5, y: sinkPoint.y - 5, width: 10, height: 10, cursor: 'move', onMouseDown: (e) => {
85
+ const handleContextMenu = useCallback((event) => {
86
+ event.stopPropagation();
87
+ onContextMenu?.(connection.ID, event);
88
+ }, [onContextMenu, connection.ID]);
89
+ return (_jsxs("g", { children: [_jsx(StyledPathHitArea, { d: connection.PathGeometry, onClick: (e) => onClick(connection.ID, e), onDoubleClick: handleDoubleClick, onContextMenu: handleContextMenu }), _jsx(StyledPath, { d: connection.PathGeometry, "$isSelected": isSelected, "$isTemporary": isTemporary, "$outputStatus": connection.OutputStatus, onClick: (e) => onClick(connection.ID, e), onDoubleClick: handleDoubleClick, onContextMenu: handleContextMenu }), connection.SinkArrowSymbol !== ArrowSymbol.None && (_jsxs("g", { transform: calculateArrowTransform(true), children: [renderArrow(connection.SinkArrowSymbol, 0), " "] })), connection.SourceArrowSymbol !== ArrowSymbol.None && (_jsx("g", { transform: calculateArrowTransform(false) + ' rotate(180)', children: renderArrow(connection.SourceArrowSymbol, 0) })), isSelected && (_jsxs(_Fragment, { children: [_jsx(StyledSquareConnector, { "$color": connectionColor, x: sourcePoint.x - 5, y: sourcePoint.y - 5, width: 10, height: 10 }), _jsx(StyledSquareConnector, { "$color": connectionColor, x: sinkPoint.x - 5, y: sinkPoint.y - 5, width: 10, height: 10, cursor: 'move', onMouseDown: (e) => {
86
90
  e.stopPropagation(); // Impedisce la propagazione dell'evento a elementi sottostanti
87
91
  onConnectionEndpointMouseDown?.(connection.ID, 'sink', e);
88
92
  } })] }))] }));
@@ -392,7 +392,7 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
392
392
  };
393
393
  // Function to render Status-specific fields
394
394
  const renderStatusFields = () => {
395
- return (_jsx(TMDataListItemPicker, { dataListID: wf?.MStatusDLID, selectedValue: localItem.StatusValue, onItemSelect: handleStatusChange }));
395
+ return (_jsx(TMDataListItemPicker, { dataListID: wf?.MStatusDLID, selectedValue: localItem.StatusValue, onItemSelect: handleStatusChange, allowEdit: true }));
396
396
  };
397
397
  const renderAppFields = () => {
398
398
  return (_jsxs(_Fragment, { children: [_jsx(TMDropDown, { label: SDKUI_Localizator.WorkflowAppType, dataSource: APP_TYPES_DATASOURCE, value: localItem.AppType, isModifiedWhen: localItem.AppType !== localItemOrig.AppType, validationItems: validationItems.filter(v => v.PropertyName === DiagramItemProps.AppType), onValueChanged: (e) => { handleAppTypeChange(e.target.value); } }), localItem.AppType === WFAppTypes.EXE