From a647ff761ee28567caada8027ff8cd378f535507 Mon Sep 17 00:00:00 2001 From: Paul Cowan Date: Thu, 8 Dec 2022 14:53:17 +0000 Subject: [PATCH] useGetCustomFields Signed-off-by: Paul Cowan --- .../app/src/components/SecurityTab/SecurityTab.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/app/src/components/SecurityTab/SecurityTab.tsx b/packages/app/src/components/SecurityTab/SecurityTab.tsx index af4d66320d..3a40f9c1d7 100644 --- a/packages/app/src/components/SecurityTab/SecurityTab.tsx +++ b/packages/app/src/components/SecurityTab/SecurityTab.tsx @@ -21,16 +21,20 @@ import { } from '@backstage/plugin-scaffolder'; interface SecurityTabProps { - customExtensionsElement: React.ReactNode; + customExtensionsElement?: React.ReactNode; } -export function SecurityTab(props: SecurityTabProps): JSX.Element | null { +export function SecurityTab({ + customExtensionsElement = <>, +}: SecurityTabProps): JSX.Element | null { // eslint-disable-next-line no-alert const onComplete = async () => alert('success!!!!'); + const onError = (error: Error | undefined) => (

{error?.message ?? 'Houston we have a problem.'}

); - const fieldExtensions = useGetCustomFields(props.customExtensionsElement); + + const fieldExtensions = useGetCustomFields(customExtensionsElement); return (