Fix BDC remember password and reprompting connection (#7957)

* Fix remember password and reprompting connection

* comment

* Fix to remember password for session

* Fix floating promises
This commit is contained in:
Charles Gagnon
2019-10-29 07:27:31 -07:00
committed by GitHub
parent 789ee4b133
commit d315ccff68
8 changed files with 183 additions and 97 deletions

View File

@@ -6,11 +6,14 @@
'use strict';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { ClusterController, ControllerError } from '../controller/clusterControllerApi';
import { ControllerTreeDataProvider } from '../tree/controllerTreeDataProvider';
import { TreeNode } from '../tree/treeNode';
import { AuthType } from '../constants';
import { ManageControllerCommand } from '../../extension';
import { BdcDashboardOptions } from './bdcDashboardModel';
const localize = nls.loadMessageBundle();
@@ -73,7 +76,8 @@ export class AddControllerDialogModel {
if (this._canceled) {
return;
}
this.treeDataProvider.addController(url, auth, username, password, rememberPassword);
this.treeDataProvider.addOrUpdateController(url, auth, username, password, rememberPassword);
vscode.commands.executeCommand(ManageControllerCommand, <BdcDashboardOptions>{ url: url, auth: auth, username: username, password: password });
await this.treeDataProvider.saveControllers();
}
} catch (error) {