fix: api-report exceptions

Signed-off-by: blbose <lillian.bose@philips.com>
This commit is contained in:
blbose
2023-11-14 22:06:27 +05:30
committed by Scott Guymer
parent e477ec4df2
commit 99c08a8980
3 changed files with 28 additions and 0 deletions
+13
View File
@@ -6,10 +6,20 @@
/// <reference types="react" />
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { IconComponent } from '@backstage/core-plugin-api';
import { JSX as JSX_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
// @public (undocumented)
export const CODESCENE_PROJECT_ANNOTATION = 'codescene.io/project-id';
// @public (undocumented)
export const CodeSceneEntityKPICard: () => JSX_2.Element;
// @public (undocumented)
export const CodeSceneEntityPage: () => JSX_2.Element;
// @public (undocumented)
export const CodeSceneIcon: IconComponent;
@@ -30,5 +40,8 @@ export const codescenePlugin: BackstagePlugin<
// @public (undocumented)
export const CodeSceneProjectDetailsPage: () => JSX_2.Element;
// @public (undocumented)
export const isCodeSceneAvailable: (entity: Entity) => boolean;
// (No @packageDocumentation comment for this package)
```
+6
View File
@@ -68,6 +68,9 @@ export const CodeSceneProjectDetailsPage = codescenePlugin.provide(
}),
);
/**
* @public
*/
export const CodeSceneEntityKPICard = codescenePlugin.provide(
createRoutableExtension({
name: 'CodeSceneEntityKPICard',
@@ -79,6 +82,9 @@ export const CodeSceneEntityKPICard = codescenePlugin.provide(
}),
);
/**
* @public
*/
export const CodeSceneEntityPage = codescenePlugin.provide(
createRoutableExtension({
name: 'CodeSceneEntityPage',
@@ -16,8 +16,14 @@
import { Entity } from '@backstage/catalog-model';
/**
* @public
*/
export const CODESCENE_PROJECT_ANNOTATION = 'codescene.io/project-id';
/**
* @public
*/
export const getProjectAnnotation = (entity: Entity) => {
const annotation =
entity?.metadata.annotations?.[CODESCENE_PROJECT_ANNOTATION];
@@ -25,5 +31,8 @@ export const getProjectAnnotation = (entity: Entity) => {
return { projectId: Number(projectId) };
};
/**
* @public
*/
export const isCodeSceneAvailable = (entity: Entity) =>
Boolean(getProjectAnnotation(entity).projectId);