Skip to content

Commit

Permalink
chore: fix function name typo (#2599)
Browse files Browse the repository at this point in the history
  • Loading branch information
FangSen9000 authored Aug 22, 2022
1 parent d166405 commit a15fe35
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions web/src/components/LabelsfDrawer/LabelsDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -122,7 +122,7 @@ const LabelsDrawer: React.FC<Props> = ({
onClose,
onChange = () => {},
}) => {
const transformLabel = transformLableValueToKeyValue(dataSource);
const transformLabel = transformLabelValueToKeyValue(dataSource);

const { formatMessage } = useIntl();
const [form] = Form.useForm();
Expand Down
2 changes: 1 addition & 1 deletion web/src/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions web/src/pages/PluginTemplate/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -51,7 +51,7 @@ const Page: React.FC = (props) => {
const onSubmit = () => {
const { desc, custom_normal_labels } = form1.getFieldsValue();
const labels: Record<string, string> = {};
transformLableValueToKeyValue(custom_normal_labels || []).forEach(
transformLabelValueToKeyValue(custom_normal_labels || []).forEach(
({ labelKey, labelValue }) => {
labels[labelKey] = labelValue;
},
Expand Down
4 changes: 2 additions & 2 deletions web/src/pages/Route/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -141,7 +141,7 @@ export const transformStepData = ({
}

const labels: Record<string, string> = {};
transformLableValueToKeyValue(custom_normal_labels).forEach(({ labelKey, labelValue }) => {
transformLabelValueToKeyValue(custom_normal_labels).forEach(({ labelKey, labelValue }) => {
labels[labelKey] = labelValue;
});

Expand Down

0 comments on commit a15fe35

Please sign in to comment.