just some more api report cleanup
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-graph': patch
|
||||
'@backstage/plugin-catalog-react': patch
|
||||
'@backstage/plugin-graphiql': patch
|
||||
'@backstage/plugin-home': patch
|
||||
'@backstage/plugin-org': patch
|
||||
---
|
||||
|
||||
Minor API report cleanup
|
||||
@@ -18,10 +18,7 @@ import { RouteRef } from '@backstage/core-plugin-api';
|
||||
export const ALL_RELATION_PAIRS: RelationPairs;
|
||||
|
||||
// @public
|
||||
export const CatalogGraphPage: ({
|
||||
relationPairs,
|
||||
initialState,
|
||||
}: {
|
||||
export const CatalogGraphPage: (props: {
|
||||
relationPairs?: RelationPairs | undefined;
|
||||
initialState?:
|
||||
| {
|
||||
@@ -66,19 +63,7 @@ export enum Direction {
|
||||
}
|
||||
|
||||
// @public
|
||||
export const EntityCatalogGraphCard: ({
|
||||
variant,
|
||||
relationPairs,
|
||||
maxDepth,
|
||||
unidirectional,
|
||||
mergeRelations,
|
||||
kinds,
|
||||
relations,
|
||||
direction,
|
||||
height,
|
||||
title,
|
||||
zoom,
|
||||
}: {
|
||||
export const EntityCatalogGraphCard: (props: {
|
||||
variant?: InfoCardVariants | undefined;
|
||||
relationPairs?: RelationPairs | undefined;
|
||||
maxDepth?: number | undefined;
|
||||
@@ -116,21 +101,7 @@ export type EntityNodeData = {
|
||||
};
|
||||
|
||||
// @public
|
||||
export const EntityRelationsGraph: ({
|
||||
rootEntityNames,
|
||||
maxDepth,
|
||||
unidirectional,
|
||||
mergeRelations,
|
||||
kinds,
|
||||
relations,
|
||||
direction,
|
||||
onNodeClick,
|
||||
relationPairs,
|
||||
className,
|
||||
zoom,
|
||||
renderNode,
|
||||
renderLabel,
|
||||
}: {
|
||||
export const EntityRelationsGraph: (props: {
|
||||
rootEntityNames: CompoundEntityRef | CompoundEntityRef[];
|
||||
maxDepth?: number | undefined;
|
||||
unidirectional?: boolean | undefined;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
getCompoundEntityRef,
|
||||
parseEntityRef,
|
||||
@@ -51,19 +52,7 @@ const useStyles = makeStyles<Theme, { height: number | undefined }>({
|
||||
},
|
||||
});
|
||||
|
||||
export const CatalogGraphCard = ({
|
||||
variant = 'gridItem',
|
||||
relationPairs = ALL_RELATION_PAIRS,
|
||||
maxDepth = 1,
|
||||
unidirectional = true,
|
||||
mergeRelations = true,
|
||||
kinds,
|
||||
relations,
|
||||
direction = Direction.LEFT_RIGHT,
|
||||
height,
|
||||
title = 'Relations',
|
||||
zoom = 'enable-on-click',
|
||||
}: {
|
||||
export const CatalogGraphCard = (props: {
|
||||
variant?: InfoCardVariants;
|
||||
relationPairs?: RelationPairs;
|
||||
maxDepth?: number;
|
||||
@@ -76,6 +65,20 @@ export const CatalogGraphCard = ({
|
||||
title?: string;
|
||||
zoom?: 'enabled' | 'disabled' | 'enable-on-click';
|
||||
}) => {
|
||||
const {
|
||||
variant = 'gridItem',
|
||||
relationPairs = ALL_RELATION_PAIRS,
|
||||
maxDepth = 1,
|
||||
unidirectional = true,
|
||||
mergeRelations = true,
|
||||
kinds,
|
||||
relations,
|
||||
direction = Direction.LEFT_RIGHT,
|
||||
height,
|
||||
title = 'Relations',
|
||||
zoom = 'enable-on-click',
|
||||
} = props;
|
||||
|
||||
const { entity } = useEntity();
|
||||
const entityName = getCompoundEntityRef(entity);
|
||||
const catalogEntityRoute = useRouteRef(entityRouteRef);
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { parseEntityRef } from '@backstage/catalog-model';
|
||||
import {
|
||||
Content,
|
||||
@@ -98,10 +99,7 @@ const useStyles = makeStyles(theme => ({
|
||||
},
|
||||
}));
|
||||
|
||||
export const CatalogGraphPage = ({
|
||||
relationPairs = ALL_RELATION_PAIRS,
|
||||
initialState,
|
||||
}: {
|
||||
export const CatalogGraphPage = (props: {
|
||||
relationPairs?: RelationPairs;
|
||||
initialState?: {
|
||||
selectedRelations?: string[];
|
||||
@@ -114,6 +112,8 @@ export const CatalogGraphPage = ({
|
||||
showFilters?: boolean;
|
||||
};
|
||||
}) => {
|
||||
const { relationPairs = ALL_RELATION_PAIRS, initialState } = props;
|
||||
|
||||
const navigate = useNavigate();
|
||||
const classes = useStyles();
|
||||
const catalogEntityRoute = useRouteRef(entityRouteRef);
|
||||
|
||||
+18
-15
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
CompoundEntityRef,
|
||||
stringifyEntityRef,
|
||||
@@ -67,21 +68,7 @@ const useStyles = makeStyles(theme => ({
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export const EntityRelationsGraph = ({
|
||||
rootEntityNames,
|
||||
maxDepth = Number.POSITIVE_INFINITY,
|
||||
unidirectional = true,
|
||||
mergeRelations = true,
|
||||
kinds,
|
||||
relations,
|
||||
direction = Direction.LEFT_RIGHT,
|
||||
onNodeClick,
|
||||
relationPairs = ALL_RELATION_PAIRS,
|
||||
className,
|
||||
zoom = 'enabled',
|
||||
renderNode,
|
||||
renderLabel,
|
||||
}: {
|
||||
export const EntityRelationsGraph = (props: {
|
||||
rootEntityNames: CompoundEntityRef | CompoundEntityRef[];
|
||||
maxDepth?: number;
|
||||
unidirectional?: boolean;
|
||||
@@ -96,6 +83,22 @@ export const EntityRelationsGraph = ({
|
||||
renderNode?: DependencyGraphTypes.RenderNodeFunction<EntityNode>;
|
||||
renderLabel?: DependencyGraphTypes.RenderLabelFunction<EntityEdge>;
|
||||
}) => {
|
||||
const {
|
||||
rootEntityNames,
|
||||
maxDepth = Number.POSITIVE_INFINITY,
|
||||
unidirectional = true,
|
||||
mergeRelations = true,
|
||||
kinds,
|
||||
relations,
|
||||
direction = Direction.LEFT_RIGHT,
|
||||
onNodeClick,
|
||||
relationPairs = ALL_RELATION_PAIRS,
|
||||
className,
|
||||
zoom = 'enabled',
|
||||
renderNode,
|
||||
renderLabel,
|
||||
} = props;
|
||||
|
||||
const theme = useTheme();
|
||||
const classes = useStyles();
|
||||
const rootEntityRefs = useMemo(
|
||||
|
||||
@@ -236,10 +236,7 @@ export class EntityOwnerFilter implements EntityFilter {
|
||||
export const EntityOwnerPicker: () => JSX.Element | null;
|
||||
|
||||
// @public
|
||||
export const EntityProvider: ({
|
||||
entity,
|
||||
children,
|
||||
}: EntityProviderProps) => JSX.Element;
|
||||
export const EntityProvider: (props: EntityProviderProps) => JSX.Element;
|
||||
|
||||
// @public
|
||||
export interface EntityProviderProps {
|
||||
|
||||
+2
-2
@@ -61,14 +61,14 @@ describe('UnregisterEntityDialog', () => {
|
||||
spec: {},
|
||||
};
|
||||
|
||||
const Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
const Wrapper = (props: { children?: React.ReactNode }) => (
|
||||
<TestApiProvider
|
||||
apis={[
|
||||
[catalogApiRef, new CatalogClient({ discoveryApi })],
|
||||
[alertApiRef, alertApi],
|
||||
]}
|
||||
>
|
||||
{children}
|
||||
{props.children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
|
||||
|
||||
+2
-2
@@ -46,9 +46,9 @@ describe('useUnregisterEntityDialogState', () => {
|
||||
};
|
||||
const catalogApi = catalogApiMock as Partial<CatalogApi> as CatalogApi;
|
||||
|
||||
const Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
const Wrapper = (props: { children?: React.ReactNode }) => (
|
||||
<TestApiProvider apis={[[catalogApiRef, catalogApi]]}>
|
||||
{children}
|
||||
{props.children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
|
||||
|
||||
@@ -297,10 +297,10 @@ describe('<UserListPicker />', () => {
|
||||
`('filter resetting for $type entities', ({ type, filterFn }) => {
|
||||
let updateFilters: jest.Mock;
|
||||
|
||||
const picker = ({ loading }: { loading: boolean }) => (
|
||||
const picker = (props: { loading: boolean }) => (
|
||||
<ApiProvider apis={apis}>
|
||||
<MockEntityListContextProvider
|
||||
value={{ backendEntities, updateFilters, loading }}
|
||||
value={{ backendEntities, updateFilters, loading: props.loading }}
|
||||
>
|
||||
<UserListPicker initialFilter={type} />
|
||||
</MockEntityListContextProvider>
|
||||
|
||||
@@ -85,13 +85,13 @@ export interface EntityProviderProps {
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export const EntityProvider = ({ entity, children }: EntityProviderProps) => (
|
||||
export const EntityProvider = (props: EntityProviderProps) => (
|
||||
<AsyncEntityProvider
|
||||
entity={entity}
|
||||
loading={!Boolean(entity)}
|
||||
entity={props.entity}
|
||||
loading={!Boolean(props.entity)}
|
||||
error={undefined}
|
||||
refresh={undefined}
|
||||
children={children}
|
||||
children={props.children}
|
||||
/>
|
||||
);
|
||||
|
||||
|
||||
@@ -37,14 +37,14 @@ describe('useEntityOwnership', () => {
|
||||
const identityApi = mockIdentityApi as unknown as IdentityApi;
|
||||
const catalogApi = mockCatalogApi as unknown as CatalogApi;
|
||||
|
||||
const Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
const Wrapper = (props: { children?: React.ReactNode }) => (
|
||||
<TestApiProvider
|
||||
apis={[
|
||||
[identityApiRef, identityApi],
|
||||
[catalogApiRef, catalogApi],
|
||||
]}
|
||||
>
|
||||
{children}
|
||||
{props.children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@ describe('useStarredEntities', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
mockApi = new MockStarredEntitiesApi();
|
||||
wrapper = ({ children }: PropsWithChildren<{}>) => (
|
||||
wrapper = (props: PropsWithChildren<{}>) => (
|
||||
<TestApiProvider apis={[[starredEntitiesApiRef, mockApi]]}>
|
||||
{children}
|
||||
{props.children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -30,9 +30,9 @@ describe('useStarredEntity', () => {
|
||||
let wrapper: React.ComponentType;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = ({ children }: PropsWithChildren<{}>) => (
|
||||
wrapper = (props: PropsWithChildren<{}>) => (
|
||||
<TestApiProvider apis={[[starredEntitiesApiRef, mockStarredEntitiesApi]]}>
|
||||
{children}
|
||||
{props.children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -12,9 +12,7 @@ import { IconComponent } from '@backstage/core-plugin-api';
|
||||
import { OAuthApi } from '@backstage/core-plugin-api';
|
||||
import { RouteRef } from '@backstage/core-plugin-api';
|
||||
|
||||
// Warning: (ae-missing-release-tag) "EndpointConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
// @public
|
||||
export type EndpointConfig = {
|
||||
id: string;
|
||||
title: string;
|
||||
@@ -25,8 +23,6 @@ export type EndpointConfig = {
|
||||
};
|
||||
};
|
||||
|
||||
// Warning: (ae-missing-release-tag) "GithubEndpointConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export type GithubEndpointConfig = {
|
||||
id: string;
|
||||
@@ -36,42 +32,28 @@ export type GithubEndpointConfig = {
|
||||
githubAuthApi: OAuthApi;
|
||||
};
|
||||
|
||||
// Warning: (ae-missing-release-tag) "GraphiQLIcon" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const GraphiQLIcon: IconComponent;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "GraphiQLPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const GraphiQLPage: () => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "graphiqlPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
const graphiqlPlugin: BackstagePlugin<{}, {}>;
|
||||
export { graphiqlPlugin };
|
||||
export { graphiqlPlugin as plugin };
|
||||
|
||||
// Warning: (ae-missing-release-tag) "graphiQLRouteRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const graphiQLRouteRef: RouteRef<undefined>;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "GraphQLBrowseApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export type GraphQLBrowseApi = {
|
||||
getEndpoints(): Promise<GraphQLEndpoint[]>;
|
||||
};
|
||||
|
||||
// Warning: (ae-missing-release-tag) "graphQlBrowseApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const graphQlBrowseApiRef: ApiRef<GraphQLBrowseApi>;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "GraphQLEndpoint" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export type GraphQLEndpoint = {
|
||||
id: string;
|
||||
@@ -79,8 +61,6 @@ export type GraphQLEndpoint = {
|
||||
fetcher: (body: any) => Promise<any>;
|
||||
};
|
||||
|
||||
// Warning: (ae-missing-release-tag) "GraphQLEndpoints" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export class GraphQLEndpoints implements GraphQLBrowseApi {
|
||||
// (undocumented)
|
||||
@@ -92,8 +72,6 @@ export class GraphQLEndpoints implements GraphQLBrowseApi {
|
||||
static github(config: GithubEndpointConfig): GraphQLEndpoint;
|
||||
}
|
||||
|
||||
// Warning: (ae-missing-release-tag) "GraphiQLPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const Router: () => JSX.Element;
|
||||
|
||||
|
||||
@@ -47,7 +47,9 @@ type GraphiQLBrowserProps = {
|
||||
endpoints: GraphQLEndpoint[];
|
||||
};
|
||||
|
||||
export const GraphiQLBrowser = ({ endpoints }: GraphiQLBrowserProps) => {
|
||||
export const GraphiQLBrowser = (props: GraphiQLBrowserProps) => {
|
||||
const { endpoints } = props;
|
||||
|
||||
const classes = useStyles();
|
||||
const [tabIndex, setTabIndex] = useState(0);
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import {
|
||||
Progress,
|
||||
} from '@backstage/core-components';
|
||||
|
||||
/** @public */
|
||||
export const GraphiQLPage = () => {
|
||||
const graphQlBrowseApi = useApi(graphQlBrowseApiRef);
|
||||
const endpoints = useAsync(() => graphQlBrowseApi.getEndpoints());
|
||||
|
||||
@@ -31,5 +31,7 @@ export {
|
||||
export { GraphiQLPage as Router } from './components';
|
||||
export * from './lib/api';
|
||||
export * from './route-refs';
|
||||
|
||||
/** @public */
|
||||
export const GraphiQLIcon: IconComponent =
|
||||
GraphiQLIconComponent as IconComponent;
|
||||
|
||||
@@ -17,7 +17,11 @@
|
||||
import { GraphQLBrowseApi, GraphQLEndpoint } from './types';
|
||||
import { ErrorApi, OAuthApi } from '@backstage/core-plugin-api';
|
||||
|
||||
// Helper for generic http endpoints
|
||||
/**
|
||||
* Helper for generic http endpoints
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type EndpointConfig = {
|
||||
id: string;
|
||||
title: string;
|
||||
@@ -29,6 +33,7 @@ export type EndpointConfig = {
|
||||
headers?: { [name in string]: string };
|
||||
};
|
||||
|
||||
/** @public */
|
||||
export type GithubEndpointConfig = {
|
||||
id: string;
|
||||
title: string;
|
||||
@@ -46,6 +51,7 @@ export type GithubEndpointConfig = {
|
||||
githubAuthApi: OAuthApi;
|
||||
};
|
||||
|
||||
/** @public */
|
||||
export class GraphQLEndpoints implements GraphQLBrowseApi {
|
||||
// Create a support
|
||||
static create(config: EndpointConfig): GraphQLEndpoint {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
import { createApiRef } from '@backstage/core-plugin-api';
|
||||
|
||||
/** @public */
|
||||
export type GraphQLEndpoint = {
|
||||
// Will be used as unique key for storing history and query data
|
||||
id: string;
|
||||
@@ -29,10 +30,12 @@ export type GraphQLEndpoint = {
|
||||
fetcher: (body: any) => Promise<any>;
|
||||
};
|
||||
|
||||
/** @public */
|
||||
export type GraphQLBrowseApi = {
|
||||
getEndpoints(): Promise<GraphQLEndpoint[]>;
|
||||
};
|
||||
|
||||
/** @public */
|
||||
export const graphQlBrowseApiRef = createApiRef<GraphQLBrowseApi>({
|
||||
id: 'plugin.graphiql.browse',
|
||||
});
|
||||
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
import { graphQlBrowseApiRef, GraphQLEndpoints } from './lib/api';
|
||||
import { graphiQLRouteRef } from './route-refs';
|
||||
|
||||
/** @public */
|
||||
export const graphiqlPlugin = createPlugin({
|
||||
id: 'graphiql',
|
||||
apis: [
|
||||
@@ -40,6 +41,7 @@ export const graphiqlPlugin = createPlugin({
|
||||
],
|
||||
});
|
||||
|
||||
/** @public */
|
||||
export const GraphiQLPage = graphiqlPlugin.provide(
|
||||
createRoutableExtension({
|
||||
name: 'GraphiQLPage',
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
import { createRouteRef } from '@backstage/core-plugin-api';
|
||||
|
||||
/** @public */
|
||||
export const graphiQLRouteRef = createRouteRef({
|
||||
id: 'graphiql-root',
|
||||
});
|
||||
|
||||
@@ -19,18 +19,8 @@ export type ClockConfig = {
|
||||
timeZone: string;
|
||||
};
|
||||
|
||||
// Warning: (ae-missing-release-tag) "ComponentAccordion" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const ComponentAccordion: ({
|
||||
title,
|
||||
expanded,
|
||||
Content,
|
||||
Actions,
|
||||
Settings,
|
||||
ContextProvider,
|
||||
...childProps
|
||||
}: {
|
||||
export const ComponentAccordion: (props: {
|
||||
title: string;
|
||||
expanded?: boolean | undefined;
|
||||
Content: () => JSX.Element;
|
||||
@@ -44,27 +34,15 @@ export type ComponentRenderer = {
|
||||
Renderer?: (props: RendererProps) => JSX.Element;
|
||||
};
|
||||
|
||||
// Warning: (ae-missing-release-tag) "ComponentTab" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const ComponentTab: ({
|
||||
title,
|
||||
Content,
|
||||
ContextProvider,
|
||||
...childProps
|
||||
}: {
|
||||
export const ComponentTab: (props: {
|
||||
title: string;
|
||||
Content: () => JSX.Element;
|
||||
ContextProvider?: ((props: any) => JSX.Element) | undefined;
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "ComponentTabs" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const ComponentTabs: ({
|
||||
title,
|
||||
tabs,
|
||||
}: {
|
||||
export const ComponentTabs: (props: {
|
||||
title: string;
|
||||
tabs: {
|
||||
label: string;
|
||||
@@ -75,22 +53,14 @@ export const ComponentTabs: ({
|
||||
// Warning: (ae-forgotten-export) The symbol "CardExtensionProps" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// @public
|
||||
export function createCardExtension<T>({
|
||||
title,
|
||||
components,
|
||||
name,
|
||||
}: {
|
||||
export function createCardExtension<T>(options: {
|
||||
title: string;
|
||||
components: () => Promise<ComponentParts>;
|
||||
name?: string;
|
||||
}): Extension<(props: CardExtensionProps<T>) => JSX.Element>;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "HeaderWorldClock" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const HeaderWorldClock: ({
|
||||
clockConfigs,
|
||||
}: {
|
||||
export const HeaderWorldClock: (props: {
|
||||
clockConfigs: ClockConfig[];
|
||||
}) => JSX.Element | null;
|
||||
|
||||
@@ -100,16 +70,12 @@ export const HomePageCompanyLogo: (props: {
|
||||
className?: string | undefined;
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "HomepageCompositionRoot" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const HomepageCompositionRoot: (props: {
|
||||
title?: string | undefined;
|
||||
children?: ReactNode;
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "HomePageRandomJoke" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const HomePageRandomJoke: (
|
||||
props: ComponentRenderer & {
|
||||
@@ -135,8 +101,6 @@ export const HomePageToolkit: (
|
||||
} & ToolkitContentProps,
|
||||
) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "homePlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const homePlugin: BackstagePlugin<
|
||||
{
|
||||
@@ -148,12 +112,7 @@ export const homePlugin: BackstagePlugin<
|
||||
// Warning: (ae-missing-release-tag) "SettingsModal" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const SettingsModal: ({
|
||||
open,
|
||||
close,
|
||||
componentName,
|
||||
children,
|
||||
}: {
|
||||
export const SettingsModal: (props: {
|
||||
open: boolean;
|
||||
close: Function;
|
||||
componentName: string;
|
||||
|
||||
@@ -38,15 +38,7 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||
},
|
||||
}));
|
||||
|
||||
export const ComponentAccordion = ({
|
||||
title,
|
||||
expanded = false,
|
||||
Content,
|
||||
Actions,
|
||||
Settings,
|
||||
ContextProvider,
|
||||
...childProps
|
||||
}: {
|
||||
export const ComponentAccordion = (props: {
|
||||
title: string;
|
||||
expanded?: boolean;
|
||||
Content: () => JSX.Element;
|
||||
@@ -54,6 +46,16 @@ export const ComponentAccordion = ({
|
||||
Settings?: () => JSX.Element;
|
||||
ContextProvider?: (props: any) => JSX.Element;
|
||||
}) => {
|
||||
const {
|
||||
title,
|
||||
expanded = false,
|
||||
Content,
|
||||
Actions,
|
||||
Settings,
|
||||
ContextProvider,
|
||||
...childProps
|
||||
} = props;
|
||||
|
||||
const classes = useStyles();
|
||||
const [settingsIsExpanded, setSettingsIsExpanded] = React.useState(false);
|
||||
const [isExpanded, setIsExpanded] = React.useState(expanded);
|
||||
|
||||
@@ -16,16 +16,13 @@
|
||||
|
||||
import React from 'react';
|
||||
|
||||
export const ComponentTab = ({
|
||||
title,
|
||||
Content,
|
||||
ContextProvider,
|
||||
...childProps
|
||||
}: {
|
||||
export const ComponentTab = (props: {
|
||||
title: string;
|
||||
Content: () => JSX.Element;
|
||||
ContextProvider?: (props: any) => JSX.Element;
|
||||
}) => {
|
||||
const { title, Content, ContextProvider, ...childProps } = props;
|
||||
|
||||
return ContextProvider ? (
|
||||
<ContextProvider {...childProps}>
|
||||
<Content />
|
||||
|
||||
@@ -23,13 +23,9 @@ type TabType = {
|
||||
Component: () => JSX.Element;
|
||||
};
|
||||
|
||||
export const ComponentTabs = ({
|
||||
title,
|
||||
tabs,
|
||||
}: {
|
||||
title: string;
|
||||
tabs: TabType[];
|
||||
}) => {
|
||||
export const ComponentTabs = (props: { title: string; tabs: TabType[] }) => {
|
||||
const { title, tabs } = props;
|
||||
|
||||
const [value, setValue] = React.useState(0);
|
||||
|
||||
const handleChange = (_event: any, newValue: number) => {
|
||||
|
||||
@@ -68,11 +68,10 @@ function getTimes(clockConfigs: ClockConfig[]) {
|
||||
return clocks;
|
||||
}
|
||||
|
||||
export const HeaderWorldClock = ({
|
||||
clockConfigs,
|
||||
}: {
|
||||
clockConfigs: ClockConfig[];
|
||||
}) => {
|
||||
/** @public */
|
||||
export const HeaderWorldClock = (props: { clockConfigs: ClockConfig[] }) => {
|
||||
const { clockConfigs } = props;
|
||||
|
||||
const defaultTimes: TimeObj[] = [];
|
||||
const [clocks, setTimes] = React.useState(defaultTimes);
|
||||
|
||||
|
||||
@@ -23,17 +23,14 @@ import {
|
||||
DialogTitle,
|
||||
} from '@material-ui/core';
|
||||
|
||||
export const SettingsModal = ({
|
||||
open,
|
||||
close,
|
||||
componentName,
|
||||
children,
|
||||
}: {
|
||||
export const SettingsModal = (props: {
|
||||
open: boolean;
|
||||
close: Function;
|
||||
componentName: string;
|
||||
children: JSX.Element;
|
||||
}) => {
|
||||
const { open, close, componentName, children } = props;
|
||||
|
||||
return (
|
||||
<Dialog open={open} onClose={() => close()}>
|
||||
<DialogTitle>Settings - {componentName}</DialogTitle>
|
||||
|
||||
@@ -44,15 +44,13 @@ type CardExtensionProps<T> = ComponentRenderer & { title?: string } & T;
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export function createCardExtension<T>({
|
||||
title,
|
||||
components,
|
||||
name,
|
||||
}: {
|
||||
export function createCardExtension<T>(options: {
|
||||
title: string;
|
||||
components: () => Promise<ComponentParts>;
|
||||
name?: string;
|
||||
}) {
|
||||
const { title, components, name } = options;
|
||||
|
||||
return createReactExtension({
|
||||
name,
|
||||
component: {
|
||||
|
||||
@@ -42,13 +42,12 @@ const getNewJoke = (type: string): Promise<Joke> =>
|
||||
.then(res => res.json())
|
||||
.then(data => (Array.isArray(data) ? data[0] : data));
|
||||
|
||||
export const ContextProvider = ({
|
||||
children,
|
||||
defaultCategory,
|
||||
}: {
|
||||
export const ContextProvider = (props: {
|
||||
children: JSX.Element;
|
||||
defaultCategory?: JokeType;
|
||||
}) => {
|
||||
const { children, defaultCategory } = props;
|
||||
|
||||
const [loading, setLoading] = React.useState(true);
|
||||
const [joke, setJoke] = React.useState<Joke>({
|
||||
setup: '',
|
||||
|
||||
@@ -28,13 +28,12 @@ type ToolkitContextValue = {
|
||||
|
||||
const Context = createContext<ToolkitContextValue | undefined>(undefined);
|
||||
|
||||
export const ContextProvider = ({
|
||||
children,
|
||||
tools,
|
||||
}: {
|
||||
export const ContextProvider = (props: {
|
||||
children: JSX.Element;
|
||||
tools: Tool[];
|
||||
}) => {
|
||||
const { children, tools } = props;
|
||||
|
||||
const [toolsValue, _setTools] = React.useState(tools);
|
||||
|
||||
const value: ToolkitContextValue = {
|
||||
|
||||
@@ -23,6 +23,7 @@ import { ToolkitContentProps } from './homePageComponents';
|
||||
|
||||
import { rootRouteRef } from './routes';
|
||||
|
||||
/** @public */
|
||||
export const homePlugin = createPlugin({
|
||||
id: 'home',
|
||||
routes: {
|
||||
@@ -30,6 +31,7 @@ export const homePlugin = createPlugin({
|
||||
},
|
||||
});
|
||||
|
||||
/** @public */
|
||||
export const HomepageCompositionRoot = homePlugin.provide(
|
||||
createRoutableExtension({
|
||||
name: 'HomepageCompositionRoot',
|
||||
@@ -39,6 +41,7 @@ export const HomepageCompositionRoot = homePlugin.provide(
|
||||
}),
|
||||
);
|
||||
|
||||
/** @public */
|
||||
export const ComponentAccordion = homePlugin.provide(
|
||||
createComponentExtension({
|
||||
name: 'ComponentAccordion',
|
||||
@@ -48,6 +51,8 @@ export const ComponentAccordion = homePlugin.provide(
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
/** @public */
|
||||
export const ComponentTabs = homePlugin.provide(
|
||||
createComponentExtension({
|
||||
name: 'ComponentTabs',
|
||||
@@ -56,6 +61,8 @@ export const ComponentTabs = homePlugin.provide(
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
/** @public */
|
||||
export const ComponentTab = homePlugin.provide(
|
||||
createComponentExtension({
|
||||
name: 'ComponentTab',
|
||||
@@ -95,6 +102,7 @@ export const HomePageCompanyLogo = homePlugin.provide(
|
||||
}),
|
||||
);
|
||||
|
||||
/** @public */
|
||||
export const HomePageRandomJoke = homePlugin.provide(
|
||||
createCardExtension<{ defaultCategory?: 'any' | 'programming' }>({
|
||||
name: 'HomePageRandomJoke',
|
||||
|
||||
File diff suppressed because one or more lines are too long
+13
-49
@@ -10,73 +10,46 @@ import { ExternalRouteRef } from '@backstage/core-plugin-api';
|
||||
import { IconComponent } from '@backstage/core-plugin-api';
|
||||
import { InfoCardVariants } from '@backstage/core-components';
|
||||
|
||||
// Warning: (ae-missing-release-tag) "EntityGroupProfileCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const EntityGroupProfileCard: ({
|
||||
variant,
|
||||
}: {
|
||||
export const EntityGroupProfileCard: (props: {
|
||||
variant?: InfoCardVariants | undefined;
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "EntityMembersListCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const EntityMembersListCard: (_props: {
|
||||
export const EntityMembersListCard: (props: {
|
||||
memberDisplayTitle?: string | undefined;
|
||||
pageSize?: number | undefined;
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "EntityOwnershipCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const EntityOwnershipCard: ({
|
||||
variant,
|
||||
entityFilterKind,
|
||||
}: {
|
||||
export const EntityOwnershipCard: (props: {
|
||||
variant?: InfoCardVariants | undefined;
|
||||
entityFilterKind?: string[] | undefined;
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "EntityUserProfileCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const EntityUserProfileCard: ({
|
||||
variant,
|
||||
}: {
|
||||
export const EntityUserProfileCard: (props: {
|
||||
variant?: InfoCardVariants | undefined;
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "GroupProfileCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const GroupProfileCard: ({
|
||||
variant,
|
||||
}: {
|
||||
variant?: InfoCardVariants | undefined;
|
||||
export const GroupProfileCard: (props: {
|
||||
variant?: InfoCardVariants;
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "MembersListCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const MembersListCard: (_props: {
|
||||
export const MembersListCard: (props: {
|
||||
memberDisplayTitle?: string;
|
||||
pageSize?: number;
|
||||
}) => JSX.Element;
|
||||
|
||||
// @public
|
||||
export const MyGroupsSidebarItem: ({
|
||||
singularTitle,
|
||||
pluralTitle,
|
||||
icon,
|
||||
}: {
|
||||
export const MyGroupsSidebarItem: (props: {
|
||||
singularTitle: string;
|
||||
pluralTitle: string;
|
||||
icon: IconComponent;
|
||||
}) => JSX.Element | null;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "orgPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
const orgPlugin: BackstagePlugin<
|
||||
{},
|
||||
@@ -87,23 +60,14 @@ const orgPlugin: BackstagePlugin<
|
||||
export { orgPlugin };
|
||||
export { orgPlugin as plugin };
|
||||
|
||||
// Warning: (ae-missing-release-tag) "OwnershipCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const OwnershipCard: ({
|
||||
variant,
|
||||
entityFilterKind,
|
||||
}: {
|
||||
variant?: InfoCardVariants | undefined;
|
||||
entityFilterKind?: string[] | undefined;
|
||||
export const OwnershipCard: (props: {
|
||||
variant?: InfoCardVariants;
|
||||
entityFilterKind?: string[];
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "UserProfileCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const UserProfileCard: ({
|
||||
variant,
|
||||
}: {
|
||||
variant?: InfoCardVariants | undefined;
|
||||
export const UserProfileCard: (props: {
|
||||
variant?: InfoCardVariants;
|
||||
}) => JSX.Element;
|
||||
```
|
||||
|
||||
@@ -53,18 +53,15 @@ import {
|
||||
} from '@backstage/core-components';
|
||||
import { alertApiRef, useApi } from '@backstage/core-plugin-api';
|
||||
|
||||
const CardTitle = ({ title }: { title: string }) => (
|
||||
const CardTitle = (props: { title: string }) => (
|
||||
<Box display="flex" alignItems="center">
|
||||
<GroupIcon fontSize="inherit" />
|
||||
<Box ml={1}>{title}</Box>
|
||||
<Box ml={1}>{props.title}</Box>
|
||||
</Box>
|
||||
);
|
||||
|
||||
export const GroupProfileCard = ({
|
||||
variant,
|
||||
}: {
|
||||
variant?: InfoCardVariants;
|
||||
}) => {
|
||||
/** @public */
|
||||
export const GroupProfileCard = (props: { variant?: InfoCardVariants }) => {
|
||||
const catalogApi = useApi(catalogApiRef);
|
||||
const alertApi = useApi(alertApiRef);
|
||||
const { entity: group } = useEntity<GroupEntity>();
|
||||
@@ -118,7 +115,7 @@ export const GroupProfileCard = ({
|
||||
<InfoCard
|
||||
title={<CardTitle title={displayName} />}
|
||||
subheader={description}
|
||||
variant={variant}
|
||||
variant={props.variant}
|
||||
action={
|
||||
<>
|
||||
{allowRefresh && (
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
DEFAULT_NAMESPACE,
|
||||
GroupEntity,
|
||||
@@ -61,12 +62,12 @@ const useStyles = makeStyles((theme: Theme) =>
|
||||
}),
|
||||
);
|
||||
|
||||
const MemberComponent = ({ member }: { member: UserEntity }) => {
|
||||
const MemberComponent = (props: { member: UserEntity }) => {
|
||||
const classes = useStyles();
|
||||
const {
|
||||
metadata: { name: metaName },
|
||||
spec: { profile },
|
||||
} = member;
|
||||
} = props.member;
|
||||
const displayName = profile?.displayName ?? metaName;
|
||||
|
||||
return (
|
||||
@@ -92,7 +93,7 @@ const MemberComponent = ({ member }: { member: UserEntity }) => {
|
||||
<Link
|
||||
to={generatePath(
|
||||
`/catalog/:namespace/user/${metaName}`,
|
||||
entityRouteParams(member),
|
||||
entityRouteParams(props.member),
|
||||
)}
|
||||
>
|
||||
{displayName}
|
||||
@@ -108,12 +109,14 @@ const MemberComponent = ({ member }: { member: UserEntity }) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const MembersListCard = (_props: {
|
||||
/** @public */
|
||||
export const MembersListCard = (props: {
|
||||
memberDisplayTitle?: string;
|
||||
pageSize?: number;
|
||||
}) => {
|
||||
const { memberDisplayTitle = 'Members', pageSize = 50 } = props;
|
||||
|
||||
const { entity: groupEntity } = useEntity<GroupEntity>();
|
||||
let { memberDisplayTitle, pageSize } = _props;
|
||||
const {
|
||||
metadata: { name: groupName, namespace: grpNamespace },
|
||||
spec: { profile },
|
||||
@@ -128,8 +131,6 @@ export const MembersListCard = (_props: {
|
||||
const pageChange = (_: React.ChangeEvent<unknown>, pageIndex: number) => {
|
||||
setPage(pageIndex);
|
||||
};
|
||||
pageSize = pageSize ? pageSize : 50;
|
||||
memberDisplayTitle = memberDisplayTitle ? memberDisplayTitle : 'Members';
|
||||
|
||||
const {
|
||||
loading,
|
||||
|
||||
@@ -51,13 +51,13 @@ const useStyles = makeStyles(theme => ({
|
||||
},
|
||||
}));
|
||||
|
||||
export const OwnershipCard = ({
|
||||
variant,
|
||||
entityFilterKind,
|
||||
}: {
|
||||
/** @public */
|
||||
export const OwnershipCard = (props: {
|
||||
variant?: InfoCardVariants;
|
||||
entityFilterKind?: string[];
|
||||
}) => {
|
||||
const { variant, entityFilterKind } = props;
|
||||
|
||||
const classes = useStyles();
|
||||
const { entity } = useEntity();
|
||||
const isGroup = entity.kind === 'Group';
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { RELATION_MEMBER_OF, UserEntity } from '@backstage/catalog-model';
|
||||
import {
|
||||
EntityRefLinks,
|
||||
@@ -40,19 +41,16 @@ import {
|
||||
Link,
|
||||
} from '@backstage/core-components';
|
||||
|
||||
const CardTitle = ({ title }: { title?: string }) =>
|
||||
title ? (
|
||||
const CardTitle = (props: { title?: string }) =>
|
||||
props.title ? (
|
||||
<Box display="flex" alignItems="center">
|
||||
<PersonIcon fontSize="inherit" />
|
||||
<Box ml={1}>{title}</Box>
|
||||
<Box ml={1}>{props.title}</Box>
|
||||
</Box>
|
||||
) : null;
|
||||
|
||||
export const UserProfileCard = ({
|
||||
variant,
|
||||
}: {
|
||||
variant?: InfoCardVariants;
|
||||
}) => {
|
||||
/** @public */
|
||||
export const UserProfileCard = (props: { variant?: InfoCardVariants }) => {
|
||||
const { entity: user } = useEntity<UserEntity>();
|
||||
if (!user) {
|
||||
return <Alert severity="error">User not found</Alert>;
|
||||
@@ -72,7 +70,7 @@ export const UserProfileCard = ({
|
||||
<InfoCard
|
||||
title={<CardTitle title={displayName} />}
|
||||
subheader={description}
|
||||
variant={variant}
|
||||
variant={props.variant}
|
||||
>
|
||||
<Grid container spacing={3} alignItems="flex-start">
|
||||
<Grid item xs={12} sm={2} xl={1}>
|
||||
|
||||
@@ -39,15 +39,13 @@ import { getCompoundEntityRef } from '@backstage/catalog-model';
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export const MyGroupsSidebarItem = ({
|
||||
singularTitle,
|
||||
pluralTitle,
|
||||
icon,
|
||||
}: {
|
||||
export const MyGroupsSidebarItem = (props: {
|
||||
singularTitle: string;
|
||||
pluralTitle: string;
|
||||
icon: IconComponent;
|
||||
}) => {
|
||||
const { singularTitle, pluralTitle, icon } = props;
|
||||
|
||||
const identityApi = useApi(identityApiRef);
|
||||
const catalogApi: CatalogApi = useApi(catalogApiRef);
|
||||
const catalogEntityRoute = useRouteRef(entityRouteRef);
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
} from '@backstage/core-plugin-api';
|
||||
import { catalogIndexRouteRef } from './routes';
|
||||
|
||||
/** @public */
|
||||
export const orgPlugin = createPlugin({
|
||||
id: 'org',
|
||||
externalRoutes: {
|
||||
@@ -26,6 +27,7 @@ export const orgPlugin = createPlugin({
|
||||
},
|
||||
});
|
||||
|
||||
/** @public */
|
||||
export const EntityGroupProfileCard = orgPlugin.provide(
|
||||
createComponentExtension({
|
||||
name: 'EntityGroupProfileCard',
|
||||
@@ -34,6 +36,8 @@ export const EntityGroupProfileCard = orgPlugin.provide(
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
/** @public */
|
||||
export const EntityMembersListCard = orgPlugin.provide(
|
||||
createComponentExtension({
|
||||
name: 'EntityMembersListCard',
|
||||
@@ -42,6 +46,8 @@ export const EntityMembersListCard = orgPlugin.provide(
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
/** @public */
|
||||
export const EntityOwnershipCard = orgPlugin.provide(
|
||||
createComponentExtension({
|
||||
name: 'EntityOwnershipCard',
|
||||
@@ -50,6 +56,8 @@ export const EntityOwnershipCard = orgPlugin.provide(
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
/** @public */
|
||||
export const EntityUserProfileCard = orgPlugin.provide(
|
||||
createComponentExtension({
|
||||
name: 'EntityUserProfileCard',
|
||||
|
||||
@@ -243,6 +243,8 @@ const NO_WARNING_PACKAGES = [
|
||||
'plugins/catalog-common',
|
||||
'plugins/catalog-graph',
|
||||
'plugins/catalog-react',
|
||||
'plugins/graphiql',
|
||||
'plugins/org',
|
||||
'plugins/periskop',
|
||||
'plugins/periskop-backend',
|
||||
'plugins/permission-backend',
|
||||
|
||||
Reference in New Issue
Block a user