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.

refactor: Add default type to some form inputs

haitaooa96f73a95efb
diff --git a/ui/src/hooks/useTagModal/index.tsx b/ui/src/hooks/useTagModal/index.tsx
index 648832d9..69a3e596 100644
--- a/ui/src/hooks/useTagModal/index.tsx
+++ b/ui/src/hooks/useTagModal/index.tsx
@@ -201,6 +201,7 @@ const useTagModal = (props: IProps = {}) => {
<Form.Group controlId="displayName" className="mb-3">
<Form.Label>{t('form.fields.display_name.label')}</Form.Label>
<Form.Control
+ type="text"
value={formData.displayName.value}
onChange={handleDisplayNameChange}
isInvalid={formData.displayName.isInvalid}
@@ -212,6 +213,7 @@ const useTagModal = (props: IProps = {}) => {
<Form.Group controlId="slugName" className="mb-3">
<Form.Label>{t('form.fields.slug_name.label')}</Form.Label>
<Form.Control
+ type="text"
value={formData.slugName.value}
onChange={handleSlugNameChange}
isInvalid={formData.slugName.isInvalid}
diff --git a/ui/src/pages/Questions/Ask/index.tsx b/ui/src/pages/Questions/Ask/index.tsx
index cdc087ee..0f3b7f47 100644
--- a/ui/src/pages/Questions/Ask/index.tsx
+++ b/ui/src/pages/Questions/Ask/index.tsx
@@ -347,6 +347,7 @@ const Ask = () => {
<Form.Group controlId="title" className="mb-3">
<Form.Label>{t('form.fields.title.label')}</Form.Label>
<Form.Control
+ type="text"
value={formData.title.value}
isInvalid={formData.title.isInvalid}
onChange={handleTitleChange}
diff --git a/ui/src/pages/Tags/Create/index.tsx b/ui/src/pages/Tags/Create/index.tsx
index 4cf3716f..8b846e9c 100644
--- a/ui/src/pages/Tags/Create/index.tsx
+++ b/ui/src/pages/Tags/Create/index.tsx
@@ -147,6 +147,7 @@ const Index = () => {
<Form.Group controlId="display_name" className="mb-3">
<Form.Label>{t('form.fields.display_name.label')}</Form.Label>
<Form.Control
+ type="text"
value={formData.displayName.value}
isInvalid={formData.displayName.isInvalid}
disabled={role_id !== 2 && role_id !== 3}
@@ -160,6 +161,7 @@ const Index = () => {
<Form.Group controlId="slug_name" className="mb-3">
<Form.Label>{t('form.fields.slug_name.label')}</Form.Label>
<Form.Control
+ type="text"
value={formData.slugName.value}
isInvalid={formData.slugName.isInvalid}
disabled={role_id !== 2 && role_id !== 3}