deprecate EntityName, introduce CompoundEntityRef
deprecate getEntityName, introduce getCompoundEntityRef Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
import { CachedEntityLoader } from './CachedEntityLoader';
|
||||
import { CatalogClient } from '@backstage/catalog-client';
|
||||
import { CacheClient } from '@backstage/backend-common';
|
||||
import { EntityName } from '@backstage/catalog-model';
|
||||
import { CompoundEntityRef } from '@backstage/catalog-model';
|
||||
|
||||
describe('CachedEntityLoader', () => {
|
||||
const catalog: jest.Mocked<CatalogClient> = {
|
||||
@@ -28,7 +28,7 @@ describe('CachedEntityLoader', () => {
|
||||
set: jest.fn(),
|
||||
} as any;
|
||||
|
||||
const entityName: EntityName = {
|
||||
const entityName: CompoundEntityRef = {
|
||||
kind: 'component',
|
||||
namespace: 'default',
|
||||
name: 'test',
|
||||
|
||||
@@ -17,7 +17,7 @@ import { CatalogClient } from '@backstage/catalog-client';
|
||||
import { CacheClient } from '@backstage/backend-common';
|
||||
import {
|
||||
Entity,
|
||||
EntityName,
|
||||
CompoundEntityRef,
|
||||
stringifyEntityRef,
|
||||
} from '@backstage/catalog-model';
|
||||
|
||||
@@ -37,7 +37,7 @@ export class CachedEntityLoader {
|
||||
}
|
||||
|
||||
async load(
|
||||
entityName: EntityName,
|
||||
entityName: CompoundEntityRef,
|
||||
token: string | undefined,
|
||||
): Promise<Entity | undefined> {
|
||||
const cacheKey = this.getCacheKey(entityName, token);
|
||||
@@ -66,7 +66,7 @@ export class CachedEntityLoader {
|
||||
}
|
||||
|
||||
private getCacheKey(
|
||||
entityName: EntityName,
|
||||
entityName: CompoundEntityRef,
|
||||
token: string | undefined,
|
||||
): string {
|
||||
const key = ['catalog', stringifyEntityRef(entityName)];
|
||||
|
||||
Reference in New Issue
Block a user