@topconsultnpm/sdkui-react 6.20.0-dev1.43 → 6.20.0-dev1.44

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.
@@ -1,6 +1,18 @@
1
1
  import React from 'react';
2
2
  import { HomeBlogPost, LayoutModes, ObjectRef, SearchResultDescriptor, TaskDescriptor, ValidationItem } from '@topconsultnpm/sdk-ts';
3
3
  import { DcmtInfo, FormModes, MetadataValueDescriptorEx, TaskContext } from '../../../ts';
4
+ /**
5
+ * Definisce il contesto da cui è stato invocato il TMDcmtForm.
6
+ * Permette di gestire logiche diverse in base alla provenienza.
7
+ */
8
+ export declare enum InvocationContext {
9
+ /** Invocazione standard */
10
+ Default = "default",
11
+ /** Invocato dalla pagina Todo/Task */
12
+ Todo = "todo",
13
+ /** Invocato dalla pagina WorkflowCtrl */
14
+ WorkflowCtrl = "workflowCtrl"
15
+ }
4
16
  interface ITMDcmtFormProps {
5
17
  allTasks?: Array<TaskDescriptor>;
6
18
  getAllTasks?: () => Promise<void>;
@@ -24,7 +36,7 @@ interface ITMDcmtFormProps {
24
36
  canPrev?: boolean;
25
37
  isClosable?: boolean;
26
38
  groupId?: string;
27
- invokedByTodo?: boolean;
39
+ invocationContext?: InvocationContext;
28
40
  taskFormDialogComponent?: React.ReactNode;
29
41
  taskMoreInfo?: TaskDescriptor;
30
42
  showBackButton?: boolean;
@@ -46,9 +46,24 @@ import TMViewHistoryDcmt from '../search/TMViewHistoryDcmt';
46
46
  import TMDcmtCheckoutInfoForm from '../search/TMDcmtCheckoutInfoForm';
47
47
  import styled from 'styled-components';
48
48
  import { ContextMenu } from '../../NewComponents/ContextMenu';
49
+ //#region Interfaces, Types and Enums
50
+ /**
51
+ * Definisce il contesto da cui è stato invocato il TMDcmtForm.
52
+ * Permette di gestire logiche diverse in base alla provenienza.
53
+ */
54
+ export var InvocationContext;
55
+ (function (InvocationContext) {
56
+ /** Invocazione standard */
57
+ InvocationContext["Default"] = "default";
58
+ /** Invocato dalla pagina Todo/Task */
59
+ InvocationContext["Todo"] = "todo";
60
+ /** Invocato dalla pagina WorkflowCtrl */
61
+ InvocationContext["WorkflowCtrl"] = "workflowCtrl";
62
+ // Aggiungi qui altri contesti futuri secondo necessità
63
+ })(InvocationContext || (InvocationContext = {}));
49
64
  let abortControllerLocal = new AbortController();
50
65
  //#endregion
51
- const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, showHeader = true, onSaveRecents, layoutMode = LayoutModes.Update, showBackButton = true, onClose, onSavedAsyncCallback, TID, DID, formMode = FormModes.Update, canNext, canPrev, count, itemIndex, onNext, onPrev, allowNavigation = true, allowRelations = true, isClosable = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, showDcmtFormSidebar = true, invokedByTodo = false, titleModal, isModal = false, widthModal = "100%", heightModal = "100%", groupId, onWFOperationCompleted, onTaskCompleted, onTaskCreateRequest, inputFile = null, taskFormDialogComponent, taskMoreInfo, connectorFileSave = undefined, inputMids = [], openS4TViewer = false, onOpenS4TViewerRequest, s4TViewerDialogComponent, enableDragDropOverlay = false, passToSearch, isSharedDcmt = false, sharedSourceTID, sharedSourceDID, allowButtonsRefs = false, onReferenceClick, }) => {
66
+ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, showHeader = true, onSaveRecents, layoutMode = LayoutModes.Update, showBackButton = true, onClose, onSavedAsyncCallback, TID, DID, formMode = FormModes.Update, canNext, canPrev, count, itemIndex, onNext, onPrev, allowNavigation = true, allowRelations = true, isClosable = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, showDcmtFormSidebar = true, invocationContext = InvocationContext.Default, titleModal, isModal = false, widthModal = "100%", heightModal = "100%", groupId, onWFOperationCompleted, onTaskCompleted, onTaskCreateRequest, inputFile = null, taskFormDialogComponent, taskMoreInfo, connectorFileSave = undefined, inputMids = [], openS4TViewer = false, onOpenS4TViewerRequest, s4TViewerDialogComponent, enableDragDropOverlay = false, passToSearch, isSharedDcmt = false, sharedSourceTID, sharedSourceDID, allowButtonsRefs = false, onReferenceClick, }) => {
52
67
  const { showHistory, showHistoryCallback, hideHistoryCallback, showCheckoutInformationForm, commentFormState, hideCommentFormCallback, showCheckoutInformationFormCallback, hideCheckoutInformationFormCallback, copyCheckoutPathToClipboardCallback, handleCheckOutCallback, handleCheckInCallback, refreshPreviewTrigger, showCicoWaitPanel, cicoWaitPanelTitle, showCicoPrimaryProgress, cicoPrimaryProgressText, cicoPrimaryProgressValue, cicoPrimaryProgressMax, } = useCheckInOutOperations();
53
68
  const [id, setID] = useState('');
54
69
  const [showWaitPanelLocal, setShowWaitPanelLocal] = useState(false);
@@ -1307,7 +1322,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
1307
1322
  // Checks if there's a saved panel layout for the current context (ToDo or general)
1308
1323
  const hasSavedLayout = () => {
1309
1324
  const { setting } = getCurrentDcmtFormSetting();
1310
- if (invokedByTodo) {
1325
+ if (invocationContext === InvocationContext.Todo) {
1311
1326
  // If invoked by ToDo, check for existence of layoutToDo and that it has keys
1312
1327
  return setting.layoutToDo !== undefined && Object.keys(setting.layoutToDo).length > 0;
1313
1328
  }
@@ -1326,8 +1341,8 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
1326
1341
  // Prepare the new setting object with updated layout depending on context
1327
1342
  const newSetting = {
1328
1343
  TID: normalizedTID,
1329
- layout: invokedByTodo ? (existingSetting.layout ?? {}) : state,
1330
- layoutToDo: invokedByTodo ? state : (existingSetting.layoutToDo ?? {}),
1344
+ layout: invocationContext === InvocationContext.Todo ? (existingSetting.layout ?? {}) : state,
1345
+ layoutToDo: invocationContext === InvocationContext.Todo ? state : (existingSetting.layoutToDo ?? {}),
1331
1346
  };
1332
1347
  // Replace existing setting if found, otherwise push a new one
1333
1348
  if (idx >= 0) {
@@ -1346,7 +1361,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
1346
1361
  return undefined;
1347
1362
  const settings = getCurrentDcmtFormSetting()?.setting;
1348
1363
  // Return the appropriate layout based on context
1349
- return invokedByTodo ? settings?.layoutToDo : settings?.layout;
1364
+ return invocationContext === InvocationContext.Todo ? settings?.layoutToDo : settings?.layout;
1350
1365
  };
1351
1366
  const handleCompleteMoreInfo = useCallback(async () => {
1352
1367
  try {
@@ -1656,10 +1656,10 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
1656
1656
  }
1657
1657
  }, [wfDiagram]);
1658
1658
  const handleCanvasDoubleClick = useCallback((event) => {
1659
- if (isReadOnly) {
1659
+ if (isReadOnly && allowEdit) {
1660
1660
  toggleReadOnlyMode();
1661
1661
  }
1662
- }, [isReadOnly, toggleReadOnlyMode]);
1662
+ }, [isReadOnly, allowEdit, toggleReadOnlyMode]);
1663
1663
  const handleFullScreenKeyDown = useCallback((event) => {
1664
1664
  if (event.key === 'Escape') {
1665
1665
  // Blocca sempre la propagazione per evitare che TMSaveForm riceva l'evento
@@ -112,5 +112,6 @@ export * from "./features/workflow/diagram/WFDiagram";
112
112
  export * from "./features/workflow/diagram/workflowHelpers";
113
113
  export * from "./features/workflow/diagram/xmlParser";
114
114
  export * from "./features/workflow/diagram/interfaces";
115
+ export * from "./features/workflow/diagram/DiagramItemSvgContent";
115
116
  export { default as TMWizard } from './wizard/TMWizard';
116
117
  export * from './wizard/TMWizard';
@@ -133,6 +133,7 @@ export * from "./features/workflow/diagram/WFDiagram";
133
133
  export * from "./features/workflow/diagram/workflowHelpers";
134
134
  export * from "./features/workflow/diagram/xmlParser";
135
135
  export * from "./features/workflow/diagram/interfaces";
136
+ export * from "./features/workflow/diagram/DiagramItemSvgContent";
136
137
  // wizard
137
138
  export { default as TMWizard } from './wizard/TMWizard';
138
139
  export * from './wizard/TMWizard';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.20.0-dev1.43",
3
+ "version": "6.20.0-dev1.44",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",