diff --git a/app-config.yaml b/app-config.yaml index 8a0199e30a..361ba8e7c8 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -50,6 +50,20 @@ newrelic: baseUrl: 'https://api.newrelic.com/v2' key: NEW_RELIC_REST_API_KEY +catalog: + entities: + [ + 'artist-lookup-component.yaml', + 'playback-order-component.yaml', + 'podcast-api-component.yaml', + 'queue-proxy-component.yaml', + 'searcher-component.yaml', + 'playback-lib-component.yaml', + 'www-artist-component.yaml', + 'shuffle-api-component.yaml', + ] + baseUrl: 'https://github.com/spotify/backstage/blob/master/packages/catalog-model/examples' + auth: providers: google: @@ -124,7 +138,7 @@ auth: env: AUTH_AUTH0_DOMAIN microsoft: development: - appOrigin: "http://localhost:3000/" + appOrigin: 'http://localhost:3000/' secure: false clientId: $secret: @@ -134,4 +148,4 @@ auth: env: AUTH_MICROSOFT_CLIENT_SECRET tenantId: $secret: - env: AUTH_MICROSOFT_TENANT_ID \ No newline at end of file + env: AUTH_MICROSOFT_TENANT_ID diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index 3eac1b7a30..a73fc5df96 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ -import { Entity } from '@backstage/catalog-model'; import { configApiRef, Content, @@ -27,9 +26,8 @@ import { rootRoute as scaffolderRootRoute } from '@backstage/plugin-scaffolder'; import { Button, makeStyles } from '@material-ui/core'; import SettingsIcon from '@material-ui/icons/Settings'; import StarIcon from '@material-ui/icons/Star'; -import React, { useEffect, useMemo, useState } from 'react'; +import React, { useMemo, useState } from 'react'; import { Link as RouterLink } from 'react-router-dom'; -import { catalogApiRef } from '../../api/types'; import { EntityFilterGroupsProvider, useFilteredEntities } from '../../filter'; import { useStarredEntities } from '../../hooks/useStarredEntites'; import { ButtonGroup, CatalogFilter } from '../CatalogFilter/CatalogFilter'; @@ -46,9 +44,6 @@ const useStyles = makeStyles(theme => ({ gridTemplateColumns: '250px 1fr', gridColumnGap: theme.spacing(2), }, - mockDataButton: { - marginRight: '20px', - }, })); const CatalogPageContents = () => { @@ -63,42 +58,9 @@ const CatalogPageContents = () => { const userId = useApi(identityApiRef).getUserId(); const [selectedTab, setSelectedTab] = useState(); const [selectedSidebarItem, setSelectedSidebarItem] = useState(); - const [entitiesState, setEntitiesState] = useState([]); - const [errorState, setError] = useState(); - - useEffect(() => { - setError(error); - setEntitiesState(matchingEntities); - }, [error, matchingEntities]); - const catalogApi = useApi(catalogApiRef); const orgName = useApi(configApiRef).getOptionalString('organization.name') ?? 'Company'; - const addMockData = async () => { - try { - const dummyEntities = [ - 'artist-lookup-component.yaml', - 'playback-order-component.yaml', - 'podcast-api-component.yaml', - 'queue-proxy-component.yaml', - 'searcher-component.yaml', - 'playback-lib-component.yaml', - 'www-artist-component.yaml', - 'shuffle-api-component.yaml', - ]; - const _promises = dummyEntities.map(file => - catalogApi.addLocation( - 'github', - `https://github.com/spotify/backstage/blob/master/packages/catalog-model/examples/${file}`, - ), - ); - await Promise.all(_promises); - const data: Entity[] = await catalogApi.getEntities(); - setEntitiesState(data); - } catch (err) { - setError(err); - } - }; const tabs = useMemo( () => [ { @@ -167,16 +129,6 @@ const CatalogPageContents = () => { - {entitiesState && entitiesState.length === 0 ? ( - - ) : null}