Allow passing showArrowHeads to entity-card:catalog-graph/relations and /catalog-graph page (#33706)
* Allow passing showArrowHeads to entity-card:catalog-graph/relations and /catalog-graph page Signed-off-by: Riley Martine <rmartine@integralads.com> * Update .changeset/nine-signs-end.md Signed-off-by: Aramis Sennyey <159921952+aramissennyeydd@users.noreply.github.com> --------- Signed-off-by: Riley Martine <rmartine@integralads.com> Signed-off-by: Aramis Sennyey <159921952+aramissennyeydd@users.noreply.github.com> Co-authored-by: Aramis Sennyey <159921952+aramissennyeydd@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-graph': patch
|
||||
---
|
||||
|
||||
Support configuring `showArrowHeads` on `page:catalog-graph` and `entity-card:catalog-graph/relations`.
|
||||
@@ -165,6 +165,7 @@ See below the complete list of available configs:
|
||||
| `maxDepth` | A maximum number of levels of relations to display in the graph. | `number` | yes | `1` |
|
||||
| `unidirectional` | Shows only relations that are from the source to the target entity. | `boolean` | yes | `true` |
|
||||
| `mergeRelations` | Merge the relations line into a single one. | `boolean` | yes | `true` |
|
||||
| `showArrowHeads` | Show arrowheads on the relation lines | `boolean` | yes | `false` |
|
||||
| `direction` | Render direction of the graph. | `TB` \| `BT` \| `LR` \| `RL` | yes | `'LR'` |
|
||||
| `relationPairs` | A list of [pairs of entity relations](https://backstage.io/docs/features/software-catalog/well-known-relations#relations), used to define which relations are merged together and which the primary relation is. | `[string[], string[]]` | yes | Show all entity [relations](https://backstage.io/docs/features/software-catalog/well-known-relations#relations). |
|
||||
| `zoom` | Controls zoom behavior of graph. | `enabled` \| `disabled` \| `enable-on-click` | yes | `'enabled'` |
|
||||
@@ -265,6 +266,7 @@ See below the complete list of available configs:
|
||||
| `maxDepth` | A maximum number of levels of relations to display in the graph. | `number` | yes | `1` |
|
||||
| `unidirectional` | Shows only relations that are from the source to the target entity. | `boolean` | yes | `true` |
|
||||
| `mergeRelations` | Merge the relations line into a single one. | `boolean` | yes | `true` |
|
||||
| `showArrowHeads` | Show arrowheads on the relation lines | `boolean` | yes | `false` |
|
||||
| `direction` | Render direction of the graph. | `TB` \| `BT` \| `LR` \| `RL` | yes | `'LR'` |
|
||||
| `relationPairs` | A list of [pairs of entity relations](https://backstage.io/docs/features/software-catalog/well-known-relations#relations), used to define which relations are merged together and which the primary relation is. | `[string[], string[]]` | yes | Show all entity [relations](https://backstage.io/docs/features/software-catalog/well-known-relations#relations). |
|
||||
| `zoom` | Controls zoom behavior of graph. | `enabled` \| `disabled` \| `enable-on-click` | yes | `'enabled'` |
|
||||
|
||||
@@ -88,6 +88,7 @@ const _default: OverridableFrontendPlugin<
|
||||
maxDepth: number | undefined;
|
||||
unidirectional: boolean | undefined;
|
||||
mergeRelations: boolean | undefined;
|
||||
showArrowHeads: boolean | undefined;
|
||||
direction: 'TB' | 'BT' | 'LR' | 'RL' | undefined;
|
||||
relationPairs: [string, string][] | undefined;
|
||||
zoom: 'disabled' | 'enabled' | 'enable-on-click' | undefined;
|
||||
@@ -103,6 +104,7 @@ const _default: OverridableFrontendPlugin<
|
||||
direction?: 'TB' | 'BT' | 'LR' | 'RL' | undefined;
|
||||
zoom?: 'disabled' | 'enabled' | 'enable-on-click' | undefined;
|
||||
title?: string | undefined;
|
||||
showArrowHeads?: boolean | undefined;
|
||||
relations?: string[] | undefined;
|
||||
maxDepth?: number | undefined;
|
||||
kinds?: string[] | undefined;
|
||||
@@ -152,6 +154,7 @@ const _default: OverridableFrontendPlugin<
|
||||
maxDepth: number | undefined;
|
||||
unidirectional: boolean | undefined;
|
||||
mergeRelations: boolean | undefined;
|
||||
showArrowHeads: boolean | undefined;
|
||||
direction: 'TB' | 'BT' | 'LR' | 'RL' | undefined;
|
||||
showFilters: boolean | undefined;
|
||||
curve: 'curveStepBefore' | 'curveMonotoneX' | undefined;
|
||||
@@ -166,6 +169,7 @@ const _default: OverridableFrontendPlugin<
|
||||
curve?: 'curveStepBefore' | 'curveMonotoneX' | undefined;
|
||||
direction?: 'TB' | 'BT' | 'LR' | 'RL' | undefined;
|
||||
zoom?: 'disabled' | 'enabled' | 'enable-on-click' | undefined;
|
||||
showArrowHeads?: boolean | undefined;
|
||||
relations?: string[] | undefined;
|
||||
maxDepth?: number | undefined;
|
||||
rootEntityRefs?: string[] | undefined;
|
||||
|
||||
@@ -37,6 +37,7 @@ const CatalogGraphEntityCard = EntityCardBlueprint.makeWithOverrides({
|
||||
maxDepth: z => z.number().optional(),
|
||||
unidirectional: z => z.boolean().optional(),
|
||||
mergeRelations: z => z.boolean().optional(),
|
||||
showArrowHeads: z => z.boolean().optional(),
|
||||
direction: z => z.nativeEnum(Direction).optional(),
|
||||
relationPairs: z => z.array(z.tuple([z.string(), z.string()])).optional(),
|
||||
zoom: z => z.enum(['enabled', 'disabled', 'enable-on-click']).optional(),
|
||||
@@ -66,6 +67,7 @@ const CatalogGraphPage = PageBlueprint.makeWithOverrides({
|
||||
maxDepth: z => z.number().optional(),
|
||||
unidirectional: z => z.boolean().optional(),
|
||||
mergeRelations: z => z.boolean().optional(),
|
||||
showArrowHeads: z => z.boolean().optional(),
|
||||
direction: z => z.nativeEnum(Direction).optional(),
|
||||
showFilters: z => z.boolean().optional(),
|
||||
curve: z => z.enum(['curveStepBefore', 'curveMonotoneX']).optional(),
|
||||
|
||||
@@ -68,6 +68,7 @@ export const CatalogGraphCard = (
|
||||
maxDepth = 1,
|
||||
unidirectional = true,
|
||||
mergeRelations = true,
|
||||
showArrowHeads,
|
||||
direction = Direction.LEFT_RIGHT,
|
||||
kinds,
|
||||
relations,
|
||||
@@ -147,6 +148,7 @@ export const CatalogGraphCard = (
|
||||
relationPairs={relationPairs}
|
||||
entityFilter={entityFilter}
|
||||
zoom={zoom}
|
||||
showArrowHeads={showArrowHeads}
|
||||
/>
|
||||
</EntityInfoCard>
|
||||
);
|
||||
|
||||
@@ -131,7 +131,7 @@ export const CatalogGraphPage = (
|
||||
};
|
||||
} & Partial<EntityRelationsGraphProps>,
|
||||
) => {
|
||||
const { relationPairs, initialState, entityFilter } = props;
|
||||
const { relationPairs, initialState, entityFilter, showArrowHeads } = props;
|
||||
const { t } = useTranslationRef(catalogGraphTranslationRef);
|
||||
const navigate = useNavigate();
|
||||
const classes = useStyles();
|
||||
@@ -260,6 +260,7 @@ export const CatalogGraphPage = (
|
||||
}
|
||||
mergeRelations={mergeRelations}
|
||||
unidirectional={unidirectional}
|
||||
showArrowHeads={showArrowHeads}
|
||||
onNodeClick={onNodeClick}
|
||||
direction={direction}
|
||||
relationPairs={relationPairs}
|
||||
|
||||
Reference in New Issue
Block a user