Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm: upgrade several dependencies #786

Merged
merged 14 commits into from
Apr 18, 2023
9,965 changes: 3,962 additions & 6,003 deletions test-result-summary-client/package-lock.json

Large diffs are not rendered by default.

35 changes: 18 additions & 17 deletions test-result-summary-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@ant-design/compatible": "^1.0.8",
"antd": "^4.16.3",
"classnames": "^2.3.1",
"codemirror": "^5.62.0",
"@ant-design/compatible": "^5.1.1",
"@ant-design/icons": "^5.0.1",
"antd": "^5.3.2",
"classnames": "^2.3.2",
"codemirror": "^5.65.12",
"highcharts": "^9.1.2",
"highcharts-react-official": "^2.2.2",
"highstock-release": "^6.0.4",
"history": "^4.10.1",
"jquery": "^3.6.0",
"history": "^5.3.0",
"jquery": "^3.6.4",
"mathjs": "^7.6.0",
"mergely": "^4.3.1",
"mergely": "^4.3.9",
"moment": "^2.29.4",
"npm-check": "^5.9.2",
"qs": "^6.10.1",
"react": "^16.14.0",
"qs": "^6.11.1",
"react": "^18.2.0",
"react-app-rewired": "^2.2.1",
"react-day-picker": "^7.4.10",
"react-dom": "^16.14.0",
"react-dom": "^18.2.0",
"react-grid-layout": "^0.16.6",
"react-highcharts": "^16.1.0",
"react-highlight-words": "^0.16.0",
"react-jsx-highcharts": "^3.6.1",
"react-jsx-highstock": "^3.6.1",
"react-nl2br": "^0.6.1",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-nl2br": "^1.0.4",
"react-router": "^6.10.0",
"react-router-dom": "^6.10.0",
"react-scripts": "^5.0.1",
"react-table": "^6.11.5",
"sweetalert2": "^10.16.9",
"react-app-rewired": "^2.1.8",
"react-scripts": "^5.0.1"
"sweetalert2": "^11.7.3"
},
"scripts": {
"start": "react-app-rewired start",
Expand All @@ -43,6 +43,7 @@
"proxy": "http://localhost:3001",
"devDependencies": {
"cypress": "^8.6.0",
"npm-check": "^6.0.1",
"prettier": "2.5.1"
},
"browserslist": [
Expand Down
2 changes: 1 addition & 1 deletion test-result-summary-client/src/App.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '~antd/dist/antd.css';
@import '~antd/dist/reset.css';

.ant-layout {
overflow: visible !important;
Expand Down
104 changes: 24 additions & 80 deletions test-result-summary-client/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { Component } from 'react';
import { Route } from 'react-router';
import { Route, Routes } from 'react-router';
import { Link } from 'react-router-dom';
import { ConfigProvider, Layout, Menu } from 'antd';
import enUS from 'antd/lib/locale-provider/en_US';
import enUS from 'antd/es/calendar/locale/en_US';

import { Dashboard } from './Dashboard/';
import ErrorBoundary from './ErrorBoundary';
Expand Down Expand Up @@ -170,84 +170,28 @@ export default class App extends Component {
minHeight: 280,
}}
>
<Route
exact
path="/"
component={TopLevelBuilds}
/>
<Route
path="/admin/settings"
component={Settings}
/>
<Route
path="/dashboard"
component={Dashboard}
/>
<Route
path="/tests/:type"
component={TopLevelBuilds}
/>
<Route
path="/output/:outputType"
component={Output}
/>
<Route
path="/deepHistory"
component={DeepHistory}
/>
<Route
path="/gitNewIssue"
component={GitNewIssue}
/>
<Route
path="/testCompare"
component={TestCompare}
/>
<Route
path="/perfCompare"
component={PerfCompare}
/>
<Route
path="/tabularView"
component={TabularView}
/>
<Route
path="/buildDetail"
component={BuildDetail}
/>
<Route
path="/buildTreeView"
component={BuildTreeView}
/>
<Route path="/builds" component={Builds} />
<Route
path="/allTestsInfo"
component={AllTestsInfo}
/>
<Route
path="/testPerPlatform"
component={TestPerPlatform}
/>
<Route
path="/possibleIssues"
component={PossibleIssues}
/>
<Route
path="/searchResult"
component={SearchResult}
/>
<Route
path="/resultSummary"
component={ResultSummary}
/>
<Route
path="/ThirdPartyAppView"
component={ThirdPartyAppView}
/>
<Route
path="/releaseSummary"
component={ReleaseSummary}
/>
<Routes>
<Route path="/" element={<TopLevelBuilds />} />
<Route path="/admin/settings" element={<Settings />} />
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/tests/:type" element={<TopLevelBuilds />} />
<Route path="/output/:outputType" element={<Output />} />
<Route path="/deepHistory" element={<DeepHistory />} />
<Route path="/gitNewIssue" element={<GitNewIssue />} />
<Route path="/testCompare" element={<TestCompare />} />
<Route path="/perfCompare" element={<PerfCompare />} />
<Route path="/tabularView" element={<TabularView />} />
<Route path="/buildDetail" element={<BuildDetail />} />
<Route path="/buildTreeView" element={<BuildTreeView />} />
<Route path="/builds" element={<Builds />} />
<Route path="/allTestsInfo" element={<AllTestsInfo />} />
<Route path="/testPerPlatform" element={<TestPerPlatform />} />
<Route path="/possibleIssues" element={<PossibleIssues />} />
<Route path="/searchResult" element={<SearchResult />} />
<Route path="/resultSummary" element={<ResultSummary />} />
<Route path="/ThirdPartyAppView" element={<ThirdPartyAppView />} />
<Route path="/releaseSummary" element={<ReleaseSummary />} />
</Routes>
</Content>
</ErrorBoundary>
</Layout>
Expand Down
17 changes: 7 additions & 10 deletions test-result-summary-client/src/Build/AlertMsg.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import React, { Component } from 'react';
import React from 'react';
import { Alert } from 'antd';

export default class AlertMsg extends Component {
render() {
const { error } = this.props;
if (!error) return null;
return (
<Alert message="Error" description={error} type="error" showIcon />
);
}
}
const AlertMsg = ({ error }) => {
if (!error) return null;
return <Alert message="Error" description={error} type="error" showIcon />;
};

export default AlertMsg;
86 changes: 40 additions & 46 deletions test-result-summary-client/src/Build/AllTestsInfo.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component } from 'react';
import React, { useState, useEffect } from 'react';
import { useLocation } from 'react-router-dom';
import TestBreadcrumb from './TestBreadcrumb';
import { SearchOutput } from '../Search/';
import { getParams } from '../utils/query';
Expand All @@ -7,21 +8,18 @@ import TestTable from './TestTable';
import AlertMsg from './AlertMsg';
import './table.css';

export default class Build extends Component {
state = {
parents: [],
testData: [],
error: '',
};
const Build = () => {
const location = useLocation();
const [parents, setParents] = useState([]);
const [testData, setTestData] = useState([]);
const [error, setError] = useState('');

async componentDidMount() {
await this.updateData();
}
useEffect(() => {
updateData();
}, []);

async updateData() {
const { buildId, limit, hasChildren } = getParams(
this.props.location.search
);
const updateData = async () => {
const { buildId, limit, hasChildren } = getParams(location.search);
let hasChildrenBool = hasChildren === 'true';
let limitParam = '';
if (limit) {
Expand All @@ -32,8 +30,8 @@ export default class Build extends Component {
let buildIds = [];

// aggregated test results and parent
let testData = [];
let parents = [];
let fetchedTestData = [];
let fetchedParents = [];
let errorMsg = '';

// if it is a parallel build.
Expand All @@ -55,13 +53,16 @@ export default class Build extends Component {

await Promise.all(
buildIds.map(async (buildId) => {
const { testResult, parent, error } = await this.getTestResult(
const { testResult, parent, error } = await getTestResult(
buildId,
limitParam
);
testData = testData.concat(testResult);
if (parent.length > parents.length || parents.length === 0) {
parents = parent;
fetchedTestData = fetchedTestData.concat(testResult);
if (
parent.length > fetchedParents.length ||
fetchedParents.length === 0
) {
fetchedParents = parent;
}
if (error) {
errorMsg = (
Expand All @@ -75,22 +76,20 @@ export default class Build extends Component {
})
);

testData.sort((a, b) => {
fetchedTestData.sort((a, b) => {
let rt = a[0].testResult.localeCompare(b[0].testResult);
if (rt === 0) {
return a.key.localeCompare(b.key);
}
return rt;
});

this.setState({
parents,
testData,
errorMsg,
});
}
setParents(fetchedParents);
setTestData(fetchedTestData);
setError(errorMsg);
};

async getTestResult(buildId, limitParam) {
const getTestResult = async (buildId, limitParam) => {
const builds = await fetchData(
`/api/getAllTestsWithHistory?buildId=${buildId}${limitParam}`
);
Expand Down Expand Up @@ -148,23 +147,18 @@ export default class Build extends Component {
};
});
return { testResult, parent, error };
}
};

render() {
const { testData, parents, errorMsg } = this.state;
const { buildId } = getParams(this.props.location.search);
const { buildId } = getParams(location.search);

return (
<div>
<TestBreadcrumb buildId={buildId} />
<AlertMsg error={errorMsg} />
<SearchOutput buildId={buildId} />
<TestTable
title={'Tests'}
testData={testData}
parents={parents}
/>
</div>
);
}
}
return (
<div>
<TestBreadcrumb buildId={buildId} />
<AlertMsg error={error} />
<SearchOutput buildId={buildId} />
<TestTable title={'Tests'} testData={testData} parents={parents} />
</div>
);
};

export default Build;
Loading