You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ju...@apache.org on 2020/09/06 10:41:21 UTC

[apisix-dashboard] 02/02: feat: use @api7-dashboard/ui

This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a commit to branch feat-consumer
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git

commit f6a8f041575a6cdcf365e21a79310d2e456bff3b
Author: juzhiyuan <ju...@apache.org>
AuthorDate: Sun Sep 6 18:40:41 2020 +0800

    feat: use @api7-dashboard/ui
---
 I18N_USER_GUIDE.md                                 | 12 --------
 src/components/PanelSection/index.tsx              | 32 ----------------------
 .../Route/components/Step1/MatchingRulesView.tsx   |  3 +-
 src/pages/Route/components/Step1/MetaView.tsx      | 13 ++++++---
 .../Route/components/Step1/RequestConfigView.tsx   |  3 +-
 .../components/Step2/HttpHeaderRewriteView.tsx     |  3 +-
 .../Route/components/Step2/RequestRewriteView.tsx  |  2 +-
 7 files changed, 13 insertions(+), 55 deletions(-)

diff --git a/I18N_USER_GUIDE.md b/I18N_USER_GUIDE.md
index 0ebd44f..9e1b991 100644
--- a/I18N_USER_GUIDE.md
+++ b/I18N_USER_GUIDE.md
@@ -90,18 +90,6 @@ we have already defined many global keys, before you do i18n, you can refer to [
 'page.route.button.returnList': '返回路由列表',
 ```
 
-- **PanelSection**
-
-| element      | props | locale subKey      |
-| ------------ | ----- | ------------------ |
-| PanelSection | title | panelSection.title |
-
-**Example:**
-
-```js
-'page.route.panelSection.title.nameDescription': '名称及其描述',
-```
-
 - **Steps**
 
 | element    | props | locale subKey   |
diff --git a/src/components/PanelSection/index.tsx b/src/components/PanelSection/index.tsx
deleted file mode 100644
index 3fa5982..0000000
--- a/src/components/PanelSection/index.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import React, { CSSProperties } from 'react';
-import { Divider } from 'antd';
-
-const PanelSection: React.FC<{
-  title: string;
-  style?: CSSProperties;
-}> = ({ title, style, children }) => {
-  return (
-    <>
-      <Divider orientation="left">{title}</Divider>
-      <div style={style}>{children}</div>
-    </>
-  );
-};
-
-export default PanelSection;
diff --git a/src/pages/Route/components/Step1/MatchingRulesView.tsx b/src/pages/Route/components/Step1/MatchingRulesView.tsx
index be403da..ed42f45 100644
--- a/src/pages/Route/components/Step1/MatchingRulesView.tsx
+++ b/src/pages/Route/components/Step1/MatchingRulesView.tsx
@@ -17,8 +17,7 @@
 import React, { useState } from 'react';
 import { Button, Table, Modal, Form, Select, Input, Space } from 'antd';
 import { useIntl } from 'umi';
-
-import PanelSection from '@/components/PanelSection';
+import { PanelSection } from '@api7-dashboard/ui';
 
 interface Props extends RouteModule.Data {}
 
diff --git a/src/pages/Route/components/Step1/MetaView.tsx b/src/pages/Route/components/Step1/MetaView.tsx
index 10fb203..b04a5ac 100644
--- a/src/pages/Route/components/Step1/MetaView.tsx
+++ b/src/pages/Route/components/Step1/MetaView.tsx
@@ -18,8 +18,7 @@ import React from 'react';
 import Form from 'antd/es/form';
 import { Input } from 'antd';
 import { useIntl } from 'umi';
-
-import PanelSection from '@/components/PanelSection';
+import { PanelSection } from '@api7-dashboard/ui';
 
 interface Props extends RouteModule.Data {}
 
@@ -39,10 +38,16 @@ const MetaView: React.FC<Props> = ({ disabled }) => {
         ]}
         extra={formatMessage({ id: 'rotue.meta.api.rule' })}
       >
-        <Input placeholder={formatMessage({ id: 'route.meta.input.api.name' })} disabled={disabled} />
+        <Input
+          placeholder={formatMessage({ id: 'route.meta.input.api.name' })}
+          disabled={disabled}
+        />
       </Form.Item>
       <Form.Item label={formatMessage({ id: 'route.meta.description' })} name="desc">
-        <Input.TextArea placeholder={formatMessage({ id: 'route.meta.description.rule' })} disabled={disabled} />
+        <Input.TextArea
+          placeholder={formatMessage({ id: 'route.meta.description.rule' })}
+          disabled={disabled}
+        />
       </Form.Item>
     </PanelSection>
   );
diff --git a/src/pages/Route/components/Step1/RequestConfigView.tsx b/src/pages/Route/components/Step1/RequestConfigView.tsx
index 60bd885..53e4013 100644
--- a/src/pages/Route/components/Step1/RequestConfigView.tsx
+++ b/src/pages/Route/components/Step1/RequestConfigView.tsx
@@ -20,6 +20,7 @@ import { Checkbox, Button, Input, Switch, Select, Row, Col } from 'antd';
 import { PlusOutlined, MinusCircleOutlined } from '@ant-design/icons';
 import { CheckboxValueType } from 'antd/lib/checkbox/Group';
 import { useIntl } from 'umi';
+import { PanelSection } from '@api7-dashboard/ui';
 
 import {
   HTTP_METHOD_OPTION_LIST,
@@ -27,8 +28,6 @@ import {
   FORM_ITEM_WITHOUT_LABEL,
 } from '@/pages/Route/constants';
 
-import PanelSection from '@/components/PanelSection';
-
 interface Props extends RouteModule.Data {}
 
 const RequestConfigView: React.FC<Props> = ({ data, disabled, onChange }) => {
diff --git a/src/pages/Route/components/Step2/HttpHeaderRewriteView.tsx b/src/pages/Route/components/Step2/HttpHeaderRewriteView.tsx
index 665bb21..543db05 100644
--- a/src/pages/Route/components/Step2/HttpHeaderRewriteView.tsx
+++ b/src/pages/Route/components/Step2/HttpHeaderRewriteView.tsx
@@ -18,8 +18,7 @@ import React, { useState } from 'react';
 import Form from 'antd/es/form';
 import { Button, Table, Space, Modal, Input, Select } from 'antd';
 import { useIntl } from 'umi';
-
-import PanelSection from '@/components/PanelSection';
+import { PanelSection } from '@api7-dashboard/ui';
 
 interface Props extends RouteModule.Data {}
 
diff --git a/src/pages/Route/components/Step2/RequestRewriteView.tsx b/src/pages/Route/components/Step2/RequestRewriteView.tsx
index da56ef1..12ad7af 100644
--- a/src/pages/Route/components/Step2/RequestRewriteView.tsx
+++ b/src/pages/Route/components/Step2/RequestRewriteView.tsx
@@ -20,6 +20,7 @@ import Radio from 'antd/lib/radio';
 import { Input, Row, Col, InputNumber, Button, Select } from 'antd';
 import { PlusOutlined, MinusCircleOutlined } from '@ant-design/icons';
 import { useIntl } from 'umi';
+import { PanelSection } from '@api7-dashboard/ui';
 
 import {
   FORM_ITEM_LAYOUT,
@@ -27,7 +28,6 @@ import {
   HASH_KEY_LIST,
   HASH_ON_LIST,
 } from '@/pages/Route/constants';
-import PanelSection from '@/components/PanelSection';
 import styles from '../../Create.less';
 import { fetchUpstreamList } from '../../service';