Skip to content

Commit 257ec10

Browse files
committed
Merge remote-tracking branch 'origin/develop' into feature/newMappingSuggestion-CMEM-5433
2 parents 5c22939 + 924e2f3 commit 257ec10

9 files changed

Lines changed: 99 additions & 28 deletions

File tree

CHANGELOG.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
88

99
### Added
1010

11-
- `CntentGroup` component
11+
- `<ContentGroup />` component
1212
- Manage display of a grouped content section.
1313
- Add info, actions and context annotations by using its properties.
1414
- Can be nested into each other.
@@ -18,19 +18,30 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1818
- editor is focused on load if `autoFocus` prop is set to `true`
1919
- implemented support for `disabled` state in code editor
2020
- implemented support for `intent` states in code editor
21-
- `Label` component
21+
- `<Label />`
2222
- `additionalElements` property to display elements at the end of the label
2323
- `inline` property to display the label component as inline block
2424
- `<NodeContent />`
2525
- `resizeDirections` to specifiy the axis that can be used to resize the node
2626
- `resizeMaxDimensions` to add maximum values for resizing height/width
27+
- `<CardActions />`
28+
- `noWrap` property to display them without wrapping its children on multiple lines
29+
- `<SimpleDialog />`
30+
- `actionsProps` property to forward `CardActions` properties, e.g. `noWrap`
31+
- `<MenutItem />`
32+
- `tooltip` property to dislay tooltip on menu item label
33+
- `<NodeContent />`
34+
- `resizeDirections` to specifiy the axis that can be used to resize the node
35+
- `resizeMaxDimensions` to add maximum values for resizing height/width
2736
- New icons:
2837
- "item-magic-edit": icon for "magic" edit suggestions
2938
- "artefact-task-concatenatetofile": icon for "Concatenate to file" operator
3039

3140
### Fixed
3241

33-
- `<OverviewItemActions/>`
42+
- `<CodeAutocompleteField />`:
43+
- Code editor resets to initial value on every code editor instance re-init
44+
- `<OverviewItemActions />`
3445
- `hiddenInteractions` stay visible if they contain focused elements or opened overlays (e.g. context menus)
3546

3647
### Changed
@@ -39,6 +50,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
3950
- property color for `graph` configuration was adjusted
4051
- `<Switch />`
4152
- use always `<Label/>` component for `label` value
53+
- `<StickyNoteNode />`
54+
- Refactored data structure position and dimension (breaking change)
4255

4356
## [24.0.1] - 2025-02-06
4457

src/components/AutoSuggestion/AutoSuggestion.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ const AutoSuggestion = ({
219219
CodeAutocompleteFieldSuggestionWithReplacementInfo | undefined
220220
>(undefined);
221221
const [cm, setCM] = React.useState<EditorView>();
222+
const currentCm = React.useRef<EditorView>()
223+
currentCm.current = cm
222224
const isFocused = React.useRef(false);
223225
const autoSuggestionDivRef = React.useRef<HTMLDivElement>(null);
224226
/** Mutable editor state, since this needs to be current in scope of the SingleLineEditorComponent. */
@@ -235,12 +237,12 @@ const AutoSuggestion = ({
235237
const pathIsValid = validationResponse?.valid ?? true;
236238

237239
React.useEffect(() => {
238-
if (reInitOnInitialValueChange && initialValue != null && cm) {
240+
if (reInitOnInitialValueChange && initialValue != null && currentCm.current) {
239241
dispatch({
240-
changes: { from: 0, to: cm?.state?.doc.length, insert: initialValue },
242+
changes: { from: 0, to: currentCm.current.state?.doc.length, insert: initialValue },
241243
});
242244
}
243-
}, [initialValue, cm, reInitOnInitialValueChange]);
245+
}, [initialValue, reInitOnInitialValueChange]);
244246

245247
const setCurrentIndex = (newIndex: number) => {
246248
editorState.index = newIndex;

src/components/Card/CardActions.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ export interface CardActionsProps extends React.HTMLAttributes<HTMLDivElement> {
88
* Mainly used for cards used as modals (dialogs).
99
*/
1010
inverseDirection?: boolean;
11+
/**
12+
* Set footer to display its children on only one line.
13+
*/
14+
noWrap?: boolean;
1115
}
1216

1317
/**
@@ -18,6 +22,7 @@ export const CardActions = ({
1822
children,
1923
className = "",
2024
inverseDirection = false,
25+
noWrap = false,
2126
...otherProps
2227
}: CardActionsProps) => {
2328
return (
@@ -26,6 +31,7 @@ export const CardActions = ({
2631
className={
2732
`${eccgui}-card__actions` +
2833
(inverseDirection ? ` ${eccgui}-card__actions--inversedirection` : "") +
34+
(noWrap ? ` ${eccgui}-card__actions--nowrap` : "") +
2935
(className ? " " + className : "")
3036
}
3137
>

src/components/Card/card.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ $eccgui-size-card-spacing: $eccgui-size-typo-base !default;
236236
flex-direction: row-reverse;
237237
}
238238

239+
.#{$eccgui}-card__actions--nowrap {
240+
flex-wrap: nowrap;
241+
}
242+
239243
.#{$eccgui}-card__actions__aux {
240244
display: flex;
241245
flex-flow: row wrap;
@@ -272,4 +276,15 @@ $eccgui-size-card-spacing: $eccgui-size-typo-base !default;
272276
.#{$eccgui}-card__actions--inversedirection > & {
273277
justify-content: flex-start;
274278
}
279+
280+
.#{$eccgui}-card__actions--nowrap > & {
281+
flex-shrink: 5;
282+
flex-wrap: nowrap;
283+
min-width: 0;
284+
285+
& > * {
286+
flex-shrink: 10;
287+
min-width: 0;
288+
}
289+
}
275290
}

src/components/Dialog/SimpleDialog.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { CLASSPREFIX as eccgui } from "../../configuration/constants";
55
import IconButton from "../Icon/IconButton";
66
import { TestableComponent } from "../interfaces";
77

8-
import { Card, CardActions, CardContent, CardHeader, CardOptions, CardTitle } from "./../Card";
8+
import { Card, CardActions, CardActionsProps, CardContent, CardHeader, CardOptions, CardTitle } from "./../Card";
99
import Divider from "./../Separation/Divider";
1010
import Modal, { ModalProps } from "./Modal";
1111

@@ -45,6 +45,8 @@ export interface SimpleDialogProps extends ModalProps, TestableComponent {
4545
showFullScreenToggler?: boolean;
4646
/** Starts the modal in full screen mode. The show full screen toggler will be automatically enabled. */
4747
startInFullScreenMode?: boolean;
48+
/** Forward properties to the actions footer component. */
49+
actionsProps?: Omit<CardActionsProps, "inverseDirection">;
4850
}
4951

5052
/**
@@ -66,6 +68,7 @@ export const SimpleDialog = ({
6668
showFullScreenToggler = false,
6769
startInFullScreenMode = false,
6870
size,
71+
actionsProps,
6972
...otherProps
7073
}: SimpleDialogProps) => {
7174
const [displayFullscreen, setDisplayFullscreen] = React.useState<boolean>(startInFullScreenMode);
@@ -112,7 +115,11 @@ export const SimpleDialog = ({
112115
<CardContent className={`${eccgui}-dialog__notifications`}>{notifications}</CardContent>
113116
)}
114117
{actions && (
115-
<CardActions inverseDirection className={intentClassName}>
118+
<CardActions
119+
{...actionsProps}
120+
inverseDirection
121+
className={`${actionsProps?.className ?? ""} ${intentClassName}`}
122+
>
116123
{actions}
117124
</CardActions>
118125
)}

src/components/Menu/MenuItem.tsx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { openInNewTab } from "../../common/utils/openInNewTab";
55
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
66
import { ValidIconName } from "../Icon/canonicalIconNames";
77
import Icon from "../Icon/Icon";
8+
import Tooltip from "../Tooltip/Tooltip";
89

910
import { TestIconProps } from "./../Icon/TestIcon";
1011

@@ -15,16 +16,41 @@ export interface MenuItemProps
1516
* If set the icon is diplayed on the left side of the menu item.
1617
*/
1718
icon?: ValidIconName | string[] | React.ReactElement<TestIconProps>;
19+
/**
20+
* Submenu.
21+
*/
1822
children?: React.ReactNode;
23+
/**
24+
* Tooltip, but only added to the label, not to the full menu item.
25+
*/
26+
tooltip?: string | JSX.Element;
1927
}
2028

2129
/**
2230
* Single item, used as child inside `Menu`.
2331
*/
24-
export const MenuItem = ({ children, className = "", icon, onClick, href, ...restProps }: MenuItemProps) => {
32+
export const MenuItem = ({
33+
children,
34+
className = "",
35+
icon,
36+
onClick,
37+
href,
38+
text,
39+
tooltip,
40+
...restProps
41+
}: MenuItemProps) => {
2542
return (
2643
<BlueprintMenuItem
2744
{...restProps}
45+
text={
46+
tooltip ? (
47+
<Tooltip content={tooltip} fill>
48+
{text}
49+
</Tooltip>
50+
) : (
51+
text
52+
)
53+
}
2854
href={href}
2955
onClick={(e: React.MouseEvent<HTMLElement>) =>
3056
openInNewTab(e as React.MouseEvent<HTMLAnchorElement>, onClick, href)

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

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11218,10 +11218,10 @@ range-parser@^1.2.1:
1121811218
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031"
1121911219
integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==
1122011220

11221-
re-resizable@^6.10.1:
11222-
version "6.10.1"
11223-
resolved "https://registry.yarnpkg.com/re-resizable/-/re-resizable-6.10.1.tgz#d062ca50bbc4ec7ae940f756cba36479e9015bc5"
11224-
integrity sha512-m33nSWRH57UZLmep5M/LatkZ2NRqimVD/bOOpvymw5Zf33+eTSEixsUugscOZzAtK0/nx+OSuOf8VbKJx/4ptw==
11221+
re-resizable@^6.10.3:
11222+
version "6.11.2"
11223+
resolved "https://registry.yarnpkg.com/re-resizable/-/re-resizable-6.11.2.tgz#2e8f7119ca3881d5b5aea0ffa014a80e5c1252b3"
11224+
integrity sha512-2xI2P3OHs5qw7K0Ud1aLILK6MQxW50TcO+DetD9eIV58j84TqYeHoZcL9H4GXFXXIh7afhH8mv5iUCXII7OW7A==
1122511225

1122611226
react-app-polyfill@^3.0.0:
1122711227
version "3.0.0"

0 commit comments

Comments
 (0)