mirror of
https://github.com/langgenius/dify.git
synced 2026-04-13 14:48:11 +08:00
fix(trigger): formitem boolean layout
This commit is contained in:
parent
801f8c1592
commit
8e1e81732a
@ -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}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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}
|
||||
|
||||
@ -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 || ''
|
||||
|
||||
Loading…
Reference in New Issue
Block a user