Add allowArbitraryValues to <OwnerPicker />

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 <contact@kjuulh.io>
This commit is contained in:
kjuulh
2022-07-14 12:36:20 +02:00
parent 3ded9cc158
commit 3bce493156
@@ -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,
},
};