Merge pull request #10957 from oodamien/dvitrac/gh-10951

Use InfoCardVariants on custom cards variant attribute
This commit is contained in:
Johan Haals
2022-04-25 15:46:13 +02:00
committed by GitHub
19 changed files with 58 additions and 32 deletions
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/plugin-api-docs': patch
'@backstage/plugin-catalog': minor
'@backstage/plugin-catalog-react': minor
---
Use InfoCardVariants on custom cards variant attribute
+6 -5
View File
@@ -10,6 +10,7 @@ import { ApiRef } from '@backstage/core-plugin-api';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { CatalogTableRow } from '@backstage/plugin-catalog';
import { ExternalRouteRef } from '@backstage/core-plugin-api';
import { InfoCardVariants } from '@backstage/core-components';
import { default as React_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
import { TableColumn } from '@backstage/core-components';
@@ -128,7 +129,7 @@ export const EntityApiDefinitionCard: () => JSX.Element;
export const EntityConsumedApisCard: ({
variant,
}: {
variant?: 'gridItem' | undefined;
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityConsumingComponentsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -137,7 +138,7 @@ export const EntityConsumedApisCard: ({
export const EntityConsumingComponentsCard: ({
variant,
}: {
variant?: 'gridItem' | undefined;
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityHasApisCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -146,7 +147,7 @@ export const EntityConsumingComponentsCard: ({
export const EntityHasApisCard: ({
variant,
}: {
variant?: 'gridItem' | undefined;
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityProvidedApisCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -155,7 +156,7 @@ export const EntityHasApisCard: ({
export const EntityProvidedApisCard: ({
variant,
}: {
variant?: 'gridItem' | undefined;
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityProvidingComponentsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -164,7 +165,7 @@ export const EntityProvidedApisCard: ({
export const EntityProvidingComponentsCard: ({
variant,
}: {
variant?: 'gridItem' | undefined;
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
// Warning: (ae-missing-release-tag) "GraphQlDefinitionWidget" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -26,13 +26,14 @@ import { apiEntityColumns } from './presets';
import {
CodeSnippet,
InfoCard,
InfoCardVariants,
Link,
Progress,
WarningPanel,
} from '@backstage/core-components';
type Props = {
variant?: 'gridItem';
variant?: InfoCardVariants;
};
export const ConsumedApisCard = ({ variant = 'gridItem' }: Props) => {
@@ -26,6 +26,7 @@ import { createSpecApiTypeColumn } from './presets';
import {
CodeSnippet,
InfoCard,
InfoCardVariants,
Link,
Progress,
TableColumn,
@@ -33,7 +34,7 @@ import {
} from '@backstage/core-components';
type Props = {
variant?: 'gridItem';
variant?: InfoCardVariants;
};
const columns: TableColumn<ApiEntity>[] = [
@@ -26,13 +26,14 @@ import { apiEntityColumns } from './presets';
import {
CodeSnippet,
InfoCard,
InfoCardVariants,
Link,
Progress,
WarningPanel,
} from '@backstage/core-components';
type Props = {
variant?: 'gridItem';
variant?: InfoCardVariants;
};
export const ProvidedApisCard = ({ variant = 'gridItem' }: Props) => {
@@ -28,13 +28,14 @@ import React from 'react';
import {
CodeSnippet,
InfoCard,
InfoCardVariants,
Link,
Progress,
WarningPanel,
} from '@backstage/core-components';
type Props = {
variant?: 'gridItem';
variant?: InfoCardVariants;
};
export const ConsumingComponentsCard = ({ variant = 'gridItem' }: Props) => {
@@ -28,13 +28,14 @@ import React from 'react';
import {
CodeSnippet,
InfoCard,
InfoCardVariants,
Link,
Progress,
WarningPanel,
} from '@backstage/core-components';
type Props = {
variant?: 'gridItem';
variant?: InfoCardVariants;
};
export const ProvidingComponentsCard = ({ variant = 'gridItem' }: Props) => {
+2 -1
View File
@@ -13,6 +13,7 @@ import { ComponentProps } from 'react';
import { CompoundEntityRef } from '@backstage/catalog-model';
import { Entity } from '@backstage/catalog-model';
import { IconButton } from '@material-ui/core';
import { InfoCardVariants } from '@backstage/core-components';
import { LinkProps } from '@backstage/core-components';
import { Observable } from '@backstage/types';
import { Overrides } from '@material-ui/core/styles/overrides';
@@ -333,7 +334,7 @@ export interface EntityTableProps<T extends Entity> {
// (undocumented)
title: string;
// (undocumented)
variant?: 'gridItem';
variant?: InfoCardVariants;
}
// @public
@@ -19,7 +19,11 @@ import { makeStyles } from '@material-ui/core';
import React, { ReactNode } from 'react';
import { columnFactories } from './columns';
import { componentEntityColumns, systemEntityColumns } from './presets';
import { Table, TableColumn } from '@backstage/core-components';
import {
InfoCardVariants,
Table,
TableColumn,
} from '@backstage/core-components';
/**
* Props for {@link EntityTable}.
@@ -28,7 +32,7 @@ import { Table, TableColumn } from '@backstage/core-components';
*/
export interface EntityTableProps<T extends Entity> {
title: string;
variant?: 'gridItem';
variant?: InfoCardVariants;
entities: T[];
emptyContent?: ReactNode;
columns: TableColumn<T>[];
+9 -9
View File
@@ -184,7 +184,7 @@ export interface DependencyOfComponentsCardProps {
// (undocumented)
title?: string;
// (undocumented)
variant?: 'gridItem';
variant?: InfoCardVariants;
}
// @public (undocumented)
@@ -192,13 +192,13 @@ export interface DependsOnComponentsCardProps {
// (undocumented)
title?: string;
// (undocumented)
variant?: 'gridItem';
variant?: InfoCardVariants;
}
// @public (undocumented)
export interface DependsOnResourcesCardProps {
// (undocumented)
variant?: 'gridItem';
variant?: InfoCardVariants;
}
// @public (undocumented)
@@ -285,7 +285,7 @@ export interface EntityLinksCardProps {
// (undocumented)
cols?: ColumnBreakpoints | number;
// (undocumented)
variant?: 'gridItem';
variant?: InfoCardVariants;
}
// @public (undocumented)
@@ -346,25 +346,25 @@ export function hasCatalogProcessingErrors(
// @public (undocumented)
export interface HasComponentsCardProps {
// (undocumented)
variant?: 'gridItem';
variant?: InfoCardVariants;
}
// @public (undocumented)
export interface HasResourcesCardProps {
// (undocumented)
variant?: 'gridItem';
variant?: InfoCardVariants;
}
// @public (undocumented)
export interface HasSubcomponentsCardProps {
// (undocumented)
variant?: 'gridItem';
variant?: InfoCardVariants;
}
// @public (undocumented)
export interface HasSystemsCardProps {
// (undocumented)
variant?: 'gridItem';
variant?: InfoCardVariants;
}
// @public
@@ -392,7 +392,7 @@ export const RelatedEntitiesCard: <T extends Entity>(
// @public (undocumented)
export type RelatedEntitiesCardProps<T extends Entity> = {
variant?: 'gridItem';
variant?: InfoCardVariants;
title: string;
columns: TableColumn<T>[];
entityKind?: string;
@@ -15,6 +15,7 @@
*/
import { RELATION_DEPENDENCY_OF } from '@backstage/catalog-model';
import { InfoCardVariants } from '@backstage/core-components';
import React from 'react';
import {
asComponentEntities,
@@ -25,7 +26,7 @@ import {
/** @public */
export interface DependencyOfComponentsCardProps {
variant?: 'gridItem';
variant?: InfoCardVariants;
title?: string;
}
@@ -15,6 +15,7 @@
*/
import { RELATION_DEPENDS_ON } from '@backstage/catalog-model';
import { InfoCardVariants } from '@backstage/core-components';
import React from 'react';
import {
asComponentEntities,
@@ -25,7 +26,7 @@ import {
/** @public */
export interface DependsOnComponentsCardProps {
variant?: 'gridItem';
variant?: InfoCardVariants;
title?: string;
}
@@ -15,6 +15,7 @@
*/
import { RELATION_DEPENDS_ON } from '@backstage/catalog-model';
import { InfoCardVariants } from '@backstage/core-components';
import React from 'react';
import {
asResourceEntities,
@@ -25,7 +26,7 @@ import {
/** @public */
export interface DependsOnResourcesCardProps {
variant?: 'gridItem';
variant?: InfoCardVariants;
}
export function DependsOnResourcesCard(props: DependsOnResourcesCardProps) {
@@ -21,12 +21,12 @@ import { EntityLinksEmptyState } from './EntityLinksEmptyState';
import { LinksGridList } from './LinksGridList';
import { ColumnBreakpoints } from './types';
import { IconComponent, useApp } from '@backstage/core-plugin-api';
import { InfoCard } from '@backstage/core-components';
import { InfoCard, InfoCardVariants } from '@backstage/core-components';
/** @public */
export interface EntityLinksCardProps {
cols?: ColumnBreakpoints | number;
variant?: 'gridItem';
variant?: InfoCardVariants;
}
export function EntityLinksCard(props: EntityLinksCardProps) {
@@ -15,6 +15,7 @@
*/
import { RELATION_HAS_PART } from '@backstage/catalog-model';
import { InfoCardVariants } from '@backstage/core-components';
import React from 'react';
import {
asComponentEntities,
@@ -25,7 +26,7 @@ import {
/** @public */
export interface HasComponentsCardProps {
variant?: 'gridItem';
variant?: InfoCardVariants;
}
export function HasComponentsCard(props: HasComponentsCardProps) {
@@ -15,6 +15,7 @@
*/
import { RELATION_HAS_PART } from '@backstage/catalog-model';
import { InfoCardVariants } from '@backstage/core-components';
import React from 'react';
import {
asResourceEntities,
@@ -25,7 +26,7 @@ import {
/** @public */
export interface HasResourcesCardProps {
variant?: 'gridItem';
variant?: InfoCardVariants;
}
export function HasResourcesCard(props: HasResourcesCardProps) {
@@ -15,6 +15,7 @@
*/
import { RELATION_HAS_PART } from '@backstage/catalog-model';
import { InfoCardVariants } from '@backstage/core-components';
import React from 'react';
import {
asComponentEntities,
@@ -24,7 +25,7 @@ import {
/** @public */
export interface HasSubcomponentsCardProps {
variant?: 'gridItem';
variant?: InfoCardVariants;
}
export function HasSubcomponentsCard(props: HasSubcomponentsCardProps) {
@@ -15,6 +15,7 @@
*/
import { RELATION_HAS_PART } from '@backstage/catalog-model';
import { InfoCardVariants } from '@backstage/core-components';
import React from 'react';
import {
asSystemEntities,
@@ -25,7 +26,7 @@ import {
/** @public */
export interface HasSystemsCardProps {
variant?: 'gridItem';
variant?: InfoCardVariants;
}
export function HasSystemsCard(props: HasSystemsCardProps) {
@@ -24,6 +24,7 @@ import {
import React from 'react';
import {
InfoCard,
InfoCardVariants,
Link,
Progress,
ResponseErrorPanel,
@@ -32,7 +33,7 @@ import {
/** @public */
export type RelatedEntitiesCardProps<T extends Entity> = {
variant?: 'gridItem';
variant?: InfoCardVariants;
title: string;
columns: TableColumn<T>[];
entityKind?: string;