mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-07 01:25:38 -05:00
Add new wizard for login migrations experience (#21317)
This commit is contained in:
@@ -337,6 +337,11 @@ export class DashboardWidget {
|
||||
MenuCommands.StartMigration,
|
||||
async () => await this.launchMigrationWizard()));
|
||||
|
||||
this._context.subscriptions.push(
|
||||
vscode.commands.registerCommand(
|
||||
MenuCommands.StartLoginMigration,
|
||||
async () => await this.launchLoginMigrationWizard()));
|
||||
|
||||
this._context.subscriptions.push(
|
||||
vscode.commands.registerCommand(
|
||||
MenuCommands.OpenNotebooks,
|
||||
@@ -369,6 +374,11 @@ export class DashboardWidget {
|
||||
MenuCommands.StartMigration,
|
||||
async () => await this.launchMigrationWizard()));
|
||||
|
||||
this._context.subscriptions.push(azdata.tasks.registerTask(
|
||||
MenuCommands.StartLoginMigration,
|
||||
async () => await this.launchLoginMigrationWizard()));
|
||||
|
||||
|
||||
this._context.subscriptions.push(
|
||||
azdata.tasks.registerTask(
|
||||
MenuCommands.NewSupportRequest,
|
||||
@@ -456,6 +466,34 @@ export class DashboardWidget {
|
||||
}
|
||||
}
|
||||
|
||||
public async launchLoginMigrationWizard(): Promise<void> {
|
||||
const activeConnection = await azdata.connection.getCurrentConnection();
|
||||
let connectionId: string = '';
|
||||
let serverName: string = '';
|
||||
if (!activeConnection) {
|
||||
const connection = await azdata.connection.openConnectionDialog();
|
||||
if (connection) {
|
||||
connectionId = connection.connectionId;
|
||||
serverName = connection.options.server;
|
||||
}
|
||||
} else {
|
||||
connectionId = activeConnection.connectionId;
|
||||
serverName = activeConnection.serverName;
|
||||
}
|
||||
if (serverName) {
|
||||
const api = (await vscode.extensions.getExtension(mssql.extension.name)?.activate()) as mssql.IExtension;
|
||||
if (api) {
|
||||
this.stateModel = new MigrationStateModel(this._context, connectionId, api.sqlMigration);
|
||||
this._context.subscriptions.push(this.stateModel);
|
||||
const wizardController = new WizardController(
|
||||
this._context,
|
||||
this.stateModel,
|
||||
this._onServiceContextChanged);
|
||||
await wizardController.openLoginWizard(connectionId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private checkSavedInfo(serverName: string): SavedInfo | undefined {
|
||||
return this._context.globalState.get<SavedInfo>(`${this.stateModel.mementoString}.${serverName}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user