Merge remote-tracking branch 'origin/master' into natasha/b2b-auth

Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
Mike Lewis
2021-11-22 18:22:57 +00:00
201 changed files with 1464 additions and 610 deletions
@@ -1,8 +1,8 @@
app:
# Should be the same as backend.baseUrl when using the `app-backend` plugin
baseUrl: http://localhost:7000
baseUrl: http://localhost:7007
backend:
baseUrl: http://localhost:7000
baseUrl: http://localhost:7007
listen:
port: 7000
port: 7007
@@ -10,9 +10,9 @@ backend:
# See authenticate-api-requests.md in the contrib docs for information on the format
# authorization:
# secret: ${BACKEND_SECRET}
baseUrl: http://localhost:7000
baseUrl: http://localhost:7007
listen:
port: 7000
port: 7007
csp:
connect-src: ["'self'", 'http:', 'https:']
# Content-Security-Policy directives follow the Helmet format: https://helmetjs.github.io/#reference
@@ -10,9 +10,9 @@ describe('App', () => {
{
data: {
app: { title: 'Test' },
backend: { baseUrl: 'http://localhost:7000' },
backend: { baseUrl: 'http://localhost:7007' },
techdocs: {
storageUrl: 'http://localhost:7000/api/techdocs/static/docs',
storageUrl: 'http://localhost:7007/api/techdocs/static/docs',
},
},
context: 'test',
@@ -2,10 +2,13 @@ import React from 'react';
import { makeStyles, Theme, Grid, List, Paper } from '@material-ui/core';
import { CatalogResultListItem } from '@backstage/plugin-catalog';
import { DocsResultListItem } from '@backstage/plugin-techdocs';
import {
SearchBar,
SearchFilter,
SearchResult,
SearchType,
DefaultResultListItem,
} from '@backstage/plugin-search';
import { Content, Header, Page } from '@backstage/core-components';
@@ -39,6 +42,11 @@ const SearchPage = () => {
</Grid>
<Grid item xs={3}>
<Paper className={classes.filters}>
<SearchType
values={['techdocs', 'software-catalog']}
name="type"
defaultValue="software-catalog"
/>
<SearchFilter.Select
className={classes.filter}
name="kind"
@@ -64,6 +72,13 @@ const SearchPage = () => {
result={document}
/>
);
case 'techdocs':
return (
<DocsResultListItem
key={document.location}
result={document}
/>
);
default:
return (
<DefaultResultListItem
@@ -36,7 +36,7 @@ yarn start
Substitute `x` for actual values, or leave them as dummy values just to try out
the backend without using the auth or sentry features.
The backend starts up on port 7000 per default.
The backend starts up on port 7007 per default.
## Populating The Catalog
@@ -6,6 +6,7 @@ import {
} from '@backstage/plugin-search-backend-node';
import { PluginEnvironment } from '../types';
import { DefaultCatalogCollator } from '@backstage/plugin-catalog-backend';
import { DefaultTechDocsCollator } from '@backstage/plugin-techdocs-backend';
export default async function createPlugin({
logger,
@@ -18,7 +19,7 @@ export default async function createPlugin({
const indexBuilder = new IndexBuilder({ logger, searchEngine });
// Collators are responsible for gathering documents known to plugins. This
// particular collator gathers entities from the software catalog.
// collator gathers entities from the software catalog.
indexBuilder.addCollator({
defaultRefreshIntervalSeconds: 600,
collator: DefaultCatalogCollator.fromConfig(config, {
@@ -27,6 +28,12 @@ export default async function createPlugin({
}),
});
// collator gathers entities from techdocs.
indexBuilder.addCollator({
defaultRefreshIntervalSeconds: 600,
collator: DefaultTechDocsCollator.fromConfig(config, { discovery, logger }),
});
// The scheduler controls when documents are gathered from collators and sent
// to the search engine for indexing.
const { scheduler } = await indexBuilder.build();