diff options
author | Michael Muré <batolettre@gmail.com> | 2021-05-27 11:08:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-27 11:08:53 +0200 |
commit | 76bdac7d11fd4f5d9cb52cd520c6b81f8d12665f (patch) | |
tree | 764d9a460a6dc95fdb88569c1a87e1210ee5e10c /webui/src/pages | |
parent | 2e9c83a08366ec20dd60e7cce3306650a0ec7e1f (diff) | |
parent | e867663bf01841684da6c74a7bcac478cf99655a (diff) | |
download | git-bug-76bdac7d11fd4f5d9cb52cd520c6b81f8d12665f.tar.gz |
Merge pull request #682 from GlancingMind/webui-comment-and-reopen-bug
WebUI: Support comment-and-reopen a bug in one step
Diffstat (limited to 'webui/src/pages')
-rw-r--r-- | webui/src/pages/bug/CommentForm.tsx | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/webui/src/pages/bug/CommentForm.tsx b/webui/src/pages/bug/CommentForm.tsx index 1a7ebc29..6d917889 100644 --- a/webui/src/pages/bug/CommentForm.tsx +++ b/webui/src/pages/bug/CommentForm.tsx @@ -5,9 +5,10 @@ import Paper from '@material-ui/core/Paper'; import { makeStyles, Theme } from '@material-ui/core/styles'; import CommentInput from '../../components/CommentInput/CommentInput'; -import CloseBugButton from 'src/components/CloseBugButton/CloseBugButton'; -import CloseBugWithCommentButton from 'src/components/CloseBugWithCommentButton/CloseBugWithCommentButton'; -import ReopenBugButton from 'src/components/ReopenBugButton/ReopenBugButton'; +import CloseBugButton from 'src/components/CloseBugButton'; +import CloseBugWithCommentButton from 'src/components/CloseBugWithCommentButton'; +import ReopenBugButton from 'src/components/ReopenBugButton'; +import ReopenBugWithCommentButton from 'src/components/ReopenBugWithCommentButton'; import { BugFragment } from './Bug.generated'; import { useAddCommentMutation } from './CommentForm.generated'; @@ -80,12 +81,27 @@ function CommentForm({ bug }: Props) { function getBugStatusButton() { if (bug.status === 'OPEN' && issueComment.length > 0) { - return <CloseBugWithCommentButton bug={bug} comment={issueComment} />; + return ( + <CloseBugWithCommentButton + bug={bug} + comment={issueComment} + postClick={resetForm} + /> + ); } if (bug.status === 'OPEN') { return <CloseBugButton bug={bug} />; } - return <ReopenBugButton bug={bug} disabled={issueComment.length > 0} />; + if (bug.status === 'CLOSED' && issueComment.length > 0) { + return ( + <ReopenBugWithCommentButton + bug={bug} + comment={issueComment} + postClick={resetForm} + /> + ); + } + return <ReopenBugButton bug={bug} />; } return ( |