diff --git a/.changeset/pretty-dryers-turn.md b/.changeset/pretty-dryers-turn.md new file mode 100644 index 0000000000..9b80d8f6b7 --- /dev/null +++ b/.changeset/pretty-dryers-turn.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-catalog': patch +'@backstage/plugin-catalog-react': patch +--- + +Expose `getEntitySourceLocation`, `getEntityMetadataViewUrl`, and +`getEntityMetadataEditUrl` from `@backstage/plugin-catalog-react`. diff --git a/plugins/catalog-react/package.json b/plugins/catalog-react/package.json index eb01aba8af..8d7bc1f5d1 100644 --- a/plugins/catalog-react/package.json +++ b/plugins/catalog-react/package.json @@ -32,6 +32,7 @@ "@backstage/catalog-model": "^0.8.1", "@backstage/core": "^0.7.12", "@backstage/core-plugin-api": "^0.1.1", + "@backstage/integration": "^0.5.0", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", diff --git a/plugins/catalog/src/utils/getEntityMetadataUrl.ts b/plugins/catalog-react/src/utils/getEntityMetadataUrl.ts similarity index 100% rename from plugins/catalog/src/utils/getEntityMetadataUrl.ts rename to plugins/catalog-react/src/utils/getEntityMetadataUrl.ts diff --git a/plugins/catalog/src/utils/getEntitySourceLocation.ts b/plugins/catalog-react/src/utils/getEntitySourceLocation.ts similarity index 100% rename from plugins/catalog/src/utils/getEntitySourceLocation.ts rename to plugins/catalog-react/src/utils/getEntitySourceLocation.ts diff --git a/plugins/catalog-react/src/utils/index.ts b/plugins/catalog-react/src/utils/index.ts index 8d045e08ac..c91ef3c3e2 100644 --- a/plugins/catalog-react/src/utils/index.ts +++ b/plugins/catalog-react/src/utils/index.ts @@ -14,5 +14,11 @@ * limitations under the License. */ export * from './filters'; +export { + getEntityMetadataEditUrl, + getEntityMetadataViewUrl, +} from './getEntityMetadataUrl'; export { getEntityRelations } from './getEntityRelations'; +export { getEntitySourceLocation } from './getEntitySourceLocation'; +export type { EntitySourceLocation } from './getEntitySourceLocation'; export { isOwnerOf } from './isOwnerOf'; diff --git a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx index b42dbe02b7..6d9f0c21bd 100644 --- a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx +++ b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx @@ -23,6 +23,8 @@ import { } from '@backstage/core'; import { formatEntityRefTitle, + getEntityMetadataEditUrl, + getEntityMetadataViewUrl, getEntityRelations, useEntityListProvider, useStarredEntities, @@ -31,10 +33,6 @@ import Edit from '@material-ui/icons/Edit'; import OpenInNew from '@material-ui/icons/OpenInNew'; import { capitalize } from 'lodash'; import React from 'react'; -import { - getEntityMetadataEditUrl, - getEntityMetadataViewUrl, -} from '../../utils'; import { favouriteEntityIcon, favouriteEntityTooltip, diff --git a/plugins/catalog/src/index.ts b/plugins/catalog/src/index.ts index 0eb646de41..aabe2bb744 100644 --- a/plugins/catalog/src/index.ts +++ b/plugins/catalog/src/index.ts @@ -14,15 +14,14 @@ * limitations under the License. */ -export { AboutCard } from './components/AboutCard'; +export * from './components/AboutCard'; export { CatalogResultListItem } from './components/CatalogResultListItem'; -export { EntityLayout } from './components/EntityLayout'; -export { EntityPageLayout } from './components/EntityPageLayout'; export { CatalogTable } from './components/CatalogTable'; +export { EntityLayout } from './components/EntityLayout'; +export * from './components/EntityOrphanWarning'; +export { EntityPageLayout } from './components/EntityPageLayout'; export * from './components/EntitySwitch'; export { Router } from './components/Router'; -export * from './components/EntityOrphanWarning'; -export * from './components/AboutCard'; export { CatalogEntityPage, CatalogIndexPage, @@ -38,4 +37,3 @@ export { EntityLinksCard, EntitySystemDiagramCard, } from './plugin'; -export * from './utils'; diff --git a/plugins/catalog/src/utils/index.ts b/plugins/catalog/src/utils/index.ts deleted file mode 100644 index bba42dac7e..0000000000 --- a/plugins/catalog/src/utils/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2020 Spotify AB - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export { - getEntityMetadataEditUrl, - getEntityMetadataViewUrl, -} from './getEntityMetadataUrl'; -export { getEntitySourceLocation } from './getEntitySourceLocation';