Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: form add feedback

shuaic7f7f310c82f
diff --git a/ui/src/components/SchemaForm/index.tsx b/ui/src/components/SchemaForm/index.tsx
index 82b234ae..6967c5a6 100644
--- a/ui/src/components/SchemaForm/index.tsx
+++ b/ui/src/components/SchemaForm/index.tsx
@@ -225,6 +225,9 @@ const SchemaForm: FC<IProps> = ({
);
})}
</Stack>
+ <Form.Control.Feedback type="invalid">
+ {formData[key]?.errorMsg}
+ </Form.Control.Feedback>
<Form.Text className="text-muted">{description}</Form.Text>
</Form.Group>
);
@@ -243,6 +246,9 @@ const SchemaForm: FC<IProps> = ({
feedbackType="invalid"
isInvalid={formData[key].isInvalid}
/>
+ <Form.Control.Feedback type="invalid">
+ {formData[key]?.errorMsg}
+ </Form.Control.Feedback>
<Form.Text className="text-muted">{description}</Form.Text>
</Form.Group>
);
@@ -255,6 +261,14 @@ const SchemaForm: FC<IProps> = ({
value={formData[key]?.value}
onChange={handleInputChange}
/>
+ <Form.Control
+ name={key}
+ className="d-none"
+ isInvalid={formData[key].isInvalid}
+ />
+ <Form.Control.Feedback type="invalid">
+ {formData[key]?.errorMsg}
+ </Form.Control.Feedback>
<Form.Text className="text-muted">{description}</Form.Text>
</Form.Group>
);
@@ -269,6 +283,14 @@ const SchemaForm: FC<IProps> = ({
value={formData[key]?.value}
onChange={(value) => handleUploadChange(key, value)}
/>
+ <Form.Control
+ name={key}
+ className="d-none"
+ isInvalid={formData[key].isInvalid}
+ />
+ <Form.Control.Feedback type="invalid">
+ {formData[key]?.errorMsg}
+ </Form.Control.Feedback>
<Form.Text className="text-muted">{description}</Form.Text>
</Form.Group>
);