diff --git a/web/app/components/base/form/components/base/base-form.tsx b/web/app/components/base/form/components/base/base-form.tsx index 4718b4f14d..0d35380523 100644 --- a/web/app/components/base/form/components/base/base-form.tsx +++ b/web/app/components/base/form/components/base/base-form.tsx @@ -139,8 +139,8 @@ const BaseForm = ({ options?: FormOption[] labelClassName?: string + fieldClassName?: string validators?: AnyValidators showRadioUI?: boolean disabled?: boolean diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/common-modal.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/common-modal.tsx index f6c5e6f64f..7952d92ab2 100644 --- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/common-modal.tsx +++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/common-modal.tsx @@ -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} diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/oauth-client.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/oauth-client.tsx index 7ba6e393eb..4d00f41ec9 100644 --- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/oauth-client.tsx +++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/oauth-client.tsx @@ -51,13 +51,16 @@ export const OAuthClientSettingsModal = ({ oauthConfig, onClose, showOAuthCreate const clientFormRef = React.useRef(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 || ''