From 660cac62eb527798bb32acd3a8a63cd864e3e1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=BF=E6=A3=AE?= <72308243+FangSen9000@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:24:41 +0800 Subject: [PATCH 1/6] Update helpers.tsx --- web/src/helpers.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/helpers.tsx b/web/src/helpers.tsx index 3cfc8e8ca9..19978a7032 100644 --- a/web/src/helpers.tsx +++ b/web/src/helpers.tsx @@ -176,7 +176,7 @@ export const yaml2json = ( } }; -export const transformLableValueToKeyValue = (data: string[]) => { +export const transformLabelValueToKeyValue = (data: string[]) => { return (data || []).map((item) => { const index = item.indexOf(':'); const labelKey = item.substring(0, index); From 7abbd37cec1917c9f406f6b8004ebd7bfbe446d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=BF=E6=A3=AE?= <72308243+FangSen9000@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:30:07 +0800 Subject: [PATCH 2/6] Update LabelsDrawer.tsx --- web/src/components/LabelsfDrawer/LabelsDrawer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/components/LabelsfDrawer/LabelsDrawer.tsx b/web/src/components/LabelsfDrawer/LabelsDrawer.tsx index 467a597703..7562e5a4ff 100644 --- a/web/src/components/LabelsfDrawer/LabelsDrawer.tsx +++ b/web/src/components/LabelsfDrawer/LabelsDrawer.tsx @@ -19,7 +19,7 @@ import { AutoComplete, Button, Col, Drawer, Form, notification, Row } from 'antd import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons'; import { useIntl } from 'umi'; -import { transformLableValueToKeyValue } from '../../helpers'; +import { transformLabelValueToKeyValue } from '../../helpers'; type Props = { title?: string; @@ -122,7 +122,7 @@ const LabelsDrawer: React.FC = ({ onClose, onChange = () => {}, }) => { - const transformLabel = transformLableValueToKeyValue(dataSource); + const transformLabel = transformLabelValueToKeyValue(dataSource); const { formatMessage } = useIntl(); const [form] = Form.useForm(); From cf4b46d64692ea4d554bd81582681dd43ec08879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=BF=E6=A3=AE?= <72308243+FangSen9000@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:31:38 +0800 Subject: [PATCH 3/6] Update Create.tsx --- web/src/pages/PluginTemplate/Create.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/pages/PluginTemplate/Create.tsx b/web/src/pages/PluginTemplate/Create.tsx index 1d15e210b3..218f85c46f 100644 --- a/web/src/pages/PluginTemplate/Create.tsx +++ b/web/src/pages/PluginTemplate/Create.tsx @@ -21,7 +21,7 @@ import { history, useIntl } from 'umi'; import ActionBar from '@/components/ActionBar'; import PluginPage from '@/components/Plugin'; -import { transformLableValueToKeyValue } from '@/helpers'; +import { transformLabelValueToKeyValue } from '@/helpers'; import Step1 from './components/Step1'; import Preview from './components/Preview'; @@ -51,7 +51,7 @@ const Page: React.FC = (props) => { const onSubmit = () => { const { desc, custom_normal_labels } = form1.getFieldsValue(); const labels: Record = {}; - transformLableValueToKeyValue(custom_normal_labels || []).forEach( + transformLabelValueToKeyValue(custom_normal_labels || []).forEach( ({ labelKey, labelValue }) => { labels[labelKey] = labelValue; }, From 8c09469177b1223ae2ed8bd5fca360288e6e16f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=BF=E6=A3=AE?= <72308243+FangSen9000@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:33:21 +0800 Subject: [PATCH 4/6] Update transform.ts --- web/src/pages/Route/transform.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/pages/Route/transform.ts b/web/src/pages/Route/transform.ts index 9fa41bed59..4261f63738 100644 --- a/web/src/pages/Route/transform.ts +++ b/web/src/pages/Route/transform.ts @@ -16,7 +16,7 @@ */ import { omit, pick, cloneDeep, isEmpty, unset } from 'lodash'; -import { transformLableValueToKeyValue } from '@/helpers'; +import { transformLabelValueToKeyValue } from '@/helpers'; import { SCHEME_REWRITE, URI_REWRITE_TYPE, HOST_REWRITE_TYPE } from '@/pages/Route/constants'; import { convertToFormData } from '@/components/Upstream/service'; @@ -141,7 +141,7 @@ export const transformStepData = ({ } const labels: Record = {}; - transformLableValueToKeyValue(custom_normal_labels).forEach(({ labelKey, labelValue }) => { + transformLabelValueToKeyValue(custom_normal_labels).forEach(({ labelKey, labelValue }) => { labels[labelKey] = labelValue; }); From 562c4b98777fcf0d6ee8518bc6dfa435e9434975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=BF=E6=A3=AE?= <72308243+FangSen9000@users.noreply.github.com> Date: Mon, 22 Aug 2022 15:06:04 +0800 Subject: [PATCH 5/6] Update LabelsDrawer.tsx From bd9ad828232e8b770e36c1f71219fdeb323d2400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=BF=E6=A3=AE?= <72308243+FangSen9000@users.noreply.github.com> Date: Mon, 22 Aug 2022 15:41:11 +0800 Subject: [PATCH 6/6] Update Create.tsx