mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 17:23:25 -05:00
Fixing migration private preview bugs WIP 3 (#14928)
* Adding server name to wizard and dialog title Surfacing async errors Fixing a bunch of strings to match the mockup * Adding auto refresh for migration status * Removing errors for sql vm migration * using new logic to get sql server username * Fixing help links * Removing unncessary await
This commit is contained in:
@@ -139,7 +139,7 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
requiredIndicator: true,
|
||||
}).component();
|
||||
this._fileShareSubscription = view.modelBuilder.inputBox().withProps({
|
||||
required: true,
|
||||
required: false,
|
||||
enabled: false
|
||||
}).component();
|
||||
|
||||
@@ -150,7 +150,7 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
}).component();
|
||||
this._fileShareStorageAccountDropdown = view.modelBuilder.dropDown()
|
||||
.withProps({
|
||||
required: true
|
||||
required: false
|
||||
}).component();
|
||||
this._fileShareStorageAccountDropdown.onValueChanged(async (value) => {
|
||||
if (value.selected) {
|
||||
@@ -195,7 +195,7 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
}).component();
|
||||
this._blobContainerSubscription = view.modelBuilder.inputBox()
|
||||
.withProps({
|
||||
required: true,
|
||||
required: false,
|
||||
enabled: false
|
||||
}).component();
|
||||
|
||||
@@ -206,7 +206,7 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
}).component();
|
||||
this._blobContainerStorageAccountDropdown = view.modelBuilder.dropDown()
|
||||
.withProps({
|
||||
required: true
|
||||
required: false
|
||||
}).component();
|
||||
this._blobContainerStorageAccountDropdown.onValueChanged(async (value) => {
|
||||
if (value.selected) {
|
||||
@@ -335,7 +335,11 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
const azureAccountHeader = view.modelBuilder.text()
|
||||
.withProps({
|
||||
value: constants.DATABASE_BACKUP_NETWORK_SHARE_AZURE_ACCOUNT_HEADER,
|
||||
width: WIZARD_INPUT_COMPONENT_WIDTH
|
||||
width: WIZARD_INPUT_COMPONENT_WIDTH,
|
||||
CSSStyles: {
|
||||
'font-size': '14px',
|
||||
'font-weight': 'bold'
|
||||
}
|
||||
}).component();
|
||||
|
||||
const azureAccountHelpText = view.modelBuilder.text()
|
||||
@@ -429,7 +433,11 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
|
||||
const networkShareDatabaseConfigHeader = view.modelBuilder.text().withProps({
|
||||
value: constants.ENTER_NETWORK_SHARE_INFORMATION,
|
||||
width: WIZARD_INPUT_COMPONENT_WIDTH
|
||||
width: WIZARD_INPUT_COMPONENT_WIDTH,
|
||||
CSSStyles: {
|
||||
'font-size': '14px',
|
||||
'font-weight': 'bold'
|
||||
}
|
||||
}).component();
|
||||
this._networkShareDatabaseConfigContainer = view.modelBuilder.flexContainer().withLayout({
|
||||
flexFlow: 'column',
|
||||
|
||||
@@ -104,17 +104,7 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
||||
|
||||
private migrationServiceDropdownContainer(): azdata.FlexContainer {
|
||||
const descriptionText = this._view.modelBuilder.text().withProps({
|
||||
value: constants.IR_PAGE_DESCRIPTION,
|
||||
links: [
|
||||
{
|
||||
url: 'https://www.microsoft.com', // TODO: Add proper link
|
||||
text: constants.LEARN_MORE
|
||||
},
|
||||
]
|
||||
}).component();
|
||||
|
||||
const noteText = this._view.modelBuilder.text().withProps({
|
||||
value: constants.IR_PAGE_NOTE
|
||||
value: constants.IR_PAGE_DESCRIPTION
|
||||
}).component();
|
||||
|
||||
const migrationServcieDropdownLabel = this._view.modelBuilder.text().withProps({
|
||||
@@ -140,7 +130,6 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
||||
|
||||
const flexContainer = this._view.modelBuilder.flexContainer().withItems([
|
||||
descriptionText,
|
||||
noteText,
|
||||
migrationServcieDropdownLabel,
|
||||
this.migrationServiceDropdown
|
||||
]).withLayout({
|
||||
|
||||
@@ -44,9 +44,19 @@ export class MigrationModePage extends MigrationWizardPage {
|
||||
const onlineButton = view.modelBuilder.radioButton().withProps({
|
||||
label: constants.DATABASE_BACKUP_MIGRATION_MODE_ONLINE_LABEL,
|
||||
name: buttonGroup,
|
||||
CSSStyles: {
|
||||
'font-weight': 'bold'
|
||||
},
|
||||
checked: true
|
||||
}).component();
|
||||
|
||||
const onlineDescription = view.modelBuilder.text().withProps({
|
||||
value: constants.DATABASE_BACKUP_MIGRATION_MODE_ONLINE_DESCRIPTION,
|
||||
CSSStyles: {
|
||||
'margin': '0 0 10px 20px'
|
||||
}
|
||||
}).component();
|
||||
|
||||
this.migrationStateModel._databaseBackup.migrationCutover = MigrationCutover.ONLINE;
|
||||
|
||||
onlineButton.onDidChangeCheckedState((e) => {
|
||||
@@ -57,9 +67,20 @@ export class MigrationModePage extends MigrationWizardPage {
|
||||
|
||||
const offlineButton = view.modelBuilder.radioButton().withProps({
|
||||
label: constants.DATABASE_BACKUP_MIGRATION_MODE_OFFLINE_LABEL,
|
||||
name: buttonGroup
|
||||
name: buttonGroup,
|
||||
CSSStyles: {
|
||||
'font-weight': 'bold'
|
||||
},
|
||||
}).component();
|
||||
|
||||
const offlineDescription = view.modelBuilder.text().withProps({
|
||||
value: constants.DATABASE_BACKUP_MIGRATION_MODE_OFFLINE_DESCRIPTION,
|
||||
CSSStyles: {
|
||||
'margin': '0 0 10px 20px'
|
||||
}
|
||||
}).component();
|
||||
|
||||
|
||||
offlineButton.onDidChangeCheckedState((e) => {
|
||||
if (e) {
|
||||
vscode.window.showInformationMessage('Feature coming soon');
|
||||
@@ -71,7 +92,9 @@ export class MigrationModePage extends MigrationWizardPage {
|
||||
const flexContainer = view.modelBuilder.flexContainer().withItems(
|
||||
[
|
||||
onlineButton,
|
||||
offlineButton
|
||||
onlineDescription,
|
||||
offlineButton,
|
||||
offlineDescription
|
||||
]
|
||||
).withLayout({
|
||||
flexFlow: 'column'
|
||||
|
||||
@@ -64,7 +64,7 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
this._view = view;
|
||||
this._igComponent = this.createStatusComponent(view); // The first component giving basic information
|
||||
this._detailsComponent = this.createDetailsComponent(view); // The details of what can be moved
|
||||
this._chooseTargetComponent = this.createChooseTargetComponent(view);
|
||||
this._chooseTargetComponent = await this.createChooseTargetComponent(view);
|
||||
this._azureSubscriptionText = this.createAzureSubscriptionText(view);
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
return component;
|
||||
}
|
||||
|
||||
private createChooseTargetComponent(view: azdata.ModelView): azdata.DivContainer {
|
||||
private async createChooseTargetComponent(view: azdata.ModelView): Promise<azdata.DivContainer> {
|
||||
|
||||
this._rbg = this._view!.modelBuilder.radioCardGroup().withProps({
|
||||
cards: [],
|
||||
@@ -279,8 +279,10 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
descriptions
|
||||
});
|
||||
});
|
||||
let miDialog = new AssessmentResultsDialog('ownerUri', this.migrationStateModel, constants.ASSESSMENT_TILE, this, MigrationTargetType.SQLMI);
|
||||
let vmDialog = new AssessmentResultsDialog('ownerUri', this.migrationStateModel, constants.ASSESSMENT_TILE, this, MigrationTargetType.SQLVM);
|
||||
|
||||
const serverName = (await this.migrationStateModel.getSourceConnectionProfile()).serverName;
|
||||
let miDialog = new AssessmentResultsDialog('ownerUri', this.migrationStateModel, constants.ASSESSMENT_TILE(serverName), this, MigrationTargetType.SQLMI);
|
||||
let vmDialog = new AssessmentResultsDialog('ownerUri', this.migrationStateModel, constants.ASSESSMENT_TILE(serverName), this, MigrationTargetType.SQLVM);
|
||||
|
||||
this._rbg.onLinkClick(async (value) => {
|
||||
if (value.cardId === MigrationTargetType.SQLVM) {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as os from 'os';
|
||||
import { MigrationWizardPage } from '../models/migrationWizardPage';
|
||||
import { MigrationSourceAuthenticationType, MigrationStateModel, StateChangeEvent } from '../models/stateMachine';
|
||||
import * as constants from '../constants/strings';
|
||||
@@ -47,24 +46,11 @@ export class SqlSourceConfigurationPage extends MigrationWizardPage {
|
||||
private async createSourceCredentialContainer(): Promise<azdata.FormComponent> {
|
||||
|
||||
const connectionProfile = await this.migrationStateModel.getSourceConnectionProfile();
|
||||
|
||||
let username;
|
||||
switch (connectionProfile.authenticationType) {
|
||||
case 'SqlLogin':
|
||||
username = connectionProfile.userName;
|
||||
this.migrationStateModel._authenticationType = MigrationSourceAuthenticationType.Sql;
|
||||
break;
|
||||
case 'Integrated':
|
||||
if (process.env.USERDOMAIN && process.env.USERNAME) {
|
||||
username = process.env.USERDOMAIN + '\\' + process.env.USERNAME;
|
||||
} else {
|
||||
username = os.userInfo().username;
|
||||
}
|
||||
this.migrationStateModel._authenticationType = MigrationSourceAuthenticationType.Integrated;
|
||||
break;
|
||||
default:
|
||||
username = '';
|
||||
}
|
||||
const queryProvider = azdata.dataprotocol.getProvider<azdata.QueryProvider>((await this.migrationStateModel.getSourceConnectionProfile()).providerId, azdata.DataProviderType.QueryProvider);
|
||||
const query = 'select SUSER_NAME()';
|
||||
const results = await queryProvider.runQueryAndReturn(await (azdata.connection.getUriForConnection(this.migrationStateModel.sourceConnectionId)), query);
|
||||
const username = results.rows[0][0].displayValue;
|
||||
this.migrationStateModel._authenticationType = connectionProfile.authenticationType === 'SqlLogin' ? MigrationSourceAuthenticationType.Sql : connectionProfile.authenticationType === 'Integrated' ? MigrationSourceAuthenticationType.Integrated : undefined!;
|
||||
|
||||
const sourceCredText = createHeadingTextComponent(this._view, constants.SOURCE_CREDENTIALS);
|
||||
|
||||
|
||||
@@ -33,7 +33,8 @@ export class WizardController {
|
||||
}
|
||||
|
||||
private async createWizard(stateModel: MigrationStateModel): Promise<void> {
|
||||
const wizard = azdata.window.createWizard(loc.WIZARD_TITLE, 'MigrationWizard', 'wide');
|
||||
const serverName = (await stateModel.getSourceConnectionProfile()).serverName;
|
||||
const wizard = azdata.window.createWizard(loc.WIZARD_TITLE(serverName), 'MigrationWizard', 'wide');
|
||||
wizard.generateScriptButton.enabled = false;
|
||||
wizard.generateScriptButton.hidden = true;
|
||||
const skuRecommendationPage = new SKURecommendationPage(wizard, stateModel);
|
||||
|
||||
Reference in New Issue
Block a user