From 2f41997d03850d70a1acacd5e03c16ce98043ac7 Mon Sep 17 00:00:00 2001 From: Nut He <18328704+hetao92@users.noreply.github.com> Date: Wed, 29 Mar 2023 15:37:54 +0800 Subject: [PATCH] fix: fix alter property limit in edit page (#514) * fix: fix alter property limit in edit page * mod: code review --- .../Schema/SchemaConfig/Edit/CommonEdit/PropertiesRow.tsx | 7 +++++-- app/utils/constant.ts | 8 ++++++++ server/api/studio/pkg/client/pool.go | 6 +++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/pages/Schema/SchemaConfig/Edit/CommonEdit/PropertiesRow.tsx b/app/pages/Schema/SchemaConfig/Edit/CommonEdit/PropertiesRow.tsx index 1bce235f..4989fd26 100644 --- a/app/pages/Schema/SchemaConfig/Edit/CommonEdit/PropertiesRow.tsx +++ b/app/pages/Schema/SchemaConfig/Edit/CommonEdit/PropertiesRow.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { AlterType, IProperty } from '@app/interfaces/schema'; import { useI18n } from '@vesoft-inc/i18n'; import { nameRulesFn, numberRulesFn, stringByteRulesFn } from '@app/config/rules'; -import { DATA_TYPE, EXPLAIN_DATA_TYPE } from '@app/utils/constant'; +import { DataTypeTransformMap, DATA_TYPE, EXPLAIN_DATA_TYPE } from '@app/utils/constant'; import styles from './index.module.less'; const Option = Select.Option; @@ -102,8 +102,11 @@ export const EditRow = (props: IEditProps) => { message: intl.get('formRules.dataTypeRequired'), }, ]}> - {DATA_TYPE.map(item => { + if(!DataTypeTransformMap[type]?.includes(item.value) || item.value !== type) { + return null; + } return (