Comments
Signed-off-by: Mauricio Martinez <mauricio.martinez@premise.com>
This commit is contained in:
@@ -246,12 +246,15 @@ createApiFactory({
|
||||
return req;
|
||||
};
|
||||
const definitionWidgets = defaultDefinitionWidgets();
|
||||
definitionWidgets[definitionWidgets.findIndex(obj => obj.type === 'openapi')] = {
|
||||
type: 'openapi',
|
||||
title: 'OpenAPI',
|
||||
rawLanguage: 'yaml',
|
||||
component: (definition) => <OpenApiDefinitionWidget definition={definition} requestInterceptor={requestInterceptor} />,
|
||||
};
|
||||
definitionWidgets.map(obj => {
|
||||
if (obj.type === 'openapi') {
|
||||
return {
|
||||
...obj,
|
||||
component: (definition) => <OpenApiDefinitionWidget definition={definition} requestInterceptor={requestInterceptor} />,
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
|
||||
return {
|
||||
getApiDefinitionWidget: (apiEntity: ApiEntity) => {
|
||||
|
||||
@@ -163,7 +163,7 @@ export const OpenApiDefinitionWidget: (
|
||||
// @public (undocumented)
|
||||
export type OpenApiDefinitionWidgetProps = {
|
||||
definition: string;
|
||||
requestInterceptor?: (req: Request_2) => Request_2 | Promise<Request_2>;
|
||||
requestInterceptor?: (req: any) => any | Promise<any>;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
@@ -188,13 +188,6 @@ export const ProvidingComponentsCard: (props: {
|
||||
variant?: InfoCardVariants;
|
||||
}) => JSX.Element;
|
||||
|
||||
// @public (undocumented)
|
||||
interface Request_2 {
|
||||
// (undocumented)
|
||||
[k: string]: any;
|
||||
}
|
||||
export { Request_2 as Request };
|
||||
|
||||
// @public (undocumented)
|
||||
export const TrpcApiDefinitionWidget: (
|
||||
props: TrpcApiDefinitionWidgetProps,
|
||||
|
||||
@@ -18,7 +18,6 @@ import { makeStyles } from '@material-ui/core/styles';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import SwaggerUI from 'swagger-ui-react';
|
||||
import 'swagger-ui-react/swagger-ui.css';
|
||||
import { Request } from './';
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
root: {
|
||||
@@ -137,7 +136,7 @@ const useStyles = makeStyles(theme => ({
|
||||
|
||||
export type OpenApiDefinitionProps = {
|
||||
definition: string;
|
||||
requestInterceptor?: (req: Request) => Request | Promise<Request>;
|
||||
requestInterceptor?: (req: any) => any | Promise<any>;
|
||||
};
|
||||
|
||||
export const OpenApiDefinition = ({
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import { Progress } from '@backstage/core-components';
|
||||
import React, { Suspense } from 'react';
|
||||
import { Request } from './';
|
||||
|
||||
// The swagger-ui component and related CSS has a significant size, only load it
|
||||
// if the element is actually used.
|
||||
@@ -29,7 +28,7 @@ const LazyOpenApiDefinition = React.lazy(() =>
|
||||
/** @public */
|
||||
export type OpenApiDefinitionWidgetProps = {
|
||||
definition: string;
|
||||
requestInterceptor?: (req: Request) => Request | Promise<Request>;
|
||||
requestInterceptor?: (req: any) => any | Promise<any>;
|
||||
};
|
||||
|
||||
/** @public */
|
||||
|
||||
@@ -16,8 +16,3 @@
|
||||
|
||||
export { OpenApiDefinitionWidget } from './OpenApiDefinitionWidget';
|
||||
export type { OpenApiDefinitionWidgetProps } from './OpenApiDefinitionWidget';
|
||||
|
||||
/** @public */
|
||||
export interface Request {
|
||||
[k: string]: any;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user