small modifications, TODO: Testing
Signed-off-by: Peter Macdonald <macdonald.peter90@gmail.com>
This commit is contained in:
+15
@@ -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.
|
||||
*/
|
||||
+3
-8
@@ -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 => (
|
||||
<TextField
|
||||
{...params}
|
||||
label={title}
|
||||
label={uiSchema['ui:options']?.title}
|
||||
margin="dense"
|
||||
helperText={description}
|
||||
helperText={uiSchema['ui:options']?.description}
|
||||
FormHelperTextProps={{ margin: 'dense', style: { marginLeft: 0 } }}
|
||||
variant="outlined"
|
||||
required={required}
|
||||
|
||||
@@ -20,8 +20,11 @@ import { makeFieldSchemaFromZod } from '../utils';
|
||||
export const OwnershipEntityRefPickerFieldSchema = makeFieldSchemaFromZod(
|
||||
z.string(),
|
||||
z.object({
|
||||
title: z.string().optional(),
|
||||
description: z.string().optional(),
|
||||
title: z.string().default('Group').describe('Group'),
|
||||
description: z
|
||||
.string()
|
||||
.default('A group you are part of')
|
||||
.describe('The group to which the entity belongs'),
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user