badges: fix markdown title bug. cleanup about card.

Signed-off-by: Andreas Stenius <git@astekk.se>
This commit is contained in:
Andreas Stenius
2021-02-19 22:22:05 +01:00
committed by Fredrik Adelöw
parent b99231c0bc
commit 1cf23e05cb
3 changed files with 13 additions and 8 deletions
+12 -3
View File
@@ -407,20 +407,29 @@ badges:
pingback:
kind: 'entity'
description: 'Link back to $${app.title}'
target: '$${window.location.href}'
target: '$${entity_url}'
label: 'View $${entity.metadata.name} in'
message: '$${app.title}'
lifecycle:
kind: 'entity'
description: 'Entity lifecycle badge'
target: '$${window.location.href}'
target: '$${entity_url}'
label: 'Lifecycle'
message: '$${entity.spec.lifecycle}'
owner:
kind: 'entity'
title: 'Resource Owner'
description: 'Entity owner badge'
target: '$${window.location.href}'
target: '$${entity_url}'
label: 'Owner'
message: '$${entity.spec.owner}'
color: 'blue'
docs:
kind: 'entity'
target: '$${entity_url}/docs'
label: 'Documentation'
message: '$${entity.metadata.name}'
color: 'navyblue'
+1 -1
View File
@@ -81,7 +81,7 @@ export class BadgesClientApi {
}
private getBadgeMarkdownCode(badge: object): string {
const title = badge.title && ` "${badge.title}"`;
const title = badge.title ? ` "${badge.title}"` : '';
const img = `![${badge.description}](${badge.url}${title})`;
if (!badge.target) {
return img;
@@ -25,7 +25,6 @@ import {
} from '@backstage/plugin-catalog-react';
import { Chip, Grid, makeStyles, Typography } from '@material-ui/core';
import React from 'react';
import { EntityBadgesField } from '@backstage/plugin-badges';
import { AboutField } from './AboutField';
const useStyles = makeStyles({
@@ -128,9 +127,6 @@ export const AboutContent = ({ entity }: Props) => {
<Chip key={t} size="small" label={t} />
))}
</AboutField>
<AboutField label="Badges" gridSizes={{ xs: 12, sm: 6, lg: 4 }}>
<EntityBadgesField />
</AboutField>
</Grid>
);
};