aboutsummaryrefslogtreecommitdiffstats
path: root/webui
diff options
context:
space:
mode:
authorSascha <GlancingMind@outlook.com>2021-03-19 20:36:09 +0100
committerSascha <GlancingMind@outlook.com>2021-03-19 20:47:37 +0100
commit688cc33ccca5fd6653ee6f2ee2946dc30a9052ae (patch)
treecc2554c98812e49e8227c2d225be23abaec7a4d1 /webui
parent4c7761461bf7cd6a32af60a75bc2ed75ca91ae3a (diff)
downloadgit-bug-688cc33ccca5fd6653ee6f2ee2946dc30a9052ae.tar.gz
Display real number of comment
Diffstat (limited to 'webui')
-rw-r--r--webui/src/pages/list/BugRow.graphql3
-rw-r--r--webui/src/pages/list/BugRow.tsx20
2 files changed, 18 insertions, 5 deletions
diff --git a/webui/src/pages/list/BugRow.graphql b/webui/src/pages/list/BugRow.graphql
index 547c09d8..e4e2760c 100644
--- a/webui/src/pages/list/BugRow.graphql
+++ b/webui/src/pages/list/BugRow.graphql
@@ -9,5 +9,8 @@ fragment BugRow on Bug {
labels {
...Label
}
+ comments {
+ totalCount
+ }
...authored
}
diff --git a/webui/src/pages/list/BugRow.tsx b/webui/src/pages/list/BugRow.tsx
index b06097ad..f9a50487 100644
--- a/webui/src/pages/list/BugRow.tsx
+++ b/webui/src/pages/list/BugRow.tsx
@@ -76,6 +76,10 @@ const useStyles = makeStyles((theme) => ({
display: 'inline-block',
},
},
+ commentCount: {
+ fontSize: '1rem',
+ marginLeft: theme.spacing(0.5),
+ },
}));
type Props = {
@@ -84,6 +88,8 @@ type Props = {
function BugRow({ bug }: Props) {
const classes = useStyles();
+ // Subtract 1 from totalCount as 1 comment is the bug description
+ const commentCount = bug.comments.totalCount - 1;
return (
<TableRow hover>
<TableCell className={classes.cell}>
@@ -109,12 +115,16 @@ function BugRow({ bug }: Props) {
</div>
</TableCell>
<TableCell>
- <Grid container wrap="nowrap">
- <Grid item>
- <CommentOutlinedIcon aria-label="Comment count" />
+ {commentCount > 0 && (
+ <Grid container wrap="nowrap">
+ <Grid item>
+ <CommentOutlinedIcon aria-label="Comment count" />
+ </Grid>
+ <Grid item>
+ <span className={classes.commentCount}>{commentCount}</span>
+ </Grid>
</Grid>
- <Grid item>Count</Grid>
- </Grid>
+ )}
</TableCell>
</TableRow>
);