Merge branch 'master' of github.com:backstage/backstage into improve-errors

This commit is contained in:
Adam Harvey
2021-02-08 11:48:19 -05:00
420 changed files with 6609 additions and 2109 deletions
+19 -6
View File
@@ -16,6 +16,7 @@
import React from 'react';
import { Route, Routes } from 'react-router-dom';
import { useEntity } from '@backstage/plugin-catalog-react';
import AuditList from './components/AuditList';
import AuditView, { AuditViewContent } from './components/AuditView';
import CreateAudit, { CreateAuditContent } from './components/CreateAudit';
@@ -35,15 +36,27 @@ export const Router = () => (
</Routes>
);
export const EmbeddedRouter = ({ entity }: { entity: Entity }) =>
!isLighthouseAvailable(entity) ? (
<MissingAnnotationEmptyState
annotation={LIGHTHOUSE_WEBSITE_URL_ANNOTATION}
/>
) : (
type Props = {
/** @deprecated The entity is now grabbed from context instead */
entity?: Entity;
};
export const EmbeddedRouter = (_props: Props) => {
const { entity } = useEntity();
if (!isLighthouseAvailable(entity)) {
return (
<MissingAnnotationEmptyState
annotation={LIGHTHOUSE_WEBSITE_URL_ANNOTATION}
/>
);
}
return (
<Routes>
<Route path="/" element={<AuditListForEntity />} />
<Route path="/audit/:id" element={<AuditViewContent />} />
<Route path="/create-audit" element={<CreateAuditContent />} />
</Routes>
);
};