mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-14 18:46:34 -05:00
Renaming controller to migration service and other bug fixes/ validations. (#14751)
* - Added coming soon message for learn more. - Potential fix for learn more message * Renaming of controller to sqlMigrationService * Surfacing some errors -Azure account is stale error -Migration Service creation error. * Adding refresh azure token validation. * Fixing some errors pointed during PR -Fixing property names -Fixing count * Fixing migration status - Adding special error handling for resource not found error - Deleting unfound migrations from local cache - Using prefetched migration status for view all Misc fixes: - Using SQL server version name instead of number - Fixing Icons on sku recommendation page - Fixing table column width in cutover dialog - Adding spinner button to refresh. * Fixing all strings in migration service page and dialog * fixed a string error in create service dialog
This commit is contained in:
@@ -4,18 +4,32 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as path from 'path';
|
||||
import { MigrationWizardPage } from '../models/migrationWizardPage';
|
||||
import { MigrationStateModel, StateChangeEvent } from '../models/stateMachine';
|
||||
import { Product, ProductLookupTable } from '../models/product';
|
||||
import { Product } from '../models/product';
|
||||
import { AssessmentResultsDialog } from '../dialog/assessmentResults/assessmentResultsDialog';
|
||||
import * as constants from '../constants/strings';
|
||||
import * as vscode from 'vscode';
|
||||
import { EOL } from 'os';
|
||||
import { IconPathHelper } from '../constants/iconPathHelper';
|
||||
|
||||
// import { SqlMigrationService } from '../../../../extensions/mssql/src/sqlMigration/sqlMigrationService';
|
||||
|
||||
export class SKURecommendationPage extends MigrationWizardPage {
|
||||
|
||||
private supportedProducts: Product[] = [
|
||||
{
|
||||
type: 'AzureSQLMI',
|
||||
name: constants.SKU_RECOMMENDATION_MI_CARD_TEXT,
|
||||
icon: IconPathHelper.sqlMiLogo
|
||||
},
|
||||
{
|
||||
type: 'AzureSQLVM',
|
||||
name: constants.SKU_RECOMMENDATION_VM_CARD_TEXT,
|
||||
icon: IconPathHelper.sqlVmLogo
|
||||
}
|
||||
];
|
||||
|
||||
// For future reference: DO NOT EXPOSE WIZARD DIRECTLY THROUGH HERE.
|
||||
constructor(wizard: azdata.window.Wizard, migrationStateModel: MigrationStateModel) {
|
||||
super(wizard, azdata.window.createWizardPage(constants.SKU_RECOMMENDATION_PAGE_TITLE), migrationStateModel);
|
||||
@@ -53,7 +67,7 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
if (e.selected) {
|
||||
this.migrationStateModel._targetSubscription = this.migrationStateModel.getSubscription(e.index);
|
||||
this.migrationStateModel._targetServerInstance = undefined!;
|
||||
this.migrationStateModel._migrationController = undefined!;
|
||||
this.migrationStateModel._sqlMigrationService = undefined!;
|
||||
this.populateResourceInstanceDropdown();
|
||||
}
|
||||
});
|
||||
@@ -66,7 +80,7 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
if (e.selected &&
|
||||
e.selected !== constants.NO_MANAGED_INSTANCE_FOUND &&
|
||||
e.selected !== constants.NO_VIRTUAL_MACHINE_FOUND) {
|
||||
this.migrationStateModel._migrationControllers = undefined!;
|
||||
this.migrationStateModel._sqlMigrationServices = undefined!;
|
||||
if (this._rbg.selectedCardId === 'AzureSQLVM') {
|
||||
this.migrationStateModel._targetServerInstance = this.migrationStateModel.getVirtualMachine(e.index);
|
||||
} else {
|
||||
@@ -179,7 +193,7 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
}
|
||||
|
||||
private constructTargets(): void {
|
||||
const products: Product[] = Object.values(ProductLookupTable);
|
||||
const products: Product[] = this.supportedProducts;
|
||||
|
||||
this._rbg = this._view!.modelBuilder.radioCardGroup().withProperties<azdata.RadioCardGroupComponentProperties>({
|
||||
cards: [],
|
||||
@@ -191,7 +205,6 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
}).component();
|
||||
|
||||
products.forEach((product) => {
|
||||
const imagePath = path.resolve(this.migrationStateModel.getExtensionPath(), 'media', product.icon ?? 'ads.svg');
|
||||
let dbCount = 0;
|
||||
if (product.type === 'AzureSQLVM') {
|
||||
dbCount = this._dbCount;
|
||||
@@ -238,7 +251,7 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
|
||||
this._rbg.cards.push({
|
||||
id: product.type,
|
||||
icon: imagePath,
|
||||
icon: product.icon,
|
||||
descriptions
|
||||
});
|
||||
});
|
||||
@@ -248,7 +261,6 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
this._rbg.onLinkClick(async (value) => {
|
||||
|
||||
//check which card is being selected, and open correct dialog based on link
|
||||
console.log(value);
|
||||
if (value.description.linkDisplayValue === 'View/Change') {
|
||||
if (value.cardId === 'AzureSQLVM') {
|
||||
await vmDialog.openDialog();
|
||||
|
||||
Reference in New Issue
Block a user