Skip to content

Commit

Permalink
Merge pull request #434 from AmericanAirlines/update-imports-for-`@ba…
Browse files Browse the repository at this point in the history
…ckstage/catalog-model`

update imports for `@backstage/catalog-model`
  • Loading branch information
Xantier authored Mar 1, 2022
2 parents 6086416 + 3296262 commit a62ee8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-pens-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@roadiehq/backstage-plugin-github-insights': patch
---

update imports for @backstage/catalog-model to remove deprecated imports
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import { useApi } from '@backstage/core-plugin-api';
import { scmIntegrationsApiRef } from '@backstage/integration-react';
import {
Entity,
parseLocationReference,
LOCATION_ANNOTATION,
SOURCE_LOCATION_ANNOTATION,
parseLocationRef,
ANNOTATION_LOCATION,
ANNOTATION_SOURCE_LOCATION,
} from '@backstage/catalog-model';

const defaultGithubIntegration = {
Expand All @@ -34,13 +34,13 @@ export const useEntityGithubScmIntegration = (entity: Entity) => {
return defaultGithubIntegration;
}

let location = entity.metadata.annotations?.[SOURCE_LOCATION_ANNOTATION];
let location = entity.metadata.annotations?.[ANNOTATION_SOURCE_LOCATION];

if (!location) {
location = entity.metadata.annotations?.[LOCATION_ANNOTATION];
location = entity.metadata.annotations?.[ANNOTATION_LOCATION];
}

const { target } = parseLocationReference(location || '');
const { target } = parseLocationRef(location || '');

const scm = integrations.github.byUrl(target);
if (scm) {
Expand Down

0 comments on commit a62ee8d

Please sign in to comment.