SKU recommendation page work (#12050)

This commit is contained in:
Amir Omidi
2020-09-01 09:31:39 -07:00
committed by GitHub
parent 96a6d0674a
commit 53081cfca9
7 changed files with 99 additions and 54 deletions

View File

@@ -5,7 +5,7 @@
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
export type MigrationProductType = 'AzureSQLMI' | 'AzureSQLVM';
export type MigrationProductType = 'AzureSQLMI' | 'AzureSQLVM' | 'AzureSQL';
export interface MigrationProduct {
readonly type: MigrationProductType;
}
@@ -22,12 +22,12 @@ export interface Checks {
export interface Product extends MigrationProduct {
readonly name: string;
readonly icon: string;
readonly learnMoreLink?: string;
readonly icon?: string;
}
export class Product implements Product {
constructor(public readonly type: MigrationProductType, public readonly name: string, public readonly icon: string, public readonly learnMoreLink?: string) {
constructor(public readonly type: MigrationProductType, public readonly name: string, public readonly icon?: string, public readonly learnMoreLink?: string) {
}
@@ -45,15 +45,17 @@ export interface SKURecommendation {
}
const ProductLookupTable: { [key in MigrationProductType]: Product } = {
export const ProductLookupTable: { [key in MigrationProductType]: Product } = {
'AzureSQLMI': {
type: 'AzureSQLMI',
name: localize('sql.migration.products.azuresqlmi.name', 'Azure Managed Instance (Microsoft managed)'),
icon: 'TODO',
},
'AzureSQLVM': {
type: 'AzureSQLVM',
name: localize('sql.migration.products.azuresqlvm.name', 'Azure SQL Virtual Machine (Customer managed)'),
icon: 'TODO',
},
'AzureSQL': {
type: 'AzureSQL',
name: localize('sql.migration.products.azuresql.name', 'Azure SQL'),
}
};

View File

@@ -43,7 +43,10 @@ export class MigrationStateModel implements Model, vscode.Disposable {
private _gatheringInformationError: string | undefined;
private _skuRecommendations: SKURecommendations | undefined;
constructor(private readonly _sourceConnection: azdata.connection.Connection) {
constructor(
private readonly _extensionContext: vscode.ExtensionContext,
private readonly _sourceConnection: azdata.connection.Connection
) {
this._currentState = State.INIT;
}
@@ -86,4 +89,8 @@ export class MigrationStateModel implements Model, vscode.Disposable {
dispose() {
this._stateChangeEventEmitter.dispose();
}
public getExtensionPath(): string {
return this._extensionContext.extensionPath;
}
}

View File

@@ -20,11 +20,13 @@ export const COLLECTING_SOURCE_CONFIGURATIONS_ERROR = (error: string = ''): stri
export const SKU_RECOMMENDATION_PAGE_TITLE = localize('sql.migration.wizard.sku.title', "Azure SQL Target Selection");
export const SKU_RECOMMENDATION_ALL_SUCCESSFUL = (databaseCount: number): string => {
return localize('sql.migration.sku.all', "Based on the results of our source configuration scans, all {0} of your databases can be migrated to Azure SQL.", databaseCount);
return localize('sql.migration.wizard.sku.all', "Based on the results of our source configuration scans, all {0} of your databases can be migrated to Azure SQL.", databaseCount);
};
export const SKU_RECOMMENDATION_SOME_SUCCESSFUL = (migratableCount: number, databaseCount: number): string => {
return localize('sql.migration.sku.some', "Based on the results of our source configuration scans, {0} out of {1} of your databases can be migrated to Azure SQL.", migratableCount, databaseCount);
return localize('sql.migration.wizard.sku.some', "Based on the results of our source configuration scans, {0} out of {1} of your databases can be migrated to Azure SQL.", migratableCount, databaseCount);
};
export const SKU_RECOMMENDATION_CHOOSE_A_TARGET = localize('sql.migration.wizard.sku.choose_a_target', "Choose a target");
export const SKU_RECOMMENDATION_NONE_SUCCESSFUL = localize('sql.migration.sku.none', "Based on the results of our source configuration scans, none of your databases can be migrated to Azure SQL.");
export const SUBSCRIPTION_SELECTION_PAGE_TITLE = localize('sql.migration.wizard.subscription.title', "Azure Subscription Selection");