From f74bbc91a467193ed4c90feff3c1148eebd2176e Mon Sep 17 00:00:00 2001 From: alex <48489896+devnaumov@users.noreply.github.com> Date: Wed, 21 Dec 2022 19:23:12 +0100 Subject: [PATCH] CB-2904 select shared connection by default (#1373) --- .../CreateConnection/Manual/CustomConnection.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webapp/packages/plugin-connections-administration/src/Administration/Connections/CreateConnection/Manual/CustomConnection.tsx b/webapp/packages/plugin-connections-administration/src/Administration/Connections/CreateConnection/Manual/CustomConnection.tsx index 898047cba9..55870093f8 100644 --- a/webapp/packages/plugin-connections-administration/src/Administration/Connections/CreateConnection/Manual/CustomConnection.tsx +++ b/webapp/packages/plugin-connections-administration/src/Administration/Connections/CreateConnection/Manual/CustomConnection.tsx @@ -33,8 +33,10 @@ export const CustomConnection = observer(function CustomConnection() { useMapResource(CustomConnection, ProjectInfoResource, CachedMapAllKey); function select(driverId: string) { - if (projectsService.activeProjects.length > 0) { - connectionManualService.select(projectsService.activeProjects[0].id, driverId); + const shared = projectsService.activeProjects.filter(project => project.shared); + + if (shared.length > 0) { + connectionManualService.select(shared[0].id, driverId); } else { notificationService.logError({ title: 'core_projects_no_default_project',