From 1e9b4a657292c1749711cc22e023cb852083b131 Mon Sep 17 00:00:00 2001 From: erosselli <67162025+erosselli@users.noreply.github.com> Date: Thu, 22 Aug 2024 18:25:55 -0300 Subject: [PATCH] Fix crashing integrations after pydantic update (#5227) --- .../forms/ConnectorParametersForm.tsx | 8 +++++--- .../types/api/models/ConnectionConfigurationResponse.ts | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParametersForm.tsx b/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParametersForm.tsx index e5925187a36..f471306391f 100644 --- a/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParametersForm.tsx +++ b/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParametersForm.tsx @@ -236,7 +236,7 @@ export const ConnectorParametersForm = ({ ).map((action) => action.toString()); // @ts-ignore - initialValues.secrets = connectionConfig.secrets ?? {}; + initialValues.secrets = connectionConfig.secrets ? _.cloneDeep(connectionConfig.secrets) : {}; // check if we need we need to pre-process any secrets values // we currently only need to do this for Fides dataset references @@ -245,8 +245,10 @@ export const ConnectorParametersForm = ({ Object.entries(secretsSchema.properties).forEach(([key, schema]) => { if (schema.allOf?.[0].$ref === FIDES_DATASET_REFERENCE) { const datasetReference = initialValues.secrets[key]; - initialValues.secrets[key] = - `${datasetReference.dataset}.${datasetReference.field}`; + if (datasetReference) { + initialValues.secrets[key] = + `${datasetReference.dataset}.${datasetReference.field}`; + } } }); } diff --git a/clients/admin-ui/src/types/api/models/ConnectionConfigurationResponse.ts b/clients/admin-ui/src/types/api/models/ConnectionConfigurationResponse.ts index 581d6202cd1..bc511df7fee 100644 --- a/clients/admin-ui/src/types/api/models/ConnectionConfigurationResponse.ts +++ b/clients/admin-ui/src/types/api/models/ConnectionConfigurationResponse.ts @@ -22,7 +22,7 @@ export type ConnectionConfigurationResponse = { last_test_timestamp?: string | null; last_test_succeeded?: boolean | null; saas_config?: SaaSConfigBase | null; - secrets?: null; + secrets?: any; authorized?: boolean | null; enabled_actions?: Array | null; };