Merge backstage/master
Signed-off-by: Kai Szybiak <kaiszybiak@gmail.com>
This commit is contained in:
@@ -16,13 +16,12 @@
|
||||
|
||||
import { ApiEntity } from '@backstage/catalog-model';
|
||||
import { EntityProvider } from '@backstage/plugin-catalog-react';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { ApiDocsConfig, apiDocsConfigRef } from '../../config';
|
||||
import { OpenApiDefinitionWidget } from '../OpenApiDefinitionWidget';
|
||||
import { ApiDefinitionCard } from './ApiDefinitionCard';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
|
||||
describe('<ApiDefinitionCard />', () => {
|
||||
const apiDocsConfig: jest.Mocked<ApiDocsConfig> = {
|
||||
@@ -31,10 +30,10 @@ describe('<ApiDefinitionCard />', () => {
|
||||
let Wrapper: React.ComponentType;
|
||||
|
||||
beforeEach(() => {
|
||||
const apis = ApiRegistry.with(apiDocsConfigRef, apiDocsConfig);
|
||||
|
||||
Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<ApiProvider apis={apis}>{children}</ApiProvider>
|
||||
<TestApiProvider apis={[[apiDocsConfigRef, apiDocsConfig]]}>
|
||||
{children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -15,11 +15,10 @@
|
||||
*/
|
||||
|
||||
import { ApiEntity } from '@backstage/catalog-model';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
|
||||
import React from 'react';
|
||||
import { ApiDocsConfig, apiDocsConfigRef } from '../../config';
|
||||
import { ApiTypeTitle } from './ApiTypeTitle';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
|
||||
describe('<ApiTypeTitle />', () => {
|
||||
const apiDocsConfig: jest.Mocked<ApiDocsConfig> = {
|
||||
@@ -28,10 +27,10 @@ describe('<ApiTypeTitle />', () => {
|
||||
let Wrapper: React.ComponentType;
|
||||
|
||||
beforeEach(() => {
|
||||
const apis = ApiRegistry.with(apiDocsConfigRef, apiDocsConfig);
|
||||
|
||||
Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<ApiProvider apis={apis}>{children}</ApiProvider>
|
||||
<TestApiProvider apis={[[apiDocsConfigRef, apiDocsConfig]]}>
|
||||
{children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -15,11 +15,7 @@
|
||||
*/
|
||||
|
||||
import { Entity, RELATION_MEMBER_OF } from '@backstage/catalog-model';
|
||||
import {
|
||||
ApiProvider,
|
||||
ApiRegistry,
|
||||
ConfigReader,
|
||||
} from '@backstage/core-app-api';
|
||||
import { ConfigReader } from '@backstage/core-app-api';
|
||||
import { TableColumn, TableProps } from '@backstage/core-components';
|
||||
import {
|
||||
ConfigApi,
|
||||
@@ -34,7 +30,11 @@ import {
|
||||
entityRouteRef,
|
||||
starredEntitiesApiRef,
|
||||
} from '@backstage/plugin-catalog-react';
|
||||
import { MockStorageApi, wrapInTestApp } from '@backstage/test-utils';
|
||||
import {
|
||||
MockStorageApi,
|
||||
TestApiProvider,
|
||||
wrapInTestApp,
|
||||
} from '@backstage/test-utils';
|
||||
import DashboardIcon from '@material-ui/icons/Dashboard';
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
@@ -88,8 +88,8 @@ describe('ApiCatalogPage', () => {
|
||||
const renderWrapped = (children: React.ReactNode) =>
|
||||
render(
|
||||
wrapInTestApp(
|
||||
<ApiProvider
|
||||
apis={ApiRegistry.from([
|
||||
<TestApiProvider
|
||||
apis={[
|
||||
[catalogApiRef, catalogApi],
|
||||
[configApiRef, configApi],
|
||||
[storageApiRef, storageApi],
|
||||
@@ -98,10 +98,10 @@ describe('ApiCatalogPage', () => {
|
||||
new DefaultStarredEntitiesApi({ storageApi }),
|
||||
],
|
||||
[apiDocsConfigRef, apiDocsConfig],
|
||||
])}
|
||||
]}
|
||||
>
|
||||
{children}
|
||||
</ApiProvider>,
|
||||
</TestApiProvider>,
|
||||
{
|
||||
mountedRoutes: {
|
||||
'/catalog/:namespace/:kind/:name': entityRouteRef,
|
||||
|
||||
@@ -21,12 +21,11 @@ import {
|
||||
EntityProvider,
|
||||
entityRouteRef,
|
||||
} from '@backstage/plugin-catalog-react';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { ApiDocsConfig, apiDocsConfigRef } from '../../config';
|
||||
import { ConsumedApisCard } from './ConsumedApisCard';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
|
||||
describe('<ConsumedApisCard />', () => {
|
||||
const apiDocsConfig: jest.Mocked<ApiDocsConfig> = {
|
||||
@@ -43,13 +42,15 @@ describe('<ConsumedApisCard />', () => {
|
||||
let Wrapper: React.ComponentType;
|
||||
|
||||
beforeEach(() => {
|
||||
const apis = ApiRegistry.with(catalogApiRef, catalogApi).with(
|
||||
apiDocsConfigRef,
|
||||
apiDocsConfig,
|
||||
);
|
||||
|
||||
Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<ApiProvider apis={apis}>{children}</ApiProvider>
|
||||
<TestApiProvider
|
||||
apis={[
|
||||
[catalogApiRef, catalogApi],
|
||||
[apiDocsConfigRef, apiDocsConfig],
|
||||
]}
|
||||
>
|
||||
{children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -21,12 +21,11 @@ import {
|
||||
EntityProvider,
|
||||
entityRouteRef,
|
||||
} from '@backstage/plugin-catalog-react';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { ApiDocsConfig, apiDocsConfigRef } from '../../config';
|
||||
import { HasApisCard } from './HasApisCard';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
|
||||
describe('<HasApisCard />', () => {
|
||||
const apiDocsConfig: jest.Mocked<ApiDocsConfig> = {
|
||||
@@ -43,13 +42,15 @@ describe('<HasApisCard />', () => {
|
||||
let Wrapper: React.ComponentType;
|
||||
|
||||
beforeEach(() => {
|
||||
const apis = ApiRegistry.with(catalogApiRef, catalogApi).with(
|
||||
apiDocsConfigRef,
|
||||
apiDocsConfig,
|
||||
);
|
||||
|
||||
Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<ApiProvider apis={apis}>{children}</ApiProvider>
|
||||
<TestApiProvider
|
||||
apis={[
|
||||
[catalogApiRef, catalogApi],
|
||||
[apiDocsConfigRef, apiDocsConfig],
|
||||
]}
|
||||
>
|
||||
{children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -21,12 +21,11 @@ import {
|
||||
EntityProvider,
|
||||
entityRouteRef,
|
||||
} from '@backstage/plugin-catalog-react';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { ApiDocsConfig, apiDocsConfigRef } from '../../config';
|
||||
import { ProvidedApisCard } from './ProvidedApisCard';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
|
||||
describe('<ProvidedApisCard />', () => {
|
||||
const apiDocsConfig: jest.Mocked<ApiDocsConfig> = {
|
||||
@@ -43,13 +42,15 @@ describe('<ProvidedApisCard />', () => {
|
||||
let Wrapper: React.ComponentType;
|
||||
|
||||
beforeEach(() => {
|
||||
const apis = ApiRegistry.with(catalogApiRef, catalogApi).with(
|
||||
apiDocsConfigRef,
|
||||
apiDocsConfig,
|
||||
);
|
||||
|
||||
Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<ApiProvider apis={apis}>{children}</ApiProvider>
|
||||
<TestApiProvider
|
||||
apis={[
|
||||
[catalogApiRef, catalogApi],
|
||||
[apiDocsConfigRef, apiDocsConfig],
|
||||
]}
|
||||
>
|
||||
{children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -21,11 +21,10 @@ import {
|
||||
EntityProvider,
|
||||
entityRouteRef,
|
||||
} from '@backstage/plugin-catalog-react';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { ConsumingComponentsCard } from './ConsumingComponentsCard';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
|
||||
describe('<ConsumingComponentsCard />', () => {
|
||||
const catalogApi: jest.Mocked<CatalogApi> = {
|
||||
@@ -39,10 +38,10 @@ describe('<ConsumingComponentsCard />', () => {
|
||||
let Wrapper: React.ComponentType;
|
||||
|
||||
beforeEach(() => {
|
||||
const apis = ApiRegistry.with(catalogApiRef, catalogApi);
|
||||
|
||||
Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<ApiProvider apis={apis}>{children}</ApiProvider>
|
||||
<TestApiProvider apis={[[catalogApiRef, catalogApi]]}>
|
||||
{children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -21,11 +21,10 @@ import {
|
||||
EntityProvider,
|
||||
entityRouteRef,
|
||||
} from '@backstage/plugin-catalog-react';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { ProvidingComponentsCard } from './ProvidingComponentsCard';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
|
||||
describe('<ProvidingComponentsCard />', () => {
|
||||
const catalogApi: jest.Mocked<CatalogApi> = {
|
||||
@@ -39,10 +38,10 @@ describe('<ProvidingComponentsCard />', () => {
|
||||
let Wrapper: React.ComponentType;
|
||||
|
||||
beforeEach(() => {
|
||||
const apis = ApiRegistry.with(catalogApiRef, catalogApi);
|
||||
|
||||
Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<ApiProvider apis={apis}>{children}</ApiProvider>
|
||||
<TestApiProvider apis={[[catalogApiRef, catalogApi]]}>
|
||||
{children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -22,18 +22,9 @@ import 'swagger-ui-react/swagger-ui.css';
|
||||
const useStyles = makeStyles(theme => ({
|
||||
root: {
|
||||
'& .swagger-ui': {
|
||||
fontFamily: 'inherit',
|
||||
fontFamily: theme.typography.fontFamily,
|
||||
color: theme.palette.text.primary,
|
||||
|
||||
[`& .info h1,
|
||||
.info h2,
|
||||
.info h3,
|
||||
.info h4,
|
||||
.info h5,
|
||||
.info h6`]: {
|
||||
fontFamily: 'inherit',
|
||||
color: theme.palette.text.primary,
|
||||
},
|
||||
[`& .scheme-container`]: {
|
||||
backgroundColor: theme.palette.background.default,
|
||||
},
|
||||
@@ -41,7 +32,7 @@ const useStyles = makeStyles(theme => ({
|
||||
.opblock-tag small,
|
||||
table thead tr td,
|
||||
table thead tr th`]: {
|
||||
fontFamily: 'inherit',
|
||||
fontFamily: theme.typography.fontFamily,
|
||||
color: theme.palette.text.primary,
|
||||
borderColor: theme.palette.divider,
|
||||
},
|
||||
@@ -49,34 +40,30 @@ const useStyles = makeStyles(theme => ({
|
||||
section.models.is-open h4`]: {
|
||||
borderColor: theme.palette.divider,
|
||||
},
|
||||
[`& .opblock .opblock-summary-description,
|
||||
.parameter__type,
|
||||
table.headers td,
|
||||
.model-title,
|
||||
.model .property.primitive,
|
||||
section h3`]: {
|
||||
fontFamily: 'inherit',
|
||||
color: theme.palette.text.secondary,
|
||||
[`& .model-title,
|
||||
.model .renderedMarkdown,
|
||||
.model .description`]: {
|
||||
fontFamily: theme.typography.fontFamily,
|
||||
fontWeight: theme.typography.fontWeightRegular,
|
||||
},
|
||||
[`& .opblock .opblock-summary-operation-id,
|
||||
.opblock .opblock-summary-path,
|
||||
.opblock .opblock-summary-path__deprecated,
|
||||
.opblock .opblock-section-header h4,
|
||||
[`& h1, h2, h3, h4, h5, h6,
|
||||
.errors h4, .error h4, .opblock h4, section.models h4,
|
||||
.response-control-media-type__accept-message,
|
||||
.opblock-summary-description,
|
||||
.opblock-summary-operation-id,
|
||||
.opblock-summary-path,
|
||||
.opblock-summary-path__deprecated,
|
||||
.opblock-external-docs-wrapper,
|
||||
.opblock-section-header .btn,
|
||||
.opblock-section-header>label,
|
||||
.scheme-container .schemes>label,a.nostyle,
|
||||
.parameter__name,
|
||||
.response-col_status,
|
||||
.response-col_links,
|
||||
.responses-inner h4,
|
||||
.responses-inner h5,
|
||||
.opblock-section-header .btn,
|
||||
.tab li,
|
||||
.info li,
|
||||
.info p,
|
||||
.info table,
|
||||
section.models h4,
|
||||
.error .btn,
|
||||
.info .title,
|
||||
table.model tr.description,
|
||||
.property-row`]: {
|
||||
fontFamily: 'inherit',
|
||||
.info .base-url`]: {
|
||||
fontFamily: theme.typography.fontFamily,
|
||||
color: theme.palette.text.primary,
|
||||
},
|
||||
[`& .opblock .opblock-section-header,
|
||||
@@ -88,22 +75,57 @@ const useStyles = makeStyles(theme => ({
|
||||
.parameter__in`]: {
|
||||
color: theme.palette.text.disabled,
|
||||
},
|
||||
[`& .opblock-description-wrapper p,
|
||||
.opblock-external-docs-wrapper p,
|
||||
.opblock-title_normal p,
|
||||
.response-control-media-type__accept-message,
|
||||
.opblock .opblock-section-header>label,
|
||||
.scheme-container .schemes>label,
|
||||
.info .base-url,
|
||||
.model`]: {
|
||||
color: theme.palette.text.hint,
|
||||
[`& table.model,
|
||||
.parameter__type,
|
||||
.model.model-title,
|
||||
.model-title,
|
||||
.model span,
|
||||
.model .brace-open,
|
||||
.model .brace-close,
|
||||
.model .property.primitive,
|
||||
.model .renderedMarkdown,
|
||||
.model .description,
|
||||
.errors small`]: {
|
||||
color: theme.palette.text.secondary,
|
||||
},
|
||||
[`& .parameter__name.required:after`]: {
|
||||
color: theme.palette.warning.dark,
|
||||
},
|
||||
[`& .prop-type`]: {
|
||||
[`& table.model,
|
||||
table.model .model,
|
||||
.opblock-external-docs-wrapper`]: {
|
||||
fontSize: theme.typography.fontSize,
|
||||
},
|
||||
[`& table.headers td`]: {
|
||||
color: theme.palette.text.primary,
|
||||
fontWeight: theme.typography.fontWeightRegular,
|
||||
},
|
||||
[`& .model-hint`]: {
|
||||
color: theme.palette.text.hint,
|
||||
backgroundColor: theme.palette.background.paper,
|
||||
},
|
||||
[`& .opblock-summary-method,
|
||||
.info a`]: {
|
||||
fontFamily: theme.typography.fontFamily,
|
||||
},
|
||||
[`& .info, .opblock, .tab`]: {
|
||||
[`& li, p`]: {
|
||||
fontFamily: theme.typography.fontFamily,
|
||||
color: theme.palette.text.primary,
|
||||
},
|
||||
},
|
||||
[`& a`]: {
|
||||
color: theme.palette.primary.main,
|
||||
},
|
||||
[`& .renderedMarkdown code`]: {
|
||||
color: theme.palette.secondary.light,
|
||||
},
|
||||
[`& .property-row td:first-child`]: {
|
||||
color: theme.palette.text.primary,
|
||||
},
|
||||
[`& span.prop-type`]: {
|
||||
color: theme.palette.success.light,
|
||||
},
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user