From 808a081e6d29956bb21a50b5ec828563704942c4 Mon Sep 17 00:00:00 2001 From: juzhiyuan Date: Thu, 18 Feb 2021 13:12:05 +0800 Subject: [PATCH 1/2] feat: added tip for Plugin module --- web/src/components/Plugin/PluginPage.tsx | 12 ++++++++++++ web/src/components/Plugin/locales/en-US.ts | 20 ++++++++++++++++++++ web/src/components/Plugin/locales/zh-CN.ts | 20 ++++++++++++++++++++ web/src/locales/en-US.ts | 2 ++ web/src/locales/zh-CN.ts | 2 ++ 5 files changed, 56 insertions(+) create mode 100644 web/src/components/Plugin/locales/en-US.ts create mode 100644 web/src/components/Plugin/locales/zh-CN.ts diff --git a/web/src/components/Plugin/PluginPage.tsx b/web/src/components/Plugin/PluginPage.tsx index 6798f5f623..e5404fbd67 100644 --- a/web/src/components/Plugin/PluginPage.tsx +++ b/web/src/components/Plugin/PluginPage.tsx @@ -18,6 +18,7 @@ import React, { useEffect, useState } from 'react'; import { Anchor, Layout, Card, Button } from 'antd'; import { PanelSection } from '@api7-dashboard/ui'; import { omit, orderBy } from 'lodash'; +import { useIntl } from 'umi'; import PluginDetail from './PluginDetail'; import { fetchList } from './service'; @@ -54,6 +55,8 @@ const PluginPage: React.FC = ({ type = 'scoped', onChange = () => {}, }) => { + const { formatMessage } = useIntl(); + const [pluginList, setPluginList] = useState([]); const [name, setName] = useState(NEVER_EXIST_PLUGIN_FLAG); const [typeList, setTypeList] = useState([]); @@ -101,6 +104,15 @@ const PluginPage: React.FC = ({ + {formatMessage({ id: 'component.plugin.tip1' })} + + {formatMessage({ id: 'component.plugin.tip2' })} + +
{typeList.map((typeItem) => { return ( Date: Thu, 18 Feb 2021 13:14:23 +0800 Subject: [PATCH 2/2] feat: added tip for Plugin module --- web/src/components/Plugin/PluginPage.tsx | 18 +++++++++--------- web/src/components/Plugin/locales/en-US.ts | 2 +- web/src/components/Plugin/locales/zh-CN.ts | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/web/src/components/Plugin/PluginPage.tsx b/web/src/components/Plugin/PluginPage.tsx index e5404fbd67..a8a811733a 100644 --- a/web/src/components/Plugin/PluginPage.tsx +++ b/web/src/components/Plugin/PluginPage.tsx @@ -104,15 +104,6 @@ const PluginPage: React.FC = ({ - {formatMessage({ id: 'component.plugin.tip1' })} - - {formatMessage({ id: 'component.plugin.tip2' })} - -
{typeList.map((typeItem) => { return ( = ({ ); })} +
+ {formatMessage({ id: 'component.plugin.tip1' })} + + {formatMessage({ id: 'component.plugin.tip2' })} +
); diff --git a/web/src/components/Plugin/locales/en-US.ts b/web/src/components/Plugin/locales/en-US.ts index 8690c6ee1a..00e968950b 100644 --- a/web/src/components/Plugin/locales/en-US.ts +++ b/web/src/components/Plugin/locales/en-US.ts @@ -15,6 +15,6 @@ * limitations under the License. */ export default { - 'component.plugin.tip1': 'After customizing the plugin, you need to update schema.json.', + 'component.plugin.tip1': 'NOTE: After customizing the plugin, you need to update schema.json.', 'component.plugin.tip2': 'How to update?', }; diff --git a/web/src/components/Plugin/locales/zh-CN.ts b/web/src/components/Plugin/locales/zh-CN.ts index b91e6ac15f..d4d9b6464a 100644 --- a/web/src/components/Plugin/locales/zh-CN.ts +++ b/web/src/components/Plugin/locales/zh-CN.ts @@ -15,6 +15,6 @@ * limitations under the License. */ export default { - 'component.plugin.tip1': '自定义插件后(修改、新增、删除等),需更新 schema.json。', + 'component.plugin.tip1': '注意:自定义插件后(修改、新增、删除等),需更新 schema.json。', 'component.plugin.tip2': '如何更新?', };