mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
[SQL Migration] Add info boxes for VM existing database names (#21566)
This commit is contained in:
@@ -540,6 +540,7 @@ export const DUPLICATE_NAME_ERROR = localize('sql.migration.unique.name', "Selec
|
|||||||
export function DATABASE_ALREADY_EXISTS_MI(dbName: string, targetName: string): string {
|
export function DATABASE_ALREADY_EXISTS_MI(dbName: string, targetName: string): string {
|
||||||
return localize('sql.migration.database.already.exists', "Database '{0}' already exists on the target managed instance '{1}'.", dbName, targetName);
|
return localize('sql.migration.database.already.exists', "Database '{0}' already exists on the target managed instance '{1}'.", dbName, targetName);
|
||||||
}
|
}
|
||||||
|
export const DATABASE_ALREADY_EXISTS_VM_INFO = localize('sql.migration.database.already.exists.vm.info', "Ensure that the provided database name(s) do not already exist on the target SQL Server on Azure Virtual Machine.");
|
||||||
export const DATABASE_BACKUP_BLOB_STORAGE_HEADER_TEXT = localize('sql.migration.blob.storage.header.text', "Azure Storage Blob Container details");
|
export const DATABASE_BACKUP_BLOB_STORAGE_HEADER_TEXT = localize('sql.migration.blob.storage.header.text', "Azure Storage Blob Container details");
|
||||||
export const DATABASE_BACKUP_BLOB_STORAGE_HELP_TEXT = localize('sql.migration.blob.storage.help.text', "Provide the Azure Storage Blob Container that contains the backups.");
|
export const DATABASE_BACKUP_BLOB_STORAGE_HELP_TEXT = localize('sql.migration.blob.storage.help.text', "Provide the Azure Storage Blob Container that contains the backups.");
|
||||||
export const DATABASE_BACKUP_BLOB_STORAGE_TABLE_HELP_TEXT = localize('sql.migration.blob.storage.table.help', "Enter target database name and select resource group, storage account and container for the selected source databases.");
|
export const DATABASE_BACKUP_BLOB_STORAGE_TABLE_HELP_TEXT = localize('sql.migration.blob.storage.table.help', "Enter target database name and select resource group, storage account and container for the selected source databases.");
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
private _blobContainerStorageAccountDropdowns!: azdata.DropDownComponent[];
|
private _blobContainerStorageAccountDropdowns!: azdata.DropDownComponent[];
|
||||||
private _blobContainerDropdowns!: azdata.DropDownComponent[];
|
private _blobContainerDropdowns!: azdata.DropDownComponent[];
|
||||||
private _blobContainerLastBackupFileDropdowns!: azdata.DropDownComponent[];
|
private _blobContainerLastBackupFileDropdowns!: azdata.DropDownComponent[];
|
||||||
|
private _blobContainerVmDatabaseAlreadyExistsInfoBox!: azdata.TextComponent;
|
||||||
|
|
||||||
private _networkShareStorageAccountDetails!: azdata.FlexContainer;
|
private _networkShareStorageAccountDetails!: azdata.FlexContainer;
|
||||||
private _networkShareContainerSubscription!: azdata.TextComponent;
|
private _networkShareContainerSubscription!: azdata.TextComponent;
|
||||||
@@ -52,6 +53,7 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
private _networkShareStorageAccountResourceGroupDropdown!: azdata.DropDownComponent;
|
private _networkShareStorageAccountResourceGroupDropdown!: azdata.DropDownComponent;
|
||||||
private _networkShareContainerStorageAccountDropdown!: azdata.DropDownComponent;
|
private _networkShareContainerStorageAccountDropdown!: azdata.DropDownComponent;
|
||||||
private _networkShareContainerStorageAccountRefreshButton!: azdata.ButtonComponent;
|
private _networkShareContainerStorageAccountRefreshButton!: azdata.ButtonComponent;
|
||||||
|
private _networkShareVmDatabaseAlreadyExistsInfoBox!: azdata.TextComponent;
|
||||||
|
|
||||||
private _targetDatabaseContainer!: azdata.FlexContainer;
|
private _targetDatabaseContainer!: azdata.FlexContainer;
|
||||||
private _networkShareTargetDatabaseNamesTable!: azdata.DeclarativeTableComponent;
|
private _networkShareTargetDatabaseNamesTable!: azdata.DeclarativeTableComponent;
|
||||||
@@ -454,9 +456,18 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
]
|
]
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
|
this._networkShareVmDatabaseAlreadyExistsInfoBox = this._view.modelBuilder.infoBox()
|
||||||
|
.withProps({
|
||||||
|
text: constants.DATABASE_ALREADY_EXISTS_VM_INFO,
|
||||||
|
style: 'information',
|
||||||
|
width: WIZARD_INPUT_COMPONENT_WIDTH,
|
||||||
|
CSSStyles: { ...styles.BODY_CSS, 'display': 'none' }
|
||||||
|
}).component();
|
||||||
|
|
||||||
this._networkTableContainer = this._view.modelBuilder.flexContainer()
|
this._networkTableContainer = this._view.modelBuilder.flexContainer()
|
||||||
.withItems([
|
.withItems([
|
||||||
networkShareTableText,
|
networkShareTableText,
|
||||||
|
this._networkShareVmDatabaseAlreadyExistsInfoBox,
|
||||||
this._networkShareTargetDatabaseNamesTable])
|
this._networkShareTargetDatabaseNamesTable])
|
||||||
.withProps({ CSSStyles: { 'display': 'none', } })
|
.withProps({ CSSStyles: { 'display': 'none', } })
|
||||||
.component();
|
.component();
|
||||||
@@ -467,10 +478,19 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
CSSStyles: { ...styles.BODY_CSS }
|
CSSStyles: { ...styles.BODY_CSS }
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
|
this._blobContainerVmDatabaseAlreadyExistsInfoBox = this._view.modelBuilder.infoBox()
|
||||||
|
.withProps({
|
||||||
|
text: constants.DATABASE_ALREADY_EXISTS_VM_INFO,
|
||||||
|
style: 'information',
|
||||||
|
width: WIZARD_INPUT_COMPONENT_WIDTH,
|
||||||
|
CSSStyles: { ...styles.BODY_CSS, 'display': 'none' }
|
||||||
|
}).component();
|
||||||
|
|
||||||
this._blobTableContainer = this._view.modelBuilder.flexContainer()
|
this._blobTableContainer = this._view.modelBuilder.flexContainer()
|
||||||
.withItems([
|
.withItems([
|
||||||
blobTableText,
|
blobTableText,
|
||||||
allFieldsRequiredLabel,
|
allFieldsRequiredLabel,
|
||||||
|
this._blobContainerVmDatabaseAlreadyExistsInfoBox,
|
||||||
this._blobContainerTargetDatabaseNamesTable])
|
this._blobContainerTargetDatabaseNamesTable])
|
||||||
.withProps({ CSSStyles: { 'display': 'none', } })
|
.withProps({ CSSStyles: { 'display': 'none', } })
|
||||||
.component();
|
.component();
|
||||||
@@ -627,6 +647,7 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
|
|
||||||
private async _updatePageControlsVisibility(): Promise<void> {
|
private async _updatePageControlsVisibility(): Promise<void> {
|
||||||
const isSqlDbTarget = this.migrationStateModel.isSqlDbTarget;
|
const isSqlDbTarget = this.migrationStateModel.isSqlDbTarget;
|
||||||
|
const isSqlVmTarget = this.migrationStateModel.isSqlVmTarget;
|
||||||
const isNetworkShare = this.migrationStateModel.isBackupContainerNetworkShare;
|
const isNetworkShare = this.migrationStateModel.isBackupContainerNetworkShare;
|
||||||
const isBlobContainer = this.migrationStateModel.isBackupContainerBlobContainer;
|
const isBlobContainer = this.migrationStateModel.isBackupContainerBlobContainer;
|
||||||
|
|
||||||
@@ -634,12 +655,13 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
await utils.updateControlDisplay(this._migrationTableSection, isSqlDbTarget);
|
await utils.updateControlDisplay(this._migrationTableSection, isSqlDbTarget);
|
||||||
await utils.updateControlDisplay(this._networkDetailsContainer, !isSqlDbTarget);
|
await utils.updateControlDisplay(this._networkDetailsContainer, !isSqlDbTarget);
|
||||||
await utils.updateControlDisplay(this._targetDatabaseContainer, !isSqlDbTarget);
|
await utils.updateControlDisplay(this._targetDatabaseContainer, !isSqlDbTarget);
|
||||||
await utils.updateControlDisplay(this._networkShareStorageAccountDetails, !isSqlDbTarget);
|
|
||||||
|
|
||||||
await utils.updateControlDisplay(this._networkShareContainer, isNetworkShare && !isSqlDbTarget);
|
await utils.updateControlDisplay(this._networkShareContainer, isNetworkShare && !isSqlDbTarget);
|
||||||
await utils.updateControlDisplay(this._networkShareStorageAccountDetails, isNetworkShare && !isSqlDbTarget);
|
await utils.updateControlDisplay(this._networkShareStorageAccountDetails, isNetworkShare && !isSqlDbTarget);
|
||||||
|
await utils.updateControlDisplay(this._networkShareVmDatabaseAlreadyExistsInfoBox, isSqlVmTarget);
|
||||||
await utils.updateControlDisplay(this._networkTableContainer, isNetworkShare && !isSqlDbTarget);
|
await utils.updateControlDisplay(this._networkTableContainer, isNetworkShare && !isSqlDbTarget);
|
||||||
await utils.updateControlDisplay(this._blobContainer, isBlobContainer && !isSqlDbTarget);
|
await utils.updateControlDisplay(this._blobContainer, isBlobContainer && !isSqlDbTarget);
|
||||||
|
await utils.updateControlDisplay(this._blobContainerVmDatabaseAlreadyExistsInfoBox, isSqlVmTarget);
|
||||||
await utils.updateControlDisplay(this._blobTableContainer, isBlobContainer && !isSqlDbTarget);
|
await utils.updateControlDisplay(this._blobTableContainer, isBlobContainer && !isSqlDbTarget);
|
||||||
|
|
||||||
await this._windowsUserAccountText.updateProperties({ required: isNetworkShare && !isSqlDbTarget });
|
await this._windowsUserAccountText.updateProperties({ required: isNetworkShare && !isSqlDbTarget });
|
||||||
|
|||||||
Reference in New Issue
Block a user