Merge pull request #12631 from kjuulh/feature/require-valid-owner-in-owner-picker

Add allowArbitraryValues to <OwnerPicker />
This commit is contained in:
Ben Lambert
2022-07-14 14:20:56 +02:00
committed by GitHub
3 changed files with 10 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder': patch
---
Add allowArbitraryValues for <OwnerPicker /> 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.
+2
View File
@@ -169,6 +169,8 @@ export const OwnerPickerFieldExtension: FieldExtensionComponent<
// @public
export interface OwnerPickerUiOptions {
// (undocumented)
allowArbitraryValues?: boolean;
// (undocumented)
allowedKinds?: string[];
}
@@ -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,
},
};