mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 01:25:38 -05:00
Register disposables for cleanup - Part 1 (#24092)
This commit is contained in:
@@ -40,9 +40,9 @@ export class AddAccountAction extends Action {
|
||||
super(AddAccountAction.ID, AddAccountAction.LABEL);
|
||||
this.class = 'add-linked-account-action';
|
||||
|
||||
this._addAccountCompleteEmitter = new Emitter<void>();
|
||||
this._addAccountErrorEmitter = new Emitter<string>();
|
||||
this._addAccountStartEmitter = new Emitter<void>();
|
||||
this._addAccountCompleteEmitter = this._register(new Emitter<void>());
|
||||
this._addAccountErrorEmitter = this._register(new Emitter<string>());
|
||||
this._addAccountStartEmitter = this._register(new Emitter<void>());
|
||||
}
|
||||
|
||||
public override async run(): Promise<void> {
|
||||
|
||||
@@ -45,11 +45,12 @@ export class EditableDropDown extends AngularDisposable implements OnInit, OnCha
|
||||
...defaultEditableDropdownStyles
|
||||
};
|
||||
this._selectbox = new Dropdown(this._el.nativeElement, this.contextViewService, dropdownOptions);
|
||||
this._register(this._selectbox);
|
||||
this._selectbox.values = this.options;
|
||||
this._selectbox.value = this.selectedOption;
|
||||
this._selectbox.fireOnTextChange = true;
|
||||
|
||||
this._selectbox.onValueChange(e => {
|
||||
this._register(this._selectbox.onValueChange(e => {
|
||||
if (this.onlyEmitOnChange) {
|
||||
if (this._previousVal !== e) {
|
||||
this.onDidSelect.emit(e);
|
||||
@@ -58,7 +59,7 @@ export class EditableDropDown extends AngularDisposable implements OnInit, OnCha
|
||||
} else {
|
||||
this.onDidSelect.emit(e);
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
|
||||
@@ -37,18 +37,18 @@ export class InputBox extends AngularDisposable implements OnInit, OnChanges {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this._inputbox = new vsInputBox(this._el.nativeElement, this.contextViewService, {
|
||||
this._inputbox = this._register(new vsInputBox(this._el.nativeElement, this.contextViewService, {
|
||||
min: this.min,
|
||||
max: this.max,
|
||||
type: this.type,
|
||||
placeholder: this.placeholder,
|
||||
ariaLabel: this.ariaLabel,
|
||||
inputBoxStyles: defaultInputBoxStyles
|
||||
});
|
||||
}));
|
||||
if (this.value) {
|
||||
this._inputbox.value = this.value;
|
||||
}
|
||||
this._inputbox.onDidChange(e => {
|
||||
this._register(this._inputbox.onDidChange(e => {
|
||||
switch (this.type) {
|
||||
case 'number':
|
||||
if (e) {
|
||||
@@ -58,7 +58,7 @@ export class InputBox extends AngularDisposable implements OnInit, OnChanges {
|
||||
default:
|
||||
this.onDidChange.emit(e);
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
|
||||
@@ -39,9 +39,9 @@ export class SelectBox extends AngularDisposable implements OnInit, OnChanges {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this._selectbox = new sqlSelectBox(this.options, this.selectedOption, defaultSelectBoxStyles, this.contextViewService, undefined, { ariaLabel: this.ariaLabel });
|
||||
this._selectbox = this._register(new sqlSelectBox(this.options, this.selectedOption, defaultSelectBoxStyles, this.contextViewService, undefined, { ariaLabel: this.ariaLabel }));
|
||||
this._selectbox.render(this._el.nativeElement);
|
||||
this._selectbox.onDidSelect(e => {
|
||||
this._register(this._selectbox.onDidSelect(e => {
|
||||
if (this.onlyEmitOnChange) {
|
||||
if (this._previousVal !== e.selected) {
|
||||
this.onDidSelect.emit(e);
|
||||
@@ -50,7 +50,7 @@ export class SelectBox extends AngularDisposable implements OnInit, OnChanges {
|
||||
} else {
|
||||
this.onDidSelect.emit(e);
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
|
||||
Reference in New Issue
Block a user