feat: review requested changes

Signed-off-by: NIKUNJ LALITKUMAR HUDKA <nikunjhudka123@gmail.com>
This commit is contained in:
NIKUNJ LALITKUMAR HUDKA
2024-05-04 22:29:09 -03:00
parent 45446a0bfa
commit de6bcac9ae
2 changed files with 2 additions and 16 deletions
-2
View File
@@ -1,7 +1,5 @@
---
'@backstage/plugin-catalog-react': minor
'@backstage/plugin-scaffolder': minor
'@backstage/plugin-catalog': minor
---
`MultiEntityPicker` uses `EntityDisplayName` instead of `humanizeEntityRef` to display entity.
@@ -82,12 +82,7 @@ export const MultiEntityPicker = (props: MultiEntityPickerProps) => {
.map(ref => {
if (typeof ref !== 'string') {
// if ref does not exist: pass 'undefined' to trigger validation for required value
return ref
? entityPresentationApi.forEntity(ref, {
defaultKind,
defaultNamespace,
}).snapshot.entityRef
: undefined;
return ref ? stringifyEntityRef(ref as Entity) : undefined;
}
if (reason === 'blur' || reason === 'create-option') {
// Add in default namespace, etc.
@@ -116,14 +111,7 @@ export const MultiEntityPicker = (props: MultiEntityPickerProps) => {
onChange(values);
},
[
onChange,
formData,
defaultKind,
defaultNamespace,
allowArbitraryValues,
entityPresentationApi,
],
[onChange, formData, defaultKind, defaultNamespace, allowArbitraryValues],
);
useEffect(() => {