fix: skip credential validation when editing data source
This commit is contained in:
@@ -311,12 +311,14 @@ function selectType(def: ConnectorDef) {
|
|||||||
|
|
||||||
// --- Test connection (stateless, no DB write) ---
|
// --- Test connection (stateless, no DB write) ---
|
||||||
async function testConnection() {
|
async function testConnection() {
|
||||||
const fields = currentDef.value?.fields || []
|
if (!isEdit.value || !credentialsConfigured.value || replaceCredentialsMode.value) {
|
||||||
for (const f of fields) {
|
const fields = currentDef.value?.fields || []
|
||||||
if (f.optional) continue
|
for (const f of fields) {
|
||||||
if (!form.value.config.credentials[f.key]) {
|
if (f.optional) continue
|
||||||
MessagePlugin.warning(`${t(f.labelKey)} ${t('datasource.isRequired')}`)
|
if (!form.value.config.credentials[f.key]) {
|
||||||
return
|
MessagePlugin.warning(`${t(f.labelKey)} ${t('datasource.isRequired')}`)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -441,6 +443,10 @@ function toggleResource(id: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function validateStep1Fields(): boolean {
|
function validateStep1Fields(): boolean {
|
||||||
|
if (isEdit.value && credentialsConfigured.value && !replaceCredentialsMode.value) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
const fields = currentDef.value?.fields || []
|
const fields = currentDef.value?.fields || []
|
||||||
for (const f of fields) {
|
for (const f of fields) {
|
||||||
if (f.optional) continue
|
if (f.optional) continue
|
||||||
|
|||||||
Reference in New Issue
Block a user