Skip to content

Commit 2561583

Browse files
CB-3771 Incorrect autocomplete of the Host field while connecting to the local db in the local env (via Search) (#3266)
* CB-3771 loads host form searchDatabases for connections * CB-3771 fixes overlap for connection host and port values --------- Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
1 parent 4a2c474 commit 2561583

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

webapp/packages/core-connections/src/ConnectionInfoResource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export class ConnectionInfoResource extends CachedMapResource<IConnectionInfoPar
326326
return this.add(connection, true);
327327
}
328328

329-
async searchDatabases(hosts: string[]): Promise<AdminConnectionSearchInfo[]> {
329+
async searchDatabases(hosts: string | string[]): Promise<AdminConnectionSearchInfo[]> {
330330
const { databases } = await this.graphQLService.sdk.searchDatabases({ hosts });
331331

332332
return databases;

webapp/packages/plugin-connections/src/ConnectionForm/Options/ConnectionOptionsTabService.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,14 @@ export class ConnectionOptionsTabService extends Bootstrap {
164164
state.config.authModelId = driver?.defaultAuthModel;
165165
state.config.configurationType = getDefaultConfigurationType(driver);
166166

167-
state.config.host = driver?.defaultServer || 'localhost';
168-
state.config.port = driver?.defaultPort;
167+
if (!state.config.host) {
168+
state.config.host = driver?.defaultServer || 'localhost';
169+
}
170+
171+
if (!state.config.port) {
172+
state.config.port = driver?.defaultPort;
173+
}
174+
169175
state.config.databaseName = driver?.defaultDatabase;
170176
state.config.url = driver?.sampleURL;
171177

0 commit comments

Comments
 (0)