Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ extend type Mutation {
testConnection( config: ConnectionConfig! ): ConnectionInfo!

# Initiate existing connection
initConnection( id: ID!, credentials: Object ): ConnectionInfo!
initConnection( id: ID!, credentials: Object, saveCredentials: Boolean ): ConnectionInfo!

# Disconnect from database
closeConnection( id: ID! ): ConnectionInfo!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ export class ConnectionInfoResource extends CachedMapResource<string, Connection
return observedConnection;
}

async init(id: string, credentials?: Record<string, any>): Promise<Connection> {
async init(id: string, credentials?: Record<string, any>, saveCredentials?: boolean): Promise<Connection> {
await this.performUpdate(id, async () => {
const connection = await this.initConnection(id, credentials);
const connection = await this.initConnection(id, credentials, saveCredentials);
this.set(id, connection);
return connection;
});
Expand Down Expand Up @@ -138,8 +138,8 @@ export class ConnectionInfoResource extends CachedMapResource<string, Connection
return authProperties;
}

private async initConnection(id: string, credentials?: any): Promise<Connection> {
const { connection } = await this.graphQLService.sdk.initConnection({ id, credentials });
private async initConnection(id: string, credentials?: any, saveCredentials?: boolean): Promise<Connection> {
const { connection } = await this.graphQLService.sdk.initConnection({ id, credentials, saveCredentials });

return connection;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class DBAuthDialogController implements IInitializableController, IDestru

this.isAuthenticating = true;
try {
await this.connectionInfoResource.init(this.connectionId, this.config.credentials);
await this.connectionInfoResource.init(this.connectionId, this.config.credentials, this.config.saveCredentials);
this.close();
} catch (exception) {
if (!this.error.catch(exception) || this.isDistructed) {
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-connections/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default [
['connections_administration_configuration_wizard_message', 'Here you can create database connections manually or using a database server search feature.\nYou can skip this step and configure connections later.'],
['connections_connection_create_custom', 'Custom'],
['connections_connection_create_search_database', 'Search'],
['connections_connection_edit_save_credentials', 'Remember Password'],
['connections_connection_edit_save_credentials', 'Save credentials'],
['connections_connection_edit_authentication', 'Authentication'],
['connections_connection_edit_access', 'Access'],
['connections_connection_edit_access_load_failed', 'Connection access loading failed'],
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-connections/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default [
['connections_administration_configuration_wizard_step_description', 'Подключения к базам'],
['connections_connection_create_custom', 'Настроить'],
['connections_connection_create_search_database', 'Найти'],
['connections_connection_edit_save_credentials', ' Запомнить пароль'],
['connections_connection_edit_save_credentials', ' Запомнить данные'],
['connections_connection_edit_authentication', 'Авторизация'],
['connections_connection_edit_access', 'Доступ'],
['connections_connection_edit_access_load_failed', 'Не удалось загрузить информацию доступа'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mutation initConnection($id: ID!, $credentials: Object) {
connection: initConnection(id: $id, credentials: $credentials) {
mutation initConnection($id: ID!, $credentials: Object, $saveCredentials: Boolean) {
connection: initConnection(id: $id, credentials: $credentials, saveCredentials: $saveCredentials) {
...UserConnection
}
}
6 changes: 4 additions & 2 deletions webapp/packages/core-sdk/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ export interface MutationDeleteConnectionArgs {
export interface MutationInitConnectionArgs {
id: Scalars['ID'];
credentials?: Maybe<Scalars['Object']>;
saveCredentials?: Maybe<Scalars['Boolean']>;
}

export interface MutationOpenConnectionArgs {
Expand Down Expand Up @@ -1062,6 +1063,7 @@ export interface GetDriverByIdQuery { driverList: Array<Pick<DriverInfo, 'id' |
export type InitConnectionMutationVariables = Exact<{
id: Scalars['ID'];
credentials?: Maybe<Scalars['Object']>;
saveCredentials?: Maybe<Scalars['Boolean']>;
}>;

export interface InitConnectionMutation { connection: UserConnectionFragment }
Expand Down Expand Up @@ -1784,8 +1786,8 @@ export const GetDriverByIdDocument = `
}
`;
export const InitConnectionDocument = `
mutation initConnection($id: ID!, $credentials: Object) {
connection: initConnection(id: $id, credentials: $credentials) {
mutation initConnection($id: ID!, $credentials: Object, $saveCredentials: Boolean) {
connection: initConnection(id: $id, credentials: $credentials, saveCredentials: $saveCredentials) {
...UserConnection
}
}
Expand Down