mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 01:25:36 -05:00
Fix a bunch of strict issues (#11857)
* fix a bunch of strict issues * fix tests * fix tests
This commit is contained in:
@@ -68,7 +68,9 @@ export class SelectBox extends vsSelectBox {
|
||||
let optionItems: SelectOptionItemSQL[] = SelectBox.createOptions(options);
|
||||
super(optionItems, 0, contextViewProvider, undefined, selectBoxOptions);
|
||||
|
||||
this._optionsDictionary = new Map<string, number>();
|
||||
this.populateOptionsDictionary(optionItems);
|
||||
this._dialogOptions = optionItems;
|
||||
const option = this._optionsDictionary.get(selectedOption);
|
||||
if (option) {
|
||||
super.select(option);
|
||||
@@ -144,7 +146,7 @@ export class SelectBox extends vsSelectBox {
|
||||
}
|
||||
|
||||
public populateOptionsDictionary(options: SelectOptionItemSQL[]) {
|
||||
this._optionsDictionary = new Map<string, number>();
|
||||
this._optionsDictionary.clear();
|
||||
for (let i = 0; i < options.length; i++) {
|
||||
this._optionsDictionary.set(options[i].value, i);
|
||||
}
|
||||
@@ -198,7 +200,7 @@ export class SelectBox extends vsSelectBox {
|
||||
}
|
||||
|
||||
public get label(): string | undefined {
|
||||
return this._dialogOptions.find(s => s.value === this._selectedOption).text;
|
||||
return this._dialogOptions?.find(s => s.value === this._selectedOption)?.text;
|
||||
}
|
||||
|
||||
public get values(): string[] {
|
||||
|
||||
Reference in New Issue
Block a user