Do not export isPluginApplicableToEntity

Signed-off-by: Tomas Dabasinskas <tomas@dabasinskas.net>
This commit is contained in:
Tomas Dabasinskas
2023-04-13 10:04:48 +03:00
parent 6236eaba3c
commit 85ef1dc0e7
3 changed files with 6 additions and 12 deletions
+1 -3
View File
@@ -12,9 +12,7 @@ import { RouteRef } from '@backstage/core-plugin-api';
import { SubRouteRef } from '@backstage/core-plugin-api';
// @public
const isPuppetDbAvailable: (entity: Entity) => boolean;
export { isPuppetDbAvailable as isPluginApplicableToEntity };
export { isPuppetDbAvailable };
export const isPuppetDbAvailable: (entity: Entity) => boolean;
// @public
export const PuppetDbPage: () => JSX.Element;
@@ -20,7 +20,7 @@ import { EntityProvider } from '@backstage/plugin-catalog-react';
import { puppetDbApiRef, PuppetDbClient } from '../../api';
import { ANNOTATION_PUPPET_CERTNAME } from '../../constants';
import { Entity } from '@backstage/catalog-model/';
import { isPluginApplicableToEntity } from '../../index';
import { isPuppetDbAvailable } from '../Router';
import { ApiProvider } from '@backstage/core-app-api';
import { puppetDbRouteRef } from '../../routes';
@@ -50,16 +50,16 @@ const mockPuppetDbApi: Partial<PuppetDbClient> = {
const apis = TestApiRegistry.from([puppetDbApiRef, mockPuppetDbApi]);
describe('isPluginApplicableToEntity', () => {
describe('isPuppetDbAvailable', () => {
describe('when entity has no annotations', () => {
it('returns false', () => {
expect(isPluginApplicableToEntity(entityWithoutAnnotations)).toBe(false);
expect(isPuppetDbAvailable(entityWithoutAnnotations)).toBe(false);
});
});
describe('when entity has the puppet annotation', () => {
it('returns true', () => {
expect(isPluginApplicableToEntity(entity)).toBe(true);
expect(isPuppetDbAvailable(entity)).toBe(true);
});
});
});
+1 -5
View File
@@ -18,9 +18,5 @@ export {
puppetdbPlugin as plugin,
PuppetDbPage,
} from './plugin';
export {
Router,
isPuppetDbAvailable,
isPuppetDbAvailable as isPluginApplicableToEntity,
} from './components/Router';
export { Router, isPuppetDbAvailable } from './components/Router';
export * from './routes';