circleci,cloudbuild,github-actions,jenkins: rename internal entity conditional
This commit is contained in:
@@ -23,7 +23,7 @@ import { WorkflowRunsTable } from './WorkflowRunsTable';
|
||||
import { CLOUDBUILD_ANNOTATION } from './useProjectName';
|
||||
import { MissingAnnotationEmptyState } from '@backstage/core';
|
||||
|
||||
export const isPluginApplicableToEntity = (entity: Entity) =>
|
||||
export const isCloudbuildAvailable = (entity: Entity) =>
|
||||
Boolean(entity.metadata.annotations?.[CLOUDBUILD_ANNOTATION]);
|
||||
|
||||
type Props = {
|
||||
@@ -34,7 +34,7 @@ type Props = {
|
||||
export const Router = (_props: Props) => {
|
||||
const { entity } = useEntity();
|
||||
|
||||
if (!isPluginApplicableToEntity(entity)) {
|
||||
if (!isCloudbuildAvailable(entity)) {
|
||||
// TODO(shmidt-i): move warning to a separate standardized component
|
||||
return <MissingAnnotationEmptyState annotation={CLOUDBUILD_ANNOTATION} />;
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ export {
|
||||
export * from './api';
|
||||
export {
|
||||
Router,
|
||||
isPluginApplicableToEntity,
|
||||
isPluginApplicableToEntity as isCloudbuildAvailable,
|
||||
isCloudbuildAvailable,
|
||||
isCloudbuildAvailable as isPluginApplicableToEntity,
|
||||
} from './components/Router';
|
||||
export * from './components/Cards';
|
||||
export { CLOUDBUILD_ANNOTATION } from './components/useProjectName';
|
||||
|
||||
Reference in New Issue
Block a user