diff --git a/src/components/ModalsContainer/BlueprintModal/Body/Editor/index.tsx b/src/components/ModalsContainer/BlueprintModal/Body/Editor/index.tsx index 8a366b8975..2b578bf358 100644 --- a/src/components/ModalsContainer/BlueprintModal/Body/Editor/index.tsx +++ b/src/components/ModalsContainer/BlueprintModal/Body/Editor/index.tsx @@ -489,6 +489,12 @@ export const Editor = ({ const parentType = selectedSchema ? selectedSchema.type : parent + const getUniqueAttributes = (attrList: Attribute[]): TAutocompleteOption[] => { + const uniqueKeys = new Set(attributes.map((attr) => attr.key)) + + return Array.from(uniqueKeys).map((key) => ({ label: key, value: key })) + } + return ( @@ -614,9 +620,7 @@ export const Editor = ({ setValue('selectedIndex', val?.value || '')} - options={attributes - .filter((attr) => attr.key) - .map((attr) => ({ label: attr.key, value: attr.key }))} + options={getUniqueAttributes(attributes)} selectedValue={resolvedSelectedIndexValue} />