diff --git a/extensions/sql-migration/src/constants/strings.ts b/extensions/sql-migration/src/constants/strings.ts index 29865c39f5..79f2be8f2d 100644 --- a/extensions/sql-migration/src/constants/strings.ts +++ b/extensions/sql-migration/src/constants/strings.ts @@ -102,6 +102,8 @@ export const DATABASE_BACKUP_MIGRATION_MODE_ONLINE_LABEL = localize('sql.migrati export const DATABASE_BACKUP_MIGRATION_MODE_ONLINE_DESCRIPTION = localize('sql.migration.database.migration.mode.online.description', "Application downtime is limited to cutover at the end of migration."); export const DATABASE_BACKUP_MIGRATION_MODE_OFFLINE_DESCRIPTION = localize('sql.migration.database.migration.mode.offline.description', "Application downtime will start when the migration starts."); export const DATABASE_BACKUP_MIGRATION_MODE_OFFLINE_LABEL = localize('sql.migration.database.migration.mode.offline.label', "Offline migration"); +export const NETWORK_SHARE_PATH = localize('sql.migration.network.share.path', "\\\\Servername.domainname.com\\Backupfolder"); +export const WINDOWS_USER_ACCOUNT = localize('sql.migration.windows.user.account', "Domain\\username"); export const NO_SUBSCRIPTIONS_FOUND = localize('sql.migration.no.subscription.found', "No subscription found"); export const NO_LOCATION_FOUND = localize('sql.migration.no.location.found', "No location found"); export const NO_STORAGE_ACCOUNT_FOUND = localize('sql.migration.no.storageAccount.found', "No storage account found"); @@ -123,8 +125,8 @@ export function INVALID_BLOB_CONTAINER_ERROR(sourceDb: string): string { export function INVALID_BLOB_LAST_BACKUP_FILE_ERROR(sourceDb: string): string { return localize('sql.migration.invalid.blob.lastBackupFile.error', "To continue, select a valid last backup file for source database '{0}'.", sourceDb); } -export const INVALID_NETWORK_SHARE_LOCATION = localize('sql.migration.invalid.network.share.location', "Invalid network share location format. Example: {0}", '\\\\Servername.domainname.com\\Backupfolder'); -export const INVALID_USER_ACCOUNT = localize('sql.migration.invalid.user.account', "Invalid user account format. Example: {0}", 'Domain\\username'); +export const INVALID_NETWORK_SHARE_LOCATION = localize('sql.migration.invalid.network.share.location', "Invalid network share location format. Example: {0}", NETWORK_SHARE_PATH); +export const INVALID_USER_ACCOUNT = localize('sql.migration.invalid.user.account', "Invalid user account format. Example: {0}", WINDOWS_USER_ACCOUNT); export const INVALID_TARGET_NAME_ERROR = localize('sql.migration.invalid.target.name.error', "Enter a valid name for the target database."); export const PROVIDE_UNIQUE_CONTAINERS = localize('sql.migration.provide.unique.containers', "Provide a unique container for each target database. Databases affected: "); export function SQL_SOURCE_DETAILS(authMethod: MigrationSourceAuthenticationType, serverName: string): string { @@ -222,6 +224,7 @@ export const CLOSE = localize('sql.migration.close', "Close"); export const DATA_UPLOADED = localize('sql.migration.data.uploaded.size', "Data Uploaded/Size"); export const COPY_THROUGHPUT = localize('sql.migration.copy.throughput', "Copy Throughput (MBPS)"); export const NEW_SUPPORT_REQUEST = localize('sql.migration.newSupportRequest', "New support request"); +export const IMPACT = localize('sql.migration.impact', "Impact"); export const ALL_FIELDS_REQUIRED = localize('sql.migration.all.fields.required', 'All fields are required.'); //Summary Page @@ -350,6 +353,11 @@ export const FILE_NAME = localize('sql.migration.file.name', "File name"); export const SIZE_COLUMN_HEADER = localize('sql.migration.size.column.header', "Size"); export const NO_PENDING_BACKUPS = localize('sql.migration.no.pending.backups', "No pending backups. Click refresh to check current status."); //Migration status dialog +export const STATUS_ALL = localize('sql.migration.status.dropdown.all', "Status: All"); +export const STATUS_ONGOING = localize('sql.migration.status.dropdown.ongoing', "Status: Ongoing"); +export const STATUS_COMPLETING = localize('sql.migration.status.dropdown.completing', "Status: Completing"); +export const STATUS_SUCCEEDED = localize('sql.migration.status.dropdown.succeeded', "Status: Succeeded"); +export const STATUS_FAILED = localize('sql.migration.status.dropdown.failed', "Status: Failed"); export const SEARCH_FOR_MIGRATIONS = localize('sql.migration.search.for.migration', "Search for migrations"); export const ONLINE = localize('sql.migration.online', "Online"); export const OFFLINE = localize('sql.migration.offline', "Offline"); @@ -368,7 +376,6 @@ export function STATUS_VALUE(status: string, count: number): string { if (count > 0) { return localize('sql.migration.status.error.count.some', "{0} (", StatusLookup[status] ?? status); } - return localize('sql.migration.status.error.count.none', "{0}", StatusLookup[status] ?? status); } @@ -383,7 +390,7 @@ export const StatusLookup: LookupTable = { ['Completing']: localize('sql.migration.status.completing', 'Completing'), ['Canceling']: localize('sql.migration.status.canceling', 'Canceling'), ['Failed']: localize('sql.migration.status.failed', 'Failed'), - default: undefined, + default: undefined }; export function STATUS_WARNING_COUNT(status: string, count: number): string | undefined { diff --git a/extensions/sql-migration/src/dialog/assessmentResults/sqlAssessmentResult.ts b/extensions/sql-migration/src/dialog/assessmentResults/sqlAssessmentResult.ts index a935383f18..7c40b7997f 100644 --- a/extensions/sql-migration/src/dialog/assessmentResults/sqlAssessmentResult.ts +++ b/extensions/sql-migration/src/dialog/assessmentResults/sqlAssessmentResult.ts @@ -3,6 +3,8 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import * as azdata from 'azdata'; +import * as loc from '../../constants/strings'; + export class SqlAssessmentResult { async createComponent(view: azdata.ModelView): Promise { @@ -25,7 +27,7 @@ export class SqlAssessmentResult { private createImpactComponent(view: azdata.ModelView): azdata.TextComponent { const impact = view.modelBuilder.text().withProps({ - title: 'Impact', // TODO localize + title: loc.IMPACT, value: 'SQL Server allows a database to log transactions across multiple files. This databases uses multiple log files' // TODO: Get this string from the actual results }); @@ -34,7 +36,7 @@ export class SqlAssessmentResult { private createRecommendationComponent(view: azdata.ModelView): azdata.TextComponent { const recommendation = view.modelBuilder.text().withProps({ - title: 'Recommendation', // TODO localize + title: loc.RECOMMENDATION, value: 'Azure SQL Managed Instance allows a single log file per database only. Please delete all but one of the log files before migrating this database.' // TODO: Get this string from the actual results }); @@ -43,7 +45,7 @@ export class SqlAssessmentResult { private createMoreInfoComponent(view: azdata.ModelView): azdata.TextComponent { const moreInfo = view.modelBuilder.text().withProps({ - title: 'More info', // TODO localize + title: loc.MORE_INFO, value: '{0}', links: [ { @@ -60,8 +62,8 @@ export class SqlAssessmentResult { const impactedObjects = view.modelBuilder.table().withProps({ title: 'Impacted Objects', columns: [ - 'Type', // TODO localize - 'Name', + loc.TYPE, + loc.NAME ], data: [ ['Database', 'AAAW2008P7'] // TODO: Get this string from the actual results diff --git a/extensions/sql-migration/src/dialog/migrationStatus/migrationStatusDialogModel.ts b/extensions/sql-migration/src/dialog/migrationStatus/migrationStatusDialogModel.ts index 56542fde03..b28f56f2b7 100644 --- a/extensions/sql-migration/src/dialog/migrationStatus/migrationStatusDialogModel.ts +++ b/extensions/sql-migration/src/dialog/migrationStatus/migrationStatusDialogModel.ts @@ -4,24 +4,25 @@ *--------------------------------------------------------------------------------------------*/ import * as azdata from 'azdata'; +import * as loc from '../../constants/strings'; import { MigrationContext } from '../../models/migrationLocalStorage'; export class MigrationStatusDialogModel { public statusDropdownValues: azdata.CategoryValue[] = [ { - displayName: 'Status: All', - name: AdsMigrationStatus.ALL, + displayName: loc.STATUS_ALL, + name: AdsMigrationStatus.ALL }, { - displayName: 'Status: Ongoing', - name: AdsMigrationStatus.ONGOING, + displayName: loc.STATUS_ONGOING, + name: AdsMigrationStatus.ONGOING }, { - displayName: 'Status: Completing', + displayName: loc.STATUS_COMPLETING, name: AdsMigrationStatus.COMPLETING }, { - displayName: 'Status: Succeeded', - name: AdsMigrationStatus.SUCCEEDED, + displayName: loc.STATUS_SUCCEEDED, + name: AdsMigrationStatus.SUCCEEDED }, { - displayName: 'Status: Failed', + displayName: loc.STATUS_FAILED, name: AdsMigrationStatus.FAILED } ]; diff --git a/extensions/sql-migration/src/wizard/databaseBackupPage.ts b/extensions/sql-migration/src/wizard/databaseBackupPage.ts index 2c035c5145..9a28cd104a 100644 --- a/extensions/sql-migration/src/wizard/databaseBackupPage.ts +++ b/extensions/sql-migration/src/wizard/databaseBackupPage.ts @@ -255,7 +255,7 @@ export class DatabaseBackupPage extends MigrationWizardPage { } }).component(); this._networkSharePath = this._view.modelBuilder.inputBox().withProps({ - placeHolder: '\\\\Servername.domainname.com\\Backupfolder', + placeHolder: constants.NETWORK_SHARE_PATH, validationErrorMessage: constants.INVALID_NETWORK_SHARE_LOCATION, width: WIZARD_INPUT_COMPONENT_WIDTH, CSSStyles: { @@ -299,7 +299,7 @@ export class DatabaseBackupPage extends MigrationWizardPage { }).component(); this._windowsUserAccountText = this._view.modelBuilder.inputBox() .withProps({ - placeHolder: 'Domain\\username', + placeHolder: constants.WINDOWS_USER_ACCOUNT, required: true, validationErrorMessage: constants.INVALID_USER_ACCOUNT, width: WIZARD_INPUT_COMPONENT_WIDTH