From 76e19f15b50218f0db71bc44bacbef9f6bb059ba Mon Sep 17 00:00:00 2001 From: Vitor Gultzgoff Date: Fri, 22 Mar 2019 10:52:10 -0300 Subject: [PATCH] Optional prop which is used as label for Tooltip #3761 (#3778) --- src/components/Charts/MiniProgress/index.d.ts | 1 + src/components/Charts/MiniProgress/index.js | 14 ++++++++++++-- src/locales/en-US/component.js | 1 + src/locales/pt-BR/component.js | 1 + src/locales/zh-CN/component.js | 1 + src/locales/zh-TW/component.js | 1 + 6 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/components/Charts/MiniProgress/index.d.ts b/src/components/Charts/MiniProgress/index.d.ts index 0ef158e8..6111d88d 100644 --- a/src/components/Charts/MiniProgress/index.d.ts +++ b/src/components/Charts/MiniProgress/index.d.ts @@ -1,6 +1,7 @@ import React from 'react'; export interface IMiniProgressProps { target: number; + targetLabel: string; color?: string; strokeWidth?: number; percent?: number; diff --git a/src/components/Charts/MiniProgress/index.js b/src/components/Charts/MiniProgress/index.js index 795c79b1..16ca2b7b 100644 --- a/src/components/Charts/MiniProgress/index.js +++ b/src/components/Charts/MiniProgress/index.js @@ -1,11 +1,21 @@ import React from 'react'; import { Tooltip } from 'antd'; +import { formatMessage } from 'umi/locale'; import styles from './index.less'; -const MiniProgress = ({ target, color = 'rgb(19, 194, 194)', strokeWidth, percent }) => ( +const MiniProgress = ({ + targetLabel, + target, + color = 'rgb(19, 194, 194)', + strokeWidth, + percent, +}) => (
- +
diff --git a/src/locales/en-US/component.js b/src/locales/en-US/component.js index 3ba7eeda..910f30e1 100644 --- a/src/locales/en-US/component.js +++ b/src/locales/en-US/component.js @@ -2,4 +2,5 @@ export default { 'component.tagSelect.expand': 'Expand', 'component.tagSelect.collapse': 'Collapse', 'component.tagSelect.all': 'All', + 'component.miniProgress.tooltipDefault': 'Target value', }; diff --git a/src/locales/pt-BR/component.js b/src/locales/pt-BR/component.js index 7cf9999c..d3a2c1b3 100644 --- a/src/locales/pt-BR/component.js +++ b/src/locales/pt-BR/component.js @@ -2,4 +2,5 @@ export default { 'component.tagSelect.expand': 'Expandir', 'component.tagSelect.collapse': 'Diminuir', 'component.tagSelect.all': 'Todas', + 'component.miniProgress.tooltipDefault': 'Valor alvo', }; diff --git a/src/locales/zh-CN/component.js b/src/locales/zh-CN/component.js index 1f1feadb..8d988ca0 100644 --- a/src/locales/zh-CN/component.js +++ b/src/locales/zh-CN/component.js @@ -2,4 +2,5 @@ export default { 'component.tagSelect.expand': '展开', 'component.tagSelect.collapse': '收起', 'component.tagSelect.all': '全部', + 'component.miniProgress.tooltipDefault': '目标值', }; diff --git a/src/locales/zh-TW/component.js b/src/locales/zh-TW/component.js index ba48e299..dde9eb59 100644 --- a/src/locales/zh-TW/component.js +++ b/src/locales/zh-TW/component.js @@ -2,4 +2,5 @@ export default { 'component.tagSelect.expand': '展開', 'component.tagSelect.collapse': '收起', 'component.tagSelect.all': '全部', + 'component.miniProgress.tooltipDefault': '目标值', }; -- GitLab