add 'start migration' action to dashboard toolbar (#14869)

* add 'start migration' action to dashboard toolbar

* localization
This commit is contained in:
Alan Ren
2021-03-25 12:36:37 -07:00
committed by GitHub
parent 5db6857c49
commit 94c0795fc7
3 changed files with 36 additions and 16 deletions

View File

@@ -28,13 +28,14 @@
"commands": [
{
"command": "sqlmigration.start",
"title": "SQL Migration Start",
"category": "SQL Migration"
"title": "%start-migration-command%",
"category": "%migration-command-category%",
"icon": "./images/migration.svg"
},
{
"command": "sqlmigration.openNotebooks",
"title": "%migration-notebook-command-title%",
"category": "SQL Migration"
"category": "%migration-command-category%"
}
],
"dashboard.tabs": [
@@ -50,6 +51,16 @@
"when": "connectionProvider == 'MSSQL' && !mssql:iscloud",
"container": {
"grid-container": [
{
"name": "",
"row": 0,
"col": 0,
"widget": {
"tasks-widget": [
"sqlmigration.start"
]
}
},
{
"name": "",
"row": 0,

View File

@@ -3,5 +3,7 @@
"description": "SQL migration description",
"migration-notebook-command-title": "Open SQL migration notebooks",
"migration-dashboard-title": "SQL Migration",
"migration-dashboard-tasks": "Migration Tasks"
"migration-dashboard-tasks": "Migration Tasks",
"migration-command-category": "SQL Migration",
"start-migration-command": "Start SQL Migration"
}

View File

@@ -28,18 +28,7 @@ class SQLMigration {
async registerCommands(): Promise<void> {
const commandDisposables: vscode.Disposable[] = [ // Array of disposables returned by registerCommand
vscode.commands.registerCommand('sqlmigration.start', async () => {
let activeConnection = await azdata.connection.getCurrentConnection();
let connectionId: string = '';
if (!activeConnection) {
const connection = await azdata.connection.openConnectionDialog();
if (connection) {
connectionId = connection.connectionId;
}
} else {
connectionId = activeConnection.connectionId;
}
const wizardController = new WizardController(this.context);
await wizardController.openWizard(connectionId);
await this.launchMigrationWizard();
}),
vscode.commands.registerCommand('sqlmigration.openNotebooks', async () => {
const input = vscode.window.createQuickPick<MigrationNotebookInfo>();
@@ -64,12 +53,30 @@ class SQLMigration {
});
input.show();
}),
azdata.tasks.registerTask('sqlmigration.start', async () => {
await this.launchMigrationWizard();
})
];
this.context.subscriptions.push(...commandDisposables);
}
async launchMigrationWizard(): Promise<void> {
let activeConnection = await azdata.connection.getCurrentConnection();
let connectionId: string = '';
if (!activeConnection) {
const connection = await azdata.connection.openConnectionDialog();
if (connection) {
connectionId = connection.connectionId;
}
} else {
connectionId = activeConnection.connectionId;
}
const wizardController = new WizardController(this.context);
await wizardController.openWizard(connectionId);
}
stop(): void {
}