diff --git a/wren-ui/src/components/modals/RelationModal.tsx b/wren-ui/src/components/modals/RelationModal.tsx index f2815015f..3f32082ea 100644 --- a/wren-ui/src/components/modals/RelationModal.tsx +++ b/wren-ui/src/components/modals/RelationModal.tsx @@ -37,6 +37,7 @@ type Props = ModalAction & { model: string; loading?: boolean; relations: SelectedRecommendRelations; + isRecommendMode?: boolean; }; export default function RelationModal(props: Props) { @@ -49,6 +50,7 @@ export default function RelationModal(props: Props) { relations, visible, formMode, + isRecommendMode, } = props; const [form] = Form.useForm(); @@ -113,7 +115,7 @@ export default function RelationModal(props: Props) { rules={[ ({ getFieldValue }) => ({ validator: createRelationshipFromFieldValidator( - isUpdateMode, + isUpdateMode || isRecommendMode, relations, getFieldValue, ), @@ -136,7 +138,7 @@ export default function RelationModal(props: Props) { rules={[ ({ getFieldValue }) => ({ validator: createRelationshipToFieldValidator( - isUpdateMode, + isUpdateMode || isRecommendMode, relations, getFieldValue, ), diff --git a/wren-ui/src/components/pages/setup/DefineRelations.tsx b/wren-ui/src/components/pages/setup/DefineRelations.tsx index a72ae0301..a70246821 100644 --- a/wren-ui/src/components/pages/setup/DefineRelations.tsx +++ b/wren-ui/src/components/pages/setup/DefineRelations.tsx @@ -37,7 +37,7 @@ export interface SelectedRecommendRelations { interface Props { fetching: boolean; recommendRelations: SelectedRecommendRelations; - recommendNameMappping: Record; + recommendNameMapping: Record; onNext: (data: { relations: SelectedRecommendRelations }) => void; onBack: () => void; onSkip: () => void; @@ -53,7 +53,7 @@ interface EditableRelationTableProps { }) => void; onDeleteRow: (modelName: string, selectedRelation: RelationsDataType) => void; relations: RelationsDataType[]; - recommendNameMappping: Record; + recommendNameMapping: Record; } function EditableRelationTable(props: EditableRelationTableProps) { @@ -63,7 +63,7 @@ function EditableRelationTable(props: EditableRelationTableProps) { onSetRelation, onDeleteRow, relations, - recommendNameMappping, + recommendNameMapping, } = props; const columns: ColumnsType = [ @@ -130,12 +130,12 @@ function EditableRelationTable(props: EditableRelationTableProps) { (