Add aria-label to kube config input box (#15743)

This commit is contained in:
Charles Gagnon
2021-06-16 12:22:00 -07:00
committed by GitHub
parent be1ff8e37b
commit 1231be124a
3 changed files with 7 additions and 3 deletions

View File

@@ -18,7 +18,7 @@ const newFileUri = vscode.Uri.file(path.join('path', 'to', 'new', '.kube', 'conf
describe('filePicker', function (): void { describe('filePicker', function (): void {
beforeEach(async () => { beforeEach(async () => {
const { modelBuilderMock } = createModelViewMock(); const { modelBuilderMock } = createModelViewMock();
filePicker = new FilePicker(modelBuilderMock.object, initialPath, (_disposable) => { }); filePicker = new FilePicker(modelBuilderMock.object, initialPath, (_disposable) => { }, '');
}); });
afterEach(() => { afterEach(() => {

View File

@@ -18,12 +18,15 @@ export class FilePicker {
public readonly filePickerButton: azdata.ButtonComponent; public readonly filePickerButton: azdata.ButtonComponent;
constructor( constructor(
modelBuilder: azdata.ModelBuilder, modelBuilder: azdata.ModelBuilder,
initialPath: string, onNewDisposableCreated: (disposable: vscode.Disposable) => void initialPath: string,
onNewDisposableCreated: (disposable: vscode.Disposable) => void,
ariaLabel: string
) { ) {
const buttonWidth = 80; const buttonWidth = 80;
this.filePathInputBox = modelBuilder.inputBox() this.filePathInputBox = modelBuilder.inputBox()
.withProperties<azdata.InputBoxProperties>({ .withProperties<azdata.InputBoxProperties>({
value: initialPath, value: initialPath,
ariaLabel: ariaLabel,
width: 350 width: 350
}).component(); }).component();

View File

@@ -96,7 +96,8 @@ abstract class ControllerDialogBase extends InitializingComponent {
this.kubeConfigInputBox = new FilePicker( this.kubeConfigInputBox = new FilePicker(
this.modelBuilder, this.modelBuilder,
controllerInfo?.kubeConfigFilePath || getDefaultKubeConfigPath(), controllerInfo?.kubeConfigFilePath || getDefaultKubeConfigPath(),
(disposable) => this._toDispose.push(disposable) (disposable) => this._toDispose.push(disposable),
loc.controllerKubeConfig
); );
this.modelBuilder.inputBox() this.modelBuilder.inputBox()
.withProps({ .withProps({