mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-24 17:23:05 -05:00
Add new wizard for login migrations experience (#21317)
This commit is contained in:
@@ -12,6 +12,7 @@ import { DatabaseMigration } from '../api/azure';
|
||||
import { getSelectedServiceStatus } from '../models/migrationLocalStorage';
|
||||
import { MenuCommands, SqlMigrationExtensionId } from '../api/utils';
|
||||
import { DashboardStatusBar } from './DashboardStatusBar';
|
||||
import { ShowStatusMessageDialog } from '../dialog/generic/genericDialogs';
|
||||
|
||||
export const EmptySettingValue = '-';
|
||||
|
||||
@@ -95,6 +96,29 @@ export abstract class TabBase<T> implements azdata.Tab, vscode.Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
protected createNewLoginMigrationButton(): azdata.ButtonComponent {
|
||||
const newLoginMigrationButton = this.view.modelBuilder.button()
|
||||
.withProps({
|
||||
buttonType: azdata.ButtonType.Normal,
|
||||
label: loc.DESKTOP_LOGIN_MIGRATION_BUTTON_LABEL,
|
||||
description: loc.DESKTOP_LOGIN_MIGRATION_BUTTON_DESCRIPTION,
|
||||
height: 24,
|
||||
iconHeight: 24,
|
||||
iconWidth: 24,
|
||||
iconPath: IconPathHelper.addNew,
|
||||
}).component();
|
||||
this.disposables.push(
|
||||
newLoginMigrationButton.onDidClick(async () => {
|
||||
const actionId = MenuCommands.StartLoginMigration;
|
||||
const args = {
|
||||
extensionId: SqlMigrationExtensionId,
|
||||
issueTitle: loc.DASHBOARD_LOGIN_MIGRATE_TASK_BUTTON_TITLE,
|
||||
};
|
||||
return await vscode.commands.executeCommand(actionId, args);
|
||||
}));
|
||||
return newLoginMigrationButton;
|
||||
}
|
||||
|
||||
protected createNewMigrationButton(): azdata.ButtonComponent {
|
||||
const newMigrationButton = this.view.modelBuilder.button()
|
||||
.withProps({
|
||||
@@ -179,50 +203,6 @@ export abstract class TabBase<T> implements azdata.Tab, vscode.Disposable {
|
||||
statusMessage: string,
|
||||
errorMessage: string,
|
||||
): void {
|
||||
const tab = azdata.window.createTab(title);
|
||||
tab.registerContent(async (view) => {
|
||||
const flex = view.modelBuilder.flexContainer()
|
||||
.withItems([
|
||||
view.modelBuilder.text()
|
||||
.withProps({ value: statusMessage })
|
||||
.component(),
|
||||
])
|
||||
.withLayout({
|
||||
flexFlow: 'column',
|
||||
width: 420,
|
||||
})
|
||||
.withProps({ CSSStyles: { 'margin': '0 15px' } })
|
||||
.component();
|
||||
|
||||
if (errorMessage.length > 0) {
|
||||
flex.addItem(
|
||||
view.modelBuilder.inputBox()
|
||||
.withProps({
|
||||
value: errorMessage,
|
||||
readOnly: true,
|
||||
multiline: true,
|
||||
inputType: 'text',
|
||||
height: 100,
|
||||
CSSStyles: { 'overflow': 'hidden auto' },
|
||||
})
|
||||
.component()
|
||||
);
|
||||
}
|
||||
|
||||
await view.initializeModel(flex);
|
||||
});
|
||||
|
||||
const dialog = azdata.window.createModelViewDialog(
|
||||
title,
|
||||
'messageDialog',
|
||||
450,
|
||||
'normal');
|
||||
dialog.content = [tab];
|
||||
dialog.okButton.hidden = true;
|
||||
dialog.cancelButton.focused = true;
|
||||
dialog.cancelButton.label = loc.CLOSE;
|
||||
dialog.cancelButton.position = 'left';
|
||||
|
||||
azdata.window.openDialog(dialog);
|
||||
ShowStatusMessageDialog(title, statusMessage, errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user