From aa1f108fb309eb14e3410d655255b7f92df68705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Tunkl?= Date: Wed, 21 Sep 2022 17:15:19 +0200 Subject: [PATCH] Update of OwnerPicker to pass correctly defaultNamespace value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomáš Tunkl --- .../src/components/fields/OwnerPicker/OwnerPicker.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx b/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx index 1cb95c4d3e..3de2b12bd0 100644 --- a/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx +++ b/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.tsx @@ -44,6 +44,8 @@ export const OwnerPicker = ( ...restProps } = props; + const defaultNamespace = uiSchema['ui:options']?.defaultNamespace; + const ownerUiSchema = { ...uiSchema, 'ui:options': { @@ -54,7 +56,7 @@ export const OwnerPicker = ( defaultKind: 'Group', allowArbitraryValues: uiSchema['ui:options']?.allowArbitraryValues ?? true, - defaultNamespace: uiSchema['ui:options']?.defaultNamespace ?? '', + ...(defaultNamespace !== undefined ? { defaultNamespace } : {}), }, };