mirror of
https://github.com/langgenius/dify.git
synced 2026-03-13 11:07:40 +08:00
fix: validate
This commit is contained in:
@ -217,6 +217,7 @@ const AddOAuthButton = ({
|
||||
disabled={disabled}
|
||||
schemas={memorizedSchemas}
|
||||
onAuth={handleOAuth}
|
||||
editValues={client_params}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@ -72,13 +72,21 @@ const ApiKeyModal = ({
|
||||
...values
|
||||
} = store?.state.values
|
||||
const isPristineSecretInputNames: string[] = []
|
||||
formSchemas.forEach((schema) => {
|
||||
for (let i = 0; i < formSchemas.length; i++) {
|
||||
const schema = formSchemas[i]
|
||||
if (schema.required && !values[schema.name]) {
|
||||
notify({
|
||||
type: 'error',
|
||||
message: t('common.errorMsg.fieldRequired', { field: schema.name }),
|
||||
})
|
||||
return
|
||||
}
|
||||
if (schema.type === FormTypeEnum.secretInput) {
|
||||
const fieldMeta = form?.getFieldMeta(schema.name)
|
||||
if (fieldMeta?.isPristine)
|
||||
isPristineSecretInputNames.push(schema.name)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const transformedValues = transformFormSchemasSecretInput(isPristineSecretInputNames, values)
|
||||
|
||||
|
||||
@ -53,13 +53,21 @@ const OAuthClientSettings = ({
|
||||
...values
|
||||
} = store?.state.values
|
||||
const isPristineSecretInputNames: string[] = []
|
||||
schemas.forEach((schema) => {
|
||||
for (let i = 0; i < schemas.length; i++) {
|
||||
const schema = schemas[i]
|
||||
if (schema.required && !values[schema.name]) {
|
||||
notify({
|
||||
type: 'error',
|
||||
message: t('common.errorMsg.fieldRequired', { field: schema.name }),
|
||||
})
|
||||
return
|
||||
}
|
||||
if (schema.type === FormTypeEnum.secretInput) {
|
||||
const fieldMeta = form?.getFieldMeta(schema.name)
|
||||
if (fieldMeta?.isPristine)
|
||||
isPristineSecretInputNames.push(schema.name)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const transformedValues = transformFormSchemasSecretInput(isPristineSecretInputNames, values)
|
||||
|
||||
|
||||
@ -282,8 +282,7 @@ const Authorized = ({
|
||||
deleteCredentialId && (
|
||||
<Confirm
|
||||
isShow
|
||||
title='Are you sure?'
|
||||
content='content'
|
||||
title={t('datasetDocuments.list.delete.title')}
|
||||
onCancel={closeConfirm}
|
||||
onConfirm={handleConfirm}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user