Add required field to kube config picker (#15795)

This commit is contained in:
Charles Gagnon
2021-06-17 19:38:38 -07:00
committed by GitHub
parent efd752aafe
commit 35832e83da
3 changed files with 6 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 {
beforeEach(async () => {
const { modelBuilderMock } = createModelViewMock();
filePicker = new FilePicker(modelBuilderMock.object, initialPath, (_disposable) => { }, '', '');
filePicker = new FilePicker(modelBuilderMock.object, initialPath, (_disposable) => { }, '', '', true);
});
afterEach(() => {

View File

@@ -21,7 +21,8 @@ export class FilePicker {
initialPath: string,
onNewDisposableCreated: (disposable: vscode.Disposable) => void,
ariaLabel: string,
validationErrorMessage: string
validationErrorMessage: string,
required: boolean
) {
const buttonWidth = 80;
this.filePathInputBox = modelBuilder.inputBox()
@@ -29,6 +30,7 @@ export class FilePicker {
value: initialPath,
ariaLabel: ariaLabel,
validationErrorMessage: validationErrorMessage,
required: required,
width: 350
}).withValidation(async () => {
try {

View File

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