Show Azure site tags in EntityAzureSitesOverviewWidget

Signed-off-by: Deepankumar Loganathan <deepan0433@gmail.com>
This commit is contained in:
Deepankumar Loganathan
2023-12-26 00:15:03 +01:00
parent 5e8988fb3a
commit a31f688161
2 changed files with 23 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-azure-sites': minor
---
Show Azure site tags in EntityAzureSitesOverviewWidget
@@ -18,6 +18,7 @@ import React, { Dispatch, useEffect, useState } from 'react';
import {
Box,
Card,
Chip,
IconButton,
LinearProgress,
Menu,
@@ -91,6 +92,18 @@ const Kind = ({ value }: { value: Kinds }) => {
);
};
const Tags = ({ tags }: { tags: any }) => {
return Object.keys(tags).map((key: any) => (
<Chip
key={key}
label={`${key}: ${tags[key]}`}
size="small"
variant="default"
style={{ marginBottom: '1px' }}
/>
));
};
type TableProps = {
data: AzureSite[];
loading: boolean;
@@ -223,6 +236,11 @@ export const AzureSitesOverviewTable = ({ data, loading }: TableProps) => {
field: 'status',
render: (func: AzureSite) => <State value={func.state as States} />,
},
{
title: 'Tags',
field: 'tags',
render: (func: AzureSite) => (func.tags ? <Tags tags={func.tags} /> : ''),
},
{
title: 'last modified',
field: 'lastModifiedDate',