mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
add 'start migration' action to dashboard toolbar (#14869)
* add 'start migration' action to dashboard toolbar * localization
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user