From 7b1b77dc444518a07779e836ec0c4c6b9406bbf9 Mon Sep 17 00:00:00 2001
From: Cláudio <claudio.engdist@gmail.com>
Date: Tue, 2 Feb 2021 16:43:09 -0300
Subject: Commit for #546

---
 webui/src/pages/bug/CommentForm.tsx | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'webui/src/pages/bug/CommentForm.tsx')

diff --git a/webui/src/pages/bug/CommentForm.tsx b/webui/src/pages/bug/CommentForm.tsx
index c39f30c2..d0935e1e 100644
--- a/webui/src/pages/bug/CommentForm.tsx
+++ b/webui/src/pages/bug/CommentForm.tsx
@@ -5,6 +5,7 @@ import Paper from '@material-ui/core/Paper';
 import { makeStyles, Theme } from '@material-ui/core/styles';
 
 import CommentInput from '../../layout/CommentInput/CommentInput';
+import CloseBugButton from 'src/components/CloseBugButton/CloseBugButton';
 
 import { useAddCommentMutation } from './CommentForm.generated';
 import { TimelineDocument } from './TimelineQuery.generated';
@@ -28,6 +29,7 @@ const useStyles = makeStyles<Theme, StyleProps>((theme) => ({
     justifyContent: 'flex-end',
   },
   greenButton: {
+    marginLeft: '8px',
     backgroundColor: '#2ea44fd9',
     color: '#fff',
     '&:hover': {
@@ -89,6 +91,7 @@ function CommentForm({ bugId }: Props) {
           onChange={(comment: string) => setIssueComment(comment)}
         />
         <div className={classes.actions}>
+          <CloseBugButton bugId={bugId} />
           <Button
             className={classes.greenButton}
             variant="contained"
-- 
cgit 


From b7ec2404b031257ea30f46d4d7f92a498ac906db Mon Sep 17 00:00:00 2001
From: Cláudio <claudio.engdist@gmail.com>
Date: Tue, 2 Feb 2021 20:27:48 -0300
Subject: Fix #546 - Fixing code review requests

---
 webui/src/pages/bug/CommentForm.tsx | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

(limited to 'webui/src/pages/bug/CommentForm.tsx')

diff --git a/webui/src/pages/bug/CommentForm.tsx b/webui/src/pages/bug/CommentForm.tsx
index d0935e1e..128e4d32 100644
--- a/webui/src/pages/bug/CommentForm.tsx
+++ b/webui/src/pages/bug/CommentForm.tsx
@@ -7,6 +7,7 @@ import { makeStyles, Theme } from '@material-ui/core/styles';
 import CommentInput from '../../layout/CommentInput/CommentInput';
 import CloseBugButton from 'src/components/CloseBugButton/CloseBugButton';
 
+import { BugFragment } from './Bug.generated';
 import { useAddCommentMutation } from './CommentForm.generated';
 import { TimelineDocument } from './TimelineQuery.generated';
 
@@ -39,10 +40,10 @@ const useStyles = makeStyles<Theme, StyleProps>((theme) => ({
 }));
 
 type Props = {
-  bugId: string;
+  bug: BugFragment;
 };
 
-function CommentForm({ bugId }: Props) {
+function CommentForm({ bug }: Props) {
   const [addComment, { loading }] = useAddCommentMutation();
   const [issueComment, setIssueComment] = useState('');
   const [inputProp, setInputProp] = useState<any>('');
@@ -53,7 +54,7 @@ function CommentForm({ bugId }: Props) {
     addComment({
       variables: {
         input: {
-          prefix: bugId,
+          prefix: bug.id,
           message: issueComment,
         },
       },
@@ -62,7 +63,7 @@ function CommentForm({ bugId }: Props) {
         {
           query: TimelineDocument,
           variables: {
-            id: bugId,
+            id: bug.id,
             first: 100,
           },
         },
@@ -91,7 +92,7 @@ function CommentForm({ bugId }: Props) {
           onChange={(comment: string) => setIssueComment(comment)}
         />
         <div className={classes.actions}>
-          <CloseBugButton bugId={bugId} />
+          <CloseBugButton bug={bug} disabled={issueComment.length > 0} />
           <Button
             className={classes.greenButton}
             variant="contained"
-- 
cgit 

