From 29aa0f416e8ccf72021a5784dab4051319c15fde Mon Sep 17 00:00:00 2001 From: Baorong Li Date: Tue, 5 Mar 2019 16:15:02 +0800 Subject: [PATCH 1/3] fix Cannot read property 'addEventListener' of null #946 --- src/layouts/PrimaryLayout.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/layouts/PrimaryLayout.js b/src/layouts/PrimaryLayout.js index f3f5e3f..8a5df9b 100644 --- a/src/layouts/PrimaryLayout.js +++ b/src/layouts/PrimaryLayout.js @@ -59,19 +59,18 @@ class PrimaryLayout extends PureComponent { // Localized route name. - const lang = langFromPath(location.pathname); + const lang = langFromPath(location.pathname) const newRouteList = - lang !== 'en' + lang !== 'en' ? routeList.map(item => { - const { name , ...other } = item + const { name, ...other } = item return { ...other, - name: ((item[lang] || {}).name || name), + name: (item[lang] || {}).name || name, } }) : routeList - // Find a route that matches the pathname. const currentRoute = newRouteList.find( _ => _.route && pathMatchRegexp(_.route, location.pathname) @@ -148,7 +147,7 @@ class PrimaryLayout extends PureComponent { document.querySelector('#primaryLayout>div')} + target={() => document.querySelector('#primaryLayout')} /> Date: Tue, 5 Mar 2019 16:15:33 +0800 Subject: [PATCH 2/3] fix less is not a command in prettier --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5ec6f0b..04a4fbd 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "lint:style": "stylelint \"src/**/*.less\" --syntax less", "start": "umi dev", "test": "cross-env BABELRC=none umi test", - "prettier": "prettier --write 'src/**/*.(js|less)'", + "prettier": "prettier --write 'src/**/*.{js,less}'", "precommit": "lint-staged", "add-locale": "lingui add-locale", "extract": "lingui extract", From 3a6c5875694d37111042b4bf0438fd81e29fde57 Mon Sep 17 00:00:00 2001 From: Baorong Li Date: Tue, 5 Mar 2019 16:17:12 +0800 Subject: [PATCH 3/3] upgrade antd@3.14 --- package.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 04a4fbd..dc8dd21 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dependencies": { "@lingui/react": "^2.7.2", "ant-design-pro": "^2.2.0", - "antd": "^3.13.0", + "antd": "^3.14.0", "axios": "^0.18.0", "babel-core": "7.0.0-bridge.0", "classnames": "^2.2.6", @@ -25,13 +25,13 @@ "lodash": "^4.17.11", "md5": "^2.2.1", "nprogress": "^0.2.0", - "path-to-regexp": "^3.0.0", - "prop-types": "^15.7.2", + "path-to-regexp": "^2.4.0", + "prop-types": "^15.7.0", "qs": "^6.6.0", - "rc-tween-one": "^2.2.18", + "rc-tween-one": "^2.3.0", "react-adsense": "^0.0.6", "react-countup": "^4.1.0", - "react-draft-wysiwyg": "^1.12.13", + "react-draft-wysiwyg": "^1.13.0", "react-helmet": "^5.2.0", "react-highcharts": "^16.0.2", "react-perfect-scrollbar": "^1.4.2", @@ -48,26 +48,26 @@ "babel-plugin-macros": "^2.5.0", "babel-plugin-module-resolver": "^3.2.0", "cross-env": "^5.2.0", - "eslint": "^5.14.0", + "eslint": "^5.15.0", "eslint-config-react-app": "^3.0.5", "eslint-plugin-flowtype": "^3.4.0", "eslint-plugin-import": "^2.16.0", - "eslint-plugin-jsx-a11y": "^6.2.0", - "eslint-plugin-react": "^7.1.0", - "husky": "^1.2.0", + "eslint-plugin-jsx-a11y": "^6.2.1", + "eslint-plugin-react": "^7.12.0", + "husky": "^1.3.0", "less-vars-to-js": "^1.3.0", "lint-staged": "^8.1.0", "mockjs": "^1.0.1-beta3", "module": "^1.2.5", "prettier": "^1.16.0", "stylelint": "^9.10.0", - "stylelint-config-prettier": "^4.0.0", + "stylelint-config-prettier": "^5.0.0", "stylelint-config-standard": "^18.2.0", "umi": "^2.5.0", "umi-plugin-react": "^1.5.0" }, "optionalDependencies": { - "puppeteer": "^1.11.0" + "puppeteer": "^1.13.0" }, "lint-staged": { "src/**/*.js": [