mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-19 01:15:04 -05:00
Migrate pgAdmin UI to use React 19. #8676
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { act, render } from '@testing-library/react';
|
||||
import {TestSchema} from './TestSchema.ui';
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React, { act } from 'react';
|
||||
import { act } from 'react';
|
||||
|
||||
import { render } from '@testing-library/react';
|
||||
import {TestSchema} from './TestSchema.ui';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { act, render } from '@testing-library/react';
|
||||
import {TestSchema} from './TestSchema.ui';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { act, render } from '@testing-library/react';
|
||||
import { TestSchemaAllTypes} from './TestSchema.ui';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { render } from '@testing-library/react';
|
||||
import Theme from '../../../pgadmin/static/js/Theme';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { render } from '@testing-library/react';
|
||||
import Theme from '../../../pgadmin/static/js/Theme';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { render } from '@testing-library/react';
|
||||
import Theme from '../../../pgadmin/static/js/Theme';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { act, render } from '@testing-library/react';
|
||||
import Theme from '../../../pgadmin/static/js/Theme';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { render } from '@testing-library/react';
|
||||
import Theme from '../../../pgadmin/static/js/Theme';
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
import React, { useRef } from 'react';
|
||||
import { useRef } from 'react';
|
||||
import CustomPropTypes from '../../../../pgadmin/static/js/custom_prop_types';
|
||||
export * from '@mui/material';
|
||||
|
||||
// mock popper
|
||||
|
||||
export const Popper = React.forwardRef((props, _ref)=>{
|
||||
export const Popper = (
|
||||
{
|
||||
ref: _ref,
|
||||
...props
|
||||
}
|
||||
) => {
|
||||
const ele = useRef();
|
||||
return <div ref={ele} data-test="material-popper">{props.children}</div>;
|
||||
});
|
||||
};
|
||||
|
||||
Popper.displayName = 'Popper';
|
||||
Popper.propTypes = {
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
import React, { useRef } from 'react';
|
||||
import { useRef } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
export * from 'react-data-grid';
|
||||
|
||||
|
||||
const ReactDataGrid = React.forwardRef((props, _ref)=>{
|
||||
const ReactDataGrid = (
|
||||
{
|
||||
ref: _ref,
|
||||
...props
|
||||
}
|
||||
) => {
|
||||
const ele = useRef();
|
||||
return <div id={props.id} ref={ele} data-test="react-data-grid"/>;
|
||||
});
|
||||
};
|
||||
|
||||
ReactDataGrid.displayName = 'ReactDataGrid';
|
||||
ReactDataGrid.propTypes = {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import React from 'react';
|
||||
|
||||
const SvgrMock = React.forwardRef((props, ref) => (
|
||||
<svg ref={ref} {...props} />
|
||||
));
|
||||
const SvgrMock = (
|
||||
{
|
||||
ref,
|
||||
...props
|
||||
}
|
||||
) => (<svg ref={ref} {...props} />);
|
||||
|
||||
SvgrMock.displayName = 'SvgrMock';
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import React from 'react';
|
||||
export default function UplotReact() {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { withTheme } from '../fake_theme';
|
||||
import InfoIcon from '@mui/icons-material/InfoRounded';
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { withTheme } from '../fake_theme';
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { withTheme } from '../fake_theme';
|
||||
import CodeMirror from 'sources/components/ReactCodeMirror';
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { withTheme } from '../fake_theme';
|
||||
import { fireEvent, render } from '@testing-library/react';
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { withTheme } from '../fake_theme';
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { withTheme } from '../fake_theme';
|
||||
import { fireEvent, render, screen } from '@testing-library/react';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { render, waitFor } from '@testing-library/react';
|
||||
import ObjectBreadcrumbs from '../../../pgadmin/static/js/components/ObjectBreadcrumbs';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import Privilege from 'sources/components/Privilege';
|
||||
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { withTheme } from '../fake_theme';
|
||||
import { render, screen, waitFor } from '@testing-library/react';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { withTheme } from '../fake_theme';
|
||||
import { act, render, waitFor } from '@testing-library/react';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { withTheme } from '../fake_theme';
|
||||
import { act, render, screen, waitFor } from '@testing-library/react';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { withTheme } from '../fake_theme';
|
||||
import { render } from '@testing-library/react';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { render } from '@testing-library/react';
|
||||
import { withTheme } from '../fake_theme';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { DATA_POINT_SIZE } from 'sources/chartjs';
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import React from 'react';
|
||||
|
||||
import {GraphsWrapper, X_AXIS_LENGTH, POINT_SIZE} from '../../../pgadmin/dashboard/static/js/Graphs';
|
||||
import { withTheme } from '../fake_theme';
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import React, { useRef, useMemo } from 'react';
|
||||
import { useRef, useMemo } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import {DebuggerContext, DebuggerEventsContext} from '../../../pgadmin/tools/debugger/static/js/components/DebuggerComponent';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
import { act, render } from '@testing-library/react';
|
||||
|
||||
import MockAdapter from 'axios-mock-adapter';
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
|
||||
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
|
||||
import MockAdapter from 'axios-mock-adapter';
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
// This software is released under the PostgreSQL Licence
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
import React from 'react';
|
||||
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
import React from 'react';
|
||||
|
||||
|
||||
import { DefaultNodeModel } from '@projectstorm/react-diagrams';
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import ConnectionBar, {STATUS} from 'pgadmin.tools.erd/erd_tool/components/ConnectionBar';
|
||||
import Theme from '../../../../pgadmin/static/js/Theme';
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import FloatingNote from 'pgadmin.tools.erd/erd_tool/components/FloatingNote';
|
||||
import Theme from '../../../../pgadmin/static/js/Theme';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import React from 'react';
|
||||
import Theme from 'sources/Theme';
|
||||
|
||||
export function withTheme(WrappedComp) {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React, { act} from 'react';
|
||||
import { act} from 'react';
|
||||
|
||||
import { render } from '@testing-library/react';
|
||||
import Theme from '../../../pgadmin/static/js/Theme';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { render } from '@testing-library/react';
|
||||
import Theme from '../../../pgadmin/static/js/Theme';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { render, screen, waitFor } from '@testing-library/react';
|
||||
import Theme from '../../../pgadmin/static/js/Theme';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { render, screen, waitFor } from '@testing-library/react';
|
||||
import Theme from '../../../pgadmin/static/js/Theme';
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import React from 'react';
|
||||
import pgAdmin from 'sources/pgadmin';
|
||||
import SchemaView from '../../pgadmin/static/js/SchemaView';
|
||||
import pgWindow from 'sources/window';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import '@testing-library/jest-dom';
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { render } from '@testing-library/react';
|
||||
import { BgProcessManagerProcessState } from '../../../pgadmin/misc/bgprocess/static/js/BgProcessConstants';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { render, waitFor } from '@testing-library/react';
|
||||
import Theme from '../../../pgadmin/static/js/Theme';
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
import React from 'react';
|
||||
import QuickSearch from '../../../pgadmin/static/js/QuickSearch';
|
||||
import { render } from '@testing-library/react';
|
||||
import Theme from '../../../pgadmin/static/js/Theme';
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
|
||||
|
||||
import React from 'react';
|
||||
import { act, render } from '@testing-library/react';
|
||||
|
||||
import MockAdapter from 'axios-mock-adapter';
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import pgAdmin from 'sources/pgadmin';
|
||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { act, render } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { act, render, screen, fireEvent, waitFor } from '@testing-library/react';
|
||||
import MockAdapter from 'axios-mock-adapter';
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { act, render } from '@testing-library/react';
|
||||
import MockAdapter from 'axios-mock-adapter';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { act, render } from '@testing-library/react';
|
||||
import { withBrowser } from '../genericFunctions';
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { act, render } from '@testing-library/react';
|
||||
import MockAdapter from 'axios-mock-adapter';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import React from 'react';
|
||||
import { PgAdminProvider } from '../../pgadmin/static/js/PgAdminProvider';
|
||||
import fakePgAdmin from './fake_pgadmin';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user