From 3bce493156798c7bb6eb3ca58eac7f7bef04b7be Mon Sep 17 00:00:00 2001 From: kjuulh Date: Thu, 14 Jul 2022 12:36:20 +0200 Subject: [PATCH] Add allowArbitraryValues to This change makes the OwnerPicker able to validate that the selected option is one of the provided values. This should provide a smoother experience for users, as they now can only enter valid values on the client side None of the tests are changed, as this value is passed to MUI, which is the library containing the validation. Signed-off-by: kjuulh --- .../src/components/fields/OwnerPicker/OwnerPicker.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx b/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx index a0c22b7fef..4d9db1f5e5 100644 --- a/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx +++ b/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx @@ -25,6 +25,7 @@ import { FieldExtensionComponentProps } from '../../../extensions'; */ export interface OwnerPickerUiOptions { allowedKinds?: string[]; + allowArbitraryValues?: boolean; } /** @@ -50,6 +51,8 @@ export const OwnerPicker = ( 'User', ]) as string[], defaultKind: 'Group', + allowArbitraryValues: + uiSchema['ui:options']?.allowArbitraryValues || true, }, };