From a9cec8ce0835245aa78948743df5700d1cd63d5d Mon Sep 17 00:00:00 2001 From: Peter Macdonald Date: Mon, 29 May 2023 15:08:33 +0200 Subject: [PATCH] small modifications, TODO: Testing Signed-off-by: Peter Macdonald --- .../OwnershipEntityRefPicker.test.tsx | 15 +++++++++++++++ .../OwnershipEntityRefPicker.tsx | 11 +++-------- .../fields/OwnershipEntityRefPicker/schema.ts | 7 +++++-- 3 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 plugins/scaffolder/src/components/fields/OwnershipEntityRefPicker/OwnershipEntityRefPicker.test.tsx diff --git a/plugins/scaffolder/src/components/fields/OwnershipEntityRefPicker/OwnershipEntityRefPicker.test.tsx b/plugins/scaffolder/src/components/fields/OwnershipEntityRefPicker/OwnershipEntityRefPicker.test.tsx new file mode 100644 index 0000000000..eb2f165350 --- /dev/null +++ b/plugins/scaffolder/src/components/fields/OwnershipEntityRefPicker/OwnershipEntityRefPicker.test.tsx @@ -0,0 +1,15 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ diff --git a/plugins/scaffolder/src/components/fields/OwnershipEntityRefPicker/OwnershipEntityRefPicker.tsx b/plugins/scaffolder/src/components/fields/OwnershipEntityRefPicker/OwnershipEntityRefPicker.tsx index 80a870e1ed..5fee57eb86 100644 --- a/plugins/scaffolder/src/components/fields/OwnershipEntityRefPicker/OwnershipEntityRefPicker.tsx +++ b/plugins/scaffolder/src/components/fields/OwnershipEntityRefPicker/OwnershipEntityRefPicker.tsx @@ -30,12 +30,7 @@ export { OwnershipEntityRefPickerSchema }; export const OwnershipEntityRefPicker = ( props: OwnershipEntityRefPickerProps, ) => { - const { - schema: { title = 'Group', description = 'A group you are part of' }, - required, - rawErrors, - formData, - } = props; + const { uiSchema, required, rawErrors, formData } = props; const identityApi = useApi(identityApiRef); const catalogApi = useApi(catalogApiRef); @@ -79,9 +74,9 @@ export const OwnershipEntityRefPicker = ( renderInput={params => (