Merge pull request #23169 from mario-mui/fix/view-component-url-error

fix: view component url use LowerCase
This commit is contained in:
Rickard Dybeck
2024-02-27 05:20:31 -08:00
committed by GitHub
2 changed files with 12 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-import': patch
---
Fixed an issue generating a wrong entity link at the end of the import process
@@ -22,7 +22,7 @@ import { EntityListComponent } from '../EntityListComponent';
import { PrepareResult } from '../useImportState';
import { Link } from '@backstage/core-components';
import partition from 'lodash/partition';
import { CompoundEntityRef } from '@backstage/catalog-model';
import { CompoundEntityRef, DEFAULT_NAMESPACE } from '@backstage/catalog-model';
import { entityRouteRef } from '@backstage/plugin-catalog-react';
import { useRouteRef } from '@backstage/core-plugin-api';
@@ -46,7 +46,12 @@ const filterComponentEntity = (
entity.kind.toLocaleLowerCase('en-US'),
)
) {
return entity;
return {
kind: entity.kind.toLocaleLowerCase('en-US'),
namespace:
entity.namespace?.toLocaleLowerCase('en-US') ?? DEFAULT_NAMESPACE,
name: entity.name,
};
}
}
}