Unverified Commit ef15fc81 authored by liuzhe-lz's avatar liuzhe-lz Committed by GitHub
Browse files

Bump node.js version to v16 (#3828)

parent b2225436
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
"plugin:react/recommended", "plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended",
"prettier/react",
"prettier" "prettier"
], ],
"rules": { "rules": {
...@@ -29,6 +28,17 @@ ...@@ -29,6 +28,17 @@
"@typescript-eslint/no-use-before-define": [2, "nofunc"], "@typescript-eslint/no-use-before-define": [2, "nofunc"],
"@typescript-eslint/no-var-requires": 0, "@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-unused-vars": [2, { "argsIgnorePattern": "^_" }], "@typescript-eslint/no-unused-vars": [2, { "argsIgnorePattern": "^_" }],
"@typescript-eslint/ban-types": [
"error",
{
"extendDefaults": true,
"types": {
"{}": false,
"object": false,
"Function": false
}
}
],
"arrow-parens": [2, "as-needed"], "arrow-parens": [2, "as-needed"],
"no-inner-declarations": 0, "no-inner-declarations": 0,
"no-empty": 2, "no-empty": 2,
...@@ -45,4 +55,4 @@ ...@@ -45,4 +55,4 @@
"**/*.js" "**/*.js"
] ]
} }
} }
\ No newline at end of file
'use strict'; 'use strict';
const fs = require('fs'); const fs = require('fs');
const isWsl = require('is-wsl');
const path = require('path'); const path = require('path');
const webpack = require('webpack'); const webpack = require('webpack');
const resolve = require('resolve'); const resolve = require('resolve');
...@@ -11,9 +10,9 @@ const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); ...@@ -11,9 +10,9 @@ const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const InlineChunkHtmlPlugin = require('react-dev-utils/InlineChunkHtmlPlugin'); const InlineChunkHtmlPlugin = require('react-dev-utils/InlineChunkHtmlPlugin');
const TerserPlugin = require('terser-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const safePostCssParser = require('postcss-safe-parser'); //const safePostCssParser = require('postcss-safe-parser');
const ManifestPlugin = require('webpack-manifest-plugin'); const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const WorkboxWebpackPlugin = require('workbox-webpack-plugin'); const WorkboxWebpackPlugin = require('workbox-webpack-plugin');
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin'); const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
...@@ -94,20 +93,22 @@ module.exports = function(webpackEnv) { ...@@ -94,20 +93,22 @@ module.exports = function(webpackEnv) {
options: { options: {
// Necessary for external CSS imports to work // Necessary for external CSS imports to work
// https://github.com/facebook/create-react-app/issues/2677 // https://github.com/facebook/create-react-app/issues/2677
ident: 'postcss', //ident: 'postcss',
plugins: () => [ postcssOptions: {
require('postcss-flexbugs-fixes'), plugins: () => [
require('postcss-preset-env')({ require('postcss-flexbugs-fixes'),
autoprefixer: { require('postcss-preset-env')({
flexbox: 'no-2009', autoprefixer: {
}, flexbox: 'no-2009',
stage: 3, },
}), stage: 3,
// Adds PostCSS Normalize as the reset css with default options, }),
// so that it honors browserslist config in package.json // Adds PostCSS Normalize as the reset css with default options,
// which in turn let's users customize the target behavior as per their needs. // so that it honors browserslist config in package.json
postcssNormalize(), // which in turn let's users customize the target behavior as per their needs.
], postcssNormalize(),
],
},
sourceMap: isEnvProduction && shouldUseSourceMap, sourceMap: isEnvProduction && shouldUseSourceMap,
}, },
}, },
...@@ -163,8 +164,6 @@ module.exports = function(webpackEnv) { ...@@ -163,8 +164,6 @@ module.exports = function(webpackEnv) {
filename: isEnvProduction filename: isEnvProduction
? 'static/js/[name].[contenthash:8].js' ? 'static/js/[name].[contenthash:8].js'
: isEnvDevelopment && 'static/js/bundle.js', : isEnvDevelopment && 'static/js/bundle.js',
// TODO: remove this when upgrading to webpack 5
futureEmitAssets: true,
// There are also additional JS chunk files if you use code splitting. // There are also additional JS chunk files if you use code splitting.
chunkFilename: isEnvProduction chunkFilename: isEnvProduction
? 'static/js/[name].[contenthash:8].chunk.js' ? 'static/js/[name].[contenthash:8].chunk.js'
...@@ -220,29 +219,23 @@ module.exports = function(webpackEnv) { ...@@ -220,29 +219,23 @@ module.exports = function(webpackEnv) {
ascii_only: true, ascii_only: true,
}, },
}, },
// Use multi-process parallel running to improve the build speed
// Default number of concurrent runs: os.cpus().length - 1
// Disabled on WSL (Windows Subsystem for Linux) due to an issue with Terser
// https://github.com/webpack-contrib/terser-webpack-plugin/issues/21
parallel: !isWsl,
// Enable file caching
cache: true,
sourceMap: shouldUseSourceMap,
}), }),
// This is only used in production mode // This is only used in production mode
new OptimizeCSSAssetsPlugin({ new CssMinimizerPlugin({
cssProcessorOptions: { minimizerOptions: {
parser: safePostCssParser, processorOptions: {
map: shouldUseSourceMap //parser: safePostCssParser,
? { map: shouldUseSourceMap
// `inline: false` forces the sourcemap to be output into a ? {
// separate file // `inline: false` forces the sourcemap to be output into a
inline: false, // separate file
// `annotation: true` appends the sourceMappingURL to the end of inline: false,
// the css file, helping the browser find the sourcemap // `annotation: true` appends the sourceMappingURL to the end of
annotation: true, // the css file, helping the browser find the sourcemap
} annotation: true,
: false, }
: false,
},
}, },
}), }),
], ],
...@@ -552,7 +545,7 @@ module.exports = function(webpackEnv) { ...@@ -552,7 +545,7 @@ module.exports = function(webpackEnv) {
// Generate a manifest file which contains a mapping of all asset filenames // Generate a manifest file which contains a mapping of all asset filenames
// to their corresponding output file so that tools can pick it up without // to their corresponding output file so that tools can pick it up without
// having to parse `index.html`. // having to parse `index.html`.
new ManifestPlugin({ new WebpackManifestPlugin({
fileName: 'asset-manifest.json', fileName: 'asset-manifest.json',
publicPath: publicPath, publicPath: publicPath,
generate: (seed, files) => { generate: (seed, files) => {
...@@ -578,9 +571,9 @@ module.exports = function(webpackEnv) { ...@@ -578,9 +571,9 @@ module.exports = function(webpackEnv) {
new WorkboxWebpackPlugin.GenerateSW({ new WorkboxWebpackPlugin.GenerateSW({
clientsClaim: true, clientsClaim: true,
exclude: [/\.map$/, /asset-manifest\.json$/], exclude: [/\.map$/, /asset-manifest\.json$/],
importWorkboxFrom: 'cdn', //importWorkboxFrom: 'cdn',
navigateFallback: publicUrl + '/index.html', navigateFallback: publicUrl + '/index.html',
navigateFallbackBlacklist: [ navigateFallbackDenylist: [
// Exclude URLs starting with /_, as they're likely an API call // Exclude URLs starting with /_, as they're likely an API call
new RegExp('^/_'), new RegExp('^/_'),
// Exclude URLs containing a dot, as they're likely a resource in // Exclude URLs containing a dot, as they're likely a resource in
...@@ -614,16 +607,16 @@ module.exports = function(webpackEnv) { ...@@ -614,16 +607,16 @@ module.exports = function(webpackEnv) {
].filter(Boolean), ].filter(Boolean),
// Some libraries import Node modules but don't use them in the browser. // Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works. // Tell Webpack to provide empty mocks for them so importing them works.
node: { //node: {
module: 'empty', // module: 'empty',
dgram: 'empty', // dgram: 'empty',
dns: 'mock', // dns: 'mock',
fs: 'empty', // fs: 'empty',
http2: 'empty', // http2: 'empty',
net: 'empty', // net: 'empty',
tls: 'empty', // tls: 'empty',
child_process: 'empty', // child_process: 'empty',
}, //},
// Turn off performance processing because we utilize // Turn off performance processing because we utilize
// our own hints via the FileSizeReporter // our own hints via the FileSizeReporter
performance: false, performance: false,
......
...@@ -4,44 +4,40 @@ ...@@ -4,44 +4,40 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"babel-eslint": "10.0.1", "babel-jest": "^27.0.2",
"babel-jest": "24.7.1", "babel-loader": "^8.2.2",
"babel-loader": "8.0.5",
"babel-plugin-named-asset-import": "^0.3.2", "babel-plugin-named-asset-import": "^0.3.2",
"babel-preset-react-app": "^8.0.0", "babel-preset-react-app": "^10.0.0",
"case-sensitive-paths-webpack-plugin": "2.2.0", "case-sensitive-paths-webpack-plugin": "^2.4.0",
"copy-to-clipboard": "^3.0.8", "copy-to-clipboard": "^3.0.8",
"css-loader": "2.1.1", "css-loader": "^5.2.6",
"d3": "^5.16.0", "css-minimizer-webpack-plugin": "^3.0.1",
"dotenv": "6.2.0", "d3": "^6.7.0",
"dotenv-expand": "4.2.0", "dotenv": "^10.0.0",
"dotenv-expand": "^5.1.0",
"echarts": "^5.0", "echarts": "^5.0",
"echarts-for-react": "3.0.0", "echarts-for-react": "^3.0.0",
"file-loader": "3.0.1", "file-loader": "^6.2.0",
"fs-extra": "7.0.1", "fs-extra": "^10.0.0",
"html-webpack-plugin": "4.0.0-beta.5", "html-webpack-plugin": "^5.3.1",
"identity-obj-proxy": "3.0.0", "jest": "^27.0.4",
"is-wsl": "^1.1.0", "jest-environment-jsdom-fourteen": "^1.0.1",
"jest": "24.7.1", "jest-resolve": "^27.0.4",
"jest-environment-jsdom-fourteen": "0.1.0", "jest-watch-typeahead": "^0.6.4",
"jest-resolve": "24.7.1",
"jest-watch-typeahead": "0.3.0",
"json5": "^2.1.1", "json5": "^2.1.1",
"mini-css-extract-plugin": "0.5.0", "mini-css-extract-plugin": "^1.6.0",
"monaco-editor": "^0.19.0", "monaco-editor": "^0.25.0",
"monaco-editor-webpack-plugin": "^1.8.1", "monaco-editor-webpack-plugin": "^4.0.0",
"node-sass": "^4.13.0", "node-sass": "^6.0.0",
"optimize-css-assets-webpack-plugin": "5.0.1",
"parcoord-es": "^2.2.10", "parcoord-es": "^2.2.10",
"pnp-webpack-plugin": "1.2.1", "pnp-webpack-plugin": "^1.6.4",
"postcss-flexbugs-fixes": "4.1.0", "postcss-flexbugs-fixes": "^5.0.2",
"postcss-loader": "3.0.0", "postcss-loader": "^6.1.0",
"postcss-normalize": "7.0.1", "postcss-normalize": "^10.0.0",
"postcss-preset-env": "6.6.0", "postcss-preset-env": "^6.6.0",
"postcss-safe-parser": "4.0.1",
"react": "^16.8.6", "react": "^16.8.6",
"react-app-polyfill": "^1.0.0", "react-app-polyfill": "^1.0.0",
"react-dev-utils": "^9.0.0", "react-dev-utils": "^11.0.4",
"react-dom": "^16.8.6", "react-dom": "^16.8.6",
"react-json-tree": "^0.11.2", "react-json-tree": "^0.11.2",
"react-monaco-editor": "^0.32.1", "react-monaco-editor": "^0.32.1",
...@@ -50,46 +46,47 @@ ...@@ -50,46 +46,47 @@
"react-router": "^5.2.0", "react-router": "^5.2.0",
"react-router-dom": "^5.2.0", "react-router-dom": "^5.2.0",
"react-table": "^7.0.0-rc.15", "react-table": "^7.0.0-rc.15",
"resolve": "1.10.0", "resolve": "^1.10.0",
"sass-loader": "7.1.0", "sass-loader": "^12.1.0",
"semver": "6.0.0", "semver": "^7.3.5",
"style-loader": "0.23.1", "style-loader": "^2.0.0",
"terser-webpack-plugin": "1.2.3", "url-loader": "^4.1.1",
"url-loader": "1.1.2", "webpack": "^5.39.0",
"webpack": "4.29.6", "webpack-dev-server": "^3.11.2",
"webpack-dev-server": "3.2.1", "webpack-manifest-plugin": "^3.1.1",
"webpack-manifest-plugin": "2.0.4", "workbox-webpack-plugin": "^6.1.5"
"workbox-webpack-plugin": "4.2.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "7.4.3", "@babel/core": "^7.14.6",
"@babel/eslint-parser": "^7.14.5",
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.14.5",
"@babel/runtime": "^7.14.6",
"@fluentui/react": "^7.135.0", "@fluentui/react": "^7.135.0",
"@svgr/webpack": "4.1.0", "@svgr/webpack": "^5.5.0",
"@types/d3": "^5.7.2", "@types/d3": "^6.7.0",
"@types/jest": "24.0.12", "@types/node": "^15.12.2",
"@types/json5": "^0.0.30", "@types/react": "^16.8.15",
"@types/node": "^10.14.2", "@types/react-dom": "^16.8.4",
"@types/react": "16.8.15", "@typescript-eslint/eslint-plugin": "^4.27.0",
"@types/react-dom": "16.8.4", "@typescript-eslint/parser": "^4.27.0",
"@typescript-eslint/eslint-plugin": "^2.11.0", "concurrently": "^6.2.0",
"@typescript-eslint/parser": "^2.11.0", "eslint": "^7.28.0",
"concurrently": "^5.2.0", "eslint-config-prettier": "^8.3.0",
"eslint": "^5.16.0", "eslint-config-react-app": "^6.0.0",
"eslint-config-prettier": "^6.1.0", "eslint-loader": "^4.0.2",
"eslint-config-react-app": "^4.0.0", "eslint-plugin-flowtype": "^5.7.2",
"eslint-loader": "2.1.2", "eslint-plugin-import": "^2.23.4",
"eslint-plugin-flowtype": "2.50.1", "eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-import": "2.16.0",
"eslint-plugin-jsx-a11y": "6.2.1",
"eslint-plugin-prettier": "^3.1.0", "eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "7.12.4", "eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^1.5.0", "eslint-plugin-react-hooks": "^4.2.0",
"express": "^4.17.1", "express": "^4.17.1",
"npx": "^10.2.0", "npx": "^10.2.0",
"prettier": "^1.18.2", "prettier": "^2.3.1",
"stylelint": "^13.7.0", "stylelint": "^13.7.0",
"stylelint-config-standard": "^20.0.0", "stylelint-config-standard": "^22.0.0",
"typescript": "^3.8.0" "typescript": "^4.3.2"
}, },
"proxy": "http://localhost:12138", "proxy": "http://localhost:12138",
"scripts": { "scripts": {
...@@ -109,15 +106,15 @@ ...@@ -109,15 +106,15 @@
], ],
"babel": { "babel": {
"presets": [ "presets": [
"react-app" "@babel/preset-react",
"@babel/preset-typescript"
] ]
}, },
"resolutions": { "resolutions": {
"npm": ">=6.14.4", "npm": ">=7.17.0",
"yargs": "~16.0.3", "yargs": ">=17.0.1",
"acorn": ">=8.0.4", "acorn": ">=8.4.0",
"node-forge": ">=0.10.0", "y18n": ">=5.0.8",
"y18n": ">=5.0.5",
"serialize-javascript": ">=5.0.1" "serialize-javascript": ">=5.0.1"
}, },
"jest": { "jest": {
......
...@@ -8,5 +8,5 @@ module.exports = { ...@@ -8,5 +8,5 @@ module.exports = {
singleQuote: true, singleQuote: true,
eslintIntegration: true, eslintIntegration: true,
jsxSingleQuote: true, jsxSingleQuote: true,
endOfline: 'lf' endOfLine: process.platform === 'win32' ? 'auto' : 'lf'
}; };
...@@ -22,7 +22,7 @@ const webpack = require('webpack'); ...@@ -22,7 +22,7 @@ const webpack = require('webpack');
const configFactory = require('../config/webpack.config'); const configFactory = require('../config/webpack.config');
const paths = require('../config/paths'); const paths = require('../config/paths');
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles'); const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages'); const formatWebpackMessages = require('./formatWebpackMessages');
const printHostingInstructions = require('react-dev-utils/printHostingInstructions'); const printHostingInstructions = require('react-dev-utils/printHostingInstructions');
const FileSizeReporter = require('react-dev-utils/FileSizeReporter'); const FileSizeReporter = require('react-dev-utils/FileSizeReporter');
const printBuildError = require('react-dev-utils/printBuildError'); const printBuildError = require('react-dev-utils/printBuildError');
......
// FIXME: This file is copied from react-dev-utils master branch. Waiting for its next release.
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
const friendlySyntaxErrorLabel = 'Syntax error:';
function isLikelyASyntaxError(message) {
return message.indexOf(friendlySyntaxErrorLabel) !== -1;
}
// Cleans up webpack error messages.
function formatMessage(message) {
let lines = [];
if (typeof message === 'string') {
lines = message.split('\n');
} else if ('message' in message) {
lines = message['message'].split('\n');
} else if (Array.isArray(message)) {
message.forEach(message => {
if ('message' in message) {
lines = message['message'].split('\n');
}
});
}
// Strip webpack-added headers off errors/warnings
// https://github.com/webpack/webpack/blob/master/lib/ModuleError.js
lines = lines.filter(line => !/Module [A-z ]+\(from/.test(line));
// Transform parsing error into syntax error
// TODO: move this to our ESLint formatter?
lines = lines.map(line => {
const parsingError = /Line (\d+):(?:(\d+):)?\s*Parsing error: (.+)$/.exec(
line
);
if (!parsingError) {
return line;
}
const [, errorLine, errorColumn, errorMessage] = parsingError;
return `${friendlySyntaxErrorLabel} ${errorMessage} (${errorLine}:${errorColumn})`;
});
message = lines.join('\n');
// Smoosh syntax errors (commonly found in CSS)
message = message.replace(
/SyntaxError\s+\((\d+):(\d+)\)\s*(.+?)\n/g,
`${friendlySyntaxErrorLabel} $3 ($1:$2)\n`
);
// Clean up export errors
message = message.replace(
/^.*export '(.+?)' was not found in '(.+?)'.*$/gm,
`Attempted import error: '$1' is not exported from '$2'.`
);
message = message.replace(
/^.*export 'default' \(imported as '(.+?)'\) was not found in '(.+?)'.*$/gm,
`Attempted import error: '$2' does not contain a default export (imported as '$1').`
);
message = message.replace(
/^.*export '(.+?)' \(imported as '(.+?)'\) was not found in '(.+?)'.*$/gm,
`Attempted import error: '$1' is not exported from '$3' (imported as '$2').`
);
lines = message.split('\n');
// Remove leading newline
if (lines.length > 2 && lines[1].trim() === '') {
lines.splice(1, 1);
}
// Clean up file name
lines[0] = lines[0].replace(/^(.*) \d+:\d+-\d+$/, '$1');
// Cleans up verbose "module not found" messages for files and packages.
if (lines[1] && lines[1].indexOf('Module not found: ') === 0) {
lines = [
lines[0],
lines[1]
.replace('Error: ', '')
.replace('Module not found: Cannot find file:', 'Cannot find file:'),
];
}
// Add helpful message for users trying to use Sass for the first time
if (lines[1] && lines[1].match(/Cannot find module.+sass/)) {
lines[1] = 'To import Sass files, you first need to install sass.\n';
lines[1] +=
'Run `npm install sass` or `yarn add sass` inside your workspace.';
}
message = lines.join('\n');
// Internal stacks are generally useless so we strip them... with the
// exception of stacks containing `webpack:` because they're normally
// from user code generated by webpack. For more information see
// https://github.com/facebook/create-react-app/pull/1050
message = message.replace(
/^\s*at\s((?!webpack:).)*:\d+:\d+[\s)]*(\n|$)/gm,
''
); // at ... ...:x:y
message = message.replace(/^\s*at\s<anonymous>(\n|$)/gm, ''); // at <anonymous>
lines = message.split('\n');
// Remove duplicated newlines
lines = lines.filter(
(line, index, arr) =>
index === 0 || line.trim() !== '' || line.trim() !== arr[index - 1].trim()
);
// Reassemble the message
message = lines.join('\n');
return message.trim();
}
function formatWebpackMessages(json) {
const formattedErrors = json.errors.map(formatMessage);
const formattedWarnings = json.warnings.map(formatMessage);
const result = { errors: formattedErrors, warnings: formattedWarnings };
if (result.errors.some(isLikelyASyntaxError)) {
// If there are any syntax errors, show just them.
result.errors = result.errors.filter(isLikelyASyntaxError);
}
return result;
}
module.exports = formatWebpackMessages;
...@@ -362,14 +362,8 @@ class Experiment extends React.Component<{}, ExpListState> { ...@@ -362,14 +362,8 @@ class Experiment extends React.Component<{}, ExpListState> {
private getSelectedData(type: string, date: Date | null | undefined): void { private getSelectedData(type: string, date: Date | null | undefined): void {
if (date !== null && date !== undefined) { if (date !== null && date !== undefined) {
const { const { selectedStatus, selectedPlatform, selectedStartDate, selectedEndDate, searchSource, sortInfo } =
selectedStatus, this.state;
selectedPlatform,
selectedStartDate,
selectedEndDate,
searchSource,
sortInfo
} = this.state;
const hasPlatform = selectedPlatform === '' ? false : true; const hasPlatform = selectedPlatform === '' ? false : true;
// filter status, platform // filter status, platform
......
...@@ -32,13 +32,7 @@ const filterByStatusOrPlatform = ( ...@@ -32,13 +32,7 @@ const filterByStatusOrPlatform = (
}; };
function fillOptions(arr: string[]): any { function fillOptions(arr: string[]): any {
const list: Array<object> = []; return arr.map(item => ({ key: item, text: item }));
arr.map(item => {
list.push({ key: item, text: item });
});
return list;
} }
function getSortedSource(source: AllExperimentList[], sortInfo: SortInfo): AllExperimentList[] { function getSortedSource(source: AllExperimentList[], sortInfo: SortInfo): AllExperimentList[] {
......
...@@ -20,11 +20,11 @@ interface SimpleColumn { ...@@ -20,11 +20,11 @@ interface SimpleColumn {
name: string; // name to display name: string; // name to display
} }
interface CheckBoxItems { //interface CheckBoxItems {
label: string; // label: string;
checked: boolean; // checked: boolean;
onChange: () => void; // onChange: () => void;
} //}
class ChangeColumnComponent extends React.Component<ChangeColumnProps, ChangeColumnState> { class ChangeColumnComponent extends React.Component<ChangeColumnProps, ChangeColumnState> {
constructor(props: ChangeColumnProps) { constructor(props: ChangeColumnProps) {
......
...@@ -51,7 +51,7 @@ class Customize extends React.Component<CustomizeProps, CustomizeState> { ...@@ -51,7 +51,7 @@ class Customize extends React.Component<CustomizeProps, CustomizeState> {
// get user edited hyperParameter, ps: will change data type if you modify the input val // get user edited hyperParameter, ps: will change data type if you modify the input val
const customized = JSON.parse(JSON.stringify(copyTrialParameter)); const customized = JSON.parse(JSON.stringify(copyTrialParameter));
// changeMap: user changed keys: values // changeMap: user changed keys: values
changeMap.forEach(function(value, key) { changeMap.forEach(function (value, key) {
customized[key] = value; customized[key] = value;
}); });
......
...@@ -27,9 +27,8 @@ export const EditExperimentParam = (): any => { ...@@ -27,9 +27,8 @@ export const EditExperimentParam = (): any => {
const hideSucceedInfo = useCallback(() => { const hideSucceedInfo = useCallback(() => {
setShowSucceedInfo(false); setShowSucceedInfo(false);
}, []); }, []);
const { title, field, editType, maxExecDuration, maxTrialNum, trialConcurrency, updateOverviewPage } = useContext( const { title, field, editType, maxExecDuration, maxTrialNum, trialConcurrency, updateOverviewPage } =
EditExpeParamContext useContext(EditExpeParamContext);
);
const originMaxDurationStr = EXPERIMENT.profile.params.maxExperimentDuration; const originMaxDurationStr = EXPERIMENT.profile.params.maxExperimentDuration;
const { maxDurationUnit, changeMaxDurationUnit } = useContext(AppContext); const { maxDurationUnit, changeMaxDurationUnit } = useContext(AppContext);
const [unit, setUnit] = useState(maxDurationUnit); const [unit, setUnit] = useState(maxDurationUnit);
...@@ -109,7 +108,6 @@ export const EditExperimentParam = (): any => { ...@@ -109,7 +108,6 @@ export const EditExperimentParam = (): any => {
// rest api, modify trial concurrency value // rest api, modify trial concurrency value
try { try {
const res = await axios.put(`${MANAGER_IP}/experiment`, newProfile, { const res = await axios.put(`${MANAGER_IP}/experiment`, newProfile, {
// eslint-disable-next-line @typescript-eslint/camelcase
params: { update_type: editType } params: { update_type: editType }
}); });
if (res.status === 200) { if (res.status === 200) {
......
...@@ -204,10 +204,12 @@ class SuccessTable extends React.Component<SuccessTableProps, SuccessTableState> ...@@ -204,10 +204,12 @@ class SuccessTable extends React.Component<SuccessTableProps, SuccessTableState>
} }
return ( return (
<Sticky stickyPosition={StickyPositionType.Header} isScrollSynced> <Sticky stickyPosition={StickyPositionType.Header} isScrollSynced>
{// eslint-disable-next-line @typescript-eslint/no-non-null-assertion {
defaultRender!({ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
...props defaultRender!({
})} ...props
})
}
</Sticky> </Sticky>
); );
}; };
......
...@@ -98,37 +98,39 @@ class OpenRow extends React.Component<OpenRowProps, OpenRowState> { ...@@ -98,37 +98,39 @@ class OpenRow extends React.Component<OpenRowProps, OpenRowState> {
)} )}
</PivotItem> </PivotItem>
<PivotItem headerText='Log' key='2' itemIcon='M365InvoicingLogo'> <PivotItem headerText='Log' key='2' itemIcon='M365InvoicingLogo'>
{// FIXME: this should not be handled in web UI side {
EXPERIMENT.trainingServicePlatform !== 'local' ? ( // FIXME: this should not be handled in web UI side
<PaiTrialLog EXPERIMENT.trainingServicePlatform !== 'local' ? (
logStr={logPathRow} <PaiTrialLog
id={trialId} logStr={logPathRow}
logCollection={EXPERIMENT.logCollectionEnabled} id={trialId}
/> logCollection={EXPERIMENT.logCollectionEnabled}
) : ( />
<div> ) : (
<TrialLog logStr={logPathRow} id={trialId} /> <div>
{/* view each trial log in drawer*/} <TrialLog logStr={logPathRow} id={trialId} />
<div id='trialog'> {/* view each trial log in drawer*/}
<div className='copy' style={{ marginTop: 15 }}> <div id='trialog'>
<PrimaryButton <div className='copy' style={{ marginTop: 15 }}>
onClick={this.openTrialLog.bind(this, 'TRIAL_LOG')} <PrimaryButton
text='View trial log' onClick={this.openTrialLog.bind(this, 'TRIAL_LOG')}
/> text='View trial log'
<PrimaryButton />
onClick={this.openTrialLog.bind(this, 'TRIAL_ERROR')} <PrimaryButton
text='View trial error' onClick={this.openTrialLog.bind(this, 'TRIAL_ERROR')}
styles={{ root: { marginLeft: 15 } }} text='View trial error'
/> styles={{ root: { marginLeft: 15 } }}
<PrimaryButton />
onClick={this.openTrialLog.bind(this, 'TRIAL_STDOUT')} <PrimaryButton
text='View trial stdout' onClick={this.openTrialLog.bind(this, 'TRIAL_STDOUT')}
styles={{ root: { marginLeft: 15 } }} text='View trial stdout'
/> styles={{ root: { marginLeft: 15 } }}
/>
</div>
</div> </div>
</div> </div>
</div> )
)} }
</PivotItem> </PivotItem>
</Pivot> </Pivot>
</Stack> </Stack>
......
...@@ -15,7 +15,7 @@ const DETAILTABS = ( ...@@ -15,7 +15,7 @@ const DETAILTABS = (
const NNILOGO = ( const NNILOGO = (
<NavLink to='/oview'> <NavLink to='/oview'>
<img src={require('../../static/img/logo.png')} alt='NNI logo' style={{ height: 40 }} /> <img src='/logo.png' alt='NNI logo' style={{ height: 40 }} />
</NavLink> </NavLink>
); );
......
...@@ -86,7 +86,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState> ...@@ -86,7 +86,7 @@ class Intermediate extends React.Component<IntermediateProps, IntermediateState>
trigger: 'item', trigger: 'item',
enterable: true, enterable: true,
confine: true, confine: true,
formatter: function(data: TooltipForIntermediate): React.ReactNode { formatter: function (data: TooltipForIntermediate): React.ReactNode {
const trialId = data.seriesName; const trialId = data.seriesName;
let parameters = {}; let parameters = {};
let trialNum = 0; let trialNum = 0;
......
...@@ -89,13 +89,8 @@ class Para extends React.Component<ParaProps, ParaState> { ...@@ -89,13 +89,8 @@ class Para extends React.Component<ParaProps, ParaState> {
} }
render(): React.ReactNode { render(): React.ReactNode {
const { const { selectedPercent, noChart, customizeColumnsDialogVisible, availableDimensions, chosenDimensions } =
selectedPercent, this.state;
noChart,
customizeColumnsDialogVisible,
availableDimensions,
chosenDimensions
} = this.state;
return ( return (
<div className='parameter'> <div className='parameter'>
...@@ -314,15 +309,9 @@ class Para extends React.Component<ParaProps, ParaState> { ...@@ -314,15 +309,9 @@ class Para extends React.Component<ParaProps, ParaState> {
if (axis.scale === 'ordinal') { if (axis.scale === 'ordinal') {
if (axis.nested) { if (axis.nested) {
// TODO: handle nested entries // TODO: handle nested entries
scaleInst = d3 scaleInst = d3.scalePoint().domain(Array.from(axis.domain.keys())).padding(0.2);
.scalePoint()
.domain(Array.from(axis.domain.keys()))
.padding(0.2);
} else { } else {
scaleInst = d3 scaleInst = d3.scalePoint().domain(axis.domain).padding(0.2);
.scalePoint()
.domain(axis.domain)
.padding(0.2);
} }
} else if (axis.scale === 'log') { } else if (axis.scale === 'log') {
scaleInst = d3.scaleLog().domain(padLog(axis.domain)); scaleInst = d3.scaleLog().domain(padLog(axis.domain));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment