From a17f543fd478c45499d22d3613437c9fc4ef4aa9 Mon Sep 17 00:00:00 2001 From: nikogu <644506165@qq.com> Date: Tue, 9 Jan 2018 15:10:21 +0800 Subject: [PATCH 1/5] fixed Authorized Demo & Ellipsis tooltip #615 --- package.json | 10 ---------- src/components/Authorized/demo/basic.md | 4 ++-- src/components/Ellipsis/index.js | 2 +- src/components/GlobalFooter/demo/basic.md | 2 +- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 7c0ad688fd..a77d20d303 100755 --- a/package.json +++ b/package.json @@ -87,16 +87,6 @@ "optionalDependencies": { "nightmare": "^2.10.0" }, - "babel": { - "presets": [ - "@babel/preset-env", - "@babel/preset-react" - ], - "plugins": [ - "transform-decorators-legacy", - "transform-class-properties" - ] - }, "jest": { "setupFiles": [ "/tests/setupTests.js" diff --git a/src/components/Authorized/demo/basic.md b/src/components/Authorized/demo/basic.md index c9694ad21d..48eb7c4459 100644 --- a/src/components/Authorized/demo/basic.md +++ b/src/components/Authorized/demo/basic.md @@ -36,7 +36,7 @@ ReactDOM.render( - - mountNode, + , + mountNode ); ``` diff --git a/src/components/Ellipsis/index.js b/src/components/Ellipsis/index.js index 3ddbc8e579..ae4019ce7e 100644 --- a/src/components/Ellipsis/index.js +++ b/src/components/Ellipsis/index.js @@ -171,7 +171,7 @@ export default class Ellipsis extends Component {
{ - tooltip ? ({children}) : children + tooltip ? ({children}) : children }
); } diff --git a/src/components/GlobalFooter/demo/basic.md b/src/components/GlobalFooter/demo/basic.md index 7662fa9f7e..9a06bade62 100644 --- a/src/components/GlobalFooter/demo/basic.md +++ b/src/components/GlobalFooter/demo/basic.md @@ -15,7 +15,7 @@ const links = [{ title: '帮助', href: '', }, { - key: 'github' + key: 'github', title: , href: 'https://github.com/ant-design/ant-design-pro', blankTarget: true, From cb206dcb5dc8fe872a02e55c1519c5b4b4480849 Mon Sep 17 00:00:00 2001 From: nikogu <644506165@qq.com> Date: Tue, 9 Jan 2018 15:14:32 +0800 Subject: [PATCH 2/5] restore package.json babel --- package.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/package.json b/package.json index a77d20d303..7c0ad688fd 100755 --- a/package.json +++ b/package.json @@ -87,6 +87,16 @@ "optionalDependencies": { "nightmare": "^2.10.0" }, + "babel": { + "presets": [ + "@babel/preset-env", + "@babel/preset-react" + ], + "plugins": [ + "transform-decorators-legacy", + "transform-class-properties" + ] + }, "jest": { "setupFiles": [ "/tests/setupTests.js" From 0949342b71b4a15096198a3221f6ac0b42b4079a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Tue, 9 Jan 2018 15:42:58 +0800 Subject: [PATCH 3/5] Turn off eslint check before build close #631 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7c0ad688fd..5389c25007 100755 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "scripts": { "precommit": "npm run lint-staged", "start": "cross-env DISABLE_ESLINT=true roadhog dev", - "start:no-proxy": "cross-env NO_PROXY=true roadhog dev", - "build": "roadhog build", + "start:no-proxy": "cross-env NO_PROXY=true DISABLE_ESLINT=true roadhog dev", + "build": "cross-env DISABLE_ESLINT=true roadhog build", "site": "roadhog-api-doc static && gh-pages -d dist", "analyze": "roadhog build --analyze", "lint:style": "stylelint \"src/**/*.less\" --syntax less", From c036c8626102b017c768082d18ee87c4eef8892c Mon Sep 17 00:00:00 2001 From: jim Date: Tue, 9 Jan 2018 16:11:56 +0800 Subject: [PATCH 4/5] add secured doc --- src/components/Authorized/demo/secured.md | 73 +++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/components/Authorized/demo/secured.md diff --git a/src/components/Authorized/demo/secured.md b/src/components/Authorized/demo/secured.md new file mode 100644 index 0000000000..2ff7c2de0a --- /dev/null +++ b/src/components/Authorized/demo/secured.md @@ -0,0 +1,73 @@ +--- +order: 1 +title: + zh-CN: 注解 + en-US: secured +--- + +```jsx +import RenderAuthorized from 'ant-design-pro/lib/Authorized'; +import { Alert } from 'antd'; + +const { Secured } = RenderAuthorized('user'); +const noMatch = ; + +const havePermission = () => { + return false; +}; + +const havePermissionAsync = new Promise((resolve, reject) => { + // Call reslove on behalf of passed + setTimeout(() => reslove(), 1000); +}); + +@Secured('admin', noMatch) +class TestSecuredString extends React.Component { + render() { + ; + } +} + +@Secured(['user', 'admin'], noMatch) +class TestSecuredArray extends React.Component { + render() { + ; + } +} + +@Secured(havePermission, noMatch) +class TestSecuredFunction extends React.Component { + render() { + ; + } +} + +@Secured(havePermissionAsync, noMatch) +class TestSecuredPromise extends React.Component { + render() { + ; + } +} + +ReactDOM.render( +
+ + + + +
, + mountNode, +); +``` From 5776750539794f8b7243dec50ccfa76af7fd77dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Cederstr=C3=B6m?= Date: Tue, 9 Jan 2018 15:13:32 +0100 Subject: [PATCH 5/5] redirect from /user to /user/login (#632) --- src/layouts/UserLayout.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/layouts/UserLayout.js b/src/layouts/UserLayout.js index 3b2487bd72..01228a51f6 100644 --- a/src/layouts/UserLayout.js +++ b/src/layouts/UserLayout.js @@ -1,5 +1,5 @@ import React from 'react'; -import { Link, Route } from 'dva/router'; +import { Link, Redirect, Switch, Route } from 'dva/router'; import DocumentTitle from 'react-document-title'; import { Icon } from 'antd'; import GlobalFooter from '../components/GlobalFooter'; @@ -47,8 +47,8 @@ class UserLayout extends React.PureComponent {
Ant Design 是西湖区最具影响力的 Web 设计规范
- { - getRoutes(match.path, routerData).map(item => + + {getRoutes(match.path, routerData).map(item => ( ) - ) - } + )} + +