Use InfoCardVariants on custom cards variant attribute
Resolves #10951 Signed-off-by: Damien Vitrac <dvitrac@vmware.com>
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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>[];
|
||||
|
||||
+2
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user