fix(types): follow up to react 18 changes (#14671)
This commit is contained in:
parent
e3a590ed80
commit
4cc25725f9
28
package-lock.json
generated
28
package-lock.json
generated
|
|
@ -23,7 +23,7 @@
|
||||||
"@babel/preset-react": "^7.16.7",
|
"@babel/preset-react": "^7.16.7",
|
||||||
"@types/formidable": "^2.0.4",
|
"@types/formidable": "^2.0.4",
|
||||||
"@types/node": "=14.17.15",
|
"@types/node": "=14.17.15",
|
||||||
"@types/react": "^18.0.11",
|
"@types/react": "^18.0.12",
|
||||||
"@types/react-dom": "^18.0.5",
|
"@types/react-dom": "^18.0.5",
|
||||||
"@types/resize-observer-browser": "^0.1.7",
|
"@types/resize-observer-browser": "^0.1.7",
|
||||||
"@types/xml2js": "^0.4.9",
|
"@types/xml2js": "^0.4.9",
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
"react-dom": "^18.1.0",
|
"react-dom": "^18.1.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"socksv5": "0.0.6",
|
"socksv5": "0.0.6",
|
||||||
"typescript": "^4.7.2",
|
"typescript": "^4.7.3",
|
||||||
"vite": "^2.9.9",
|
"vite": "^2.9.9",
|
||||||
"ws": "^8.5.0",
|
"ws": "^8.5.0",
|
||||||
"xml2js": "^0.4.23",
|
"xml2js": "^0.4.23",
|
||||||
|
|
@ -1287,9 +1287,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/react": {
|
"node_modules/@types/react": {
|
||||||
"version": "18.0.11",
|
"version": "18.0.12",
|
||||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.12.tgz",
|
||||||
"integrity": "sha512-JxSwm54IgMW4XTR+zFF5QpNx4JITmFbB4WHR2J0vg9RpjNeyqEMlODXsD2e64br6GX70TL0UYjZJETpyyC1WdA==",
|
"integrity": "sha512-duF1OTASSBQtcigUvhuiTB1Ya3OvSy+xORCiEf20H0P0lzx+/KeVsA99U5UjLXSbyo1DRJDlLKqTeM1ngosqtg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/prop-types": "*",
|
"@types/prop-types": "*",
|
||||||
|
|
@ -5920,9 +5920,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "4.7.2",
|
"version": "4.7.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz",
|
||||||
"integrity": "sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A==",
|
"integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
|
|
@ -7574,9 +7574,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/react": {
|
"@types/react": {
|
||||||
"version": "18.0.11",
|
"version": "18.0.12",
|
||||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.12.tgz",
|
||||||
"integrity": "sha512-JxSwm54IgMW4XTR+zFF5QpNx4JITmFbB4WHR2J0vg9RpjNeyqEMlODXsD2e64br6GX70TL0UYjZJETpyyC1WdA==",
|
"integrity": "sha512-duF1OTASSBQtcigUvhuiTB1Ya3OvSy+xORCiEf20H0P0lzx+/KeVsA99U5UjLXSbyo1DRJDlLKqTeM1ngosqtg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/prop-types": "*",
|
"@types/prop-types": "*",
|
||||||
|
|
@ -11000,9 +11000,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "4.7.2",
|
"version": "4.7.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz",
|
||||||
"integrity": "sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A==",
|
"integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"universalify": {
|
"universalify": {
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
"@babel/preset-react": "^7.16.7",
|
"@babel/preset-react": "^7.16.7",
|
||||||
"@types/formidable": "^2.0.4",
|
"@types/formidable": "^2.0.4",
|
||||||
"@types/node": "=14.17.15",
|
"@types/node": "=14.17.15",
|
||||||
"@types/react": "^18.0.11",
|
"@types/react": "^18.0.12",
|
||||||
"@types/react-dom": "^18.0.5",
|
"@types/react-dom": "^18.0.5",
|
||||||
"@types/resize-observer-browser": "^0.1.7",
|
"@types/resize-observer-browser": "^0.1.7",
|
||||||
"@types/xml2js": "^0.4.9",
|
"@types/xml2js": "^0.4.9",
|
||||||
|
|
@ -87,7 +87,7 @@
|
||||||
"react-dom": "^18.1.0",
|
"react-dom": "^18.1.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"socksv5": "0.0.6",
|
"socksv5": "0.0.6",
|
||||||
"typescript": "^4.7.2",
|
"typescript": "^4.7.3",
|
||||||
"vite": "^2.9.9",
|
"vite": "^2.9.9",
|
||||||
"ws": "^8.5.0",
|
"ws": "^8.5.0",
|
||||||
"xml2js": "^0.4.23",
|
"xml2js": "^0.4.23",
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import { expect, test } from '@playwright/experimental-ct-react';
|
import { expect, test } from '@playwright/experimental-ct-react';
|
||||||
import { AutoChip, Chip as LocalChip } from './chip';
|
import { AutoChip, Chip as LocalChip } from './chip';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import { test, expect } from '@playwright/experimental-ct-react';
|
import { test, expect } from '@playwright/experimental-ct-react';
|
||||||
import { HeaderView } from './headerView';
|
import { HeaderView } from './headerView';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,11 @@ import * as icons from './icons';
|
||||||
import { Link, navigate } from './links';
|
import { Link, navigate } from './links';
|
||||||
import { statusIcon } from './statusIcon';
|
import { statusIcon } from './statusIcon';
|
||||||
|
|
||||||
export const HeaderView: React.FC<{
|
export const HeaderView: React.FC<React.PropsWithChildren<{
|
||||||
stats: Stats,
|
stats: Stats,
|
||||||
filterText: string,
|
filterText: string,
|
||||||
setFilterText: (filterText: string) => void,
|
setFilterText: (filterText: string) => void,
|
||||||
}> = ({ stats, filterText, setFilterText }) => {
|
}>> = ({ stats, filterText, setFilterText }) => {
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
window.addEventListener('popstate', () => {
|
window.addEventListener('popstate', () => {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as React from 'react';
|
|
||||||
import './colors.css';
|
import './colors.css';
|
||||||
import './common.css';
|
import './common.css';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,10 +93,10 @@ export const ImageDiffView: React.FunctionComponent<{
|
||||||
</div>;
|
</div>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ImageDiffSlider: React.FC<{
|
export const ImageDiffSlider: React.FC<React.PropsWithChildren<{
|
||||||
sliderPosition: number,
|
sliderPosition: number,
|
||||||
setSliderPosition: (position: number) => void,
|
setSliderPosition: (position: number) => void,
|
||||||
}> = ({ children, sliderPosition, setSliderPosition }) => {
|
}>> = ({ children, sliderPosition, setSliderPosition }) => {
|
||||||
const [resizing, setResizing] = React.useState<{ offset: number, size: number } | null>(null);
|
const [resizing, setResizing] = React.useState<{ offset: number, size: number } | null>(null);
|
||||||
const size = sliderPosition;
|
const size = sliderPosition;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,9 @@ export type Metainfo = {
|
||||||
'revision.link'?: string;
|
'revision.link'?: string;
|
||||||
'ci.link'?: string;
|
'ci.link'?: string;
|
||||||
'timestamp'?: number
|
'timestamp'?: number
|
||||||
} | undefined;
|
};
|
||||||
|
|
||||||
class ErrorBoundary extends React.Component<{}, { error: Error | null, errorInfo: React.ErrorInfo | null }> {
|
class ErrorBoundary extends React.Component<React.PropsWithChildren<{}>, { error: Error | null, errorInfo: React.ErrorInfo | null }> {
|
||||||
state: { error: Error | null, errorInfo: React.ErrorInfo | null } = {
|
state: { error: Error | null, errorInfo: React.ErrorInfo | null } = {
|
||||||
error: null,
|
error: null,
|
||||||
errorInfo: null,
|
errorInfo: null,
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,13 @@ import { Link, ProjectLink } from './links';
|
||||||
import { statusIcon } from './statusIcon';
|
import { statusIcon } from './statusIcon';
|
||||||
import './testFileView.css';
|
import './testFileView.css';
|
||||||
|
|
||||||
export const TestFileView: React.FC<{
|
export const TestFileView: React.FC<React.PropsWithChildren<{
|
||||||
report: HTMLReport;
|
report: HTMLReport;
|
||||||
file: TestFileSummary;
|
file: TestFileSummary;
|
||||||
isFileExpanded: (fileId: string) => boolean;
|
isFileExpanded: (fileId: string) => boolean;
|
||||||
setFileExpanded: (fileId: string, expanded: boolean) => void;
|
setFileExpanded: (fileId: string, expanded: boolean) => void;
|
||||||
filter: Filter;
|
filter: Filter;
|
||||||
}> = ({ file, report, isFileExpanded, setFileExpanded, filter }) => {
|
}>> = ({ file, report, isFileExpanded, setFileExpanded, filter }) => {
|
||||||
return <Chip
|
return <Chip
|
||||||
expanded={isFileExpanded(file.fileId)}
|
expanded={isFileExpanded(file.fileId)}
|
||||||
noInsets={true}
|
noInsets={true}
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ export const ConsoleTab: React.FunctionComponent<{
|
||||||
} else {
|
} else {
|
||||||
return <div className='console-line error' key={index}>
|
return <div className='console-line error' key={index}>
|
||||||
<span className={'codicon codicon-error'}></span>
|
<span className={'codicon codicon-error'}></span>
|
||||||
<span className='console-line-message'>{value}</span>
|
<span className='console-line-message'>{String(value)}</span>
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,12 @@
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
export const Expandable: React.FunctionComponent<{
|
export const Expandable: React.FunctionComponent<React.PropsWithChildren<{
|
||||||
title: JSX.Element | string,
|
title: JSX.Element | string,
|
||||||
setExpanded: Function,
|
setExpanded: Function,
|
||||||
expanded: Boolean,
|
expanded: Boolean,
|
||||||
style?: React.CSSProperties,
|
style?: React.CSSProperties,
|
||||||
children: JSX.Element | JSX.Element[] | string,
|
}>> = ({ title, children, setExpanded, expanded, style }) => {
|
||||||
}> = ({ title, children, setExpanded, expanded, style }) => {
|
|
||||||
return <div style={{ ...style, display: 'flex', flexDirection: 'column' }}>
|
return <div style={{ ...style, display: 'flex', flexDirection: 'column' }}>
|
||||||
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', whiteSpace: 'nowrap' }}>
|
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', whiteSpace: 'nowrap' }}>
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ export interface SplitViewProps {
|
||||||
sidebarHidden?: boolean,
|
sidebarHidden?: boolean,
|
||||||
sidebarIsFirst?: boolean,
|
sidebarIsFirst?: boolean,
|
||||||
orientation?: 'vertical' | 'horizontal',
|
orientation?: 'vertical' | 'horizontal',
|
||||||
|
children: JSX.Element | JSX.Element[] | string,
|
||||||
}
|
}
|
||||||
|
|
||||||
const kMinSize = 50;
|
const kMinSize = 50;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import * as React from 'react';
|
||||||
export interface ToolbarProps {
|
export interface ToolbarProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Toolbar: React.FC<ToolbarProps> = ({
|
export const Toolbar: React.FC<React.PropsWithChildren<ToolbarProps>> = ({
|
||||||
children
|
children
|
||||||
}) => {
|
}) => {
|
||||||
return <div className='toolbar'>{children}</div>;
|
return <div className='toolbar'>{children}</div>;
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,10 @@ export interface ToolbarButtonProps {
|
||||||
icon: string,
|
icon: string,
|
||||||
disabled?: boolean,
|
disabled?: boolean,
|
||||||
toggled?: boolean,
|
toggled?: boolean,
|
||||||
onClick: () => void
|
onClick: () => void,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ToolbarButton: React.FC<ToolbarButtonProps> = ({
|
export const ToolbarButton: React.FC<React.PropsWithChildren<ToolbarButtonProps>> = ({
|
||||||
children,
|
children,
|
||||||
title = '',
|
title = '',
|
||||||
icon = '',
|
icon = '',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue