- {tooltip ? (
-
- {childNode}
-
- ) : (
- childNode
- )}
+ {getTooltip({
+ tooltip,
+ overlayStyle: TooltipOverlayStyle,
+ title: text,
+ children: childNode,
+ })}
{children}
diff --git a/src/components/Exception/index.d.ts b/src/components/Exception/index.d.ts
index d62c177193d067f19484b3b40b591de7a3ccb86b..a74abb1fa6334cb2b8ef987aab5a1b5dc1f0d531 100644
--- a/src/components/Exception/index.d.ts
+++ b/src/components/Exception/index.d.ts
@@ -5,7 +5,7 @@ export interface IExceptionProps {
desc?: React.ReactNode;
img?: string;
actions?: React.ReactNode;
- linkElement?: React.ReactNode;
+ linkElement?: string | React.ComponentType;
style?: React.CSSProperties;
className?: string;
backText?: React.ReactNode;
diff --git a/src/components/Login/LoginItem.js b/src/components/Login/LoginItem.js
index cc32ec1d547a200f3aa32cd671f6305b05b46e47..0f45a7fddee20463eec7014b74928e445cae58f6 100644
--- a/src/components/Login/LoginItem.js
+++ b/src/components/Login/LoginItem.js
@@ -1,5 +1,6 @@
import React, { Component } from 'react';
import { Form, Input, Button, Row, Col } from 'antd';
+import { formatMessage } from 'umi/locale';
import omit from 'omit.js';
import styles from './index.less';
import ItemMap from './map';
@@ -9,7 +10,8 @@ const FormItem = Form.Item;
class WrapFormItem extends Component {
static defaultProps = {
- buttonText: '获取验证码',
+ getCaptchaButtonText: formatMessage({ id: 'form.captcha' }),
+ getCaptchaSecondText: formatMessage({ id: 'form.captcha.second' }),
};
constructor(props) {
@@ -83,7 +85,8 @@ class WrapFormItem extends Component {
defaultValue,
rules,
name,
- buttonText,
+ getCaptchaButtonText,
+ getCaptchaSecondText,
updateActive,
type,
...restProps
@@ -108,7 +111,7 @@ class WrapFormItem extends Component {
size="large"
onClick={this.onGetCaptcha}
>
- {count ? `${count} s` : buttonText}
+ {count ? `${count} ${getCaptchaSecondText}` : getCaptchaButtonText}
diff --git a/src/components/Login/index.less b/src/components/Login/index.less
index 995b68d27a2795e2371a963228e32023fd6d38b2..646b6631d2b771e6f09332e62f310230715e462b 100644
--- a/src/components/Login/index.less
+++ b/src/components/Login/index.less
@@ -13,6 +13,11 @@
}
}
+ .getCaptcha {
+ display: block;
+ width: 100%;
+ }
+
.icon {
font-size: 24px;
color: rgba(0, 0, 0, 0.2);
diff --git a/src/components/NoticeIcon/index.zh-CN.md b/src/components/NoticeIcon/index.zh-CN.md
index 056e376898b24443331dd70852d66d5cdcc55cf5..3c78dba1132c76ca398cf35572d386c930729630 100644
--- a/src/components/NoticeIcon/index.zh-CN.md
+++ b/src/components/NoticeIcon/index.zh-CN.md
@@ -21,6 +21,7 @@ popupAlign | 弹出卡片的位置配置 | Object [alignConfig](https://github.c
onPopupVisibleChange | 弹出卡片显隐的回调 | function(visible) | -
popupVisible | 控制弹层显隐 | boolean | -
locale | 默认文案 | Object | `{ emptyText: '暂无数据', clear: '清空' }`
+clearClose | 点击清空按钮后关闭通知菜单 | boolean | false
### NoticeIcon.Tab
@@ -43,3 +44,4 @@ title | 标题 | ReactNode | -
description | 描述信息 | ReactNode | -
datetime | 时间戳 | ReactNode | -
extra | 额外信息,在列表项右上角 | ReactNode | -
+clickClose | 点击列表项关闭通知菜单 | boolean | false
diff --git a/src/components/SiderMenu/SiderMenu.js b/src/components/SiderMenu/SiderMenu.js
index 2d366b9ba04b3a4bbbae3d014cf5af4aa7e2dd85..e457f2f5b6f12524b26c112302e2e6c0cbe91f67 100644
--- a/src/components/SiderMenu/SiderMenu.js
+++ b/src/components/SiderMenu/SiderMenu.js
@@ -118,7 +118,7 @@ export default class SiderMenu extends PureComponent {
mode="inline"
handleOpenChange={this.handleOpenChange}
onOpenChange={this.handleOpenChange}
- style={{ padding: '16px 0', width: '100%', overflowX: 'hidden' }}
+ style={{ padding: '16px 0', width: '100%' }}
{...defaultProps}
/>
diff --git a/src/components/SiderMenu/index.less b/src/components/SiderMenu/index.less
index 06d5f6abcea2bffeda660d1a07cb8bb522da52df..7ffba1b1f6479cf29f6f2b4c9312c2a0950c4109 100644
--- a/src/components/SiderMenu/index.less
+++ b/src/components/SiderMenu/index.less
@@ -21,7 +21,7 @@
vertical-align: middle;
font-size: 20px;
margin: 0 0 0 12px;
- font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
+ font-family: Avenir, 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: 600;
}
}
diff --git a/src/components/Trend/index.js b/src/components/Trend/index.js
index 1cdceb2eeb67283c8b69cc10dbb8a90592a92393..c476ef62c722f10ca6dcf05c121111f9f91d89db 100644
--- a/src/components/Trend/index.js
+++ b/src/components/Trend/index.js
@@ -14,7 +14,7 @@ const Trend = ({ colorful = true, reverseColor = false, flag, children, classNam
);
return (
- {children}
+ {children}
{flag && (
diff --git a/src/e2e/home.e2e.js b/src/e2e/home.e2e.js
index 914ed7c1934eaf4fb2f89d6aee76a5f81470482e..cadac245b6ff2e7fd721b1de5961f6034ad41ef7 100644
--- a/src/e2e/home.e2e.js
+++ b/src/e2e/home.e2e.js
@@ -3,13 +3,16 @@ import puppeteer from 'puppeteer';
const BASE_URL = `http://localhost:${process.env.PORT || 8000}`;
describe('Homepage', () => {
+ beforeAll(async () => {
+ jest.setTimeout(1000000);
+ });
it('it should have logo text', async () => {
const browser = await puppeteer.launch({ args: ['--no-sandbox'] });
const page = await browser.newPage();
await page.goto(BASE_URL, { waitUntil: 'networkidle2' });
- await page.waitForSelector('#logo h1');
- const text = await page.evaluate(() => document.body.innerHTML);
- expect(text).toContain('Ant Design Pro
');
+ const text = await page.evaluate(() => document.getElementsByTagName('h1')[0].innerText);
+ expect(text).toContain('Ant Design Pro');
+
await page.close();
browser.close();
});
diff --git a/src/e2e/layout.e2e.js b/src/e2e/layout.e2e.js
index 58525bc98bfbb8da3079074bf1f870b626caa6c8..3d95dc1d06db6acdcb4237ffc548b327de21d916 100644
--- a/src/e2e/layout.e2e.js
+++ b/src/e2e/layout.e2e.js
@@ -28,6 +28,7 @@ describe('Homepage', () => {
};
beforeAll(async () => {
+ jest.setTimeout(1000000);
browser = await puppeteer.launch({ args: ['--no-sandbox'] });
page = await browser.newPage();
});
diff --git a/src/layouts/UserLayout.less b/src/layouts/UserLayout.less
index d4ac3861f83cd5a6176a232ae14546a4bce34c01..5eb257a442db44cc5abfbecdb8db76f94d8d08d6 100644
--- a/src/layouts/UserLayout.less
+++ b/src/layouts/UserLayout.less
@@ -32,7 +32,7 @@
}
.content {
- padding: 72px 0 24px 0;
+ padding: 32px 0 24px 0;
}
}
@@ -57,7 +57,7 @@
.title {
font-size: 33px;
color: @heading-color;
- font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
+ font-family: Avenir, 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: 600;
position: relative;
top: 2px;
diff --git a/src/locales/en-US.js b/src/locales/en-US.js
index 9e4eb346841c7ea3f852fb093b1196e9acbf201d..692c0939e59c79d4a13f686d477e533f75185ef7 100644
--- a/src/locales/en-US.js
+++ b/src/locales/en-US.js
@@ -20,6 +20,8 @@ export default {
'validation.date.required': 'Please select the start and end date',
'validation.goal.required': 'Please enter a description of the goal',
'validation.standard.required': 'Please enter a metric',
+ 'form.captcha': 'Get Captcha',
+ 'form.captcha.second': 'sec',
'form.optional': ' (optional) ',
'form.submit': 'Submit',
'form.save': 'Save',
diff --git a/src/locales/pt-BR.js b/src/locales/pt-BR.js
index 8e6627ca67ebad651c3d91afae7d369e567f7a06..5ac17a884e9e2fe9da4235b8e341b98bd7e09383 100644
--- a/src/locales/pt-BR.js
+++ b/src/locales/pt-BR.js
@@ -16,6 +16,8 @@ export default {
'validation.phone-number.required': 'Por favor insira seu telefone!',
'validation.phone-number.wrong-format': 'Formato de telefone errado!',
'validation.verification-code.required': 'Por favor insira seu código de verificação!',
+ 'form.captcha': 'Get Captcha',
+ 'form.captcha.second': 'sec',
'form.email.placeholder': 'Email',
'form.password.placeholder': 'Senha',
'form.confirm-password.placeholder': 'Confirme a senha',
diff --git a/src/locales/zh-CN.js b/src/locales/zh-CN.js
index 1b16e5ffbb714681338195bf166a7e72464772c3..ecf546589c04e1da6894faff4c801076029a076d 100644
--- a/src/locales/zh-CN.js
+++ b/src/locales/zh-CN.js
@@ -19,6 +19,8 @@ export default {
'validation.date.required': '请选择起止日期',
'validation.goal.required': '请输入目标描述',
'validation.standard.required': '请输入衡量标准',
+ 'form.captcha': '获取验证码',
+ 'form.captcha.second': '秒',
'form.optional': '(选填)',
'form.submit': '提交',
'form.save': '保存',
diff --git a/src/locales/zh-TW.js b/src/locales/zh-TW.js
index b919c44c540c2c35a1bb4cfc644b96397aeaef65..7017aa5e9f10aed1612b9b889d4bdbed94e874b6 100644
--- a/src/locales/zh-TW.js
+++ b/src/locales/zh-TW.js
@@ -19,6 +19,8 @@ export default {
'validation.date.required': '請選擇起止日期',
'validation.goal.required': '請輸入目標描述',
'validation.standard.required': '請輸入衡量標淮',
+ 'form.captcha': '獲取驗證碼',
+ 'form.captcha.second': '秒',
'form.optional': '(選填)',
'form.submit': '提交',
'form.save': '保存',
diff --git a/src/pages/Dashboard/Monitor.js b/src/pages/Dashboard/Monitor.js
index a6d68905b6397a67d38fbb34a7fa0bca059919fb..629091747c22a65cc6e62d7d4e87af362c2fc7fb 100644
--- a/src/pages/Dashboard/Monitor.js
+++ b/src/pages/Dashboard/Monitor.js
@@ -145,7 +145,7 @@ class Monitor extends PureComponent {
-
+
-
+
-
+
-
+