From 4c7761461bf7cd6a32af60a75bc2ed75ca91ae3a Mon Sep 17 00:00:00 2001 From: Sascha Date: Fri, 19 Mar 2021 19:23:16 +0100 Subject: [PATCH 1/3] Add message icon with placeholder count --- webui/src/pages/list/BugRow.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/webui/src/pages/list/BugRow.tsx b/webui/src/pages/list/BugRow.tsx index 8d8fb5cbc8f9d04deab1a688092b913a139c8991..b06097ada6cae4fe835e29ef327abc3948f7c3a1 100644 --- a/webui/src/pages/list/BugRow.tsx +++ b/webui/src/pages/list/BugRow.tsx @@ -1,11 +1,13 @@ import React from 'react'; import { Link } from 'react-router-dom'; +import Grid from '@material-ui/core/Grid'; import TableCell from '@material-ui/core/TableCell/TableCell'; import TableRow from '@material-ui/core/TableRow/TableRow'; import Tooltip from '@material-ui/core/Tooltip/Tooltip'; import { makeStyles } from '@material-ui/core/styles'; import CheckCircleOutline from '@material-ui/icons/CheckCircleOutline'; +import CommentOutlinedIcon from '@material-ui/icons/CommentOutlined'; import ErrorOutline from '@material-ui/icons/ErrorOutline'; import Date from 'src/components/Date'; @@ -106,6 +108,14 @@ function BugRow({ bug }: Props) { + + + + + + Count + + ); } From 688cc33ccca5fd6653ee6f2ee2946dc30a9052ae Mon Sep 17 00:00:00 2001 From: Sascha Date: Fri, 19 Mar 2021 20:36:09 +0100 Subject: [PATCH 2/3] Display real number of comment --- webui/src/pages/list/BugRow.graphql | 3 +++ webui/src/pages/list/BugRow.tsx | 20 +++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/webui/src/pages/list/BugRow.graphql b/webui/src/pages/list/BugRow.graphql index 547c09d8ef8cf91c966f50788eab8a075ea906ed..e4e2760c23379585d5963dc5dc4d263c22f8e25f 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 b06097ada6cae4fe835e29ef327abc3948f7c3a1..f9a50487a085ca04bebdeb2723979376605a65e5 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 ( @@ -109,12 +115,16 @@ function BugRow({ bug }: Props) { - - - + {commentCount > 0 && ( + + + + + + {commentCount} + - Count - + )} ); From b7ddb22558bd4b429e810157b343ee41a6575945 Mon Sep 17 00:00:00 2001 From: Sascha Date: Sat, 20 Mar 2021 14:30:10 +0100 Subject: [PATCH 3/3] Fixate message counter to end of bug row Previously the counter has shifted around depending on the length of the bug titles. --- webui/src/pages/list/BugRow.tsx | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/webui/src/pages/list/BugRow.tsx b/webui/src/pages/list/BugRow.tsx index f9a50487a085ca04bebdeb2723979376605a65e5..1f5d22aae2626eea582b8b311a59d4b374959c0b 100644 --- a/webui/src/pages/list/BugRow.tsx +++ b/webui/src/pages/list/BugRow.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { Link } from 'react-router-dom'; -import Grid from '@material-ui/core/Grid'; import TableCell from '@material-ui/core/TableCell/TableCell'; import TableRow from '@material-ui/core/TableRow/TableRow'; import Tooltip from '@material-ui/core/Tooltip/Tooltip'; @@ -80,6 +79,9 @@ const useStyles = makeStyles((theme) => ({ fontSize: '1rem', marginLeft: theme.spacing(0.5), }, + commentCountCell: { + display: 'inline-flex', + }, })); type Props = { @@ -113,17 +115,11 @@ function BugRow({ bug }: Props) {  by {bug.author.displayName} - - {commentCount > 0 && ( - - - - - - {commentCount} - - + + + {commentCount} + )}