@topconsultnpm/sdkui-react 6.20.0-dev3.16 → 6.20.0-dev3.17
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/base/TMPopUp.js +4 -0
- package/lib/components/choosers/TMDataListItemFields.js +1 -1
- package/lib/components/choosers/TMDataListItemPicker.d.ts +1 -0
- package/lib/components/choosers/TMDataListItemPicker.js +5 -1
- package/lib/components/features/workflow/diagram/DiagramItemForm.d.ts +2 -0
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +2 -2
- package/lib/components/features/workflow/diagram/WFDiagram.js +13 -1
- package/package.json +1 -1
|
@@ -258,6 +258,10 @@ const TMMessageBox = ({ resizable = false, onButtonClick, title = 'TopMedia', me
|
|
|
258
258
|
const el = document.getElementById('tm-messagebox-wrapper');
|
|
259
259
|
if (el)
|
|
260
260
|
el.style.zIndex = '20000';
|
|
261
|
+
// Blocca traduzione sul titolo
|
|
262
|
+
const titleEl = el?.querySelector('.dx-popup-title');
|
|
263
|
+
if (titleEl)
|
|
264
|
+
titleEl.setAttribute('translate', 'no');
|
|
261
265
|
}, onResizeEnd: handleResizeEnd, wrapperAttr: { id: 'tm-messagebox-wrapper' }, children: _jsx(ResponsiveMessageBody, { message: message, isMobile: isMobile, MessageToolbar: MessageToolbar, showToppy: showToppy }) }));
|
|
262
266
|
};
|
|
263
267
|
const TMExceptionBox = ({ resizable = false, exception, title = `${SDK_Globals.appModule} v. ${SDK_Globals.appVersion}`, onClose }) => {
|
|
@@ -56,6 +56,6 @@ const TMDataListItemFields = ({ item, originalItem, onItemChanged, validationIte
|
|
|
56
56
|
Object.assign(clone, item);
|
|
57
57
|
onItemChanged(clone);
|
|
58
58
|
};
|
|
59
|
-
return (_jsxs(FieldsContainer, { children: [_jsx(TMTextBox, { label: SDKUI_Localizator.Value, value: item.value, isModifiedWhen: (item.value || '') != (originalItem?.value || ''), validationItems: validationItems.filter(o => o.PropertyName === "value"), readOnly: readOnly, onValueChanged: handleValueChange }), _jsx(TMLocalizedTextBox, { label: SDKUI_Localizator.Description, value: item.name, isModifiedWhen: (item.name || '') != (originalItem?.name || ''), validationItems: validationItems.filter(o => o.PropertyName === "itemName"), readOnly: readOnly, value_IT: item.namesLoc?.it_IT, value_EN: item.namesLoc?.en_US, value_FR: item.namesLoc?.fr_FR, value_PT: item.namesLoc?.pt_PT, value_ES: item.namesLoc?.es_ES, value_DE: item.namesLoc?.de_DE, onValueChanged: handleLocalizedNameChange }), _jsx(TMImageIDChooser, { elementStyle: { marginBottom: '10px' }, label: "Immagine", value: item.imageID, isModifiedWhen: (item.imageID || '') != (originalItem?.imageID || ''), validationItems: validationItems.filter(o => o.PropertyName === "imageID"), readOnly: readOnly, onValueChanged: handleImageIDChange })] }));
|
|
59
|
+
return (_jsxs(FieldsContainer, { children: [_jsx(TMTextBox, { label: SDKUI_Localizator.Value, value: item.value, isModifiedWhen: (item.value || '') != (originalItem?.value || ''), validationItems: validationItems.filter(o => o.PropertyName === "value"), readOnly: readOnly, autoFocus: true, onValueChanged: handleValueChange }), _jsx(TMLocalizedTextBox, { label: SDKUI_Localizator.Description, value: item.name, isModifiedWhen: (item.name || '') != (originalItem?.name || ''), validationItems: validationItems.filter(o => o.PropertyName === "itemName"), readOnly: readOnly, value_IT: item.namesLoc?.it_IT, value_EN: item.namesLoc?.en_US, value_FR: item.namesLoc?.fr_FR, value_PT: item.namesLoc?.pt_PT, value_ES: item.namesLoc?.es_ES, value_DE: item.namesLoc?.de_DE, onValueChanged: handleLocalizedNameChange }), _jsx(TMImageIDChooser, { elementStyle: { marginBottom: '10px' }, label: "Immagine", value: item.imageID, isModifiedWhen: (item.imageID || '') != (originalItem?.imageID || ''), validationItems: validationItems.filter(o => o.PropertyName === "imageID"), readOnly: readOnly, onValueChanged: handleImageIDChange })] }));
|
|
60
60
|
};
|
|
61
61
|
export default TMDataListItemFields;
|
|
@@ -4,6 +4,7 @@ interface TMDataListItemPickerProps {
|
|
|
4
4
|
dataListID: number | undefined;
|
|
5
5
|
selectedValue: string | undefined;
|
|
6
6
|
onItemSelect: (item: DataListItemDescriptor) => void;
|
|
7
|
+
onItemEdited?: (originalItem: DataListItemDescriptor, editedItem: DataListItemDescriptor) => void;
|
|
7
8
|
allowEdit?: boolean;
|
|
8
9
|
}
|
|
9
10
|
declare const TMDataListItemPicker: React.FC<TMDataListItemPickerProps>;
|
|
@@ -128,7 +128,7 @@ const Label = styled.div `
|
|
|
128
128
|
font-weight: bold;
|
|
129
129
|
margin-bottom: 5px;
|
|
130
130
|
`;
|
|
131
|
-
const TMDataListItemPicker = ({ dataListID, selectedValue, onItemSelect, allowEdit = false }) => {
|
|
131
|
+
const TMDataListItemPicker = ({ dataListID, selectedValue, onItemSelect, onItemEdited, allowEdit = false }) => {
|
|
132
132
|
const [dataList, setDataList] = useState(undefined);
|
|
133
133
|
const [items, setItems] = useState([]);
|
|
134
134
|
const [loading, setLoading] = useState(true);
|
|
@@ -194,6 +194,10 @@ const TMDataListItemPicker = ({ dataListID, selectedValue, onItemSelect, allowEd
|
|
|
194
194
|
DataListCacheService.Remove();
|
|
195
195
|
// Ricarica i dati dalla cache (che richiamerà il server)
|
|
196
196
|
await loadDataList(false);
|
|
197
|
+
// Notifica il parent se un item esistente è stato modificato
|
|
198
|
+
if (!isCreating && editingItem) {
|
|
199
|
+
onItemEdited?.(editingItem, newItem);
|
|
200
|
+
}
|
|
197
201
|
handleCloseDialog();
|
|
198
202
|
}
|
|
199
203
|
catch (error) {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DiagramItem, WfInfo } from './interfaces';
|
|
3
|
+
import { DataListItemDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
4
|
interface DiagramItemFormProps {
|
|
4
5
|
itemToEdit: DiagramItem;
|
|
5
6
|
wf: WfInfo | null | undefined;
|
|
6
7
|
onClose: () => void;
|
|
7
8
|
onApply: (updatedItem: DiagramItem) => void;
|
|
9
|
+
onStatusItemEdited?: (originalItem: DataListItemDescriptor, editedItem: DataListItemDescriptor) => void;
|
|
8
10
|
}
|
|
9
11
|
declare const DiagramItemForm: React.FC<DiagramItemFormProps>;
|
|
10
12
|
export default DiagramItemForm;
|
|
@@ -83,7 +83,7 @@ const APP_TYPES_DATASOURCE = [
|
|
|
83
83
|
{ value: WFAppTypes.SP, display: "SP" },
|
|
84
84
|
{ value: WFAppTypes.REST, display: "REST" }
|
|
85
85
|
];
|
|
86
|
-
const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
86
|
+
const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply, onStatusItemEdited }) => {
|
|
87
87
|
const [localItem, setLocalItem] = useState(itemToEdit);
|
|
88
88
|
const [localItemOrig] = useState(structuredClone(itemToEdit));
|
|
89
89
|
const [validationItems, setValidationItems] = useState([]);
|
|
@@ -399,7 +399,7 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
|
399
399
|
};
|
|
400
400
|
// Function to render Status-specific fields
|
|
401
401
|
const renderStatusFields = () => {
|
|
402
|
-
return (_jsx(TMDataListItemPicker, { dataListID: wf?.MStatusDLID, selectedValue: localItem.StatusValue, onItemSelect: handleStatusChange, allowEdit: true }));
|
|
402
|
+
return (_jsx(TMDataListItemPicker, { dataListID: wf?.MStatusDLID, selectedValue: localItem.StatusValue, onItemSelect: handleStatusChange, onItemEdited: onStatusItemEdited, allowEdit: true }));
|
|
403
403
|
};
|
|
404
404
|
const renderAppFields = () => {
|
|
405
405
|
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
|
|
@@ -1643,6 +1643,18 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
1643
1643
|
const newDiagram = { ...wfDiagram, DiagramItems: updatedDiagramItems };
|
|
1644
1644
|
updateDiagram(newDiagram);
|
|
1645
1645
|
}, [wfDiagram, updateDiagram]);
|
|
1646
|
+
const handleStatusItemEdited = useCallback((originalItem, editedItem) => {
|
|
1647
|
+
if (!wfDiagram)
|
|
1648
|
+
return;
|
|
1649
|
+
const updatedDiagramItems = wfDiagram.DiagramItems.map(item => {
|
|
1650
|
+
if (item.Type === DiagramItemTypes.Status && item.StatusValue === originalItem.value) {
|
|
1651
|
+
return { ...item, ItemName: editedItem.name || '', StatusValue: editedItem.value };
|
|
1652
|
+
}
|
|
1653
|
+
return item;
|
|
1654
|
+
});
|
|
1655
|
+
const newDiagram = { ...wfDiagram, DiagramItems: updatedDiagramItems };
|
|
1656
|
+
updateDiagram(newDiagram);
|
|
1657
|
+
}, [wfDiagram, updateDiagram]);
|
|
1646
1658
|
const handleUpdateConnection = useCallback((updatedConnection) => {
|
|
1647
1659
|
setWfDiagram(prevDiagram => {
|
|
1648
1660
|
if (!prevDiagram)
|
|
@@ -1924,7 +1936,7 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
1924
1936
|
// Determina se questa è la connessione che stiamo trascinando
|
|
1925
1937
|
const isThisConnectionBeingDragged = isDraggingExistingConnectionEndpoint && draggingConnectionId === connection.ID;
|
|
1926
1938
|
return (_jsx(ConnectionComponent, { connection: connection, isSelected: selectedConnections.has(connection.ID), sourcePoint: sourcePoint, sinkPoint: sinkPoint, isTemporary: isThisConnectionBeingDragged, onClick: handleConnectionClick, onDoubleClick: handleDoubleClickConnection, onConnectionEndpointMouseDown: handleConnectionEndpointMouseDown, onContextMenu: handleConnectionContextMenu }, connection.ID));
|
|
1927
|
-
}), isDrawingConnection && tempConnectionPathData && (_jsx(TempConnectionPath, { d: tempConnectionPathData })), isDraggingExistingConnectionEndpoint && tempConnectionPathData && (_jsx(TempConnectionPath, { d: tempConnectionPathData })), isDrawingSelectionRect && currentSelectionRect && (_jsx(SelectionRect, { x: currentSelectionRect.x, y: currentSelectionRect.y, width: currentSelectionRect.width, height: currentSelectionRect.height }))] }) })) : (_jsx(DiagramMessage, { children: `${SDKUI_Localizator.WorkflowDiagramMissingOrInvalid} ...` })) }), isModalOpen && itemToEdit && (_jsx(DiagramItemForm, { itemToEdit: itemToEdit, wf: wfDiagram?.Info, onClose: handleCloseModal, onApply: handleUpdateDiagramItem })), isConnectionModalOpen && connectionToEdit && (_jsx(ConnectionForm, { connectionToEdit: connectionToEdit, onClose: () => setIsConnectionModalOpen(false), onApply: handleUpdateConnection })), _jsx(TMContextMenu, { items: connectionContextMenuItems, externalControl: {
|
|
1939
|
+
}), isDrawingConnection && tempConnectionPathData && (_jsx(TempConnectionPath, { d: tempConnectionPathData })), isDraggingExistingConnectionEndpoint && tempConnectionPathData && (_jsx(TempConnectionPath, { d: tempConnectionPathData })), isDrawingSelectionRect && currentSelectionRect && (_jsx(SelectionRect, { x: currentSelectionRect.x, y: currentSelectionRect.y, width: currentSelectionRect.width, height: currentSelectionRect.height }))] }) })) : (_jsx(DiagramMessage, { children: `${SDKUI_Localizator.WorkflowDiagramMissingOrInvalid} ...` })) }), isModalOpen && itemToEdit && (_jsx(DiagramItemForm, { itemToEdit: itemToEdit, wf: wfDiagram?.Info, onClose: handleCloseModal, onApply: handleUpdateDiagramItem, onStatusItemEdited: handleStatusItemEdited })), isConnectionModalOpen && connectionToEdit && (_jsx(ConnectionForm, { connectionToEdit: connectionToEdit, onClose: () => setIsConnectionModalOpen(false), onApply: handleUpdateConnection })), _jsx(TMContextMenu, { items: connectionContextMenuItems, externalControl: {
|
|
1928
1940
|
visible: contextMenuConnectionId !== null,
|
|
1929
1941
|
position: connectionContextMenuPosition,
|
|
1930
1942
|
onClose: closeConnectionContextMenu
|