From 0bd1e9cf590bc7e61c159b952d0a5518b8611488 Mon Sep 17 00:00:00 2001 From: Baorong Li Date: Wed, 6 Mar 2019 12:11:42 +0800 Subject: [PATCH 1/6] fix #947 misspelled word cancel --- src/utils/constant.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/constant.js b/src/utils/constant.js index f2788fb..3ca2222 100644 --- a/src/utils/constant.js +++ b/src/utils/constant.js @@ -4,4 +4,4 @@ export const ROLE_TYPE = { DEVELOPER: 'developer', } -export const CANCEL_REQUEST_MESSAGE = 'cancle request' +export const CANCEL_REQUEST_MESSAGE = 'cancel request' From e6b2f7f2713f2e7719f2886aa1fb3d8b48ed4b91 Mon Sep 17 00:00:00 2001 From: Baorong Li Date: Wed, 13 Mar 2019 16:59:12 +0800 Subject: [PATCH 2/6] fix #950 modify z-index in header --- src/components/Layout/Header.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Layout/Header.less b/src/components/Layout/Header.less index a308f32..1709b6d 100644 --- a/src/components/Layout/Header.less +++ b/src/components/Layout/Header.less @@ -16,7 +16,7 @@ top: 0; right: 0; width: ~'calc(100% - 256px)'; - z-index: 9; + z-index: 29; transition: width 0.2s; &.collapsed { From 33abd9369e380ccd6feec88a1465ae5426a69dbf Mon Sep 17 00:00:00 2001 From: Baorong Li Date: Tue, 19 Mar 2019 10:59:37 +0800 Subject: [PATCH 3/6] fix #957 an flaw ignored --- README.md | 2 +- docs/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 95cb04f..c0c1cf8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@
-A excellent front-end solution for enterprise applications. +An excellent front-end solution for enterprise applications. [![antd](https://img.shields.io/badge/antd-^3.10.0-blue.svg?style=flat-square)](https://github.com/ant-design/ant-design) [![umi](https://img.shields.io/badge/umi-^2.2.1-orange.svg?style=flat-square)](https://github.com/umijs/umi) diff --git a/docs/README.md b/docs/README.md index eb56477..41f72da 100644 --- a/docs/README.md +++ b/docs/README.md @@ -8,7 +8,7 @@
-A excellent front-end solution for enterprise applications. +An excellent front-end solution for enterprise applications. [![antd](https://img.shields.io/badge/antd-^3.10.0-blue.svg?style=flat-square)](https://github.com/ant-design/ant-design) [![umi](https://img.shields.io/badge/umi-^2.2.1-orange.svg?style=flat-square)](https://github.com/umijs/umi) From b278b028cf5ab36642b3cd87fac3cecc097325b1 Mon Sep 17 00:00:00 2001 From: Baorong Li Date: Thu, 4 Apr 2019 16:45:28 +0800 Subject: [PATCH 4/6] fix #958 redux form initialValues not updating with state --- docs/zh-cn/deploy.md | 2 +- src/pages/login/index.js | 2 +- src/pages/request/index.js | 2 +- src/pages/user/components/Filter.js | 2 +- src/pages/user/components/Modal.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/zh-cn/deploy.md b/docs/zh-cn/deploy.md index e9cb04c..cdbac06 100644 --- a/docs/zh-cn/deploy.md +++ b/docs/zh-cn/deploy.md @@ -36,7 +36,7 @@ File sizes after gzip: `build` 命令会打包所有的资源,包含 JavaScript, CSS, web fonts, images, html 等。你可以在 `dist/` 目录下找到这些文件。 -> 如果  有使用 HashHistory 、 部署 html 到非根目录、静态化等需求,请查看[Umi 部署](https://umijs.org/zh/guide/deploy.html)。 +> 如果有使用 HashHistory 、 部署 html 到非根目录、静态化等需求,请查看[Umi 部署](https://umijs.org/zh/guide/deploy.html)。 ## 本地验证 diff --git a/src/pages/login/index.js b/src/pages/login/index.js index 1228630..b7dfdc3 100644 --- a/src/pages/login/index.js +++ b/src/pages/login/index.js @@ -12,7 +12,7 @@ const FormItem = Form.Item @withI18n() @connect(({ loading }) => ({ loading })) -@Form.create() +@Form.create({ enableReinitialize: true }) class Login extends PureComponent { handleOk = () => { const { dispatch, form } = this.props diff --git a/src/pages/request/index.js b/src/pages/request/index.js index 911e101..d3ded13 100644 --- a/src/pages/request/index.js +++ b/src/pages/request/index.js @@ -46,7 +46,7 @@ const requests = Object.values(api).map(item => { }) let uuid = 2 -@Form.create() +@Form.create({ enableReinitialize: true }) class RequestPage extends React.Component { constructor(props) { super(props) diff --git a/src/pages/user/components/Filter.js b/src/pages/user/components/Filter.js index c031d30..01d0f49 100644 --- a/src/pages/user/components/Filter.js +++ b/src/pages/user/components/Filter.js @@ -24,7 +24,7 @@ const TwoColProps = { } @withI18n() -@Form.create() +@Form.create({ enableReinitialize: true }) class Filter extends PureComponent { handleFields = fields => { const { createTime } = fields diff --git a/src/pages/user/components/Modal.js b/src/pages/user/components/Modal.js index 2d8fe28..96901d6 100644 --- a/src/pages/user/components/Modal.js +++ b/src/pages/user/components/Modal.js @@ -15,7 +15,7 @@ const formItemLayout = { }, } @withI18n() -@Form.create() +@Form.create({ enableReinitialize: true }) class UserModal extends PureComponent { handleOk = () => { const { item = {}, onOk, form } = this.props From 565bce6d8bd2fcbf8f7c6e05467d0819dfe7083c Mon Sep 17 00:00:00 2001 From: Baorong Li Date: Fri, 5 Apr 2019 09:02:25 +0800 Subject: [PATCH 5/6] refix #958 by reset form in componentDidUpdate --- src/pages/login/index.js | 2 +- src/pages/request/index.js | 2 +- src/pages/user/components/Filter.js | 11 ++++++++--- src/pages/user/components/Modal.js | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/pages/login/index.js b/src/pages/login/index.js index b7dfdc3..1228630 100644 --- a/src/pages/login/index.js +++ b/src/pages/login/index.js @@ -12,7 +12,7 @@ const FormItem = Form.Item @withI18n() @connect(({ loading }) => ({ loading })) -@Form.create({ enableReinitialize: true }) +@Form.create() class Login extends PureComponent { handleOk = () => { const { dispatch, form } = this.props diff --git a/src/pages/request/index.js b/src/pages/request/index.js index d3ded13..911e101 100644 --- a/src/pages/request/index.js +++ b/src/pages/request/index.js @@ -46,7 +46,7 @@ const requests = Object.values(api).map(item => { }) let uuid = 2 -@Form.create({ enableReinitialize: true }) +@Form.create() class RequestPage extends React.Component { constructor(props) { super(props) diff --git a/src/pages/user/components/Filter.js b/src/pages/user/components/Filter.js index 01d0f49..1931677 100644 --- a/src/pages/user/components/Filter.js +++ b/src/pages/user/components/Filter.js @@ -1,5 +1,5 @@ /* global document */ -import React, { PureComponent } from 'react' +import React, { Component } from 'react' import PropTypes from 'prop-types' import moment from 'moment' import { FilterItem } from 'components' @@ -24,8 +24,13 @@ const TwoColProps = { } @withI18n() -@Form.create({ enableReinitialize: true }) -class Filter extends PureComponent { +@Form.create() +class Filter extends Component { + componentDidUpdate(prevProps, prevState) { + if (Object.keys(prevProps.filter).length === 0) { + this.handleReset() + } + } handleFields = fields => { const { createTime } = fields if (createTime.length) { diff --git a/src/pages/user/components/Modal.js b/src/pages/user/components/Modal.js index 96901d6..2d8fe28 100644 --- a/src/pages/user/components/Modal.js +++ b/src/pages/user/components/Modal.js @@ -15,7 +15,7 @@ const formItemLayout = { }, } @withI18n() -@Form.create({ enableReinitialize: true }) +@Form.create() class UserModal extends PureComponent { handleOk = () => { const { item = {}, onOk, form } = this.props From 0ac4839e948f7b1d34c90d33f4ece483bd9d2f48 Mon Sep 17 00:00:00 2001 From: Baorong Li Date: Wed, 10 Apr 2019 07:22:53 +0800 Subject: [PATCH 6/6] upgrade umi@2.6.x --- .umirc.js | 1 - package.json | 21 +++++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.umirc.js b/.umirc.js index 2aadb7e..05a0fab 100644 --- a/.umirc.js +++ b/.umirc.js @@ -58,7 +58,6 @@ export default { dll: { include: ['dva', 'dva/router', 'dva/saga', 'dva/fetch', 'antd/es'], }, - // hardSource: /* isMac */ process.platform === 'darwin', pwa: { manifestOptions: { srcPath: 'manifest.json' diff --git a/package.json b/package.json index dc8dd21..2e777f6 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "private": true, "description": "An admin dashboard application demo built upon Ant Design and UmiJS", "dependencies": { - "@lingui/react": "^2.7.2", - "ant-design-pro": "^2.2.0", + "@lingui/react": "^2.7.0", + "ant-design-pro": "^2.3.0", "antd": "^3.14.0", "axios": "^0.18.0", "babel-core": "7.0.0-bridge.0", @@ -27,7 +27,7 @@ "nprogress": "^0.2.0", "path-to-regexp": "^2.4.0", "prop-types": "^15.7.0", - "qs": "^6.6.0", + "qs": "^6.7.0", "rc-tween-one": "^2.3.0", "react-adsense": "^0.0.6", "react-countup": "^4.1.0", @@ -39,9 +39,9 @@ "store": "^2.0.12" }, "devDependencies": { - "@lingui/babel-preset-react": "^2.7.2", - "@lingui/cli": "^2.7.2", - "@lingui/loader": "^2.7.2", + "@lingui/babel-preset-react": "^2.7.0", + "@lingui/cli": "^2.7.0", + "@lingui/loader": "^2.7.0", "babel-eslint": "^10.0.1", "babel-plugin-dev-expression": "^0.2.1", "babel-plugin-import": "^1.10.0", @@ -50,7 +50,7 @@ "cross-env": "^5.2.0", "eslint": "^5.15.0", "eslint-config-react-app": "^3.0.5", - "eslint-plugin-flowtype": "^3.4.0", + "eslint-plugin-flowtype": "^3.6.0", "eslint-plugin-import": "^2.16.0", "eslint-plugin-jsx-a11y": "^6.2.1", "eslint-plugin-react": "^7.12.0", @@ -63,11 +63,8 @@ "stylelint": "^9.10.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.13.0" + "umi": "^2.6.0", + "umi-plugin-react": "^1.7.0" }, "lint-staged": { "src/**/*.js": [