Skip to content

Commit dbb2916

Browse files
committed
Merge remote-tracking branch 'origin/develop' into fix/uriPatternEditor-CMEM-6461
2 parents aa088ec + e2bb749 commit dbb2916

3 files changed

Lines changed: 21 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
3636
- `CodeAutocompleteField`:
3737
- Code editor resets to initial value on every code editor instance re-init
3838

39+
### Changed
40+
41+
- StickyNote data structure: Refactored position and dimension (breaking change)
42+
3943
## [24.0.1] - 2025-02-06
4044

4145
### Changed

src/extensions/react-flow/nodes/NodeContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type NodeContentHandleNextProps = HandleNextProps;
2222

2323
export type NodeContentHandleProps = NodeContentHandleLegacyProps | NodeContentHandleNextProps;
2424

25-
type NodeDimensions = {
25+
export type NodeDimensions = {
2626
width?: number;
2727
height?: number;
2828
};

src/extensions/react-flow/nodes/nodeUtils.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
import { CSSProperties } from "react";
2-
import { Node } from "react-flow-renderer";
2+
import {Node, XYPosition} from "react-flow-renderer";
33
import Color from "color";
4+
import {NodeDimensions} from "./NodeContent";
45

5-
type IStickyNote = {
6+
/** A sticky note for display in the UI as returned from the backend. */
7+
export interface StickyNote {
68
id: string;
79
content: string;
810
color: string;
9-
position: number[];
10-
dimension: number[];
11-
};
11+
position: XYPosition & NodeDimensions;
12+
}
1213

1314
/**
1415
* converts a react-flow node with
15-
* type = "stickynote" to IStickyNote type compatible with the backend
16+
* type = "stickynote" to StickyNote type compatible with the backend
1617
* @param node
17-
* @returns {IStickyNote}
18+
* @returns {StickyNote}
1819
*/
19-
const transformNodeToStickyNode = (node: Node<any>): IStickyNote => ({
20-
id: node.id,
21-
content: node.data.businessData.stickyNote!,
22-
position: [node.position.x, node.position.y],
23-
dimension: [node.data.nodeDimensions?.width!, node.data.nodeDimensions?.height!],
24-
color: node.data.style?.borderColor!,
25-
});
20+
const transformNodeToStickyNode = (node: Node<any>): StickyNote => {
21+
return {
22+
id: node.id,
23+
content: node.data.businessData.stickyNote!,
24+
position: {x: node.position.x, y: node.position.y, width: node.data.nodeDimensions?.width, height: node.data.nodeDimensions?.height},
25+
color: node.data.style?.borderColor!,
26+
}
27+
};
2628

2729
/**
2830
* takes in a hex color string and returns

0 commit comments

Comments
 (0)