diff --git a/.changeset/famous-forks-carry.md b/.changeset/famous-forks-carry.md new file mode 100644 index 0000000000..0362d463cd --- /dev/null +++ b/.changeset/famous-forks-carry.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder': patch +--- + +Add allowArbitraryValues for to provide input validation. This makes it a better experience of users, as they can now expect the values they enter to correspond to a valid owner. This is set to the default behavior by default. diff --git a/plugins/scaffolder/api-report.md b/plugins/scaffolder/api-report.md index 3fa623b5b9..8485198724 100644 --- a/plugins/scaffolder/api-report.md +++ b/plugins/scaffolder/api-report.md @@ -169,6 +169,8 @@ export const OwnerPickerFieldExtension: FieldExtensionComponent< // @public export interface OwnerPickerUiOptions { + // (undocumented) + allowArbitraryValues?: boolean; // (undocumented) allowedKinds?: string[]; } diff --git a/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx b/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx index a0c22b7fef..10425c17ff 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, }, };