From 2346b070295866cd380fbe85c660a85ef74f1f79 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 16 Apr 2021 10:03:32 +0100 Subject: [PATCH] GithubStateIndicator component + link from backstage Signed-off-by: Andrew Johnson --- .../src/components/GithubDeploymentsTable/columns.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx b/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx index 94d60e9b5f..f050af836c 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx @@ -21,13 +21,14 @@ import { TableColumn, StatusAborted, StatusError, + Link, } from '@backstage/core'; import { GithubDeployment } from '../../api'; import { DateTime } from 'luxon'; -import { Box, Typography, Link } from '@material-ui/core'; +import { Box, Typography } from '@material-ui/core'; -const statusIndicator = (value: string): JSX.Element => { - switch (value) { +export const GithubStateIndicator = ({ state }: { state: string }) => { + switch (state) { case 'PENDING': return ; case 'IN_PROGRESS': @@ -55,7 +56,7 @@ export function createStatusColumn(): TableColumn { title: 'Status', render: (row: GithubDeployment): JSX.Element => ( - {statusIndicator(row.state)} + {row.state} ), @@ -66,7 +67,7 @@ export function createCommitColumn(): TableColumn { return { title: 'Commit', render: (row: GithubDeployment): JSX.Element => ( - + {row.commit.abbreviatedOid} ),