mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 09:35:38 -05:00
Dev/brih/hotfix status page (#16407)
* add dispose pattern, fix migration status enum * format strings * add dispose handler to more events
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { MigrationWizardPage } from '../models/migrationWizardPage';
|
||||
import { MigrationSourceAuthenticationType, MigrationStateModel, StateChangeEvent } from '../models/stateMachine';
|
||||
import * as constants from '../constants/strings';
|
||||
@@ -13,6 +14,7 @@ export class SqlSourceConfigurationPage extends MigrationWizardPage {
|
||||
private _view!: azdata.ModelView;
|
||||
private _usernameInput!: azdata.InputBoxComponent;
|
||||
private _password!: azdata.InputBoxComponent;
|
||||
private _disposables: vscode.Disposable[] = [];
|
||||
|
||||
constructor(wizard: azdata.window.Wizard, migrationStateModel: MigrationStateModel) {
|
||||
super(wizard, azdata.window.createWizardPage(constants.SOURCE_CONFIGURATION, 'MigrationModePage'), migrationStateModel);
|
||||
@@ -26,6 +28,12 @@ export class SqlSourceConfigurationPage extends MigrationWizardPage {
|
||||
await this.createSourceCredentialContainer(),
|
||||
]
|
||||
);
|
||||
|
||||
this._disposables.push(this._view.onClosed(e => {
|
||||
this._disposables.forEach(
|
||||
d => { try { d.dispose(); } catch { } });
|
||||
}));
|
||||
|
||||
await view.initializeModel(form.component());
|
||||
}
|
||||
|
||||
@@ -107,9 +115,9 @@ export class SqlSourceConfigurationPage extends MigrationWizardPage {
|
||||
enabled: false,
|
||||
width: WIZARD_INPUT_COMPONENT_WIDTH
|
||||
}).component();
|
||||
this._usernameInput.onTextChanged(value => {
|
||||
this._disposables.push(this._usernameInput.onTextChanged(value => {
|
||||
this.migrationStateModel._sqlServerUsername = value;
|
||||
});
|
||||
}));
|
||||
|
||||
const passwordLabel = this._view.modelBuilder.text().withProps({
|
||||
value: constants.DATABASE_BACKUP_NETWORK_SHARE_PASSWORD_LABEL,
|
||||
@@ -125,9 +133,9 @@ export class SqlSourceConfigurationPage extends MigrationWizardPage {
|
||||
inputType: 'password',
|
||||
width: WIZARD_INPUT_COMPONENT_WIDTH
|
||||
}).component();
|
||||
this._password.onTextChanged(value => {
|
||||
this._disposables.push(this._password.onTextChanged(value => {
|
||||
this.migrationStateModel._sqlServerPassword = value;
|
||||
});
|
||||
}));
|
||||
|
||||
const container = this._view.modelBuilder.flexContainer().withItems(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user