mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 01:25:38 -05:00
Fixing errors in existing migration pages (#13977)
* - Adding null checks for onValueChanged - Adding new event for radiobuttons onDIdChangeCheckedState * changing the null checks in checkbox
This commit is contained in:
@@ -85,7 +85,11 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
checked: true
|
||||
}).component();
|
||||
|
||||
networkShareButton.onDidClick((e) => this.toggleNetworkContainerFields(NetworkContainerType.NETWORK_SHARE, this._networkShare));
|
||||
networkShareButton.onDidChangeCheckedState((e) => {
|
||||
if (e) {
|
||||
this.toggleNetworkContainerFields(NetworkContainerType.NETWORK_SHARE, this._networkShare);
|
||||
}
|
||||
});
|
||||
|
||||
const blobContainerButton = view.modelBuilder.radioButton()
|
||||
.withProps({
|
||||
@@ -93,7 +97,11 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
label: constants.DATABASE_BACKUP_NC_BLOB_STORAGE_RADIO_LABEL,
|
||||
}).component();
|
||||
|
||||
blobContainerButton.onDidClick((e) => this.toggleNetworkContainerFields(NetworkContainerType.BLOB_CONTAINER, this._blob));
|
||||
blobContainerButton.onDidChangeCheckedState((e) => {
|
||||
if (e) {
|
||||
this.toggleNetworkContainerFields(NetworkContainerType.BLOB_CONTAINER, this._blob);
|
||||
}
|
||||
});
|
||||
|
||||
const fileShareButton = view.modelBuilder.radioButton()
|
||||
.withProps({
|
||||
@@ -101,7 +109,11 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
label: constants.DATABASE_BACKUP_NC_FILE_SHARE_RADIO_LABEL,
|
||||
}).component();
|
||||
|
||||
fileShareButton.onDidClick((e) => this.toggleNetworkContainerFields(NetworkContainerType.FILE_SHARE, this._fileShare));
|
||||
fileShareButton.onDidChangeCheckedState((e) => {
|
||||
if (e) {
|
||||
this.toggleNetworkContainerFields(NetworkContainerType.FILE_SHARE, this._fileShare);
|
||||
}
|
||||
});
|
||||
|
||||
const flexContainer = view.modelBuilder.flexContainer().withItems(
|
||||
[
|
||||
@@ -139,8 +151,10 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
return true;
|
||||
}).component();
|
||||
this._fileShareSubscriptionDropdown.onValueChanged(async (value) => {
|
||||
this._fileShare.subscriptionId = (this._fileShareSubscriptionDropdown.value as azdata.CategoryValue).name;
|
||||
await this.loadFileShareStorageDropdown();
|
||||
if (this._fileShareSubscriptionDropdown.value) {
|
||||
this._fileShare.subscriptionId = (this._fileShareSubscriptionDropdown.value as azdata.CategoryValue).name;
|
||||
await this.loadFileShareStorageDropdown();
|
||||
}
|
||||
});
|
||||
|
||||
const storageAccountLabel = view.modelBuilder.text()
|
||||
@@ -163,8 +177,10 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
return true;
|
||||
}).component();
|
||||
this._fileShareStorageAccountDropdown.onValueChanged(async (value) => {
|
||||
this._fileShare.storageAccountId = (this._fileShareStorageAccountDropdown.value as azdata.CategoryValue).name;
|
||||
await this.loadFileShareDropdown();
|
||||
if (this._fileShareStorageAccountDropdown.value) {
|
||||
this._fileShare.storageAccountId = (this._fileShareStorageAccountDropdown.value as azdata.CategoryValue).name;
|
||||
await this.loadFileShareDropdown();
|
||||
}
|
||||
});
|
||||
|
||||
const fileShareLabel = view.modelBuilder.text()
|
||||
@@ -187,7 +203,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
return true;
|
||||
}).component();
|
||||
this._fileShareFileShareDropdown.onValueChanged((value) => {
|
||||
this._fileShare.fileShareId = (this._fileShareFileShareDropdown.value as azdata.CategoryValue).name;
|
||||
if (this._fileShareFileShareDropdown.value) {
|
||||
this._fileShare.fileShareId = (this._fileShareFileShareDropdown.value as azdata.CategoryValue).name;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -230,8 +248,10 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
return true;
|
||||
}).component();
|
||||
this._blobContainerSubscriptionDropdown.onValueChanged(async (value) => {
|
||||
this._blob.subscriptionId = (this._blobContainerSubscriptionDropdown.value as azdata.CategoryValue).name;
|
||||
await this.loadblobStorageDropdown();
|
||||
if (this._blobContainerSubscriptionDropdown.value) {
|
||||
this._blob.subscriptionId = (this._blobContainerSubscriptionDropdown.value as azdata.CategoryValue).name;
|
||||
await this.loadblobStorageDropdown();
|
||||
}
|
||||
});
|
||||
|
||||
const storageAccountLabel = view.modelBuilder.text()
|
||||
@@ -254,8 +274,10 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
return true;
|
||||
}).component();
|
||||
this._blobContainerStorageAccountDropdown.onValueChanged(async (value) => {
|
||||
this._blob.storageAccountId = (this._blobContainerStorageAccountDropdown.value as azdata.CategoryValue).name;
|
||||
await this.loadBlobContainerDropdown();
|
||||
if (this._blobContainerStorageAccountDropdown.value) {
|
||||
this._blob.storageAccountId = (this._blobContainerStorageAccountDropdown.value as azdata.CategoryValue).name;
|
||||
await this.loadBlobContainerDropdown();
|
||||
}
|
||||
});
|
||||
|
||||
const containerLabel = view.modelBuilder.text().withProps({
|
||||
@@ -277,7 +299,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
return true;
|
||||
}).component();
|
||||
this._blobContainerBlobDropdown.onValueChanged((value) => {
|
||||
this._blob.containerId = (this._blobContainerBlobDropdown.value as azdata.CategoryValue).name;
|
||||
if (this._blobContainerBlobDropdown.value) {
|
||||
this._blob.containerId = (this._blobContainerBlobDropdown.value as azdata.CategoryValue).name;
|
||||
}
|
||||
});
|
||||
|
||||
const flexContainer = view.modelBuilder.flexContainer()
|
||||
@@ -389,8 +413,10 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
return true;
|
||||
}).component();
|
||||
this._networkShareContainerSubscriptionDropdown.onValueChanged(async (value) => {
|
||||
this._networkShare.storageSubscriptionId = (this._networkShareContainerSubscriptionDropdown.value as azdata.CategoryValue).name;
|
||||
await this.loadNetworkShareStorageDropdown();
|
||||
if (this._networkShareContainerSubscriptionDropdown.value) {
|
||||
this._networkShare.storageSubscriptionId = (this._networkShareContainerSubscriptionDropdown.value as azdata.CategoryValue).name;
|
||||
await this.loadNetworkShareStorageDropdown();
|
||||
}
|
||||
});
|
||||
|
||||
const storageAccountLabel = view.modelBuilder.text()
|
||||
@@ -413,7 +439,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
return true;
|
||||
}).component();
|
||||
this._networkShareContainerStorageAccountDropdown.onValueChanged((value) => {
|
||||
this._networkShare.storageAccountId = (this._networkShareContainerStorageAccountDropdown.value as azdata.CategoryValue).name;
|
||||
if (this._networkShareContainerStorageAccountDropdown.value) {
|
||||
this._networkShare.storageAccountId = (this._networkShareContainerStorageAccountDropdown.value as azdata.CategoryValue).name;
|
||||
}
|
||||
});
|
||||
|
||||
const flexContainer = view.modelBuilder.flexContainer().withItems(
|
||||
@@ -443,7 +471,11 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
label: constants.DATABASE_BACKUP_EMAIL_NOTIFICATION_CHECKBOX_LABEL
|
||||
}).component();
|
||||
|
||||
emailCheckbox.onChanged((value) => this.migrationStateModel.databaseBackup.emailNotification = value);
|
||||
emailCheckbox.onChanged((value) => {
|
||||
if (value !== undefined) {
|
||||
this.migrationStateModel.databaseBackup.emailNotification = value;
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
title: constants.DATABASE_BACKUP_EMAIL_NOTIFICATION_LABEL,
|
||||
@@ -466,14 +498,22 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
||||
|
||||
this.migrationStateModel.databaseBackup.migrationCutover = MigrationCutover.AUTOMATIC;
|
||||
|
||||
automaticButton.onDidClick((e) => this.migrationStateModel.databaseBackup.migrationCutover = MigrationCutover.AUTOMATIC);
|
||||
automaticButton.onDidChangeCheckedState((e) => {
|
||||
if (e) {
|
||||
this.migrationStateModel.databaseBackup.migrationCutover = MigrationCutover.AUTOMATIC;
|
||||
}
|
||||
});
|
||||
|
||||
const manualButton = view.modelBuilder.radioButton().withProps({
|
||||
label: constants.DATABASE_BACKUP_MIGRATION_CUTOVER_MANUAL_LABEL,
|
||||
name: buttonGroup
|
||||
}).component();
|
||||
|
||||
manualButton.onDidClick((e) => this.migrationStateModel.databaseBackup.migrationCutover = MigrationCutover.MANUAL);
|
||||
manualButton.onDidChangeCheckedState((e) => {
|
||||
if (e) {
|
||||
this.migrationStateModel.databaseBackup.migrationCutover = MigrationCutover.MANUAL;
|
||||
}
|
||||
});
|
||||
|
||||
const flexContainer = view.modelBuilder.flexContainer().withItems(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user