mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -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:
@@ -42,7 +42,10 @@ export class AccountsSelectionPage extends MigrationWizardPage {
|
|||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
this._azureAccountsDropdown.onValueChanged(async (value) => {
|
this._azureAccountsDropdown.onValueChanged(async (value) => {
|
||||||
this.migrationStateModel.azureAccount = this._accountsMap.get((this._azureAccountsDropdown.value as azdata.CategoryValue).name)!;
|
if (this._azureAccountsDropdown.value) {
|
||||||
|
const selectedAccount = (this._azureAccountsDropdown.value as azdata.CategoryValue).name;
|
||||||
|
this.migrationStateModel.azureAccount = this._accountsMap.get(selectedAccount)!;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const addAccountButton = view.modelBuilder.button()
|
const addAccountButton = view.modelBuilder.button()
|
||||||
|
|||||||
@@ -85,7 +85,11 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
checked: true
|
checked: true
|
||||||
}).component();
|
}).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()
|
const blobContainerButton = view.modelBuilder.radioButton()
|
||||||
.withProps({
|
.withProps({
|
||||||
@@ -93,7 +97,11 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
label: constants.DATABASE_BACKUP_NC_BLOB_STORAGE_RADIO_LABEL,
|
label: constants.DATABASE_BACKUP_NC_BLOB_STORAGE_RADIO_LABEL,
|
||||||
}).component();
|
}).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()
|
const fileShareButton = view.modelBuilder.radioButton()
|
||||||
.withProps({
|
.withProps({
|
||||||
@@ -101,7 +109,11 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
label: constants.DATABASE_BACKUP_NC_FILE_SHARE_RADIO_LABEL,
|
label: constants.DATABASE_BACKUP_NC_FILE_SHARE_RADIO_LABEL,
|
||||||
}).component();
|
}).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(
|
const flexContainer = view.modelBuilder.flexContainer().withItems(
|
||||||
[
|
[
|
||||||
@@ -139,8 +151,10 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
return true;
|
return true;
|
||||||
}).component();
|
}).component();
|
||||||
this._fileShareSubscriptionDropdown.onValueChanged(async (value) => {
|
this._fileShareSubscriptionDropdown.onValueChanged(async (value) => {
|
||||||
this._fileShare.subscriptionId = (this._fileShareSubscriptionDropdown.value as azdata.CategoryValue).name;
|
if (this._fileShareSubscriptionDropdown.value) {
|
||||||
await this.loadFileShareStorageDropdown();
|
this._fileShare.subscriptionId = (this._fileShareSubscriptionDropdown.value as azdata.CategoryValue).name;
|
||||||
|
await this.loadFileShareStorageDropdown();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const storageAccountLabel = view.modelBuilder.text()
|
const storageAccountLabel = view.modelBuilder.text()
|
||||||
@@ -163,8 +177,10 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
return true;
|
return true;
|
||||||
}).component();
|
}).component();
|
||||||
this._fileShareStorageAccountDropdown.onValueChanged(async (value) => {
|
this._fileShareStorageAccountDropdown.onValueChanged(async (value) => {
|
||||||
this._fileShare.storageAccountId = (this._fileShareStorageAccountDropdown.value as azdata.CategoryValue).name;
|
if (this._fileShareStorageAccountDropdown.value) {
|
||||||
await this.loadFileShareDropdown();
|
this._fileShare.storageAccountId = (this._fileShareStorageAccountDropdown.value as azdata.CategoryValue).name;
|
||||||
|
await this.loadFileShareDropdown();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const fileShareLabel = view.modelBuilder.text()
|
const fileShareLabel = view.modelBuilder.text()
|
||||||
@@ -187,7 +203,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
return true;
|
return true;
|
||||||
}).component();
|
}).component();
|
||||||
this._fileShareFileShareDropdown.onValueChanged((value) => {
|
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;
|
return true;
|
||||||
}).component();
|
}).component();
|
||||||
this._blobContainerSubscriptionDropdown.onValueChanged(async (value) => {
|
this._blobContainerSubscriptionDropdown.onValueChanged(async (value) => {
|
||||||
this._blob.subscriptionId = (this._blobContainerSubscriptionDropdown.value as azdata.CategoryValue).name;
|
if (this._blobContainerSubscriptionDropdown.value) {
|
||||||
await this.loadblobStorageDropdown();
|
this._blob.subscriptionId = (this._blobContainerSubscriptionDropdown.value as azdata.CategoryValue).name;
|
||||||
|
await this.loadblobStorageDropdown();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const storageAccountLabel = view.modelBuilder.text()
|
const storageAccountLabel = view.modelBuilder.text()
|
||||||
@@ -254,8 +274,10 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
return true;
|
return true;
|
||||||
}).component();
|
}).component();
|
||||||
this._blobContainerStorageAccountDropdown.onValueChanged(async (value) => {
|
this._blobContainerStorageAccountDropdown.onValueChanged(async (value) => {
|
||||||
this._blob.storageAccountId = (this._blobContainerStorageAccountDropdown.value as azdata.CategoryValue).name;
|
if (this._blobContainerStorageAccountDropdown.value) {
|
||||||
await this.loadBlobContainerDropdown();
|
this._blob.storageAccountId = (this._blobContainerStorageAccountDropdown.value as azdata.CategoryValue).name;
|
||||||
|
await this.loadBlobContainerDropdown();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const containerLabel = view.modelBuilder.text().withProps({
|
const containerLabel = view.modelBuilder.text().withProps({
|
||||||
@@ -277,7 +299,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
return true;
|
return true;
|
||||||
}).component();
|
}).component();
|
||||||
this._blobContainerBlobDropdown.onValueChanged((value) => {
|
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()
|
const flexContainer = view.modelBuilder.flexContainer()
|
||||||
@@ -389,8 +413,10 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
return true;
|
return true;
|
||||||
}).component();
|
}).component();
|
||||||
this._networkShareContainerSubscriptionDropdown.onValueChanged(async (value) => {
|
this._networkShareContainerSubscriptionDropdown.onValueChanged(async (value) => {
|
||||||
this._networkShare.storageSubscriptionId = (this._networkShareContainerSubscriptionDropdown.value as azdata.CategoryValue).name;
|
if (this._networkShareContainerSubscriptionDropdown.value) {
|
||||||
await this.loadNetworkShareStorageDropdown();
|
this._networkShare.storageSubscriptionId = (this._networkShareContainerSubscriptionDropdown.value as azdata.CategoryValue).name;
|
||||||
|
await this.loadNetworkShareStorageDropdown();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const storageAccountLabel = view.modelBuilder.text()
|
const storageAccountLabel = view.modelBuilder.text()
|
||||||
@@ -413,7 +439,9 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
return true;
|
return true;
|
||||||
}).component();
|
}).component();
|
||||||
this._networkShareContainerStorageAccountDropdown.onValueChanged((value) => {
|
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(
|
const flexContainer = view.modelBuilder.flexContainer().withItems(
|
||||||
@@ -443,7 +471,11 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
label: constants.DATABASE_BACKUP_EMAIL_NOTIFICATION_CHECKBOX_LABEL
|
label: constants.DATABASE_BACKUP_EMAIL_NOTIFICATION_CHECKBOX_LABEL
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
emailCheckbox.onChanged((value) => this.migrationStateModel.databaseBackup.emailNotification = value);
|
emailCheckbox.onChanged((value) => {
|
||||||
|
if (value !== undefined) {
|
||||||
|
this.migrationStateModel.databaseBackup.emailNotification = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: constants.DATABASE_BACKUP_EMAIL_NOTIFICATION_LABEL,
|
title: constants.DATABASE_BACKUP_EMAIL_NOTIFICATION_LABEL,
|
||||||
@@ -466,14 +498,22 @@ export class DatabaseBackupPage extends MigrationWizardPage {
|
|||||||
|
|
||||||
this.migrationStateModel.databaseBackup.migrationCutover = MigrationCutover.AUTOMATIC;
|
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({
|
const manualButton = view.modelBuilder.radioButton().withProps({
|
||||||
label: constants.DATABASE_BACKUP_MIGRATION_CUTOVER_MANUAL_LABEL,
|
label: constants.DATABASE_BACKUP_MIGRATION_CUTOVER_MANUAL_LABEL,
|
||||||
name: buttonGroup
|
name: buttonGroup
|
||||||
}).component();
|
}).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(
|
const flexContainer = view.modelBuilder.flexContainer().withItems(
|
||||||
[
|
[
|
||||||
|
|||||||
Reference in New Issue
Block a user