Another set of feedback improvements

Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
This commit is contained in:
Andre Wanlin
2021-10-08 10:06:05 -05:00
parent a9d460dd1c
commit 0b0876b0da
8 changed files with 58 additions and 29 deletions
@@ -56,11 +56,12 @@ const columns: TableColumn[] = [
title: 'ID',
field: 'id',
highlight: false,
width: '100px',
width: 'auto',
},
{
title: 'Build',
field: 'title',
width: 'auto',
render: (row: Partial<RepoBuild>) => (
<Link href={row.link} target="_blank">
{row.title}
@@ -70,10 +71,12 @@ const columns: TableColumn[] = [
{
title: 'Source',
field: 'source',
width: 'auto',
},
{
title: 'Status',
field: 'status',
width: 'auto',
render: (row: Partial<RepoBuild>) => (
<Box display="flex" alignItems="center">
<Box mr={1} />
@@ -86,6 +89,7 @@ const columns: TableColumn[] = [
{
title: 'Result',
field: 'result',
width: 'auto',
render: (row: Partial<RepoBuild>) => (
<Box display="flex" alignItems="center">
{getBuildResultComponent(row.result)}
@@ -97,8 +101,9 @@ const columns: TableColumn[] = [
),
},
{
title: 'Date',
title: 'Age',
field: 'queueTime',
width: 'auto',
render: (row: Partial<RepoBuild>) =>
DateTime.fromISO(
row.queueTime ? row.queueTime.toString() : new Date().toString(),
@@ -24,5 +24,24 @@ export function useProjectRepoFromEntity(entity: Entity): {
const [project, repo] = (
entity.metadata.annotations?.[AZURE_DEVOPS_ANNOTATION] ?? ''
).split('/');
if (!project && !repo) {
throw new Error(
'Value for annotation dev.azure.com/project-repo was not in the correct format: <project-name>/<repo-name>',
);
}
if (!project) {
throw new Error(
'Project Name for annotation dev.azure.com/project-repo was not found; expected format is: <project-name>/<repo-name>',
);
}
if (!repo) {
throw new Error(
'Repo Name for annotation dev.azure.com/project-repo was not found; expected format is: <project-name>/<repo-name>',
);
}
return { project, repo };
}
@@ -29,7 +29,8 @@ export function useRepoBuilds(entity: Entity): {
} {
const config = useApi(configApiRef);
const top =
config.getOptionalNumber('azureDevOps.top') ?? AZURE_DEVOPS_DEFAULT_TOP;
config.getOptionalNumber('azureDevOps.azurePipelines.top') ??
AZURE_DEVOPS_DEFAULT_TOP;
const api = useApi(azureDevOpsApiRef);
const { project, repo } = useProjectRepoFromEntity(entity);
const { value, loading, error } = useAsync(() => {