@topconsultnpm/sdkui-react-beta 6.16.95 → 6.16.97
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/search/TMSearchResultsMenuItems.js +3 -3
- package/lib/components/features/workflow/diagram/WFDiagram.js +3 -28
- package/lib/components/features/workflow/diagram/workflowHelpers.d.ts +2 -1
- package/lib/components/features/workflow/diagram/workflowHelpers.js +40 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +2 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { AccessLevels, AccessLevelsEx, AppModules, FileFormats, LayoutModes, SDK_Globals } from '@topconsultnpm/sdk-ts-beta';
|
|
3
|
-
import { IconActivity, IconArchiveDoc, IconBatchUpdate,
|
|
3
|
+
import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCheckIn, IconCircleInfo, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconEdit, IconExportTo, IconFileDots, IconHide, IconInfo, IconPlatform, IconPreview, IconRelation, IconSearch, IconShow, IconSignature, IconStar, IconSubstFile, IconUndo, IconUserGroupOutline, SDKUI_Localizator, svgToString } from '../../../helper';
|
|
4
4
|
import ShowAlert from '../../base/TMAlert';
|
|
5
5
|
import { TMMessageBoxManager, ButtonNames, TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
6
6
|
import TMSpinner from '../../base/TMSpinner';
|
|
@@ -224,14 +224,14 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
224
224
|
disabled: disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem),
|
|
225
225
|
items: [
|
|
226
226
|
{
|
|
227
|
-
icon: svgToString(_jsx(
|
|
227
|
+
icon: svgToString(_jsx(IconCircleInfo, {})),
|
|
228
228
|
text: SDKUI_Localizator.SignatureInformation,
|
|
229
229
|
operationType: 'singleRow',
|
|
230
230
|
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
231
231
|
onClick: () => signatureInformationCallback(isMobile, getSelectedDcmtsOrFocused(selectedItems, focusedItem))
|
|
232
232
|
},
|
|
233
233
|
{
|
|
234
|
-
icon: svgToString(_jsx(
|
|
234
|
+
icon: svgToString(_jsx(IconCheckIn, {})),
|
|
235
235
|
text: SDKUI_Localizator.VerifySignature,
|
|
236
236
|
operationType: 'multiRow',
|
|
237
237
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
@@ -7,7 +7,7 @@ import { CultureIDs, SearchEngine, WFAppTypes, WorkItemStatus } from "@topconsul
|
|
|
7
7
|
import ConnectionComponent from './ConnectionComponent';
|
|
8
8
|
import DiagramItemComponent from './DiagramItemComponent';
|
|
9
9
|
import DiagramItemSvgContent from './DiagramItemSvgContent';
|
|
10
|
-
import { calculateArrowAngle, downloadFile, getConnectionPoint, isConnectionNonLinear, validateDiagram } from './workflowHelpers';
|
|
10
|
+
import { calculateArrowAngle, downloadFile, getConnectionPoint, getNewWfDiagram, isConnectionNonLinear, validateDiagram } from './workflowHelpers';
|
|
11
11
|
import { IconFlowChart, IconUndo, IconRestore, IconAdjust, IconCopy, IconCut, IconPaste, IconPin, IconUnpin, IconChevronRight, IconCloseOutline, IconNew, SDKUI_Localizator, generateUUID, IconExport, IconImport, IconWindowMaximize, IconZoomIn, IconZoomOut, IconPencil, IconLock } from '../../../../helper';
|
|
12
12
|
import { ButtonNames, TMExceptionBoxManager, TMMessageBoxManager } from '../../../base/TMPopUp';
|
|
13
13
|
import { StyledLoadingContainer, StyledSpinner } from '../../../base/Styled';
|
|
@@ -548,33 +548,8 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
548
548
|
const handleNew = useCallback(() => {
|
|
549
549
|
if (isReadOnly)
|
|
550
550
|
return;
|
|
551
|
-
const
|
|
552
|
-
|
|
553
|
-
Left: 100,
|
|
554
|
-
Top: 100,
|
|
555
|
-
Width: 64,
|
|
556
|
-
Height: 64,
|
|
557
|
-
Type: DiagramItemTypes.Start,
|
|
558
|
-
ItemName: '',
|
|
559
|
-
Description: '',
|
|
560
|
-
};
|
|
561
|
-
const endItem = {
|
|
562
|
-
ID: generateUUID(),
|
|
563
|
-
Left: 300,
|
|
564
|
-
Top: 100,
|
|
565
|
-
Width: 64,
|
|
566
|
-
Height: 64,
|
|
567
|
-
Type: DiagramItemTypes.End,
|
|
568
|
-
ItemName: '',
|
|
569
|
-
Description: '',
|
|
570
|
-
};
|
|
571
|
-
const newWfDiagram = {
|
|
572
|
-
DiagramItems: [startItem, endItem],
|
|
573
|
-
Connections: [],
|
|
574
|
-
Info: wfDiagram?.Info || null,
|
|
575
|
-
};
|
|
576
|
-
setWfDiagram(newWfDiagram);
|
|
577
|
-
initialDiagramRef.current = newWfDiagram;
|
|
551
|
+
const newWfDiagram = getNewWfDiagram(wfDiagram?.Info || null);
|
|
552
|
+
updateDiagram(newWfDiagram);
|
|
578
553
|
setWfDiagramHistory([newWfDiagram]);
|
|
579
554
|
setHistoryIndex(0);
|
|
580
555
|
setSelectedItems(new Set());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WorkItemStatus } from '@topconsultnpm/sdk-ts-beta';
|
|
2
|
-
import { Point, Rect, DiagramItem, WfDiagram, TextDimensions, Connection } from './interfaces';
|
|
2
|
+
import { Point, Rect, DiagramItem, WfDiagram, TextDimensions, Connection, WfInfo } from './interfaces';
|
|
3
3
|
/**
|
|
4
4
|
* Calculates the angle in degrees of an arrow based on two points.
|
|
5
5
|
* @param prevPoint The previous point on the trajectory.
|
|
@@ -66,3 +66,4 @@ export declare const calculateDiagramItemFullDimensions: (item: DiagramItem, tex
|
|
|
66
66
|
export declare const getConnectionColor: (status: WorkItemStatus) => string;
|
|
67
67
|
export declare const validateDiagram: (diagram: WfDiagram, newConnection?: Connection) => void;
|
|
68
68
|
export declare const downloadFile: (data: string, filename: string, type: string) => void;
|
|
69
|
+
export declare const getNewWfDiagram: (info: WfInfo | null) => WfDiagram;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { WorkItemStatus } from '@topconsultnpm/sdk-ts-beta';
|
|
2
|
-
import { DiagramItemTypes } from './interfaces'; // Assicurati che il percorso sia corretto
|
|
2
|
+
import { DiagramItemTypes, ArrowSymbol } from './interfaces'; // Assicurati che il percorso sia corretto
|
|
3
|
+
import { generateUUID } from '../../../../helper';
|
|
3
4
|
/**
|
|
4
5
|
* Calculates the angle in degrees of an arrow based on two points.
|
|
5
6
|
* @param prevPoint The previous point on the trajectory.
|
|
@@ -253,3 +254,41 @@ export const downloadFile = (data, filename, type) => {
|
|
|
253
254
|
document.body.removeChild(a);
|
|
254
255
|
window.URL.revokeObjectURL(url);
|
|
255
256
|
};
|
|
257
|
+
export const getNewWfDiagram = (info) => {
|
|
258
|
+
const startItem = {
|
|
259
|
+
ID: generateUUID(),
|
|
260
|
+
Left: 100,
|
|
261
|
+
Top: 100,
|
|
262
|
+
Width: 64,
|
|
263
|
+
Height: 64,
|
|
264
|
+
Type: DiagramItemTypes.Start,
|
|
265
|
+
ItemName: '',
|
|
266
|
+
Description: '',
|
|
267
|
+
};
|
|
268
|
+
const endItem = {
|
|
269
|
+
ID: generateUUID(),
|
|
270
|
+
Left: 300,
|
|
271
|
+
Top: 100,
|
|
272
|
+
Width: 64,
|
|
273
|
+
Height: 64,
|
|
274
|
+
Type: DiagramItemTypes.End,
|
|
275
|
+
ItemName: '',
|
|
276
|
+
Description: '',
|
|
277
|
+
};
|
|
278
|
+
const newConnection = {
|
|
279
|
+
ID: generateUUID(),
|
|
280
|
+
Source: { ParentDiagramItem: { ID: startItem.ID }, ConnectorName: 'Right' },
|
|
281
|
+
Sink: { ParentDiagramItem: { ID: endItem.ID }, ConnectorName: 'Left' },
|
|
282
|
+
OutputStatus: WorkItemStatus.New,
|
|
283
|
+
Description: "New Connection",
|
|
284
|
+
PathGeometry: "",
|
|
285
|
+
SourceArrowSymbol: ArrowSymbol.None,
|
|
286
|
+
SinkArrowSymbol: ArrowSymbol.Arrow,
|
|
287
|
+
};
|
|
288
|
+
const newWfDiagram = {
|
|
289
|
+
DiagramItems: [startItem, endItem],
|
|
290
|
+
Connections: [newConnection],
|
|
291
|
+
Info: info,
|
|
292
|
+
};
|
|
293
|
+
return newWfDiagram;
|
|
294
|
+
};
|
|
@@ -92,4 +92,6 @@ export * from "./layout/panelManager/TMPanelWrapper";
|
|
|
92
92
|
export * from "./layout/panelManager/types";
|
|
93
93
|
export * from "./layout/panelManager/utils";
|
|
94
94
|
export * from "./features/workflow/diagram/WFDiagram";
|
|
95
|
+
export * from "./features/workflow/diagram/workflowHelpers";
|
|
96
|
+
export * from "./features/workflow/diagram/xmlParser";
|
|
95
97
|
export * from "./features/workflow/diagram/interfaces";
|
package/lib/components/index.js
CHANGED
|
@@ -112,4 +112,6 @@ export * from "./layout/panelManager/types";
|
|
|
112
112
|
export * from "./layout/panelManager/utils";
|
|
113
113
|
// workflow
|
|
114
114
|
export * from "./features/workflow/diagram/WFDiagram";
|
|
115
|
+
export * from "./features/workflow/diagram/workflowHelpers";
|
|
116
|
+
export * from "./features/workflow/diagram/xmlParser";
|
|
115
117
|
export * from "./features/workflow/diagram/interfaces";
|