mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -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": [
|
"commands": [
|
||||||
{
|
{
|
||||||
"command": "sqlmigration.start",
|
"command": "sqlmigration.start",
|
||||||
"title": "SQL Migration Start",
|
"title": "%start-migration-command%",
|
||||||
"category": "SQL Migration"
|
"category": "%migration-command-category%",
|
||||||
|
"icon": "./images/migration.svg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "sqlmigration.openNotebooks",
|
"command": "sqlmigration.openNotebooks",
|
||||||
"title": "%migration-notebook-command-title%",
|
"title": "%migration-notebook-command-title%",
|
||||||
"category": "SQL Migration"
|
"category": "%migration-command-category%"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dashboard.tabs": [
|
"dashboard.tabs": [
|
||||||
@@ -50,6 +51,16 @@
|
|||||||
"when": "connectionProvider == 'MSSQL' && !mssql:iscloud",
|
"when": "connectionProvider == 'MSSQL' && !mssql:iscloud",
|
||||||
"container": {
|
"container": {
|
||||||
"grid-container": [
|
"grid-container": [
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"row": 0,
|
||||||
|
"col": 0,
|
||||||
|
"widget": {
|
||||||
|
"tasks-widget": [
|
||||||
|
"sqlmigration.start"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "",
|
"name": "",
|
||||||
"row": 0,
|
"row": 0,
|
||||||
|
|||||||
@@ -3,5 +3,7 @@
|
|||||||
"description": "SQL migration description",
|
"description": "SQL migration description",
|
||||||
"migration-notebook-command-title": "Open SQL migration notebooks",
|
"migration-notebook-command-title": "Open SQL migration notebooks",
|
||||||
"migration-dashboard-title": "SQL Migration",
|
"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> {
|
async registerCommands(): Promise<void> {
|
||||||
const commandDisposables: vscode.Disposable[] = [ // Array of disposables returned by registerCommand
|
const commandDisposables: vscode.Disposable[] = [ // Array of disposables returned by registerCommand
|
||||||
vscode.commands.registerCommand('sqlmigration.start', async () => {
|
vscode.commands.registerCommand('sqlmigration.start', async () => {
|
||||||
let activeConnection = await azdata.connection.getCurrentConnection();
|
await this.launchMigrationWizard();
|
||||||
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);
|
|
||||||
}),
|
}),
|
||||||
vscode.commands.registerCommand('sqlmigration.openNotebooks', async () => {
|
vscode.commands.registerCommand('sqlmigration.openNotebooks', async () => {
|
||||||
const input = vscode.window.createQuickPick<MigrationNotebookInfo>();
|
const input = vscode.window.createQuickPick<MigrationNotebookInfo>();
|
||||||
@@ -64,12 +53,30 @@ class SQLMigration {
|
|||||||
});
|
});
|
||||||
|
|
||||||
input.show();
|
input.show();
|
||||||
|
}),
|
||||||
|
azdata.tasks.registerTask('sqlmigration.start', async () => {
|
||||||
|
await this.launchMigrationWizard();
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
this.context.subscriptions.push(...commandDisposables);
|
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 {
|
stop(): void {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user