fix(trigger): formitem boolean layout

This commit is contained in:
yessenia 2025-10-20 19:16:39 +08:00
parent 801f8c1592
commit 8e1e81732a
4 changed files with 13 additions and 8 deletions

View File

@ -139,8 +139,8 @@ const BaseForm = ({
<BaseField
field={field}
formSchema={formSchema}
fieldClassName={fieldClassName}
labelClassName={labelClassName}
fieldClassName={fieldClassName ?? formSchema.fieldClassName}
labelClassName={labelClassName ?? formSchema.labelClassName}
inputContainerClassName={inputContainerClassName}
inputClassName={inputClassName}
disabled={disabled}

View File

@ -68,6 +68,7 @@ export type FormSchema = {
placeholder?: string | TypeWithI18N | Record<Locale, string>
options?: FormOption[]
labelClassName?: string
fieldClassName?: string
validators?: AnyValidators
showRadioUI?: boolean
disabled?: boolean

View File

@ -423,6 +423,7 @@ export const CommonCreateModal = ({ onClose, createType, builder }: Props) => {
parameter: schema.name,
credential_id: subscriptionBuilder?.id || '',
} : undefined,
fieldClassName: schema.type === FormTypeEnum.boolean ? 'flex items-center justify-between' : undefined,
}
})}
ref={autoCommonParametersFormRef}

View File

@ -51,13 +51,16 @@ export const OAuthClientSettingsModal = ({ oauthConfig, onClose, showOAuthCreate
const clientFormRef = React.useRef<FormRefObject>(null)
const oauthClientSchema = useMemo(() => {
const clientSchema = detail?.declaration.trigger?.subscription_constructor?.oauth_schema?.client_schema || []
const oauthConfigPramaKeys = Object.keys(params || {})
for (const schema of clientSchema) {
if (oauthConfigPramaKeys.includes(schema.name))
schema.default = params?.[schema.name]
if (detail && params) {
const clientSchema = detail?.declaration.trigger?.subscription_constructor?.oauth_schema?.client_schema || []
const oauthConfigPramaKeys = Object.keys(params || {})
for (const schema of clientSchema) {
if (oauthConfigPramaKeys.includes(schema.name))
schema.default = params?.[schema.name]
}
return clientSchema
}
return clientSchema
return []
}, [detail, params])
const providerName = detail?.provider || ''