From 2d2f27ea462f3e4e9b8a837f4a825272d02d1f68 Mon Sep 17 00:00:00 2001 From: Vladyslav Matsiiako Date: Fri, 4 Oct 2024 00:27:17 -0700 Subject: [PATCH] accounted for not scopes in databricks use case --- .../services/integration-auth/integration-app-list.ts | 9 +++++---- frontend/src/pages/integrations/databricks/create.tsx | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/src/services/integration-auth/integration-app-list.ts b/backend/src/services/integration-auth/integration-app-list.ts index 5e4963a96..e61aa4a54 100644 --- a/backend/src/services/integration-auth/integration-app-list.ts +++ b/backend/src/services/integration-auth/integration-app-list.ts @@ -471,10 +471,11 @@ const getAppsDatabricks = async ({ url, accessToken }: { url?: string | null; ac } ); - const scopes = res.data.scopes.map((a) => ({ - name: a.name, // name maps to unique scope name in Databricks - backend_type: a.backend_type - })); + const scopes = + res.data?.scopes?.map((a) => ({ + name: a.name, // name maps to unique scope name in Databricks + backend_type: a.backend_type + })) ?? []; return scopes; }; diff --git a/frontend/src/pages/integrations/databricks/create.tsx b/frontend/src/pages/integrations/databricks/create.tsx index 0871c54ea..f60c31a4c 100644 --- a/frontend/src/pages/integrations/databricks/create.tsx +++ b/frontend/src/pages/integrations/databricks/create.tsx @@ -170,7 +170,7 @@ export default function DatabricksCreateIntegrationPage() { setTargetScope(val); }} className="w-full border border-mineshaft-500" - placeholder="Select scope..." + placeholder={integrationAuthScopes.length === 0 ? "No scopes found." : "Select scope..."} isDisabled={integrationAuthScopes.length === 0} > {integrationAuthScopes.length > 0 ? (