From f9ea944422ed7d7d1c3036f55a31cdd72a21adc9 Mon Sep 17 00:00:00 2001 From: sblausten Date: Wed, 21 Dec 2022 18:52:30 +0100 Subject: [PATCH 01/25] Add generic Explore tab for entities and refactor existing to use it; Add Systems to default page Signed-off-by: sblausten --- .changeset/itchy-kiwis-unite.md | 5 + plugins/explore/README.md | 7 +- .../DefaultExplorePage/DefaultExplorePage.tsx | 7 +- .../DomainExplorerContent.tsx | 4 +- .../EntityCard.test.tsx} | 6 +- .../EntityCard.tsx} | 4 +- .../{DomainCard => EntityCard}/index.ts | 2 +- .../EntityExplorerContent.test.tsx | 136 ++++++++++++++++++ .../EntityExplorerContent.tsx | 109 ++++++++++++++ .../components/EntityExplorerContent/index.ts | 17 +++ 10 files changed, 285 insertions(+), 12 deletions(-) create mode 100644 .changeset/itchy-kiwis-unite.md rename plugins/explore/src/components/{DomainCard/DomainCard.test.tsx => EntityCard/EntityCard.test.tsx} (93%) rename plugins/explore/src/components/{DomainCard/DomainCard.tsx => EntityCard/EntityCard.tsx} (93%) rename plugins/explore/src/components/{DomainCard => EntityCard}/index.ts (93%) create mode 100644 plugins/explore/src/components/EntityExplorerContent/EntityExplorerContent.test.tsx create mode 100644 plugins/explore/src/components/EntityExplorerContent/EntityExplorerContent.tsx create mode 100644 plugins/explore/src/components/EntityExplorerContent/index.ts diff --git a/.changeset/itchy-kiwis-unite.md b/.changeset/itchy-kiwis-unite.md new file mode 100644 index 0000000000..a17f3072b2 --- /dev/null +++ b/.changeset/itchy-kiwis-unite.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-explore': patch +--- + +Extracted generic EntityExplorerContent component so that is is easy to show any component kinds in their own tab in the Explore page. diff --git a/plugins/explore/README.md b/plugins/explore/README.md index 0204f34714..f60d83eafb 100644 --- a/plugins/explore/README.md +++ b/plugins/explore/README.md @@ -2,7 +2,7 @@ Welcome to the explore plugin! -This plugin helps to visualize the domains and tools in your ecosystem. +This plugin helps to visualize the domains, systems and tools in your ecosystem. ## Setup @@ -116,7 +116,10 @@ export const ExplorePage = () => { subtitle="Browse our ecosystem" > - + + + + diff --git a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.tsx b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.tsx index 54beb59619..49a79f5143 100644 --- a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.tsx +++ b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.tsx @@ -15,11 +15,11 @@ */ import React from 'react'; -import { DomainExplorerContent } from '../DomainExplorerContent'; import { ExploreLayout } from '../ExploreLayout'; import { GroupsExplorerContent } from '../GroupsExplorerContent'; import { ToolExplorerContent } from '../ToolExplorerContent'; import { configApiRef, useApi } from '@backstage/core-plugin-api'; +import { EntityExplorerContent } from '../EntityExplorerContent'; export const DefaultExplorePage = () => { const configApi = useApi(configApiRef); @@ -32,7 +32,10 @@ export const DefaultExplorePage = () => { subtitle="Discover solutions available in your ecosystem" > - + + + + diff --git a/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.tsx b/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.tsx index 3cfed5b12b..15c0d650cc 100644 --- a/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.tsx +++ b/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.tsx @@ -19,7 +19,6 @@ import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { Button } from '@material-ui/core'; import React from 'react'; import useAsync from 'react-use/lib/useAsync'; -import { DomainCard } from '../DomainCard'; import { Content, ContentHeader, @@ -30,6 +29,7 @@ import { WarningPanel, } from '@backstage/core-components'; import { useApi } from '@backstage/core-plugin-api'; +import { EntityCard } from '../EntityCard'; const Body = () => { const catalogApi = useApi(catalogApiRef); @@ -78,7 +78,7 @@ const Body = () => { return ( {entities.map((entity, index) => ( - + ))} ); diff --git a/plugins/explore/src/components/DomainCard/DomainCard.test.tsx b/plugins/explore/src/components/EntityCard/EntityCard.test.tsx similarity index 93% rename from plugins/explore/src/components/DomainCard/DomainCard.test.tsx rename to plugins/explore/src/components/EntityCard/EntityCard.test.tsx index df9b84820a..ccf5deb875 100644 --- a/plugins/explore/src/components/DomainCard/DomainCard.test.tsx +++ b/plugins/explore/src/components/EntityCard/EntityCard.test.tsx @@ -18,9 +18,9 @@ import { DomainEntity } from '@backstage/catalog-model'; import { entityRouteRef } from '@backstage/plugin-catalog-react'; import { renderInTestApp } from '@backstage/test-utils'; import React from 'react'; -import { DomainCard } from './DomainCard'; +import { EntityCard } from './EntityCard'; -describe('', () => { +describe('', () => { it('renders a domain card', async () => { const entity: DomainEntity = { apiVersion: 'backstage.io/v1alpha1', @@ -35,7 +35,7 @@ describe('', () => { }, }; const { getByText } = await renderInTestApp( - , + , { mountedRoutes: { '/catalog/:namespace/:kind/:name': entityRouteRef, diff --git a/plugins/explore/src/components/DomainCard/DomainCard.tsx b/plugins/explore/src/components/EntityCard/EntityCard.tsx similarity index 93% rename from plugins/explore/src/components/DomainCard/DomainCard.tsx rename to plugins/explore/src/components/EntityCard/EntityCard.tsx index a20a5e1f0c..a9ba4f2550 100644 --- a/plugins/explore/src/components/DomainCard/DomainCard.tsx +++ b/plugins/explore/src/components/EntityCard/EntityCard.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { DomainEntity, RELATION_OWNED_BY } from '@backstage/catalog-model'; +import { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model'; import { EntityRefLinks, entityRouteParams, @@ -35,7 +35,7 @@ import { Button, ItemCardHeader } from '@backstage/core-components'; import { useRouteRef } from '@backstage/core-plugin-api'; /** @public */ -export const DomainCard = (props: { entity: DomainEntity }) => { +export const EntityCard = (props: { entity: Entity }) => { const { entity } = props; const catalogEntityRoute = useRouteRef(entityRouteRef); diff --git a/plugins/explore/src/components/DomainCard/index.ts b/plugins/explore/src/components/EntityCard/index.ts similarity index 93% rename from plugins/explore/src/components/DomainCard/index.ts rename to plugins/explore/src/components/EntityCard/index.ts index dbae755460..be80fb3f8f 100644 --- a/plugins/explore/src/components/DomainCard/index.ts +++ b/plugins/explore/src/components/EntityCard/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export { DomainCard } from './DomainCard'; +export { EntityCard } from './EntityCard'; diff --git a/plugins/explore/src/components/EntityExplorerContent/EntityExplorerContent.test.tsx b/plugins/explore/src/components/EntityExplorerContent/EntityExplorerContent.test.tsx new file mode 100644 index 0000000000..4670a10855 --- /dev/null +++ b/plugins/explore/src/components/EntityExplorerContent/EntityExplorerContent.test.tsx @@ -0,0 +1,136 @@ +/* + * Copyright 2020 The Backstage Authors + * + * 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. + */ + +import { DomainEntity } from '@backstage/catalog-model'; +import { catalogApiRef, entityRouteRef } from '@backstage/plugin-catalog-react'; +import { renderInTestApp, TestApiProvider } from '@backstage/test-utils'; +import { waitFor } from '@testing-library/react'; +import React from 'react'; +import { EntityExplorerContent } from './EntityExplorerContent'; + +describe('', () => { + const catalogApi = { + addLocation: jest.fn(), + getEntities: jest.fn(), + getLocationByRef: jest.fn(), + getLocationById: jest.fn(), + removeLocationById: jest.fn(), + removeEntityByUid: jest.fn(), + getEntityByRef: jest.fn(), + refreshEntity: jest.fn(), + getEntityAncestors: jest.fn(), + getEntityFacets: jest.fn(), + validateEntity: jest.fn(), + }; + + const Wrapper = ({ children }: { children?: React.ReactNode }) => ( + + {children} + + ); + + const mountedRoutes = { + mountedRoutes: { + '/catalog/:namespace/:kind/:name': entityRouteRef, + }, + }; + + beforeEach(() => { + jest.resetAllMocks(); + }); + + it('renders a grid of domains', async () => { + const entities: DomainEntity[] = [ + { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Domain', + metadata: { + name: 'playback', + }, + spec: { + owner: 'guest', + }, + }, + { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Domain', + metadata: { + name: 'artists', + }, + spec: { + owner: 'guest', + }, + }, + ]; + catalogApi.getEntities.mockResolvedValue({ items: entities }); + + const { getByText } = await renderInTestApp( + + + , + mountedRoutes, + ); + + await waitFor(() => { + expect(getByText('artists')).toBeInTheDocument(); + expect(getByText('playback')).toBeInTheDocument(); + }); + }); + + it('renders a custom title', async () => { + catalogApi.getEntities.mockResolvedValue({ items: [] }); + + const { getByText } = await renderInTestApp( + + + , + mountedRoutes, + ); + + await waitFor(() => expect(getByText('Our Areas')).toBeInTheDocument()); + }); + + it('renders empty state', async () => { + catalogApi.getEntities.mockResolvedValue({ items: [] }); + + const { getByText } = await renderInTestApp( + + + , + mountedRoutes, + ); + + await waitFor(() => + expect(getByText('No domains to display')).toBeInTheDocument(), + ); + }); + + it('renders a friendly error if it cannot collect domains', async () => { + const catalogError = new Error('Network timeout'); + catalogApi.getEntities.mockRejectedValueOnce(catalogError); + + const { getByText } = await renderInTestApp( + + + , + mountedRoutes, + ); + + await waitFor(() => + expect(getByText(/Could not load domains/)).toBeInTheDocument(), + ); + }); +}); diff --git a/plugins/explore/src/components/EntityExplorerContent/EntityExplorerContent.tsx b/plugins/explore/src/components/EntityExplorerContent/EntityExplorerContent.tsx new file mode 100644 index 0000000000..55ef13d98e --- /dev/null +++ b/plugins/explore/src/components/EntityExplorerContent/EntityExplorerContent.tsx @@ -0,0 +1,109 @@ +/* + * Copyright 2021 The Backstage Authors + * + * 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. + */ + +import { Entity } from '@backstage/catalog-model'; +import { catalogApiRef } from '@backstage/plugin-catalog-react'; +import { Button } from '@material-ui/core'; +import React from 'react'; +import useAsync from 'react-use/lib/useAsync'; +import { EntityCard } from '../EntityCard'; +import { + Content, + ContentHeader, + EmptyState, + ItemCardGrid, + Progress, + SupportButton, + WarningPanel, +} from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; + +const Body = (props: { kind: string }) => { + const { kind } = props; + const kindPlural = `${kind}s`; + const catalogApi = useApi(catalogApiRef); + const { + value: entities, + loading, + error, + } = useAsync(async () => { + const response = await catalogApi.getEntities({ + filter: { kind }, + }); + return response.items as Entity[]; + }, [catalogApi]); + + if (loading) { + return ; + } + + if (error) { + return ( + + {error.message} + + ); + } + + if (!entities?.length) { + return ( + + Read more + + } + /> + ); + } + + return ( + + {entities.map((entity, index) => ( + + ))} + + ); +}; + +/** @public */ +export const EntityExplorerContent = (props: { + tabTitle?: string; + kind: string; +}) => { + const { kind, tabTitle } = props; + return ( + + + + Discover the {kind.toLocaleLowerCase()}s in your ecosystem. + + + + + ); +}; diff --git a/plugins/explore/src/components/EntityExplorerContent/index.ts b/plugins/explore/src/components/EntityExplorerContent/index.ts new file mode 100644 index 0000000000..ab06193939 --- /dev/null +++ b/plugins/explore/src/components/EntityExplorerContent/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2021 The Backstage Authors + * + * 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 { EntityExplorerContent } from './EntityExplorerContent'; From 8465e989a6a83262596f4bc55275e90af8979d21 Mon Sep 17 00:00:00 2001 From: sblausten Date: Wed, 21 Dec 2022 18:58:30 +0100 Subject: [PATCH 02/25] Make changeset a minor Signed-off-by: sblausten --- .changeset/itchy-kiwis-unite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/itchy-kiwis-unite.md b/.changeset/itchy-kiwis-unite.md index a17f3072b2..5fe13d9339 100644 --- a/.changeset/itchy-kiwis-unite.md +++ b/.changeset/itchy-kiwis-unite.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-explore': patch +'@backstage/plugin-explore': minor --- Extracted generic EntityExplorerContent component so that is is easy to show any component kinds in their own tab in the Explore page. From a651c48edd050ca1c3554b2a306376fe0b359071 Mon Sep 17 00:00:00 2001 From: sblausten Date: Wed, 21 Dec 2022 19:19:27 +0100 Subject: [PATCH 03/25] Fix export and typo Signed-off-by: sblausten --- .changeset/itchy-kiwis-unite.md | 2 +- plugins/explore/src/components/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/itchy-kiwis-unite.md b/.changeset/itchy-kiwis-unite.md index 5fe13d9339..e0bee850eb 100644 --- a/.changeset/itchy-kiwis-unite.md +++ b/.changeset/itchy-kiwis-unite.md @@ -2,4 +2,4 @@ '@backstage/plugin-explore': minor --- -Extracted generic EntityExplorerContent component so that is is easy to show any component kinds in their own tab in the Explore page. +Extracted generic EntityExplorerContent component so that it is easy to show any component kinds in their own tab in the Explore page. diff --git a/plugins/explore/src/components/index.ts b/plugins/explore/src/components/index.ts index d3af1b99c2..4cee9f7143 100644 --- a/plugins/explore/src/components/index.ts +++ b/plugins/explore/src/components/index.ts @@ -14,6 +14,6 @@ * limitations under the License. */ -export * from './DomainCard'; +export * from './EntityExplorerContent'; export * from './ExploreLayout'; export * from './ToolSearchResultListItem'; From 18537fedfe293848dd55bf16d3ad4f83d1de9d04 Mon Sep 17 00:00:00 2001 From: sblausten Date: Wed, 21 Dec 2022 19:21:04 +0100 Subject: [PATCH 04/25] Export more stuff for use Signed-off-by: sblausten --- plugins/explore/src/components/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/explore/src/components/index.ts b/plugins/explore/src/components/index.ts index 4cee9f7143..315bd1732a 100644 --- a/plugins/explore/src/components/index.ts +++ b/plugins/explore/src/components/index.ts @@ -15,5 +15,7 @@ */ export * from './EntityExplorerContent'; +export * from './GroupsExplorerContent'; +export * from './DefaultExplorePage'; export * from './ExploreLayout'; export * from './ToolSearchResultListItem'; From 3373cc3e5e2451641054889efacdd44ead01ffcb Mon Sep 17 00:00:00 2001 From: sblausten Date: Thu, 22 Dec 2022 11:45:59 +0100 Subject: [PATCH 05/25] remove duplicate exports Signed-off-by: sblausten --- plugins/explore/src/components/index.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/explore/src/components/index.ts b/plugins/explore/src/components/index.ts index 315bd1732a..96175770fa 100644 --- a/plugins/explore/src/components/index.ts +++ b/plugins/explore/src/components/index.ts @@ -14,8 +14,5 @@ * limitations under the License. */ -export * from './EntityExplorerContent'; -export * from './GroupsExplorerContent'; -export * from './DefaultExplorePage'; export * from './ExploreLayout'; export * from './ToolSearchResultListItem'; From 7d308d65c7ea15aa7a71b684b7e91e97a2330bc8 Mon Sep 17 00:00:00 2001 From: sblausten Date: Thu, 22 Dec 2022 14:31:21 +0100 Subject: [PATCH 06/25] Fix test and update api-report Signed-off-by: sblausten --- plugins/explore/api-report.md | 4 ---- .../components/DefaultExplorePage/DefaultExplorePage.test.tsx | 3 ++- plugins/explore/src/components/index.ts | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/explore/api-report.md b/plugins/explore/api-report.md index d184ce01a4..d10f5ddf95 100644 --- a/plugins/explore/api-report.md +++ b/plugins/explore/api-report.md @@ -9,7 +9,6 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; import { default as default_2 } from 'react'; import { DiscoveryApi } from '@backstage/core-plugin-api'; -import { DomainEntity } from '@backstage/catalog-model'; import { ExploreToolsConfig } from '@backstage/plugin-explore-react'; import { ExternalRouteRef } from '@backstage/core-plugin-api'; import { FetchApi } from '@backstage/core-plugin-api'; @@ -31,9 +30,6 @@ export const catalogEntityRouteRef: ExternalRouteRef< true >; -// @public (undocumented) -export const DomainCard: (props: { entity: DomainEntity }) => JSX.Element; - // @public (undocumented) export const DomainExplorerContent: (props: { title?: string | undefined; diff --git a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx index 62d197803f..f2533dbc40 100644 --- a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx +++ b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx @@ -56,8 +56,9 @@ describe('', () => { await waitFor(() => { const elements = getAllByRole('tab'); - expect(elements.length).toBe(3); + expect(elements.length).toBe(4); expect(getByText(elements[0], 'Domains')).toBeInTheDocument(); + expect(getByText(elements[1], 'Systems')).toBeInTheDocument(); expect(getByText(elements[1], 'Groups')).toBeInTheDocument(); expect(getByText(elements[2], 'Tools')).toBeInTheDocument(); }); diff --git a/plugins/explore/src/components/index.ts b/plugins/explore/src/components/index.ts index 96175770fa..4cee9f7143 100644 --- a/plugins/explore/src/components/index.ts +++ b/plugins/explore/src/components/index.ts @@ -14,5 +14,6 @@ * limitations under the License. */ +export * from './EntityExplorerContent'; export * from './ExploreLayout'; export * from './ToolSearchResultListItem'; From b3e213629cf1b965e3da36d75887f1070f775664 Mon Sep 17 00:00:00 2001 From: sblausten Date: Tue, 3 Jan 2023 15:11:57 +0100 Subject: [PATCH 07/25] Fix test Signed-off-by: sblausten --- .../components/DefaultExplorePage/DefaultExplorePage.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx index f2533dbc40..c4c6b3011e 100644 --- a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx +++ b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx @@ -59,8 +59,8 @@ describe('', () => { expect(elements.length).toBe(4); expect(getByText(elements[0], 'Domains')).toBeInTheDocument(); expect(getByText(elements[1], 'Systems')).toBeInTheDocument(); - expect(getByText(elements[1], 'Groups')).toBeInTheDocument(); - expect(getByText(elements[2], 'Tools')).toBeInTheDocument(); + expect(getByText(elements[2], 'Groups')).toBeInTheDocument(); + expect(getByText(elements[3], 'Tools')).toBeInTheDocument(); }); }); }); From 6a5dc558f69d521ac63fc0820b8631262cc45673 Mon Sep 17 00:00:00 2001 From: sblausten Date: Tue, 3 Jan 2023 15:47:53 +0100 Subject: [PATCH 08/25] Build api reports Signed-off-by: sblausten --- packages/backend-app-api/api-report.md | 5 - packages/backend-common/api-report.md | 87 ++++++++++++----- packages/backend-plugin-api/api-report.md | 94 ++----------------- packages/catalog-client/api-report.md | 12 --- plugins/apollo-explorer/api-report.md | 2 +- plugins/bazaar/api-report.md | 10 -- .../api-report.md | 8 +- plugins/code-coverage-backend/api-report.md | 3 - plugins/explore/api-report.md | 4 + plugins/rollbar-backend/api-report.md | 6 +- plugins/scaffolder-backend/api-report.md | 40 +++----- plugins/scaffolder/api-report.md | 34 ++----- plugins/techdocs-react/api-report.md | 3 - 13 files changed, 99 insertions(+), 209 deletions(-) diff --git a/packages/backend-app-api/api-report.md b/packages/backend-app-api/api-report.md index ef88d9a9d0..33e732cf05 100644 --- a/packages/backend-app-api/api-report.md +++ b/packages/backend-app-api/api-report.md @@ -83,11 +83,6 @@ export const permissionsFactory: ( options?: undefined, ) => ServiceFactory; -// @public -export const rootLifecycleFactory: ( - options?: undefined, -) => ServiceFactory; - // @public (undocumented) export const rootLoggerFactory: ( options?: undefined, diff --git a/packages/backend-common/api-report.md b/packages/backend-common/api-report.md index e8b41e21bb..784f3295c6 100644 --- a/packages/backend-common/api-report.md +++ b/packages/backend-common/api-report.md @@ -30,23 +30,12 @@ import { KubeConfig } from '@kubernetes/client-node'; import { LoadConfigOptionsRemote } from '@backstage/config-loader'; import { Logger } from 'winston'; import { MergeResult } from 'isomorphic-git'; -import { DiscoveryService as PluginEndpointDiscovery } from '@backstage/backend-plugin-api'; import { PushResult } from 'isomorphic-git'; import { Readable } from 'stream'; import { ReadCommitResult } from 'isomorphic-git'; -import { ReadTreeOptions } from '@backstage/backend-plugin-api'; -import { ReadTreeResponse } from '@backstage/backend-plugin-api'; -import { ReadTreeResponseDirOptions } from '@backstage/backend-plugin-api'; -import { ReadTreeResponseFile } from '@backstage/backend-plugin-api'; -import { ReadUrlOptions } from '@backstage/backend-plugin-api'; -import { ReadUrlResponse } from '@backstage/backend-plugin-api'; import { RequestHandler } from 'express'; import { Router } from 'express'; -import { SearchOptions } from '@backstage/backend-plugin-api'; -import { SearchResponse } from '@backstage/backend-plugin-api'; -import { SearchResponseFile } from '@backstage/backend-plugin-api'; import { Server } from 'http'; -import { UrlReaderService as UrlReader } from '@backstage/backend-plugin-api'; import { V1PodTemplateSpec } from '@kubernetes/client-node'; import * as winston from 'winston'; import { Writable } from 'stream'; @@ -531,7 +520,11 @@ export interface PluginDatabaseManager { }; } -export { PluginEndpointDiscovery }; +// @public +export type PluginEndpointDiscovery = { + getBaseUrl(pluginId: string): Promise; + getExternalBaseUrl(pluginId: string): Promise; +}; // @public export type ReaderFactory = (options: { @@ -540,11 +533,30 @@ export type ReaderFactory = (options: { treeResponseFactory: ReadTreeResponseFactory; }) => UrlReaderPredicateTuple[]; -export { ReadTreeOptions }; +// @public +export type ReadTreeOptions = { + filter?( + path: string, + info?: { + size: number; + }, + ): boolean; + etag?: string; + signal?: AbortSignal; +}; -export { ReadTreeResponse }; +// @public +export type ReadTreeResponse = { + files(): Promise; + archive(): Promise; + dir(options?: ReadTreeResponseDirOptions): Promise; + etag: string; +}; -export { ReadTreeResponseDirOptions }; +// @public +export type ReadTreeResponseDirOptions = { + targetDir?: string; +}; // @public export interface ReadTreeResponseFactory { @@ -575,11 +587,24 @@ export type ReadTreeResponseFactoryOptions = { ) => boolean; }; -export { ReadTreeResponseFile }; +// @public +export type ReadTreeResponseFile = { + path: string; + content(): Promise; +}; -export { ReadUrlOptions }; +// @public +export type ReadUrlOptions = { + etag?: string; + signal?: AbortSignal; +}; -export { ReadUrlResponse }; +// @public +export type ReadUrlResponse = { + buffer(): Promise; + stream?(): Readable; + etag?: string; +}; // @public export class ReadUrlResponseFactory { @@ -627,11 +652,23 @@ export type RunContainerOptions = { pullImage?: boolean; }; -export { SearchOptions }; +// @public +export type SearchOptions = { + etag?: string; + signal?: AbortSignal; +}; -export { SearchResponse }; +// @public +export type SearchResponse = { + files: SearchResponseFile[]; + etag: string; +}; -export { SearchResponseFile }; +// @public +export type SearchResponseFile = { + url: string; + content(): Promise; +}; // @public export class ServerTokenManager implements TokenManager { @@ -718,7 +755,13 @@ export interface TokenManager { }>; } -export { UrlReader }; +// @public +export type UrlReader = { + read(url: string): Promise; + readUrl(url: string, options?: ReadUrlOptions): Promise; + readTree(url: string, options?: ReadTreeOptions): Promise; + search(url: string, options?: SearchOptions): Promise; +}; // @public export type UrlReaderPredicateTuple = { diff --git a/packages/backend-plugin-api/api-report.md b/packages/backend-plugin-api/api-report.md index e0fa44eb20..545728b386 100644 --- a/packages/backend-plugin-api/api-report.md +++ b/packages/backend-plugin-api/api-report.md @@ -3,8 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -/// - import { Config } from '@backstage/config'; import { Handler } from 'express'; import { Logger } from 'winston'; @@ -12,10 +10,11 @@ import { PermissionAuthorizer } from '@backstage/plugin-permission-common'; import { PermissionEvaluator } from '@backstage/plugin-permission-common'; import { PluginCacheManager } from '@backstage/backend-common'; import { PluginDatabaseManager } from '@backstage/backend-common'; +import { PluginEndpointDiscovery } from '@backstage/backend-common'; import { PluginTaskScheduler } from '@backstage/backend-tasks'; -import { Readable } from 'stream'; import { TokenManager } from '@backstage/backend-common'; import { TransportStreamOptions } from 'winston-transport'; +import { UrlReader } from '@backstage/backend-common'; // @public (undocumented) export interface BackendFeature { @@ -90,7 +89,6 @@ declare namespace coreServices { tokenManagerServiceRef as tokenManager, permissionsServiceRef as permissions, schedulerServiceRef as scheduler, - rootLifecycleServiceRef as rootLifecycle, rootLoggerServiceRef as rootLogger, pluginMetadataServiceRef as pluginMetadata, lifecycleServiceRef as lifecycle, @@ -168,14 +166,11 @@ export type DatabaseService = PluginDatabaseManager; // @public (undocumented) const databaseServiceRef: ServiceRef; -// @public -export type DiscoveryService = { - getBaseUrl(pluginId: string): Promise; - getExternalBaseUrl(pluginId: string): Promise; -}; +// @public (undocumented) +export type DiscoveryService = PluginEndpointDiscovery; // @public (undocumented) -const discoveryServiceRef: ServiceRef; +const discoveryServiceRef: ServiceRef; // @public export type ExtensionPoint = { @@ -205,7 +200,6 @@ const lifecycleServiceRef: ServiceRef; // @public (undocumented) export type LifecycleServiceShutdownHook = { fn: () => void | Promise; - labels?: Record; }; // @public (undocumented) @@ -251,56 +245,6 @@ export interface PluginMetadataService { // @public (undocumented) const pluginMetadataServiceRef: ServiceRef; -// @public -export type ReadTreeOptions = { - filter?( - path: string, - info?: { - size: number; - }, - ): boolean; - etag?: string; - signal?: AbortSignal; -}; - -// @public -export type ReadTreeResponse = { - files(): Promise; - archive(): Promise; - dir(options?: ReadTreeResponseDirOptions): Promise; - etag: string; -}; - -// @public -export type ReadTreeResponseDirOptions = { - targetDir?: string; -}; - -// @public -export type ReadTreeResponseFile = { - path: string; - content(): Promise; -}; - -// @public -export type ReadUrlOptions = { - etag?: string; - signal?: AbortSignal; -}; - -// @public -export type ReadUrlResponse = { - buffer(): Promise; - stream?(): Readable; - etag?: string; -}; - -// @public (undocumented) -export type RootLifecycleService = LifecycleService; - -// @public (undocumented) -const rootLifecycleServiceRef: ServiceRef; - // @public (undocumented) export type RootLoggerService = LoggerService; @@ -313,24 +257,6 @@ export type SchedulerService = PluginTaskScheduler; // @public (undocumented) const schedulerServiceRef: ServiceRef; -// @public -export type SearchOptions = { - etag?: string; - signal?: AbortSignal; -}; - -// @public -export type SearchResponse = { - files: SearchResponseFile[]; - etag: string; -}; - -// @public -export type SearchResponseFile = { - url: string; - content(): Promise; -}; - // @public (undocumented) export type ServiceFactory = | { @@ -381,13 +307,9 @@ export type TypesToServiceRef = { [key in keyof T]: ServiceRef; }; -// @public -export type UrlReaderService = { - readUrl(url: string, options?: ReadUrlOptions): Promise; - readTree(url: string, options?: ReadTreeOptions): Promise; - search(url: string, options?: SearchOptions): Promise; -}; +// @public (undocumented) +export type UrlReaderService = UrlReader; // @public (undocumented) -const urlReaderServiceRef: ServiceRef; +const urlReaderServiceRef: ServiceRef; ``` diff --git a/packages/catalog-client/api-report.md b/packages/catalog-client/api-report.md index a81314308b..2f76be79e2 100644 --- a/packages/catalog-client/api-report.md +++ b/packages/catalog-client/api-report.md @@ -161,17 +161,6 @@ export type EntityFilterQuery = | Record[] | Record; -// @public -export type EntityOrderQuery = - | { - field: string; - order: 'asc' | 'desc'; - } - | Array<{ - field: string; - order: 'asc' | 'desc'; - }>; - // @public export interface GetEntitiesByRefsRequest { entityRefs: string[]; @@ -190,7 +179,6 @@ export interface GetEntitiesRequest { filter?: EntityFilterQuery; limit?: number; offset?: number; - order?: EntityOrderQuery; } // @public diff --git a/plugins/apollo-explorer/api-report.md b/plugins/apollo-explorer/api-report.md index 1d3b41eac1..7272903b0c 100644 --- a/plugins/apollo-explorer/api-report.md +++ b/plugins/apollo-explorer/api-report.md @@ -25,7 +25,7 @@ export const ApolloExplorerPage: (props: { displayOptions: { docsPanelState?: 'closed' | 'open' | undefined; showHeadersAndEnvVars?: boolean | undefined; - theme?: 'dark' | 'light' | undefined; + theme?: 'light' | 'dark' | undefined; }; } | undefined; diff --git a/plugins/bazaar/api-report.md b/plugins/bazaar/api-report.md index afbb7b5504..d7c463888a 100644 --- a/plugins/bazaar/api-report.md +++ b/plugins/bazaar/api-report.md @@ -5,9 +5,7 @@ ```ts /// -import { ApiHolder } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; -import { Entity } from '@backstage/catalog-model'; import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) @@ -38,14 +36,6 @@ export const bazaarPlugin: BackstagePlugin< // @public (undocumented) export const EntityBazaarInfoCard: () => JSX.Element | null; -// @public (undocumented) -export const isBazaarAvailable: ( - entity: Entity, - context: { - apis: ApiHolder; - }, -) => Promise; - // @public (undocumented) export const SortView: () => JSX.Element; diff --git a/plugins/catalog-backend-module-github/api-report.md b/plugins/catalog-backend-module-github/api-report.md index 78ffd5b018..8ccfdb09ee 100644 --- a/plugins/catalog-backend-module-github/api-report.md +++ b/plugins/catalog-backend-module-github/api-report.md @@ -178,9 +178,7 @@ export class GitHubOrgEntityProvider extends GithubOrgEntityProvider { } // @public -export class GithubOrgEntityProvider - implements EntityProvider, EventSubscriber -{ +export class GithubOrgEntityProvider implements EntityProvider { constructor(options: { id: string; orgUrl: string; @@ -199,11 +197,7 @@ export class GithubOrgEntityProvider ): GithubOrgEntityProvider; // (undocumented) getProviderName(): string; - // (undocumented) - onEvent(params: EventParams): Promise; read(options?: { logger?: Logger }): Promise; - // (undocumented) - supportsEventTopics(): string[]; } // @public @deprecated (undocumented) diff --git a/plugins/code-coverage-backend/api-report.md b/plugins/code-coverage-backend/api-report.md index 440af50714..c33874064b 100644 --- a/plugins/code-coverage-backend/api-report.md +++ b/plugins/code-coverage-backend/api-report.md @@ -3,7 +3,6 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; import express from 'express'; import { Logger } from 'winston'; @@ -16,8 +15,6 @@ export function createRouter(options: RouterOptions): Promise; // @public export interface RouterOptions { - // (undocumented) - catalogApi?: CatalogApi; // (undocumented) config: Config; // (undocumented) diff --git a/plugins/explore/api-report.md b/plugins/explore/api-report.md index d10f5ddf95..d184ce01a4 100644 --- a/plugins/explore/api-report.md +++ b/plugins/explore/api-report.md @@ -9,6 +9,7 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; import { default as default_2 } from 'react'; import { DiscoveryApi } from '@backstage/core-plugin-api'; +import { DomainEntity } from '@backstage/catalog-model'; import { ExploreToolsConfig } from '@backstage/plugin-explore-react'; import { ExternalRouteRef } from '@backstage/core-plugin-api'; import { FetchApi } from '@backstage/core-plugin-api'; @@ -30,6 +31,9 @@ export const catalogEntityRouteRef: ExternalRouteRef< true >; +// @public (undocumented) +export const DomainCard: (props: { entity: DomainEntity }) => JSX.Element; + // @public (undocumented) export const DomainExplorerContent: (props: { title?: string | undefined; diff --git a/plugins/rollbar-backend/api-report.md b/plugins/rollbar-backend/api-report.md index 58a5fb0252..9086121306 100644 --- a/plugins/rollbar-backend/api-report.md +++ b/plugins/rollbar-backend/api-report.md @@ -29,8 +29,8 @@ export class RollbarApi { }, ): Promise< { - count: number; timestamp: number; + count: number; }[] >; // (undocumented) @@ -51,8 +51,8 @@ export class RollbarApi { }, ): Promise< { - count: number; timestamp: number; + count: number; }[] >; // (undocumented) @@ -64,8 +64,8 @@ export class RollbarApi { }>; // (undocumented) getProjectItems(projectName: string): Promise<{ - page: number; items: RollbarItem[]; + page: number; totalCount: number; }>; // (undocumented) diff --git a/plugins/scaffolder-backend/api-report.md b/plugins/scaffolder-backend/api-report.md index 66757a01cd..94377d7720 100644 --- a/plugins/scaffolder-backend/api-report.md +++ b/plugins/scaffolder-backend/api-report.md @@ -195,12 +195,6 @@ export function createGithubRepoCreateAction(options: { gitAuthorEmail?: string | undefined; allowRebaseMerge?: boolean | undefined; allowSquashMerge?: boolean | undefined; - squashMergeCommitTitle?: 'PR_TITLE' | 'COMMIT_OR_PR_TITLE' | undefined; - squashMergeCommitMessage?: - | 'PR_BODY' - | 'COMMIT_MESSAGES' - | 'BLANK' - | undefined; allowMergeCommit?: boolean | undefined; allowAutoMerge?: boolean | undefined; requireCodeOwnerReviews?: boolean | undefined; @@ -214,16 +208,16 @@ export function createGithubRepoCreateAction(options: { requiredStatusCheckContexts?: string[] | undefined; requireBranchesToBeUpToDate?: boolean | undefined; requiredConversationResolution?: boolean | undefined; - repoVisibility?: 'internal' | 'private' | 'public' | undefined; + repoVisibility?: 'public' | 'private' | 'internal' | undefined; collaborators?: | ( | { user: string; - access: string; + access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage'; } | { team: string; - access: string; + access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage'; } | { username: string; @@ -231,9 +225,6 @@ export function createGithubRepoCreateAction(options: { } )[] | undefined; - hasProjects?: boolean | undefined; - hasWiki?: boolean | undefined; - hasIssues?: boolean | undefined; token?: string | undefined; topics?: string[] | undefined; }>; @@ -307,7 +298,7 @@ export function createPublishBitbucketAction(options: { repoUrl: string; description?: string | undefined; defaultBranch?: string | undefined; - repoVisibility?: 'private' | 'public' | undefined; + repoVisibility?: 'public' | 'private' | undefined; sourcePath?: string | undefined; enableLFS?: boolean | undefined; token?: string | undefined; @@ -324,7 +315,7 @@ export function createPublishBitbucketCloudAction(options: { repoUrl: string; description?: string | undefined; defaultBranch?: string | undefined; - repoVisibility?: 'private' | 'public' | undefined; + repoVisibility?: 'public' | 'private' | undefined; sourcePath?: string | undefined; token?: string | undefined; }>; @@ -337,7 +328,7 @@ export function createPublishBitbucketServerAction(options: { repoUrl: string; description?: string | undefined; defaultBranch?: string | undefined; - repoVisibility?: 'private' | 'public' | undefined; + repoVisibility?: 'public' | 'private' | undefined; sourcePath?: string | undefined; enableLFS?: boolean | undefined; token?: string | undefined; @@ -389,12 +380,6 @@ export function createPublishGithubAction(options: { gitAuthorEmail?: string | undefined; allowRebaseMerge?: boolean | undefined; allowSquashMerge?: boolean | undefined; - squashMergeCommitTitle?: 'PR_TITLE' | 'COMMIT_OR_PR_TITLE' | undefined; - squashMergeCommitMessage?: - | 'PR_BODY' - | 'COMMIT_MESSAGES' - | 'BLANK' - | undefined; allowMergeCommit?: boolean | undefined; allowAutoMerge?: boolean | undefined; sourcePath?: string | undefined; @@ -410,16 +395,16 @@ export function createPublishGithubAction(options: { requiredStatusCheckContexts?: string[] | undefined; requireBranchesToBeUpToDate?: boolean | undefined; requiredConversationResolution?: boolean | undefined; - repoVisibility?: 'internal' | 'private' | 'public' | undefined; + repoVisibility?: 'public' | 'private' | 'internal' | undefined; collaborators?: | ( | { user: string; - access: string; + access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage'; } | { team: string; - access: string; + access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage'; } | { username: string; @@ -427,9 +412,6 @@ export function createPublishGithubAction(options: { } )[] | undefined; - hasProjects?: boolean | undefined; - hasWiki?: boolean | undefined; - hasIssues?: boolean | undefined; token?: string | undefined; topics?: string[] | undefined; }>; @@ -459,7 +441,7 @@ export function createPublishGitlabAction(options: { }): TemplateAction<{ repoUrl: string; defaultBranch?: string | undefined; - repoVisibility?: 'internal' | 'private' | 'public' | undefined; + repoVisibility?: 'public' | 'private' | 'internal' | undefined; sourcePath?: string | undefined; token?: string | undefined; gitCommitMessage?: string | undefined; @@ -480,7 +462,7 @@ export const createPublishGitlabMergeRequestAction: (options: { sourcePath?: string | undefined; targetPath?: string | undefined; token?: string | undefined; - commitAction?: 'update' | 'delete' | 'create' | undefined; + commitAction?: 'create' | 'update' | 'delete' | undefined; projectid?: string | undefined; removeSourceBranch?: boolean | undefined; assignee?: string | undefined; diff --git a/plugins/scaffolder/api-report.md b/plugins/scaffolder/api-report.md index 1c4d163123..d936542cfe 100644 --- a/plugins/scaffolder/api-report.md +++ b/plugins/scaffolder/api-report.md @@ -11,6 +11,7 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; import { ComponentType } from 'react'; import { DiscoveryApi } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; +import type { ErrorTransformer } from '@rjsf/utils'; import { Extension } from '@backstage/core-plugin-api'; import { ExternalRouteRef } from '@backstage/core-plugin-api'; import { FetchApi } from '@backstage/core-plugin-api'; @@ -18,8 +19,7 @@ import { FieldProps } from '@rjsf/core'; import { FieldProps as FieldProps_2 } from '@rjsf/utils'; import { FieldValidation } from '@rjsf/core'; import { FieldValidation as FieldValidation_2 } from '@rjsf/utils'; -import type { FormProps as FormProps_2 } from '@rjsf/core'; -import type { FormProps as FormProps_3 } from '@rjsf/core-v5'; +import type { FormProps } from '@rjsf/core'; import { IdentityApi } from '@backstage/core-plugin-api'; import { JsonObject } from '@backstage/types'; import { JSONSchema7 } from 'json-schema'; @@ -88,10 +88,6 @@ export const EntityPickerFieldExtension: FieldExtensionComponent< defaultNamespace?: string | false | undefined; allowedKinds?: string[] | undefined; allowArbitraryValues?: boolean | undefined; - catalogFilter?: - | Record - | Record[] - | undefined; } >; @@ -103,10 +99,6 @@ export const EntityPickerFieldSchema: FieldSchema< defaultNamespace?: string | false | undefined; allowedKinds?: string[] | undefined; allowArbitraryValues?: boolean | undefined; - catalogFilter?: - | Record - | Record[] - | undefined; } >; @@ -175,12 +167,6 @@ export interface FieldSchema { readonly uiOptionsType: TUiOptions; } -// @alpha -export type FormProps = Pick< - FormProps_3, - 'transformErrors' | 'noHtml5Validate' ->; - // @public export type LayoutComponent<_TInputProps> = () => null; @@ -193,7 +179,7 @@ export interface LayoutOptions

{ } // @public -export type LayoutTemplate = FormProps_2['ObjectFieldTemplate']; +export type LayoutTemplate = FormProps['ObjectFieldTemplate']; // @public export type ListActionsResponse = Array<{ @@ -278,7 +264,7 @@ export type NextRouterProps = { TaskPageComponent?: React_2.ComponentType<{}>; }; groups?: TemplateGroupFilter[]; - FormProps?: FormProps; + transformErrors?: ErrorTransformer; }; // @alpha @@ -324,10 +310,6 @@ export const OwnerPickerFieldExtension: FieldExtensionComponent< defaultNamespace?: string | false | undefined; allowedKinds?: string[] | undefined; allowArbitraryValues?: boolean | undefined; - catalogFilter?: - | Record - | Record[] - | undefined; } >; @@ -338,10 +320,6 @@ export const OwnerPickerFieldSchema: FieldSchema< defaultNamespace?: string | false | undefined; allowedKinds?: string[] | undefined; allowArbitraryValues?: boolean | undefined; - catalogFilter?: - | Record - | Record[] - | undefined; } >; @@ -370,10 +348,10 @@ export const RepoUrlPickerFieldExtension: FieldExtensionComponent< | { additionalScopes?: | { - azure?: string[] | undefined; github?: string[] | undefined; gitlab?: string[] | undefined; bitbucket?: string[] | undefined; + azure?: string[] | undefined; gerrit?: string[] | undefined; } | undefined; @@ -396,10 +374,10 @@ export const RepoUrlPickerFieldSchema: FieldSchema< | { additionalScopes?: | { - azure?: string[] | undefined; github?: string[] | undefined; gitlab?: string[] | undefined; bitbucket?: string[] | undefined; + azure?: string[] | undefined; gerrit?: string[] | undefined; } | undefined; diff --git a/plugins/techdocs-react/api-report.md b/plugins/techdocs-react/api-report.md index f1d6d3f177..09da4e012c 100644 --- a/plugins/techdocs-react/api-report.md +++ b/plugins/techdocs-react/api-report.md @@ -32,9 +32,6 @@ export const SHADOW_DOM_STYLE_LOAD_EVENT = 'TECH_DOCS_SHADOW_DOM_STYLE_LOAD'; // @public export type SyncResult = 'cached' | 'updated'; -// @public -export const TECHDOCS_ADDONS_KEY = 'techdocs.addons.addon.v1'; - // @public export const TECHDOCS_ADDONS_WRAPPER_KEY = 'techdocs.addons.wrapper.v1'; From 268f58aea16d52b1e2173c4a1602ecc81d493b07 Mon Sep 17 00:00:00 2001 From: sblausten Date: Tue, 3 Jan 2023 15:51:55 +0100 Subject: [PATCH 09/25] Revert "Build api reports" This reverts commit 6a5dc558f69d521ac63fc0820b8631262cc45673. Signed-off-by: sblausten --- packages/backend-app-api/api-report.md | 5 + packages/backend-common/api-report.md | 87 +++++------------ packages/backend-plugin-api/api-report.md | 94 +++++++++++++++++-- packages/catalog-client/api-report.md | 12 +++ plugins/apollo-explorer/api-report.md | 2 +- plugins/bazaar/api-report.md | 10 ++ .../api-report.md | 8 +- plugins/code-coverage-backend/api-report.md | 3 + plugins/explore/api-report.md | 4 - plugins/rollbar-backend/api-report.md | 6 +- plugins/scaffolder-backend/api-report.md | 40 +++++--- plugins/scaffolder/api-report.md | 34 +++++-- plugins/techdocs-react/api-report.md | 3 + 13 files changed, 209 insertions(+), 99 deletions(-) diff --git a/packages/backend-app-api/api-report.md b/packages/backend-app-api/api-report.md index 33e732cf05..ef88d9a9d0 100644 --- a/packages/backend-app-api/api-report.md +++ b/packages/backend-app-api/api-report.md @@ -83,6 +83,11 @@ export const permissionsFactory: ( options?: undefined, ) => ServiceFactory; +// @public +export const rootLifecycleFactory: ( + options?: undefined, +) => ServiceFactory; + // @public (undocumented) export const rootLoggerFactory: ( options?: undefined, diff --git a/packages/backend-common/api-report.md b/packages/backend-common/api-report.md index 784f3295c6..e8b41e21bb 100644 --- a/packages/backend-common/api-report.md +++ b/packages/backend-common/api-report.md @@ -30,12 +30,23 @@ import { KubeConfig } from '@kubernetes/client-node'; import { LoadConfigOptionsRemote } from '@backstage/config-loader'; import { Logger } from 'winston'; import { MergeResult } from 'isomorphic-git'; +import { DiscoveryService as PluginEndpointDiscovery } from '@backstage/backend-plugin-api'; import { PushResult } from 'isomorphic-git'; import { Readable } from 'stream'; import { ReadCommitResult } from 'isomorphic-git'; +import { ReadTreeOptions } from '@backstage/backend-plugin-api'; +import { ReadTreeResponse } from '@backstage/backend-plugin-api'; +import { ReadTreeResponseDirOptions } from '@backstage/backend-plugin-api'; +import { ReadTreeResponseFile } from '@backstage/backend-plugin-api'; +import { ReadUrlOptions } from '@backstage/backend-plugin-api'; +import { ReadUrlResponse } from '@backstage/backend-plugin-api'; import { RequestHandler } from 'express'; import { Router } from 'express'; +import { SearchOptions } from '@backstage/backend-plugin-api'; +import { SearchResponse } from '@backstage/backend-plugin-api'; +import { SearchResponseFile } from '@backstage/backend-plugin-api'; import { Server } from 'http'; +import { UrlReaderService as UrlReader } from '@backstage/backend-plugin-api'; import { V1PodTemplateSpec } from '@kubernetes/client-node'; import * as winston from 'winston'; import { Writable } from 'stream'; @@ -520,11 +531,7 @@ export interface PluginDatabaseManager { }; } -// @public -export type PluginEndpointDiscovery = { - getBaseUrl(pluginId: string): Promise; - getExternalBaseUrl(pluginId: string): Promise; -}; +export { PluginEndpointDiscovery }; // @public export type ReaderFactory = (options: { @@ -533,30 +540,11 @@ export type ReaderFactory = (options: { treeResponseFactory: ReadTreeResponseFactory; }) => UrlReaderPredicateTuple[]; -// @public -export type ReadTreeOptions = { - filter?( - path: string, - info?: { - size: number; - }, - ): boolean; - etag?: string; - signal?: AbortSignal; -}; +export { ReadTreeOptions }; -// @public -export type ReadTreeResponse = { - files(): Promise; - archive(): Promise; - dir(options?: ReadTreeResponseDirOptions): Promise; - etag: string; -}; +export { ReadTreeResponse }; -// @public -export type ReadTreeResponseDirOptions = { - targetDir?: string; -}; +export { ReadTreeResponseDirOptions }; // @public export interface ReadTreeResponseFactory { @@ -587,24 +575,11 @@ export type ReadTreeResponseFactoryOptions = { ) => boolean; }; -// @public -export type ReadTreeResponseFile = { - path: string; - content(): Promise; -}; +export { ReadTreeResponseFile }; -// @public -export type ReadUrlOptions = { - etag?: string; - signal?: AbortSignal; -}; +export { ReadUrlOptions }; -// @public -export type ReadUrlResponse = { - buffer(): Promise; - stream?(): Readable; - etag?: string; -}; +export { ReadUrlResponse }; // @public export class ReadUrlResponseFactory { @@ -652,23 +627,11 @@ export type RunContainerOptions = { pullImage?: boolean; }; -// @public -export type SearchOptions = { - etag?: string; - signal?: AbortSignal; -}; +export { SearchOptions }; -// @public -export type SearchResponse = { - files: SearchResponseFile[]; - etag: string; -}; +export { SearchResponse }; -// @public -export type SearchResponseFile = { - url: string; - content(): Promise; -}; +export { SearchResponseFile }; // @public export class ServerTokenManager implements TokenManager { @@ -755,13 +718,7 @@ export interface TokenManager { }>; } -// @public -export type UrlReader = { - read(url: string): Promise; - readUrl(url: string, options?: ReadUrlOptions): Promise; - readTree(url: string, options?: ReadTreeOptions): Promise; - search(url: string, options?: SearchOptions): Promise; -}; +export { UrlReader }; // @public export type UrlReaderPredicateTuple = { diff --git a/packages/backend-plugin-api/api-report.md b/packages/backend-plugin-api/api-report.md index 545728b386..e0fa44eb20 100644 --- a/packages/backend-plugin-api/api-report.md +++ b/packages/backend-plugin-api/api-report.md @@ -3,6 +3,8 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// + import { Config } from '@backstage/config'; import { Handler } from 'express'; import { Logger } from 'winston'; @@ -10,11 +12,10 @@ import { PermissionAuthorizer } from '@backstage/plugin-permission-common'; import { PermissionEvaluator } from '@backstage/plugin-permission-common'; import { PluginCacheManager } from '@backstage/backend-common'; import { PluginDatabaseManager } from '@backstage/backend-common'; -import { PluginEndpointDiscovery } from '@backstage/backend-common'; import { PluginTaskScheduler } from '@backstage/backend-tasks'; +import { Readable } from 'stream'; import { TokenManager } from '@backstage/backend-common'; import { TransportStreamOptions } from 'winston-transport'; -import { UrlReader } from '@backstage/backend-common'; // @public (undocumented) export interface BackendFeature { @@ -89,6 +90,7 @@ declare namespace coreServices { tokenManagerServiceRef as tokenManager, permissionsServiceRef as permissions, schedulerServiceRef as scheduler, + rootLifecycleServiceRef as rootLifecycle, rootLoggerServiceRef as rootLogger, pluginMetadataServiceRef as pluginMetadata, lifecycleServiceRef as lifecycle, @@ -166,11 +168,14 @@ export type DatabaseService = PluginDatabaseManager; // @public (undocumented) const databaseServiceRef: ServiceRef; -// @public (undocumented) -export type DiscoveryService = PluginEndpointDiscovery; +// @public +export type DiscoveryService = { + getBaseUrl(pluginId: string): Promise; + getExternalBaseUrl(pluginId: string): Promise; +}; // @public (undocumented) -const discoveryServiceRef: ServiceRef; +const discoveryServiceRef: ServiceRef; // @public export type ExtensionPoint = { @@ -200,6 +205,7 @@ const lifecycleServiceRef: ServiceRef; // @public (undocumented) export type LifecycleServiceShutdownHook = { fn: () => void | Promise; + labels?: Record; }; // @public (undocumented) @@ -245,6 +251,56 @@ export interface PluginMetadataService { // @public (undocumented) const pluginMetadataServiceRef: ServiceRef; +// @public +export type ReadTreeOptions = { + filter?( + path: string, + info?: { + size: number; + }, + ): boolean; + etag?: string; + signal?: AbortSignal; +}; + +// @public +export type ReadTreeResponse = { + files(): Promise; + archive(): Promise; + dir(options?: ReadTreeResponseDirOptions): Promise; + etag: string; +}; + +// @public +export type ReadTreeResponseDirOptions = { + targetDir?: string; +}; + +// @public +export type ReadTreeResponseFile = { + path: string; + content(): Promise; +}; + +// @public +export type ReadUrlOptions = { + etag?: string; + signal?: AbortSignal; +}; + +// @public +export type ReadUrlResponse = { + buffer(): Promise; + stream?(): Readable; + etag?: string; +}; + +// @public (undocumented) +export type RootLifecycleService = LifecycleService; + +// @public (undocumented) +const rootLifecycleServiceRef: ServiceRef; + // @public (undocumented) export type RootLoggerService = LoggerService; @@ -257,6 +313,24 @@ export type SchedulerService = PluginTaskScheduler; // @public (undocumented) const schedulerServiceRef: ServiceRef; +// @public +export type SearchOptions = { + etag?: string; + signal?: AbortSignal; +}; + +// @public +export type SearchResponse = { + files: SearchResponseFile[]; + etag: string; +}; + +// @public +export type SearchResponseFile = { + url: string; + content(): Promise; +}; + // @public (undocumented) export type ServiceFactory = | { @@ -307,9 +381,13 @@ export type TypesToServiceRef = { [key in keyof T]: ServiceRef; }; -// @public (undocumented) -export type UrlReaderService = UrlReader; +// @public +export type UrlReaderService = { + readUrl(url: string, options?: ReadUrlOptions): Promise; + readTree(url: string, options?: ReadTreeOptions): Promise; + search(url: string, options?: SearchOptions): Promise; +}; // @public (undocumented) -const urlReaderServiceRef: ServiceRef; +const urlReaderServiceRef: ServiceRef; ``` diff --git a/packages/catalog-client/api-report.md b/packages/catalog-client/api-report.md index 2f76be79e2..a81314308b 100644 --- a/packages/catalog-client/api-report.md +++ b/packages/catalog-client/api-report.md @@ -161,6 +161,17 @@ export type EntityFilterQuery = | Record[] | Record; +// @public +export type EntityOrderQuery = + | { + field: string; + order: 'asc' | 'desc'; + } + | Array<{ + field: string; + order: 'asc' | 'desc'; + }>; + // @public export interface GetEntitiesByRefsRequest { entityRefs: string[]; @@ -179,6 +190,7 @@ export interface GetEntitiesRequest { filter?: EntityFilterQuery; limit?: number; offset?: number; + order?: EntityOrderQuery; } // @public diff --git a/plugins/apollo-explorer/api-report.md b/plugins/apollo-explorer/api-report.md index 7272903b0c..1d3b41eac1 100644 --- a/plugins/apollo-explorer/api-report.md +++ b/plugins/apollo-explorer/api-report.md @@ -25,7 +25,7 @@ export const ApolloExplorerPage: (props: { displayOptions: { docsPanelState?: 'closed' | 'open' | undefined; showHeadersAndEnvVars?: boolean | undefined; - theme?: 'light' | 'dark' | undefined; + theme?: 'dark' | 'light' | undefined; }; } | undefined; diff --git a/plugins/bazaar/api-report.md b/plugins/bazaar/api-report.md index d7c463888a..afbb7b5504 100644 --- a/plugins/bazaar/api-report.md +++ b/plugins/bazaar/api-report.md @@ -5,7 +5,9 @@ ```ts /// +import { ApiHolder } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { Entity } from '@backstage/catalog-model'; import { RouteRef } from '@backstage/core-plugin-api'; // @public (undocumented) @@ -36,6 +38,14 @@ export const bazaarPlugin: BackstagePlugin< // @public (undocumented) export const EntityBazaarInfoCard: () => JSX.Element | null; +// @public (undocumented) +export const isBazaarAvailable: ( + entity: Entity, + context: { + apis: ApiHolder; + }, +) => Promise; + // @public (undocumented) export const SortView: () => JSX.Element; diff --git a/plugins/catalog-backend-module-github/api-report.md b/plugins/catalog-backend-module-github/api-report.md index 8ccfdb09ee..78ffd5b018 100644 --- a/plugins/catalog-backend-module-github/api-report.md +++ b/plugins/catalog-backend-module-github/api-report.md @@ -178,7 +178,9 @@ export class GitHubOrgEntityProvider extends GithubOrgEntityProvider { } // @public -export class GithubOrgEntityProvider implements EntityProvider { +export class GithubOrgEntityProvider + implements EntityProvider, EventSubscriber +{ constructor(options: { id: string; orgUrl: string; @@ -197,7 +199,11 @@ export class GithubOrgEntityProvider implements EntityProvider { ): GithubOrgEntityProvider; // (undocumented) getProviderName(): string; + // (undocumented) + onEvent(params: EventParams): Promise; read(options?: { logger?: Logger }): Promise; + // (undocumented) + supportsEventTopics(): string[]; } // @public @deprecated (undocumented) diff --git a/plugins/code-coverage-backend/api-report.md b/plugins/code-coverage-backend/api-report.md index c33874064b..440af50714 100644 --- a/plugins/code-coverage-backend/api-report.md +++ b/plugins/code-coverage-backend/api-report.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; import express from 'express'; import { Logger } from 'winston'; @@ -15,6 +16,8 @@ export function createRouter(options: RouterOptions): Promise; // @public export interface RouterOptions { + // (undocumented) + catalogApi?: CatalogApi; // (undocumented) config: Config; // (undocumented) diff --git a/plugins/explore/api-report.md b/plugins/explore/api-report.md index d184ce01a4..d10f5ddf95 100644 --- a/plugins/explore/api-report.md +++ b/plugins/explore/api-report.md @@ -9,7 +9,6 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; import { default as default_2 } from 'react'; import { DiscoveryApi } from '@backstage/core-plugin-api'; -import { DomainEntity } from '@backstage/catalog-model'; import { ExploreToolsConfig } from '@backstage/plugin-explore-react'; import { ExternalRouteRef } from '@backstage/core-plugin-api'; import { FetchApi } from '@backstage/core-plugin-api'; @@ -31,9 +30,6 @@ export const catalogEntityRouteRef: ExternalRouteRef< true >; -// @public (undocumented) -export const DomainCard: (props: { entity: DomainEntity }) => JSX.Element; - // @public (undocumented) export const DomainExplorerContent: (props: { title?: string | undefined; diff --git a/plugins/rollbar-backend/api-report.md b/plugins/rollbar-backend/api-report.md index 9086121306..58a5fb0252 100644 --- a/plugins/rollbar-backend/api-report.md +++ b/plugins/rollbar-backend/api-report.md @@ -29,8 +29,8 @@ export class RollbarApi { }, ): Promise< { - timestamp: number; count: number; + timestamp: number; }[] >; // (undocumented) @@ -51,8 +51,8 @@ export class RollbarApi { }, ): Promise< { - timestamp: number; count: number; + timestamp: number; }[] >; // (undocumented) @@ -64,8 +64,8 @@ export class RollbarApi { }>; // (undocumented) getProjectItems(projectName: string): Promise<{ - items: RollbarItem[]; page: number; + items: RollbarItem[]; totalCount: number; }>; // (undocumented) diff --git a/plugins/scaffolder-backend/api-report.md b/plugins/scaffolder-backend/api-report.md index 94377d7720..66757a01cd 100644 --- a/plugins/scaffolder-backend/api-report.md +++ b/plugins/scaffolder-backend/api-report.md @@ -195,6 +195,12 @@ export function createGithubRepoCreateAction(options: { gitAuthorEmail?: string | undefined; allowRebaseMerge?: boolean | undefined; allowSquashMerge?: boolean | undefined; + squashMergeCommitTitle?: 'PR_TITLE' | 'COMMIT_OR_PR_TITLE' | undefined; + squashMergeCommitMessage?: + | 'PR_BODY' + | 'COMMIT_MESSAGES' + | 'BLANK' + | undefined; allowMergeCommit?: boolean | undefined; allowAutoMerge?: boolean | undefined; requireCodeOwnerReviews?: boolean | undefined; @@ -208,16 +214,16 @@ export function createGithubRepoCreateAction(options: { requiredStatusCheckContexts?: string[] | undefined; requireBranchesToBeUpToDate?: boolean | undefined; requiredConversationResolution?: boolean | undefined; - repoVisibility?: 'public' | 'private' | 'internal' | undefined; + repoVisibility?: 'internal' | 'private' | 'public' | undefined; collaborators?: | ( | { user: string; - access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage'; + access: string; } | { team: string; - access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage'; + access: string; } | { username: string; @@ -225,6 +231,9 @@ export function createGithubRepoCreateAction(options: { } )[] | undefined; + hasProjects?: boolean | undefined; + hasWiki?: boolean | undefined; + hasIssues?: boolean | undefined; token?: string | undefined; topics?: string[] | undefined; }>; @@ -298,7 +307,7 @@ export function createPublishBitbucketAction(options: { repoUrl: string; description?: string | undefined; defaultBranch?: string | undefined; - repoVisibility?: 'public' | 'private' | undefined; + repoVisibility?: 'private' | 'public' | undefined; sourcePath?: string | undefined; enableLFS?: boolean | undefined; token?: string | undefined; @@ -315,7 +324,7 @@ export function createPublishBitbucketCloudAction(options: { repoUrl: string; description?: string | undefined; defaultBranch?: string | undefined; - repoVisibility?: 'public' | 'private' | undefined; + repoVisibility?: 'private' | 'public' | undefined; sourcePath?: string | undefined; token?: string | undefined; }>; @@ -328,7 +337,7 @@ export function createPublishBitbucketServerAction(options: { repoUrl: string; description?: string | undefined; defaultBranch?: string | undefined; - repoVisibility?: 'public' | 'private' | undefined; + repoVisibility?: 'private' | 'public' | undefined; sourcePath?: string | undefined; enableLFS?: boolean | undefined; token?: string | undefined; @@ -380,6 +389,12 @@ export function createPublishGithubAction(options: { gitAuthorEmail?: string | undefined; allowRebaseMerge?: boolean | undefined; allowSquashMerge?: boolean | undefined; + squashMergeCommitTitle?: 'PR_TITLE' | 'COMMIT_OR_PR_TITLE' | undefined; + squashMergeCommitMessage?: + | 'PR_BODY' + | 'COMMIT_MESSAGES' + | 'BLANK' + | undefined; allowMergeCommit?: boolean | undefined; allowAutoMerge?: boolean | undefined; sourcePath?: string | undefined; @@ -395,16 +410,16 @@ export function createPublishGithubAction(options: { requiredStatusCheckContexts?: string[] | undefined; requireBranchesToBeUpToDate?: boolean | undefined; requiredConversationResolution?: boolean | undefined; - repoVisibility?: 'public' | 'private' | 'internal' | undefined; + repoVisibility?: 'internal' | 'private' | 'public' | undefined; collaborators?: | ( | { user: string; - access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage'; + access: string; } | { team: string; - access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage'; + access: string; } | { username: string; @@ -412,6 +427,9 @@ export function createPublishGithubAction(options: { } )[] | undefined; + hasProjects?: boolean | undefined; + hasWiki?: boolean | undefined; + hasIssues?: boolean | undefined; token?: string | undefined; topics?: string[] | undefined; }>; @@ -441,7 +459,7 @@ export function createPublishGitlabAction(options: { }): TemplateAction<{ repoUrl: string; defaultBranch?: string | undefined; - repoVisibility?: 'public' | 'private' | 'internal' | undefined; + repoVisibility?: 'internal' | 'private' | 'public' | undefined; sourcePath?: string | undefined; token?: string | undefined; gitCommitMessage?: string | undefined; @@ -462,7 +480,7 @@ export const createPublishGitlabMergeRequestAction: (options: { sourcePath?: string | undefined; targetPath?: string | undefined; token?: string | undefined; - commitAction?: 'create' | 'update' | 'delete' | undefined; + commitAction?: 'update' | 'delete' | 'create' | undefined; projectid?: string | undefined; removeSourceBranch?: boolean | undefined; assignee?: string | undefined; diff --git a/plugins/scaffolder/api-report.md b/plugins/scaffolder/api-report.md index d936542cfe..1c4d163123 100644 --- a/plugins/scaffolder/api-report.md +++ b/plugins/scaffolder/api-report.md @@ -11,7 +11,6 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; import { ComponentType } from 'react'; import { DiscoveryApi } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; -import type { ErrorTransformer } from '@rjsf/utils'; import { Extension } from '@backstage/core-plugin-api'; import { ExternalRouteRef } from '@backstage/core-plugin-api'; import { FetchApi } from '@backstage/core-plugin-api'; @@ -19,7 +18,8 @@ import { FieldProps } from '@rjsf/core'; import { FieldProps as FieldProps_2 } from '@rjsf/utils'; import { FieldValidation } from '@rjsf/core'; import { FieldValidation as FieldValidation_2 } from '@rjsf/utils'; -import type { FormProps } from '@rjsf/core'; +import type { FormProps as FormProps_2 } from '@rjsf/core'; +import type { FormProps as FormProps_3 } from '@rjsf/core-v5'; import { IdentityApi } from '@backstage/core-plugin-api'; import { JsonObject } from '@backstage/types'; import { JSONSchema7 } from 'json-schema'; @@ -88,6 +88,10 @@ export const EntityPickerFieldExtension: FieldExtensionComponent< defaultNamespace?: string | false | undefined; allowedKinds?: string[] | undefined; allowArbitraryValues?: boolean | undefined; + catalogFilter?: + | Record + | Record[] + | undefined; } >; @@ -99,6 +103,10 @@ export const EntityPickerFieldSchema: FieldSchema< defaultNamespace?: string | false | undefined; allowedKinds?: string[] | undefined; allowArbitraryValues?: boolean | undefined; + catalogFilter?: + | Record + | Record[] + | undefined; } >; @@ -167,6 +175,12 @@ export interface FieldSchema { readonly uiOptionsType: TUiOptions; } +// @alpha +export type FormProps = Pick< + FormProps_3, + 'transformErrors' | 'noHtml5Validate' +>; + // @public export type LayoutComponent<_TInputProps> = () => null; @@ -179,7 +193,7 @@ export interface LayoutOptions

{ } // @public -export type LayoutTemplate = FormProps['ObjectFieldTemplate']; +export type LayoutTemplate = FormProps_2['ObjectFieldTemplate']; // @public export type ListActionsResponse = Array<{ @@ -264,7 +278,7 @@ export type NextRouterProps = { TaskPageComponent?: React_2.ComponentType<{}>; }; groups?: TemplateGroupFilter[]; - transformErrors?: ErrorTransformer; + FormProps?: FormProps; }; // @alpha @@ -310,6 +324,10 @@ export const OwnerPickerFieldExtension: FieldExtensionComponent< defaultNamespace?: string | false | undefined; allowedKinds?: string[] | undefined; allowArbitraryValues?: boolean | undefined; + catalogFilter?: + | Record + | Record[] + | undefined; } >; @@ -320,6 +338,10 @@ export const OwnerPickerFieldSchema: FieldSchema< defaultNamespace?: string | false | undefined; allowedKinds?: string[] | undefined; allowArbitraryValues?: boolean | undefined; + catalogFilter?: + | Record + | Record[] + | undefined; } >; @@ -348,10 +370,10 @@ export const RepoUrlPickerFieldExtension: FieldExtensionComponent< | { additionalScopes?: | { + azure?: string[] | undefined; github?: string[] | undefined; gitlab?: string[] | undefined; bitbucket?: string[] | undefined; - azure?: string[] | undefined; gerrit?: string[] | undefined; } | undefined; @@ -374,10 +396,10 @@ export const RepoUrlPickerFieldSchema: FieldSchema< | { additionalScopes?: | { + azure?: string[] | undefined; github?: string[] | undefined; gitlab?: string[] | undefined; bitbucket?: string[] | undefined; - azure?: string[] | undefined; gerrit?: string[] | undefined; } | undefined; diff --git a/plugins/techdocs-react/api-report.md b/plugins/techdocs-react/api-report.md index 09da4e012c..f1d6d3f177 100644 --- a/plugins/techdocs-react/api-report.md +++ b/plugins/techdocs-react/api-report.md @@ -32,6 +32,9 @@ export const SHADOW_DOM_STYLE_LOAD_EVENT = 'TECH_DOCS_SHADOW_DOM_STYLE_LOAD'; // @public export type SyncResult = 'cached' | 'updated'; +// @public +export const TECHDOCS_ADDONS_KEY = 'techdocs.addons.addon.v1'; + // @public export const TECHDOCS_ADDONS_WRAPPER_KEY = 'techdocs.addons.wrapper.v1'; From 26b4bbd8b22fe2104952becdab630ab839321089 Mon Sep 17 00:00:00 2001 From: sblausten Date: Tue, 3 Jan 2023 16:02:08 +0100 Subject: [PATCH 10/25] Api report Signed-off-by: sblausten --- plugins/explore/api-report.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/explore/api-report.md b/plugins/explore/api-report.md index d10f5ddf95..d184ce01a4 100644 --- a/plugins/explore/api-report.md +++ b/plugins/explore/api-report.md @@ -9,6 +9,7 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; import { default as default_2 } from 'react'; import { DiscoveryApi } from '@backstage/core-plugin-api'; +import { DomainEntity } from '@backstage/catalog-model'; import { ExploreToolsConfig } from '@backstage/plugin-explore-react'; import { ExternalRouteRef } from '@backstage/core-plugin-api'; import { FetchApi } from '@backstage/core-plugin-api'; @@ -30,6 +31,9 @@ export const catalogEntityRouteRef: ExternalRouteRef< true >; +// @public (undocumented) +export const DomainCard: (props: { entity: DomainEntity }) => JSX.Element; + // @public (undocumented) export const DomainExplorerContent: (props: { title?: string | undefined; From a70d460887d6f0487384985aa6ceda9900edd687 Mon Sep 17 00:00:00 2001 From: sblausten Date: Mon, 30 Jan 2023 09:53:47 +0100 Subject: [PATCH 11/25] Fix api report Signed-off-by: sblausten --- plugins/explore/api-report.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/explore/api-report.md b/plugins/explore/api-report.md index e7adde4b77..b6418fa3e9 100644 --- a/plugins/explore/api-report.md +++ b/plugins/explore/api-report.md @@ -9,7 +9,6 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; import { default as default_2 } from 'react'; import { DiscoveryApi } from '@backstage/core-plugin-api'; -import { DomainEntity } from '@backstage/catalog-model'; import { ExploreToolsConfig } from '@backstage/plugin-explore-react'; import { ExternalRouteRef } from '@backstage/core-plugin-api'; import { FetchApi } from '@backstage/core-plugin-api'; @@ -31,14 +30,17 @@ export const catalogEntityRouteRef: ExternalRouteRef< true >; -// @public (undocumented) -export const DomainCard: (props: { entity: DomainEntity }) => JSX.Element; - // @public (undocumented) export const DomainExplorerContent: (props: { title?: string | undefined; }) => JSX.Element; +// @public (undocumented) +export const EntityExplorerContent: (props: { + tabTitle?: string; + kind: string; +}) => JSX.Element; + // @public export interface ExploreApi { getTools(request?: GetExploreToolsRequest): Promise; From 91306c7aa895a356940f62be6e60520d2e192a3f Mon Sep 17 00:00:00 2001 From: sblausten Date: Fri, 17 Mar 2023 15:38:08 +0100 Subject: [PATCH 12/25] Review comments and fixing bug Signed-off-by: sblausten --- .../CatalogKindExploreContent.test.tsx} | 0 .../CatalogKindExploreContent.tsx} | 0 .../index.ts | 0 .../src/components/DomainCard/DomainCard.test.tsx | 15 +++++++++++++++ .../src/components/DomainCard/DomainCard.tsx | 15 +++++++++++++++ .../explore/src/components/DomainCard/index.ts | 15 +++++++++++++++ 6 files changed, 45 insertions(+) rename plugins/explore/src/components/{EntityExplorerContent/EntityExplorerContent.test.tsx => CatalogKindExploreContent/CatalogKindExploreContent.test.tsx} (100%) rename plugins/explore/src/components/{EntityExplorerContent/EntityExplorerContent.tsx => CatalogKindExploreContent/CatalogKindExploreContent.tsx} (100%) rename plugins/explore/src/components/{EntityExplorerContent => CatalogKindExploreContent}/index.ts (100%) create mode 100644 plugins/explore/src/components/DomainCard/DomainCard.test.tsx create mode 100644 plugins/explore/src/components/DomainCard/DomainCard.tsx create mode 100644 plugins/explore/src/components/DomainCard/index.ts diff --git a/plugins/explore/src/components/EntityExplorerContent/EntityExplorerContent.test.tsx b/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.test.tsx similarity index 100% rename from plugins/explore/src/components/EntityExplorerContent/EntityExplorerContent.test.tsx rename to plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.test.tsx diff --git a/plugins/explore/src/components/EntityExplorerContent/EntityExplorerContent.tsx b/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.tsx similarity index 100% rename from plugins/explore/src/components/EntityExplorerContent/EntityExplorerContent.tsx rename to plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.tsx diff --git a/plugins/explore/src/components/EntityExplorerContent/index.ts b/plugins/explore/src/components/CatalogKindExploreContent/index.ts similarity index 100% rename from plugins/explore/src/components/EntityExplorerContent/index.ts rename to plugins/explore/src/components/CatalogKindExploreContent/index.ts diff --git a/plugins/explore/src/components/DomainCard/DomainCard.test.tsx b/plugins/explore/src/components/DomainCard/DomainCard.test.tsx new file mode 100644 index 0000000000..eb2f165350 --- /dev/null +++ b/plugins/explore/src/components/DomainCard/DomainCard.test.tsx @@ -0,0 +1,15 @@ +/* + * Copyright 2023 The Backstage Authors + * + * 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. + */ diff --git a/plugins/explore/src/components/DomainCard/DomainCard.tsx b/plugins/explore/src/components/DomainCard/DomainCard.tsx new file mode 100644 index 0000000000..eb2f165350 --- /dev/null +++ b/plugins/explore/src/components/DomainCard/DomainCard.tsx @@ -0,0 +1,15 @@ +/* + * Copyright 2023 The Backstage Authors + * + * 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. + */ diff --git a/plugins/explore/src/components/DomainCard/index.ts b/plugins/explore/src/components/DomainCard/index.ts new file mode 100644 index 0000000000..eb2f165350 --- /dev/null +++ b/plugins/explore/src/components/DomainCard/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright 2023 The Backstage Authors + * + * 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. + */ From dfecc7db6b3f6bb69243de4a0a50761dd5c7cf07 Mon Sep 17 00:00:00 2001 From: sblausten Date: Fri, 17 Mar 2023 15:41:10 +0100 Subject: [PATCH 13/25] Review comments and fixing bug Signed-off-by: sblausten --- plugins/explore/api-report.md | 14 ++-- plugins/explore/package.json | 3 +- .../CatalogKindExploreContent.test.tsx | 12 +-- .../CatalogKindExploreContent.tsx | 19 +++-- .../CatalogKindExploreContent/index.ts | 2 +- .../DefaultExplorePage/DefaultExplorePage.tsx | 6 +- .../components/DomainCard/DomainCard.test.tsx | 54 +++++++++++++ .../src/components/DomainCard/DomainCard.tsx | 75 +++++++++++++++++++ .../src/components/DomainCard/index.ts | 17 +++++ .../components/EntityCard/EntityCard.test.tsx | 6 +- plugins/explore/src/components/index.ts | 3 +- 11 files changed, 181 insertions(+), 30 deletions(-) diff --git a/plugins/explore/api-report.md b/plugins/explore/api-report.md index d7bafb7ee0..27748aa8c5 100644 --- a/plugins/explore/api-report.md +++ b/plugins/explore/api-report.md @@ -9,6 +9,7 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; import { default as default_2 } from 'react'; import { DiscoveryApi } from '@backstage/core-plugin-api'; +import { DomainEntity } from '@backstage/catalog-model'; import { ExploreToolsConfig } from '@backstage/plugin-explore-react'; import { ExternalRouteRef } from '@backstage/core-plugin-api'; import { FetchApi } from '@backstage/core-plugin-api'; @@ -32,14 +33,17 @@ export const catalogEntityRouteRef: ExternalRouteRef< >; // @public (undocumented) -export const DomainExplorerContent: (props: { - title?: string | undefined; +export const CatalogKindExploreContent: (props: { + tabTitle?: string; + kind: string; }) => JSX.Element; // @public (undocumented) -export const EntityExplorerContent: (props: { - tabTitle?: string; - kind: string; +export const DomainCard: (props: { entity: DomainEntity }) => JSX.Element; + +// @public (undocumented) +export const DomainExplorerContent: (props: { + title?: string | undefined; }) => JSX.Element; // @public diff --git a/plugins/explore/package.json b/plugins/explore/package.json index d14a276ecc..2f5cad2244 100644 --- a/plugins/explore/package.json +++ b/plugins/explore/package.json @@ -46,7 +46,8 @@ "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.57", "classnames": "^2.2.6", - "react-use": "^17.2.4" + "react-use": "^17.2.4", + "pluralize": "^8.0.0" }, "peerDependencies": { "@types/react": "^16.13.1 || ^17.0.0", diff --git a/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.test.tsx b/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.test.tsx index 4670a10855..6075561ff1 100644 --- a/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.test.tsx +++ b/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.test.tsx @@ -19,9 +19,9 @@ import { catalogApiRef, entityRouteRef } from '@backstage/plugin-catalog-react'; import { renderInTestApp, TestApiProvider } from '@backstage/test-utils'; import { waitFor } from '@testing-library/react'; import React from 'react'; -import { EntityExplorerContent } from './EntityExplorerContent'; +import { CatalogKindExploreContent } from './CatalogKindExploreContent'; -describe('', () => { +describe('', () => { const catalogApi = { addLocation: jest.fn(), getEntities: jest.fn(), @@ -79,7 +79,7 @@ describe('', () => { const { getByText } = await renderInTestApp( - + , mountedRoutes, ); @@ -95,7 +95,7 @@ describe('', () => { const { getByText } = await renderInTestApp( - + , mountedRoutes, ); @@ -108,7 +108,7 @@ describe('', () => { const { getByText } = await renderInTestApp( - + , mountedRoutes, ); @@ -124,7 +124,7 @@ describe('', () => { const { getByText } = await renderInTestApp( - + , mountedRoutes, ); diff --git a/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.tsx b/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.tsx index 55ef13d98e..f3f4ccd103 100644 --- a/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.tsx +++ b/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.tsx @@ -30,10 +30,11 @@ import { WarningPanel, } from '@backstage/core-components'; import { useApi } from '@backstage/core-plugin-api'; +import pluralize from 'pluralize'; const Body = (props: { kind: string }) => { const { kind } = props; - const kindPlural = `${kind}s`; + const kindPlural = pluralize(kind); const catalogApi = useApi(catalogApiRef); const { value: entities, @@ -44,7 +45,7 @@ const Body = (props: { kind: string }) => { filter: { kind }, }); return response.items as Entity[]; - }, [catalogApi]); + }, [kind]); if (loading) { return ; @@ -87,23 +88,21 @@ const Body = (props: { kind: string }) => { }; /** @public */ -export const EntityExplorerContent = (props: { +export const CatalogKindExploreContent = (props: { tabTitle?: string; kind: string; }) => { const { kind, tabTitle } = props; + const kindLowercase = kind.toLocaleLowerCase(); + const kindCapitalized = `${kind[0].toLocaleUpperCase()}${kind.substring(1)}`; return ( - + - Discover the {kind.toLocaleLowerCase()}s in your ecosystem. + Discover the {pluralize(kindLowercase)} in your ecosystem. - + ); }; diff --git a/plugins/explore/src/components/CatalogKindExploreContent/index.ts b/plugins/explore/src/components/CatalogKindExploreContent/index.ts index ab06193939..af4cafae62 100644 --- a/plugins/explore/src/components/CatalogKindExploreContent/index.ts +++ b/plugins/explore/src/components/CatalogKindExploreContent/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export { EntityExplorerContent } from './EntityExplorerContent'; +export { CatalogKindExploreContent } from './CatalogKindExploreContent'; diff --git a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.tsx b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.tsx index 49a79f5143..689da217fe 100644 --- a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.tsx +++ b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.tsx @@ -19,7 +19,7 @@ import { ExploreLayout } from '../ExploreLayout'; import { GroupsExplorerContent } from '../GroupsExplorerContent'; import { ToolExplorerContent } from '../ToolExplorerContent'; import { configApiRef, useApi } from '@backstage/core-plugin-api'; -import { EntityExplorerContent } from '../EntityExplorerContent'; +import { CatalogKindExploreContent } from '../CatalogKindExploreContent'; export const DefaultExplorePage = () => { const configApi = useApi(configApiRef); @@ -32,10 +32,10 @@ export const DefaultExplorePage = () => { subtitle="Discover solutions available in your ecosystem" > - + - + diff --git a/plugins/explore/src/components/DomainCard/DomainCard.test.tsx b/plugins/explore/src/components/DomainCard/DomainCard.test.tsx index eb2f165350..1e4b9b30f1 100644 --- a/plugins/explore/src/components/DomainCard/DomainCard.test.tsx +++ b/plugins/explore/src/components/DomainCard/DomainCard.test.tsx @@ -1,3 +1,57 @@ +/* + * Copyright 2020 The Backstage Authors + * + * 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. + */ + +import { DomainEntity } from '@backstage/catalog-model'; +import { entityRouteRef } from '@backstage/plugin-catalog-react'; +import { renderInTestApp } from '@backstage/test-utils'; +import React from 'react'; +import { DomainCard } from './DomainCard'; + +describe('', () => { + it('renders a domain card', async () => { + const entity: DomainEntity = { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Domain', + metadata: { + name: 'artists', + description: 'Everything about artists', + tags: ['a-tag'], + }, + spec: { + owner: 'guest', + }, + }; + const { getByText } = await renderInTestApp( + , + { + mountedRoutes: { + '/catalog/:namespace/:kind/:name': entityRouteRef, + }, + }, + ); + + expect(getByText('artists')).toBeInTheDocument(); + expect(getByText('Everything about artists')).toBeInTheDocument(); + expect(getByText('a-tag')).toBeInTheDocument(); + expect(getByText('Explore').parentElement).toHaveAttribute( + 'href', + '/catalog/default/domain/artists', + ); + }); +}); /* * Copyright 2023 The Backstage Authors * diff --git a/plugins/explore/src/components/DomainCard/DomainCard.tsx b/plugins/explore/src/components/DomainCard/DomainCard.tsx index eb2f165350..867109f03c 100644 --- a/plugins/explore/src/components/DomainCard/DomainCard.tsx +++ b/plugins/explore/src/components/DomainCard/DomainCard.tsx @@ -1,3 +1,78 @@ +/* + * Copyright 2021 The Backstage Authors + * + * 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. + */ + +import { DomainEntity, RELATION_OWNED_BY } from '@backstage/catalog-model'; +import { + EntityRefLinks, + entityRouteParams, + getEntityRelations, + entityRouteRef, +} from '@backstage/plugin-catalog-react'; +import { + Box, + Card, + CardActions, + CardContent, + CardMedia, + Chip, +} from '@material-ui/core'; +import React from 'react'; + +import { LinkButton, ItemCardHeader } from '@backstage/core-components'; +import { useRouteRef } from '@backstage/core-plugin-api'; + +/** @public */ +export const DomainCard = (props: { entity: DomainEntity }) => { + const { entity } = props; + + const catalogEntityRoute = useRouteRef(entityRouteRef); + const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY); + const url = catalogEntityRoute(entityRouteParams(entity)); + + const owner = ( + + ); + + return ( + + + + + + {entity.metadata.tags?.length ? ( + + {entity.metadata.tags.map(tag => ( + + ))} + + ) : null} + {entity.metadata.description} + + + + Explore + + + + ); +}; /* * Copyright 2023 The Backstage Authors * diff --git a/plugins/explore/src/components/DomainCard/index.ts b/plugins/explore/src/components/DomainCard/index.ts index eb2f165350..47870e5645 100644 --- a/plugins/explore/src/components/DomainCard/index.ts +++ b/plugins/explore/src/components/DomainCard/index.ts @@ -1,3 +1,20 @@ +/* + * Copyright 2021 The Backstage Authors + * + * 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 { DomainCard } from './DomainCard'; /* * Copyright 2023 The Backstage Authors * diff --git a/plugins/explore/src/components/EntityCard/EntityCard.test.tsx b/plugins/explore/src/components/EntityCard/EntityCard.test.tsx index ccf5deb875..4b006e347f 100644 --- a/plugins/explore/src/components/EntityCard/EntityCard.test.tsx +++ b/plugins/explore/src/components/EntityCard/EntityCard.test.tsx @@ -14,15 +14,15 @@ * limitations under the License. */ -import { DomainEntity } from '@backstage/catalog-model'; +import { Entity } from '@backstage/catalog-model'; import { entityRouteRef } from '@backstage/plugin-catalog-react'; import { renderInTestApp } from '@backstage/test-utils'; import React from 'react'; import { EntityCard } from './EntityCard'; describe('', () => { - it('renders a domain card', async () => { - const entity: DomainEntity = { + it('renders an entity card', async () => { + const entity: Entity = { apiVersion: 'backstage.io/v1alpha1', kind: 'Domain', metadata: { diff --git a/plugins/explore/src/components/index.ts b/plugins/explore/src/components/index.ts index e2f7810216..b3aa82bc79 100644 --- a/plugins/explore/src/components/index.ts +++ b/plugins/explore/src/components/index.ts @@ -14,5 +14,6 @@ * limitations under the License. */ -export * from './EntityExplorerContent'; +export * from './CatalogKindExploreContent'; export * from './ExploreLayout'; +export * from './DomainCard'; From 7137f8f1dc6708a7d01f1bdd1e70aa9752f95a43 Mon Sep 17 00:00:00 2001 From: sblausten Date: Fri, 17 Mar 2023 15:43:22 +0100 Subject: [PATCH 14/25] Change to patch changeset Signed-off-by: sblausten --- .changeset/itchy-kiwis-unite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/itchy-kiwis-unite.md b/.changeset/itchy-kiwis-unite.md index e0bee850eb..c7bcad6759 100644 --- a/.changeset/itchy-kiwis-unite.md +++ b/.changeset/itchy-kiwis-unite.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-explore': minor +'@backstage/plugin-explore': patch --- Extracted generic EntityExplorerContent component so that it is easy to show any component kinds in their own tab in the Explore page. From 2ad6372e450c769cf948641f785bb30cf09786e5 Mon Sep 17 00:00:00 2001 From: sblausten Date: Fri, 17 Mar 2023 15:44:31 +0100 Subject: [PATCH 15/25] Remove systems tab from defaults Signed-off-by: sblausten --- .../components/DefaultExplorePage/DefaultExplorePage.test.tsx | 1 - .../src/components/DefaultExplorePage/DefaultExplorePage.tsx | 3 --- 2 files changed, 4 deletions(-) diff --git a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx index c4c6b3011e..b04e9335e8 100644 --- a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx +++ b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx @@ -58,7 +58,6 @@ describe('', () => { const elements = getAllByRole('tab'); expect(elements.length).toBe(4); expect(getByText(elements[0], 'Domains')).toBeInTheDocument(); - expect(getByText(elements[1], 'Systems')).toBeInTheDocument(); expect(getByText(elements[2], 'Groups')).toBeInTheDocument(); expect(getByText(elements[3], 'Tools')).toBeInTheDocument(); }); diff --git a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.tsx b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.tsx index 689da217fe..098f73be2e 100644 --- a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.tsx +++ b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.tsx @@ -34,9 +34,6 @@ export const DefaultExplorePage = () => { - - - From d12f28c0f249b0eee7ac71f031de9f42097ad048 Mon Sep 17 00:00:00 2001 From: sblausten Date: Fri, 17 Mar 2023 15:45:42 +0100 Subject: [PATCH 16/25] Ammend readme Signed-off-by: sblausten --- plugins/explore/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/explore/README.md b/plugins/explore/README.md index 27093b69b8..44942ab2a3 100644 --- a/plugins/explore/README.md +++ b/plugins/explore/README.md @@ -2,7 +2,7 @@ Welcome to the explore plugin! -This plugin helps to visualize the domains, systems and tools in your ecosystem. +This plugin helps to visualize the top level entities like domains, groups and tools in your ecosystem. ## Setup From bda537de2c440509dae012207426a40bb7665640 Mon Sep 17 00:00:00 2001 From: sblausten Date: Fri, 17 Mar 2023 15:47:07 +0100 Subject: [PATCH 17/25] Rename prop Signed-off-by: sblausten --- .../CatalogKindExploreContent.test.tsx | 2 +- .../CatalogKindExploreContent/CatalogKindExploreContent.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.test.tsx b/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.test.tsx index 6075561ff1..4f4f0f034c 100644 --- a/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.test.tsx +++ b/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.test.tsx @@ -95,7 +95,7 @@ describe('', () => { const { getByText } = await renderInTestApp( - + , mountedRoutes, ); diff --git a/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.tsx b/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.tsx index f3f4ccd103..f6f76ce1e0 100644 --- a/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.tsx +++ b/plugins/explore/src/components/CatalogKindExploreContent/CatalogKindExploreContent.tsx @@ -89,15 +89,15 @@ const Body = (props: { kind: string }) => { /** @public */ export const CatalogKindExploreContent = (props: { - tabTitle?: string; + title?: string; kind: string; }) => { - const { kind, tabTitle } = props; + const { kind, title } = props; const kindLowercase = kind.toLocaleLowerCase(); const kindCapitalized = `${kind[0].toLocaleUpperCase()}${kind.substring(1)}`; return ( - + Discover the {pluralize(kindLowercase)} in your ecosystem. From 194013944ad099a43767ccb0e1d174e8127b22f0 Mon Sep 17 00:00:00 2001 From: sblausten Date: Fri, 17 Mar 2023 15:48:19 +0100 Subject: [PATCH 18/25] Update api report Signed-off-by: sblausten --- plugins/explore/api-report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/explore/api-report.md b/plugins/explore/api-report.md index 27748aa8c5..70ad479841 100644 --- a/plugins/explore/api-report.md +++ b/plugins/explore/api-report.md @@ -34,7 +34,7 @@ export const catalogEntityRouteRef: ExternalRouteRef< // @public (undocumented) export const CatalogKindExploreContent: (props: { - tabTitle?: string; + title?: string; kind: string; }) => JSX.Element; From 2216940d26db0421fc0b51b0c375747be88d7fde Mon Sep 17 00:00:00 2001 From: sblausten Date: Fri, 17 Mar 2023 15:50:10 +0100 Subject: [PATCH 19/25] deps Signed-off-by: sblausten --- plugins/explore/package.json | 4 ++-- yarn.lock | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/explore/package.json b/plugins/explore/package.json index 2f5cad2244..8f2e0a6126 100644 --- a/plugins/explore/package.json +++ b/plugins/explore/package.json @@ -46,8 +46,8 @@ "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.57", "classnames": "^2.2.6", - "react-use": "^17.2.4", - "pluralize": "^8.0.0" + "pluralize": "^8.0.0", + "react-use": "^17.2.4" }, "peerDependencies": { "@types/react": "^16.13.1 || ^17.0.0", diff --git a/yarn.lock b/yarn.lock index ad03a668e0..561e390fd0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6045,6 +6045,7 @@ __metadata: classnames: ^2.2.6 cross-fetch: ^3.1.5 msw: ^1.0.0 + pluralize: ^8.0.0 react-use: ^17.2.4 peerDependencies: "@types/react": ^16.13.1 || ^17.0.0 From e604552e3d99e5b0cf9ed3fd07514e82276a36bb Mon Sep 17 00:00:00 2001 From: sblausten Date: Mon, 20 Mar 2023 11:31:29 +0100 Subject: [PATCH 20/25] Add test Signed-off-by: sblausten --- .../components/DefaultExplorePage/DefaultExplorePage.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx index b04e9335e8..153bcdb73b 100644 --- a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx +++ b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx @@ -56,7 +56,7 @@ describe('', () => { await waitFor(() => { const elements = getAllByRole('tab'); - expect(elements.length).toBe(4); + expect(elements.length).toBe(3); expect(getByText(elements[0], 'Domains')).toBeInTheDocument(); expect(getByText(elements[2], 'Groups')).toBeInTheDocument(); expect(getByText(elements[3], 'Tools')).toBeInTheDocument(); From 66669634ed00bf5ffd8172aecaf8e6f75d40b83a Mon Sep 17 00:00:00 2001 From: sblausten Date: Mon, 20 Mar 2023 13:47:30 +0100 Subject: [PATCH 21/25] Fix test Signed-off-by: sblausten --- .../components/DefaultExplorePage/DefaultExplorePage.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx index 153bcdb73b..62d197803f 100644 --- a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx +++ b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx @@ -58,8 +58,8 @@ describe('', () => { const elements = getAllByRole('tab'); expect(elements.length).toBe(3); expect(getByText(elements[0], 'Domains')).toBeInTheDocument(); - expect(getByText(elements[2], 'Groups')).toBeInTheDocument(); - expect(getByText(elements[3], 'Tools')).toBeInTheDocument(); + expect(getByText(elements[1], 'Groups')).toBeInTheDocument(); + expect(getByText(elements[2], 'Tools')).toBeInTheDocument(); }); }); }); From a580e4af62760d30a511ef4842271b4cbad073e0 Mon Sep 17 00:00:00 2001 From: Sam Blausten Date: Tue, 4 Apr 2023 17:48:11 +0200 Subject: [PATCH 22/25] Update .changeset/itchy-kiwis-unite.md Co-authored-by: Patrik Oldsberg Signed-off-by: Sam Blausten --- .changeset/itchy-kiwis-unite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/itchy-kiwis-unite.md b/.changeset/itchy-kiwis-unite.md index c7bcad6759..f4d263589b 100644 --- a/.changeset/itchy-kiwis-unite.md +++ b/.changeset/itchy-kiwis-unite.md @@ -2,4 +2,4 @@ '@backstage/plugin-explore': patch --- -Extracted generic EntityExplorerContent component so that it is easy to show any component kinds in their own tab in the Explore page. +Extracted generic `EntityExplorerContent` component so that it is easy to show any component kinds in their own tab in the explore page. From f40e571360bf14dfb395757c0546ad97148fea47 Mon Sep 17 00:00:00 2001 From: Sam Blausten Date: Tue, 4 Apr 2023 17:49:35 +0200 Subject: [PATCH 23/25] Update plugins/explore/README.md Co-authored-by: Patrik Oldsberg Signed-off-by: Sam Blausten --- plugins/explore/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/explore/README.md b/plugins/explore/README.md index 44942ab2a3..a1cb273aab 100644 --- a/plugins/explore/README.md +++ b/plugins/explore/README.md @@ -117,10 +117,10 @@ export const ExplorePage = () => { subtitle="Browse our ecosystem" > - + - + From fab17a4f6dadd752f7150b93a9e7e829fa253a94 Mon Sep 17 00:00:00 2001 From: sblausten Date: Tue, 4 Apr 2023 17:51:53 +0200 Subject: [PATCH 24/25] Remove extra licencing comments Signed-off-by: sblausten --- .../src/components/DomainCard/DomainCard.test.tsx | 15 --------------- .../src/components/DomainCard/DomainCard.tsx | 15 --------------- .../explore/src/components/DomainCard/index.ts | 15 --------------- 3 files changed, 45 deletions(-) diff --git a/plugins/explore/src/components/DomainCard/DomainCard.test.tsx b/plugins/explore/src/components/DomainCard/DomainCard.test.tsx index 1e4b9b30f1..df9b84820a 100644 --- a/plugins/explore/src/components/DomainCard/DomainCard.test.tsx +++ b/plugins/explore/src/components/DomainCard/DomainCard.test.tsx @@ -52,18 +52,3 @@ describe('', () => { ); }); }); -/* - * Copyright 2023 The Backstage Authors - * - * 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. - */ diff --git a/plugins/explore/src/components/DomainCard/DomainCard.tsx b/plugins/explore/src/components/DomainCard/DomainCard.tsx index 867109f03c..0d37e3e273 100644 --- a/plugins/explore/src/components/DomainCard/DomainCard.tsx +++ b/plugins/explore/src/components/DomainCard/DomainCard.tsx @@ -73,18 +73,3 @@ export const DomainCard = (props: { entity: DomainEntity }) => { ); }; -/* - * Copyright 2023 The Backstage Authors - * - * 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. - */ diff --git a/plugins/explore/src/components/DomainCard/index.ts b/plugins/explore/src/components/DomainCard/index.ts index 47870e5645..dbae755460 100644 --- a/plugins/explore/src/components/DomainCard/index.ts +++ b/plugins/explore/src/components/DomainCard/index.ts @@ -15,18 +15,3 @@ */ export { DomainCard } from './DomainCard'; -/* - * Copyright 2023 The Backstage Authors - * - * 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. - */ From 6b2a5fe7482b27c47dca052cb71b80ccecd30f7c Mon Sep 17 00:00:00 2001 From: sblausten Date: Tue, 4 Apr 2023 17:53:23 +0200 Subject: [PATCH 25/25] Component name update Signed-off-by: sblausten --- .changeset/itchy-kiwis-unite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/itchy-kiwis-unite.md b/.changeset/itchy-kiwis-unite.md index f4d263589b..0e3bcae282 100644 --- a/.changeset/itchy-kiwis-unite.md +++ b/.changeset/itchy-kiwis-unite.md @@ -2,4 +2,4 @@ '@backstage/plugin-explore': patch --- -Extracted generic `EntityExplorerContent` component so that it is easy to show any component kinds in their own tab in the explore page. +Extracted generic `CatalogKindExploreContent` component so that it is easy to show any component kinds in their own tab in the explore page.