Skip to content

Commit

Permalink
Sync with master
Browse files Browse the repository at this point in the history
  • Loading branch information
smouillour committed Oct 23, 2023
2 parents 14add4a + 96d6884 commit 8c6fd49
Show file tree
Hide file tree
Showing 52 changed files with 1,335 additions and 1,292 deletions.
22 changes: 22 additions & 0 deletions .changeset/blue-beds-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@talend/react-faceted-search': major
'@talend/design-system': major
'@talend/react-flow-designer': major
'@talend/router-bridge': major
'@talend/react-storybook-cmf': major
'@talend/react-bootstrap': major
'@talend/react-cmf-router': major
'@talend/react-components': major
'@talend/react-containers': major
'@talend/react-cmf-cqrs': major
'@talend/react-dataviz': major
'@talend/react-stepper': major
'@talend/react-forms': major
'@talend/icons': major
'@talend/react-sagas': major
'@talend/react-a11y': major
'@talend/http': major
'@talend/react-cmf': major
---

React: Upgrade to react 18 and @types/react 18
5 changes: 5 additions & 0 deletions .changeset/perfect-mayflies-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/design-system': patch
---

fix TypeError: popover.hide is not a function on close Popover
5 changes: 5 additions & 0 deletions .changeset/rare-needles-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/scripts-config-jest': minor
---

feat: mock revokeURL
6 changes: 3 additions & 3 deletions fork/react-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
"create-react-class": "^15.7.0",
"cross-env": "^7.0.3",
"lodash": "^4.17.21",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-test-renderer": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-test-renderer": "^18.2.0",
"sinon": "^11.1.2"
},
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions fork/react-bootstrap/src/Dropdown.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ describe('<Dropdown>', () => {
console.error = originalConsoleError;
});

it('menu is exclusive', () => {
xit('menu is exclusive', () => {
// when
render(
<Dropdown id="test">
Expand Down Expand Up @@ -409,7 +409,7 @@ describe('<Dropdown>', () => {
);
});

it('toggles are not exclusive', () => {
xit('toggles are not exclusive', () => {
// when
render(
<Dropdown id="test">
Expand All @@ -423,7 +423,7 @@ describe('<Dropdown>', () => {
expect(console.error).not.toBeCalled();
});

it('toggle is required', () => {
xit('toggle is required', () => {
// when
render(
<Dropdown id="test">
Expand Down Expand Up @@ -489,7 +489,7 @@ describe('<Dropdown>', () => {
expect(screen.getByTestId('menuRefSet')).toBeInTheDocument();
});

it('warns when a string ref is specified', () => {
xit('warns when a string ref is specified', () => {
// given
function RefDropdown() {
return (
Expand Down
4 changes: 2 additions & 2 deletions packages/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"@types/react-dom": "^17.0.20",
"date-fns": "^1.30.1",
"jest-in-case": "^1.0.2",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"peerDependencies": {
"react": ">= 16.14.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/cmf-cqrs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"@testing-library/react-hooks": "^8.0.1",
"mock-socket": "^9.3.1",
"prop-types": "^15.8.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redux-mock-store": "^1.5.4"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/cmf-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"@talend/scripts-core": "^15.0.0",
"@talend/scripts-config-babel": "^13.0.0",
"@talend/scripts-config-react-webpack": "^16.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redux-saga-tester": "^1.0.874"
},
"publishConfig": {
Expand Down
17 changes: 9 additions & 8 deletions packages/cmf/__tests__/bootstrap.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ReactDOM from 'react-dom';
import ReactDOM from 'react-dom/client';
import createSagaMiddleware from 'redux-saga';

import bootstrap, * as internals from '../src/bootstrap';
Expand All @@ -11,9 +11,12 @@ import storeAPI from '../src/store';
import sagas from '../src/sagas';
import onError from '../src/onError';

jest.mock('react-dom', () => ({
render: jest.fn(),
jest.mock('react-dom/client', () => ({
createRoot: jest.fn().mockImplementation(() => ({
render: jest.fn(),
})),
}));

jest.mock('redux-saga', () => ({
__esModule: true, // this property makes it work
default: (() => {
Expand Down Expand Up @@ -60,7 +63,7 @@ jest.mock('../src/store', () => ({
describe('bootstrap', () => {
beforeEach(() => {
onError.bootstrap.mockClear();
ReactDOM.render.mockClear();
jest.clearAllMocks();
});
describe('error management', () => {
it('should bootstrap onError', async () => {
Expand Down Expand Up @@ -205,11 +208,9 @@ describe('bootstrap', () => {
const options = {
root: div,
};
expect(ReactDOM.render).not.toHaveBeenCalled();
expect(ReactDOM.createRoot).not.toHaveBeenCalled();
await bootstrap(options);
expect(ReactDOM.render).toHaveBeenCalled();
const args = ReactDOM.render.mock.calls[0];
expect(args[1]).toBe(div);
expect(ReactDOM.createRoot).toHaveBeenCalled();
});
});
});
6 changes: 3 additions & 3 deletions packages/cmf/__tests__/cmfModule.merge.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable no-empty-function */
/* eslint-disable react/prop-types */
import { render, screen } from '@testing-library/react';
Expand All @@ -11,6 +10,7 @@ describe('mergeModule', () => {
beforeEach(() => {
// eslint-disable-next-line no-console
global.console = {
...originalLog,
warn: jest.fn(),
log: jest.fn(),
};
Expand Down Expand Up @@ -258,8 +258,8 @@ describe('mergeModule', () => {
};

// when
const { RootComponent } = mergeModules(module1, module2, module3);
render(<RootComponent />);
const cmfModule = mergeModules(module1, module2, module3);
render(<cmfModule.RootComponent />);

// then
const mod1 = screen.getByText('first');
Expand Down
4 changes: 2 additions & 2 deletions packages/cmf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
"jest-in-case": "^1.0.2",
"jsdoc": "^3.6.11",
"node-fetch": "^2.7.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redux-mock-store": "^1.5.4",
"redux-saga-tester": "^1.0.874"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/cmf/src/bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { render } from 'react-dom';
import ReactDOM from 'react-dom/client';
import createSagaMiddleware from 'redux-saga';
import { batchedSubscribe } from 'redux-batched-subscribe';
import { spawn } from 'redux-saga/effects';
Expand Down Expand Up @@ -150,7 +150,8 @@ export default async function bootstrap(appOptions = {}) {
if (options.render !== false) {
saga.run();

render(
const root = ReactDOM.createRoot(element);
root.render(
<App
store={store}
loading={options.AppLoader}
Expand All @@ -159,7 +160,6 @@ export default async function bootstrap(appOptions = {}) {
>
<RootComponent />
</App>,
element,
);
}

Expand Down
4 changes: 3 additions & 1 deletion packages/cmf/src/cmfModule.merge.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,13 @@ function composeComponents(RootComponent, NestedRootComponent) {
return NestedRootComponent;
}
// eslint-disable-next-line react/prop-types
return ({ children }) => (
const CMFComposition = ({ children }) => (
<RootComponent>
<NestedRootComponent>{children}</NestedRootComponent>
</RootComponent>
);
CMFComposition.displayName = 'CMFComposition';
return CMFComposition;
}

const MERGE_FNS = {
Expand Down
9 changes: 5 additions & 4 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,20 @@
"@types/jest": "^29.5.5",
"@types/lodash": "^4.14.198",
"@types/prop-types": "^15.7.5",
"@types/react": "^17.0.65",
"@types/react": "^18.2.8",
"@types/react-dom": "^18.2.4",
"cross-env": "^7.0.3",
"i18next": "^20.6.1",
"jest-in-case": "^1.0.2",
"jsdom": "^20.0.3",
"prop-types": "^15.8.1",
"react": "^17.0.2",
"react": "^18.2.0",
"react-a11y": "^0.3.4",
"react-dom": "^17.0.2",
"react-dom": "^18.2.0",
"react-router-dom": "~6.3.0",
"react-i18next": "^11.18.6",
"react-storybook-addon-props-combinations": "^1.1.0",
"react-test-renderer": "^17.0.2"
"react-test-renderer": "^18.2.0"
},
"peerDependencies": {
"@talend/design-system": "^7.15.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ exports[`ModelViewerLeaf should render ModelViewerLeaf 1`] = `
toto
</span>
</span>
<span
class="theme-tc-model-leaf-options tc-model-leaf-options"
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/Inject/Inject.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function Inject({ getComponent, component, ...props }: InjectProps) {
Inject.map = function injectMap(
getComponent: GetComponentType,
array: InjectConfig[],
CustomInject: (props: InjectProps) => JSX.Element | null = Inject,
CustomInject: FunctionComponent<InjectProps> = Inject,
): JSX.Element[] {
return array.map((props, index) => (
<CustomInject key={index} getComponent={getComponent} {...props} />
Expand Down Expand Up @@ -138,7 +138,7 @@ Inject.getAll = function injectGetAll(
*/
Inject.getReactElement = function getReactElement(
getComponent: GetComponentType,
data: InjectedComponentType | InjectedComponentType[] | InjectConfig,
data: InjectedComponentType | InjectedComponentType[] | InjectConfig | any,
CustomInject: FunctionComponent<InjectProps> = Inject,
withKey = false,
): ReactNode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ exports[`ListGrid should render react-virtualized list 1`] = `
<dt
class="theme-field-label"
>
:
</dt>
<dd
Expand Down Expand Up @@ -176,7 +175,6 @@ exports[`ListGrid should render react-virtualized list 1`] = `
<dt
class="theme-field-label"
>
:
</dt>
<dd
Expand Down
6 changes: 3 additions & 3 deletions packages/containers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@
"i18next": "^20.6.1",
"jest-in-case": "^1.0.2",
"prop-types": "^15.8.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^11.18.6",
"react-test-renderer": "^17.0.2",
"react-test-renderer": "^18.2.0",
"redux-saga-tester": "^1.0.874"
},
"peerDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/dataviz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@
"@types/geojson": "^7946.0.10",
"@types/lodash": "^4.14.198",
"@types/node": "^6.14.13",
"@types/react": "^17.0.65",
"@types/react": "^18.2.8",
"@types/topojson-client": "^3.1.2",
"@types/topojson-specification": "^1.0.3",
"cypress": "^12.17.4",
"cross-env": "^7.0.3",
"i18next": "^20.6.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^11.18.6"
},
"peerDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions packages/design-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"figma-js": "^1.16.0",
"pkg-dir": "^7.0.0",
"react-hook-form": "^6.15.8",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"use-overflow": "^1.2.0"
},
"devDependencies": {
Expand All @@ -61,11 +61,11 @@
"@talend/scripts-config-babel": "^13.0.0",
"@talend/scripts-config-storybook-lib": "^5.0.0",
"@talend/scripts-config-typescript": "^11.1.0",
"@types/react": "^17.0.65",
"@types/react": "^18.2.7",
"i18next": "^20.6.1",
"mdx-embed": "^1.1.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "~6.3.0",
"storybook-docs-toc": "^1.7.0"
},
Expand Down
12 changes: 6 additions & 6 deletions packages/design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@
"@testing-library/cypress": "^9.0.0",
"@types/classnames": "^2.3.1",
"@types/jest-axe": "^3.5.6",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
"@types/react-is": "^17.0.0",
"@types/react-transition-group": "2.9.2",
"@types/react-is": "^18.2.0",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@types/react-transition-group": "^2.9.2",
"browser-sync": "^2.29.3",
"browser-sync-webpack-plugin": "^2.3.0",
"concurrently": "^7.6.0",
Expand All @@ -91,8 +91,8 @@
"i18next-scanner-typescript": "^1.1.1",
"jest-axe": "^8.0.0",
"mdx-embed": "^1.1.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet": "^6.1.0",
"react-i18next": "^11.18.6",
"react-is": "^17.0.0",
Expand Down
Loading

0 comments on commit 8c6fd49

Please sign in to comment.