Add allowArbitraryValues in OwnedEntityPicker
Signed-off-by: Joan Aymà <joan.ayma@clarivate.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder': patch
|
||||
---
|
||||
|
||||
Add allowArbitraryValues to ui:options in OwnedEntityPicker uiSchema, similar to allowArbitraryValues in EntityPicker
|
||||
@@ -60,6 +60,8 @@ export const OwnedEntityPicker = (
|
||||
|
||||
const allowedKinds = uiSchema['ui:options']?.allowedKinds;
|
||||
const defaultKind = uiSchema['ui:options']?.defaultKind;
|
||||
const allowArbitraryValues =
|
||||
uiSchema['ui:options']?.allowArbitraryValues ?? true;
|
||||
const { ownedEntities, loading } = useOwnedEntities(allowedKinds);
|
||||
|
||||
const entityRefs = ownedEntities?.items
|
||||
@@ -83,7 +85,7 @@ export const OwnedEntityPicker = (
|
||||
onChange={onSelect}
|
||||
options={entityRefs || []}
|
||||
autoSelect
|
||||
freeSolo
|
||||
freeSolo={allowArbitraryValues}
|
||||
renderInput={params => (
|
||||
<TextField
|
||||
{...params}
|
||||
|
||||
Reference in New Issue
Block a user