mirror of
https://github.com/apache/superset.git
synced 2024-09-06 22:07:34 -04:00
fix: Dynamic form to connect to Snowflake DB is not displaying authentication errors (#19491)
* fix: Dynamic form to connect to Snowflake DB is not displaying authentication errors * pr comments
This commit is contained in:
parent
1521ab3b6f
commit
634693b270
@ -89,6 +89,9 @@ const engineSpecificAlertMapping = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const errorAlertMapping = {
|
const errorAlertMapping = {
|
||||||
|
GENERIC_DB_ENGINE_ERROR: {
|
||||||
|
message: t('Generic database engine error'),
|
||||||
|
},
|
||||||
CONNECTION_MISSING_PARAMETERS_ERROR: {
|
CONNECTION_MISSING_PARAMETERS_ERROR: {
|
||||||
message: t('Missing Required Fields'),
|
message: t('Missing Required Fields'),
|
||||||
description: t('Please complete all required fields.'),
|
description: t('Please complete all required fields.'),
|
||||||
@ -929,6 +932,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
|||||||
}
|
}
|
||||||
description={
|
description={
|
||||||
errorAlertMapping[validationErrors?.error_type]?.description ||
|
errorAlertMapping[validationErrors?.error_type]?.description ||
|
||||||
|
validationErrors?.description ||
|
||||||
JSON.stringify(validationErrors)
|
JSON.stringify(validationErrors)
|
||||||
}
|
}
|
||||||
showIcon
|
showIcon
|
||||||
|
@ -689,6 +689,10 @@ export function useDatabaseValidation() {
|
|||||||
url: string;
|
url: string;
|
||||||
idx: number;
|
idx: number;
|
||||||
};
|
};
|
||||||
|
issue_codes?: {
|
||||||
|
code?: number;
|
||||||
|
message?: string;
|
||||||
|
}[];
|
||||||
};
|
};
|
||||||
message: string;
|
message: string;
|
||||||
},
|
},
|
||||||
@ -744,6 +748,14 @@ export function useDatabaseValidation() {
|
|||||||
),
|
),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
if (extra.issue_codes?.length) {
|
||||||
|
return {
|
||||||
|
...obj,
|
||||||
|
error_type,
|
||||||
|
description: message || extra.issue_codes[0]?.message,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
|
Loading…
Reference in New Issue
Block a user