Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix function name typo #2599

Merged
merged 6 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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