Skip to content

Commit c7fc0ed

Browse files
committed
Aditional updates
Signed-off-by: Luciano Resende <[email protected]>
1 parent ab5f80a commit c7fc0ed

File tree

9 files changed

+894
-56
lines changed

9 files changed

+894
-56
lines changed

jest.config.base.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,13 @@ module.exports = {
2323
// Ignore snapshot tests.
2424
"!**/*.snap.test.{ts,tsx}",
2525
],
26+
transformIgnorePatterns: [
27+
"node_modules/(?!(uuid|@elyra/canvas)/)"
28+
],
29+
extensionsToTreatAsEsm: ['.ts', '.tsx'],
30+
globals: {
31+
'ts-jest': {
32+
useESM: true
33+
}
34+
}
2635
};

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,18 @@
3737
"eslint-plugin-testing-library": "^3.10.1",
3838
"husky": "^8.0.3",
3939
"jest": "^29.7.0",
40+
"jest-environment-jsdom": "^29.0.0",
4041
"lerna": "^8.0.1",
4142
"lint-staged": "^15.2.0",
4243
"microbundle": "^0.15.1",
4344
"prettier": "^3.1.1",
45+
"react": "^18.2.0",
46+
"react-dom": "^18.2.0",
4447
"rimraf": "~5.0.5",
4548
"start-server-and-test": "^2.0.3",
4649
"ts-jest": "^29.1.1",
47-
"typescript": "5.1.6"
50+
"typescript": "~5.5.4",
51+
"webpack": "^5.0.0"
4852
},
4953
"husky": {
5054
"hooks": {

packages/pipeline-editor/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"link": "yarn link"
2222
},
2323
"dependencies": {
24+
"@carbon/icons-react": "^10.44.0",
2425
"@elyra/canvas": "^12.23.2",
2526
"@elyra/pipeline-services": "^1.12.1",
2627
"@rjsf/core": "^4.2.3",
@@ -32,13 +33,14 @@
3233
"downshift": "^6.1.2",
3334
"immer": "^9.0.7",
3435
"nanoid": "^3.1.20",
35-
"react-dom": "^18.0.9",
36+
"react-dom": "^18.2.0",
3637
"react-intl": "^6.5.5",
3738
"react-redux": "^7.0.0",
38-
"redux": "^4.0.5",
39+
"redux": "^4.2.0",
3940
"styled-components": "^6.0.7"
4041
},
4142
"devDependencies": {
43+
"@testing-library/dom": "^7.21.4",
4244
"@testing-library/jest-dom": "^5.11.9",
4345
"@testing-library/react": "^13.4.0",
4446
"@testing-library/user-event": "^12.8.0",

packages/pipeline-editor/src/PalettePanel/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ interface Props {
105105
}
106106

107107
function PalettePanel({ nodes }: Props) {
108-
const handleDragStart = useCallback((e, node) => {
108+
const handleDragStart = useCallback((e: any, node: any) => {
109109
const evData = {
110110
operation: "addToCanvas",
111111
data: {

packages/pipeline-editor/src/PipelineEditor/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ const PipelineEditor = forwardRef(
235235
}
236236
// don't call to persist change because it will cause an infinity loop
237237
} catch (e) {
238-
onError?.(e);
238+
onError?.(e instanceof Error ? e : new Error(String(e)));
239239
}
240240
}, [palette, onError, pipeline, readOnly, theme.palette.error.main]);
241241

@@ -604,15 +604,15 @@ const PipelineEditor = forwardRef(
604604
);
605605

606606
const handlePropertiesChange = useCallback(
607-
(nodeID, data) => {
607+
(nodeID: string, data: any) => {
608608
controller.current.updateProperties(nodeID, data);
609609
onChange?.(controller.current.getPipelineFlow());
610610
},
611611
[onChange]
612612
);
613613

614614
const handlePipelinePropertiesChange = useCallback(
615-
(data) => {
615+
(data: any) => {
616616
const pipeline = controller.current.getPipelineFlow();
617617
if (pipeline?.pipelines?.[0]?.app_data) {
618618
pipeline.pipelines[0].app_data.properties = {
@@ -627,7 +627,7 @@ const PipelineEditor = forwardRef(
627627
);
628628

629629
const handlePipelineParametersChange = useCallback(
630-
(data) => {
630+
(data: any) => {
631631
const pipeline = controller.current.getPipelineFlow();
632632
if (pipeline?.pipelines?.[0]?.app_data) {
633633
pipeline.pipelines[0].app_data.properties = {

packages/pipeline-editor/src/ThemeProvider/index.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function mergeThemes(systemInfo: {
9595
};
9696
}
9797

98-
const ThemeProvider: React.FC<{ theme: DeepPartial<Theme> }> = ({
98+
const ThemeProvider: React.FC<{ theme: DeepPartial<Theme>; children?: React.ReactNode }> = ({
9999
theme,
100100
children,
101101
}) => {
@@ -104,9 +104,14 @@ const ThemeProvider: React.FC<{ theme: DeepPartial<Theme> }> = ({
104104
);
105105
};
106106

107-
export const InternalThemeProvider: React.FC = ({ children }) => {
107+
export const InternalThemeProvider: React.FC<{ children?: React.ReactNode }> = ({ children }) => {
108108
const systemInfo = useSystemInfo();
109-
const theme = useMemo(() => mergeThemes(systemInfo), [systemInfo]);
109+
const theme = useMemo(() => {
110+
return deepmerge<Theme>(
111+
{ ...defaultTheme, ...systemInfo },
112+
{} as DeepPartial<Theme>
113+
);
114+
}, [systemInfo]);
110115

111116
return (
112117
<StyledThemeProvider theme={theme}>

packages/pipeline-editor/src/ThemeProvider/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function deepmerge<T>(target: T, source: DeepPartial<T>) {
3232

3333
if (sVal !== undefined) {
3434
if (isPlainObject(sVal) && tVal !== undefined) {
35-
output[key] = deepmerge<typeof tVal>(tVal, sVal);
35+
output[key] = deepmerge<typeof tVal>(tVal, sVal as any);
3636
} else {
3737
output[key] = sVal as T[keyof T];
3838
}

packages/pipeline-services/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4-
"target": "es5",
4+
"target": "es2018",
55
"lib": ["esnext"],
66
"module": "commonjs",
77
"outDir": "dist",

0 commit comments

Comments
 (0)