diff --git a/plugins/catalog/src/data/utils.tsx b/plugins/catalog/src/data/utils.tsx index 5302fd75c2..3f04883e34 100644 --- a/plugins/catalog/src/data/utils.tsx +++ b/plugins/catalog/src/data/utils.tsx @@ -25,7 +25,14 @@ const DescriptionWrapper = styled('span')({ alignItems: 'center', }); -const createEditLink = (url: string): string => url.replace('/blob/', '/edit/'); +const createEditLink = (location: Location): string => { + switch (location.type) { + case 'github': + return location.target.replace('/blob/', '/edit/'); + default: + return location.target; + } +}; export function envelopeToComponent( envelope: Entity, @@ -38,7 +45,7 @@ export function envelopeToComponent( {envelope.metadata?.annotations?.description ?? 'placeholder'} {location?.target ? ( - +