Skip to content

Commit ad360d9

Browse files
committed
adapted for react 18
1 parent b9fd1c0 commit ad360d9

48 files changed

Lines changed: 97 additions & 89 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@
9191
"lodash": "^4.17.21",
9292
"n3": "^1.25.1",
9393
"re-resizable": "^6.10.3",
94-
"react": "^16.13.1",
95-
"react-dom": "^16.13.1",
94+
"react": "^18.2.0",
95+
"react-dom": "^18.2.0",
9696
"react-flow-renderer": "9.7.4",
9797
"react-inlinesvg": "^3.0.3",
9898
"react-markdown": "^10.1.0",
@@ -178,7 +178,7 @@
178178
"react-dom": ">=16"
179179
},
180180
"resolutions": {
181-
"**/@types/react": "^17.0.85",
181+
"**/@types/react": "^18.2.0",
182182
"node-sass-package-importer/**/postcss": "^8.4.49",
183183
"string-width": "^4.2.3",
184184
"wrap-ansi": "^7.0.0",

src/cmem/ActivityControl/ActivityControlWidget.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ export interface ActivityControlWidgetProps extends TestableComponent {
2727
/**
2828
* The label to be shown
2929
*/
30-
label?: string | JSX.Element;
30+
label?: string | React.JSX.Element;
3131
/**
3232
* Element that wraps around the label.
3333
* Default: `<OverflowText inline={true} />`
3434
*/
35-
labelWrapper?: JSX.Element;
35+
labelWrapper?: React.JSX.Element;
3636
/**
3737
* To add tags in addition to the widget status description
3838
*/
39-
tags?: JSX.Element;
39+
tags?: React.JSX.Element;
4040
/**
4141
* The progress bar parameters if it should be show by a progres bar
4242
*/
@@ -80,7 +80,7 @@ export interface ActivityControlWidgetProps extends TestableComponent {
8080
/**
8181
* execution timer messages for waiting and running times.
8282
*/
83-
timerExecutionMsg?: JSX.Element | null;
83+
timerExecutionMsg?: React.JSX.Element | null;
8484
/**
8585
* additional actions that can serve as a complex component, positioned between the default actions and the context menu
8686
*/
@@ -146,7 +146,7 @@ export function ActivityControlWidget(props: ActivityControlWidgetProps) {
146146
keepColors
147147
>
148148
{progressSpinnerFinishedIcon ? (
149-
React.cloneElement(progressSpinnerFinishedIcon as JSX.Element, { small, large: !small })
149+
React.cloneElement(progressSpinnerFinishedIcon as React.JSX.Element, { small, large: !small })
150150
) : (
151151
<Spinner
152152
position="inline"

src/cmem/ActivityControl/ActivityExecutionErrorReportModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface ActivityExecutionErrorReportModalProps {
88
// Called when the close button is clicked
99
onDiscard: () => any;
1010
// The error report
11-
report: JSX.Element;
11+
report: React.JSX.Element;
1212
// Value of the download button
1313
downloadButtonValue: string;
1414
// Value of the close button

src/cmem/ActivityControl/SilkActivityControl.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ const progressBreakpointAnimation = 99;
1515

1616
export interface SilkActivityControlProps extends TestableComponent {
1717
// The label of this activity
18-
label: string | JSX.Element;
18+
label: string | React.JSX.Element;
1919
/**
2020
* To add tags in addition to the widget status description
2121
*/
22-
tags?: JSX.Element;
22+
tags?: React.JSX.Element;
2323
// Initial state
2424
initialStatus?: SilkActivityStatusProps;
2525
// Register a function in order to receive callbacks
@@ -80,7 +80,7 @@ export interface SilkActivityControlLayoutProps {
8080
// what type of progrss display should be uses, horizontal progress bar, circular spinner, or none of that
8181
visualization?: "none" | "progressbar" | "spinner";
8282
// wrapper around label
83-
labelWrapper?: JSX.Element;
83+
labelWrapper?: React.JSX.Element;
8484
}
8585

8686
const defaultLayout: SilkActivityControlLayoutProps = {
@@ -94,7 +94,7 @@ interface IErrorReportAction {
9494
// The title of the error report modal
9595
title?: string;
9696
// The element that will be rendered in the modal, either as Markdown or object
97-
renderReport: (report: string | SilkActivityExecutionReportProps) => JSX.Element;
97+
renderReport: (report: string | SilkActivityExecutionReportProps) => React.JSX.Element;
9898
// What version of the report should be handed to the renderReport function, if false SilkActivityExecutionReportProps, if true the Markdown string
9999
renderMarkdown: boolean;
100100
// The function to fetch the error report. It returns undefined if something went wrong.

src/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface StringPreviewContentBlobTogglerProps
2121
/** Allows to add non-string elements at the end of the content if the full description is shown, i.e. no toggler is necessary.
2222
* This allows to add non-string elements to both the full-view content and the pure string content.
2323
*/
24-
noTogglerContentSuffix?: JSX.Element;
24+
noTogglerContentSuffix?: React.JSX.Element;
2525
}
2626

2727
/** Version of the content toggler for text only content. */

src/cmem/react-flow/configuration/graph.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
import { NodeProps } from "react-flow-renderer";
12
import { EdgeBezier } from "./../../../extensions/react-flow/edges/EdgeBezier";
23
import { NodeDefault } from "./../../../extensions/react-flow/nodes/NodeDefault";
34
import { GRAPH_NODE_TYPES } from "./typing";
4-
//import {ComponentType} from "react";
5-
//import {NodeProps} from "react-flow-renderer-lts";
65

76
const edgeTypes = {
87
default: EdgeBezier,
@@ -16,7 +15,7 @@ const edgeTypes = {
1615
danger: EdgeBezier,
1716
};
1817

19-
const nodeTypes: Record<GRAPH_NODE_TYPES, React.ReactNode /*& ComponentType<NodeProps>*/> = {
18+
const nodeTypes: Record<GRAPH_NODE_TYPES, React.ComponentType<NodeProps>> = {
2019
default: NodeDefault,
2120
graph: NodeDefault,
2221
class: NodeDefault,

src/cmem/react-flow/configuration/linking.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { EdgeStep } from "./../../../extensions/react-flow/edges/EdgeStep";
22
import { NodeDefault } from "./../../../extensions/react-flow/nodes/NodeDefault";
33
import { StickyNoteNode } from "./../nodes/StickyNoteNode";
44
import { LINKING_NODE_TYPES } from "./typing";
5-
//import {ComponentType} from "react";
6-
//import {NodeProps} from "react-flow-renderer-lts";
5+
import {NodeProps} from "react-flow-renderer";
76

87
const edgeTypes = {
98
default: EdgeStep,
@@ -14,7 +13,7 @@ const edgeTypes = {
1413
danger: EdgeStep,
1514
};
1615

17-
const nodeTypes: Record<LINKING_NODE_TYPES, React.ReactNode /*& ComponentType<NodeProps>*/> = {
16+
const nodeTypes: Record<LINKING_NODE_TYPES, React.ComponentType<NodeProps> /*& ComponentType<NodeProps>*/> = {
1817
default: NodeDefault,
1918
sourcepath: NodeDefault,
2019
targetpath: NodeDefault,

src/cmem/react-flow/configuration/workflow.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { EdgeStep } from "./../../../extensions/react-flow/edges/EdgeStep";
22
import { NodeDefault } from "./../../../extensions/react-flow/nodes/NodeDefault";
33
import { StickyNoteNode } from "./../nodes/StickyNoteNode";
44
import { WORKFLOW_NODE_TYPES } from "./typing";
5-
//import {ComponentType} from "react";
6-
//import {NodeProps} from "react-flow-renderer-lts";
5+
import {NodeProps} from "react-flow-renderer";
76

87
const edgeTypes = {
98
default: EdgeStep,
@@ -12,7 +11,7 @@ const edgeTypes = {
1211
danger: EdgeStep,
1312
};
1413

15-
const nodeTypes: Record<WORKFLOW_NODE_TYPES, React.ReactNode /*& ComponentType<NodeProps>*/> = {
14+
const nodeTypes: Record<WORKFLOW_NODE_TYPES, React.ComponentType<NodeProps>> = {
1615
default: NodeDefault,
1716
dataset: NodeDefault,
1817
linking: NodeDefault,

src/components/Accordion/AccordionItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface AccordionItemProps
1818
/**
1919
* header of accordion item
2020
*/
21-
label: string | JSX.Element;
21+
label: string | React.JSX.Element;
2222
/**
2323
* use full available width for content
2424
*/

src/components/Application/ApplicationSidebarNavigation.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ import { SideNav as CarbonSideNav, SideNavProps as CarbonSideNavProps } from "@c
44
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
55

66
export interface ApplicationSidebarNavigationProps
7-
extends Omit<CarbonSideNavProps, "ref" | "defaultExpanded" | "isPersistent" | "isFixedNav" | "isChildOfHeader">,
8-
React.HTMLAttributes<HTMLElement> {}
7+
extends Omit<CarbonSideNavProps, "ref" | "defaultExpanded" | "isPersistent" | "isFixedNav" | "isChildOfHeader"| "onToggle"> {
8+
children: React.ReactNode;
9+
className?: string;
10+
onToggle?: any //todo change later
11+
}
912

1013
export const ApplicationSidebarNavigation = ({
1114
children,
1215
className = "",
1316
...otherCarbonSideNavProps
1417
}: ApplicationSidebarNavigationProps) => {
18+
1519
return (
1620
<CarbonSideNav
1721
className={`${eccgui}-application__menu__sidebar ${className}`}

0 commit comments

Comments
 (0)