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(schemaForm): remove title

robinfc0c2804a4cc
diff --git a/ui/src/components/SchemaForm/components/Switch.tsx b/ui/src/components/SchemaForm/components/Switch.tsx
index 0454f79a..336142ae 100644
--- a/ui/src/components/SchemaForm/components/Switch.tsx
+++ b/ui/src/components/SchemaForm/components/Switch.tsx
@@ -23,7 +23,6 @@ import { Form } from 'react-bootstrap';
import type * as Type from '@/common/interface';
interface Props {
- title: string;
label: string | undefined;
fieldName: string;
onChange?: (fd: Type.FormDataType) => void;
@@ -31,7 +30,6 @@ interface Props {
readOnly?: boolean;
}
const Index: FC<Props> = ({
- title,
fieldName,
onChange,
label,
@@ -55,7 +53,6 @@ const Index: FC<Props> = ({
};
return (
<Form.Check
- id={`switch-${title}`}
name={fieldName}
type="switch"
label={label}
diff --git a/ui/src/components/SchemaForm/index.tsx b/ui/src/components/SchemaForm/index.tsx
index 51fc4655..1fe8c8c1 100644
--- a/ui/src/components/SchemaForm/index.tsx
+++ b/ui/src/components/SchemaForm/index.tsx
@@ -318,7 +318,6 @@ const SchemaForm: ForwardRefRenderFunction<FormRef, FormProps> = (
) : null}
{widget === 'switch' ? (
<Switch
- title={title}
label={uiOpt && 'label' in uiOpt ? uiOpt.label : ''}
fieldName={key}
onChange={onChange}