Save And Close Functionality (#17000)

* save and close

* wip

* working save and close

* cleanup

* pr changes

* pr changes

* fix capitalization

* fix build

* pr fix
This commit is contained in:
Christopher Suh
2021-09-24 14:59:35 -07:00
committed by GitHub
parent 177b56c5ff
commit 207254fa6c
12 changed files with 386 additions and 25 deletions

View File

@@ -24,6 +24,7 @@ export class AccountsSelectionPage extends MigrationWizardPage {
}
protected async registerContent(view: azdata.ModelView): Promise<void> {
this.wizard.customButtons[0].enabled = true;
const form = view.modelBuilder.formContainer()
.withFormItems(
[
@@ -95,6 +96,14 @@ export class AccountsSelectionPage extends MigrationWizardPage {
await this._accountTenantFlexContainer.updateCssStyles({
'display': 'none'
});
if (this.migrationStateModel.resumeAssessment && this.migrationStateModel.savedInfo.closedPage >= 0) {
(<azdata.CategoryValue[]>this._azureAccountsDropdown.values)?.forEach((account, index) => {
if (account.name === this.migrationStateModel.savedInfo.azureAccount?.displayInfo.userId) {
selectDropDownIndex(this._azureAccountsDropdown, index);
}
});
}
}
this.migrationStateModel._subscriptions = undefined!;
this.migrationStateModel._targetSubscription = undefined!;
@@ -162,12 +171,17 @@ export class AccountsSelectionPage extends MigrationWizardPage {
* All azure requests will only run on this tenant from now on
*/
const selectedIndex = findDropDownItemIndex(this._accountTenantDropdown, value);
const selectedTenant = this.migrationStateModel.getTenant(selectedIndex);
this.migrationStateModel._azureTenant = deepClone(selectedTenant);
if (selectedIndex > -1) {
this.migrationStateModel._azureAccount.properties.tenants = [this.migrationStateModel.getTenant(selectedIndex)];
this.migrationStateModel._subscriptions = undefined!;
this.migrationStateModel._targetSubscription = undefined!;
this.migrationStateModel._databaseBackup.subscription = undefined!;
}
const selectedAzureAccount = this.migrationStateModel.getAccount(selectedIndex);
this.migrationStateModel._azureAccount = deepClone(selectedAzureAccount);
}));
this._accountTenantFlexContainer = view.modelBuilder.flexContainer()