Fix other fields being editable in password reprompt for Arc (#14117)

This commit is contained in:
Charles Gagnon
2021-01-29 16:27:20 -08:00
committed by GitHub
parent 667c12abdc
commit f6e39a7211
5 changed files with 10 additions and 65 deletions

View File

@@ -6,14 +6,13 @@ import * as azdata from 'azdata';
import * as path from 'path';
import * as vscode from 'vscode';
import * as loc from '../../localizedConstants';
import { IReadOnly } from '../dialogs/connectControllerDialog';
export interface RadioOptionsInfo {
values?: string[],
defaultValue: string
}
export class FilePicker implements IReadOnly {
export class FilePicker {
private _flexContainer: azdata.FlexContainer;
public readonly filePathInputBox: azdata.InputBoxComponent;
public readonly filePickerButton: azdata.ButtonComponent;
@@ -64,21 +63,8 @@ export class FilePicker implements IReadOnly {
return this.filePathInputBox?.value;
}
get readOnly(): boolean {
return this.enabled;
}
set readOnly(value: boolean) {
this.enabled = value;
}
get enabled(): boolean {
return !!this._flexContainer.enabled && this._flexContainer.items.every(r => r.enabled);
}
set enabled(value: boolean) {
this._flexContainer.items.forEach(r => r.enabled = value);
this._flexContainer.enabled = value;
get items(): azdata.Component[] {
return this._flexContainer.items;
}
}

View File

@@ -5,14 +5,13 @@
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { getErrorMessage } from '../../common/utils';
import { IReadOnly } from '../dialogs/connectControllerDialog';
export interface RadioOptionsInfo {
values?: string[],
defaultValue: string
}
export class RadioOptionsGroup implements IReadOnly {
export class RadioOptionsGroup {
static id: number = 1;
private _divContainer!: azdata.DivContainer;
private _loadingBuilder: azdata.LoadingComponentBuilder;
@@ -68,23 +67,6 @@ export class RadioOptionsGroup implements IReadOnly {
return this._currentRadioOption?.value;
}
get readOnly(): boolean {
return this.enabled;
}
set readOnly(value: boolean) {
this.enabled = value;
}
get enabled(): boolean {
return !!this._divContainer.enabled && this._divContainer.items.every(r => r.enabled);
}
set enabled(value: boolean) {
this._divContainer.items.forEach(r => r.enabled = value);
this._divContainer.enabled = value;
}
get items(): azdata.Component[] {
return this._divContainer.items;
}