diff --git a/packages/app/src/apis.ts b/packages/app/src/apis.ts index a6d9987819..9bfc618216 100644 --- a/packages/app/src/apis.ts +++ b/packages/app/src/apis.ts @@ -32,8 +32,6 @@ import { githubAuthApiRef, storageApiRef, WebStorage, - identityApiRef, - MockIdentity, } from '@backstage/core'; import { @@ -54,8 +52,6 @@ export const apis = (config: ConfigApi) => { const builder = ApiRegistry.builder(); - builder.add(identityApiRef, new MockIdentity()); - const alertApi = builder.add(alertApiRef, new AlertApiForwarder()); const errorApi = builder.add( errorApiRef, diff --git a/packages/core-api/src/apis/implementations/IdentityApi/Identity.ts b/packages/core-api/src/apis/implementations/IdentityApi/Identity.ts deleted file mode 100644 index 6f2035d1b8..0000000000 --- a/packages/core-api/src/apis/implementations/IdentityApi/Identity.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2020 Spotify AB - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { IdentityApi } from '../..'; - -export class MockIdentity implements IdentityApi { - getUserId(): string { - return ''; - } - getIdToken(): string | undefined { - throw new Error('Method not implemented.'); - } -} diff --git a/packages/core-api/src/apis/implementations/IdentityApi/index.ts b/packages/core-api/src/apis/implementations/IdentityApi/index.ts deleted file mode 100644 index 1e57036685..0000000000 --- a/packages/core-api/src/apis/implementations/IdentityApi/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2020 Spotify AB - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export * from './Identity'; diff --git a/packages/core-api/src/apis/implementations/index.ts b/packages/core-api/src/apis/implementations/index.ts index 885082ce09..e6d23fee21 100644 --- a/packages/core-api/src/apis/implementations/index.ts +++ b/packages/core-api/src/apis/implementations/index.ts @@ -26,4 +26,3 @@ export * from './ConfigApi'; export * from './ErrorApi'; export * from './OAuthRequestApi'; export * from './StorageApi'; -export * from './IdentityApi'; diff --git a/packages/storybook/.storybook/apis.js b/packages/storybook/.storybook/apis.js index 83f6bbca23..d3c78fa2d6 100644 --- a/packages/storybook/.storybook/apis.js +++ b/packages/storybook/.storybook/apis.js @@ -13,7 +13,6 @@ import { GoogleAuth, GithubAuth, identityApiRef, - MockIdentity, } from '@backstage/core'; const builder = ApiRegistry.builder(); diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx index 4a9319ea3b..8fae75b68b 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx @@ -44,6 +44,7 @@ describe('CatalogPage', () => { kind: 'Component', spec: { owner: 'tools@example.com', + type: 'service', }, }, { @@ -54,6 +55,7 @@ describe('CatalogPage', () => { kind: 'Component', spec: { owner: 'not-tools@example.com', + type: 'service', }, }, ] as Entity[]), @@ -83,7 +85,6 @@ describe('CatalogPage', () => { ), ); await waitFor(() => screen.getByText(/All Services \(2\)/)); - expect(screen.getByText(/All Services \(2\)/)).toBeInTheDocument(); }); it('should filter by owner', async () => { render( @@ -102,6 +103,5 @@ describe('CatalogPage', () => { ); fireEvent.click(screen.getByText(/Owned/)); await waitFor(() => screen.getByText(/Owned \(1\)/)); - expect(screen.getByText(/Owned \(1\)/)).toBeInTheDocument(); }); }); diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index 68506136d2..e9dd2a6295 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -61,11 +61,10 @@ export const CatalogPage: FC<{}> = () => { error, loading, selectedFilter, + setSelectedFilter, toggleStarredEntity, isStarredEntity, - setSelectedFilter, - selectedTypeFilter: selectedTab, - selectTypeFilter: setSelectedTab, + selectTypeFilter, } = useEntities(); const filteredEntities = entitiesByFilter[selectedFilter ?? EntityGroup.ALL]; @@ -123,7 +122,7 @@ export const CatalogPage: FC<{}> = () => { { - setSelectedTab(labeledEntityTypes[index as number].id); + selectTypeFilter(labeledEntityTypes[index as number].id); }} />